diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/.OwlBot.yaml b/owl-bot-staging/google-cloud-dialogflow-cx/.OwlBot.yaml new file mode 100644 index 000000000000..18004150206c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 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. + +deep-copy-regex: + - source: /google/cloud/dialogflow/cx/google-cloud-dialogflow-cx-nodejs + dest: /owl-bot-staging/google-cloud-dialogflow-cx + +api-name: cx \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/.gitignore b/owl-bot-staging/google-cloud-dialogflow-cx/.gitignore new file mode 100644 index 000000000000..d4f03a0df2e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/.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-dialogflow-cx/.jsdoc.js b/owl-bot-staging/google-cloud-dialogflow-cx/.jsdoc.js new file mode 100644 index 000000000000..52a8cd520de2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 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 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dialogflow-cx', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/.nycrc b/owl-bot-staging/google-cloud-dialogflow-cx/.nycrc new file mode 100644 index 000000000000..81a95fc94b00 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/README.md b/owl-bot-staging/google-cloud-dialogflow-cx/README.md new file mode 100644 index 000000000000..4e8ea240f28b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/README.md @@ -0,0 +1,391 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Dialogflow API: Nodejs Client][homepage] + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority + +[![npm version](https://img.shields.io/npm/v/@google-cloud/dialogflow-cx.svg)](https://www.npmjs.org/package/@google-cloud/dialogflow-cx) + +Dialogflow API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Dialogflow API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/cx/latest) +* [Dialogflow API Documentation](https://docs.cloud.google.com/dialogflow/docs) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Dialogflow API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/dialogflow-cx +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| create agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js) | +| delete agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.delete_agent.js) | +| export agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.export_agent.js) | +| get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent.js) | +| get agent validation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js) | +| get generative settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_generative_settings.js) | +| list agents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.list_agents.js) | +| restore agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.restore_agent.js) | +| update agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_agent.js) | +| update generative settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_generative_settings.js) | +| validate agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.validate_agent.js) | +| get changelog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/changelogs.get_changelog.js) | +| list changelogs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/changelogs.list_changelogs.js) | +| get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/deployments.get_deployment.js) | +| list deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/deployments.list_deployments.js) | +| create entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js) | +| delete entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js) | +| export entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.export_entity_types.js) | +| get entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js) | +| import entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.import_entity_types.js) | +| list entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js) | +| update entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js) | +| create environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.create_environment.js) | +| delete environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.delete_environment.js) | +| deploy flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.deploy_flow.js) | +| get environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.get_environment.js) | +| list continuous test results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js) | +| list environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_environments.js) | +| lookup environment history | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js) | +| run continuous test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js) | +| update environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.update_environment.js) | +| create example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/examples.create_example.js) | +| delete example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/examples.delete_example.js) | +| get example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/examples.get_example.js) | +| list examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/examples.list_examples.js) | +| update example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/examples.update_example.js) | +| create experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js) | +| delete experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js) | +| get experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js) | +| list experiments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js) | +| start experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js) | +| stop experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js) | +| update experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js) | +| create flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.create_flow.js) | +| delete flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.delete_flow.js) | +| export flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.export_flow.js) | +| get flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow.js) | +| get flow validation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js) | +| import flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.import_flow.js) | +| list flows | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.list_flows.js) | +| train flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.train_flow.js) | +| update flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.update_flow.js) | +| validate flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.validate_flow.js) | +| create generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/generators.create_generator.js) | +| delete generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/generators.delete_generator.js) | +| get generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/generators.get_generator.js) | +| list generators | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/generators.list_generators.js) | +| update generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/generators.update_generator.js) | +| create intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.create_intent.js) | +| delete intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.delete_intent.js) | +| export intents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.export_intents.js) | +| get intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.get_intent.js) | +| import intents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.import_intents.js) | +| list intents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.list_intents.js) | +| update intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.update_intent.js) | +| create page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.create_page.js) | +| delete page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.delete_page.js) | +| get page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.get_page.js) | +| list pages | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.list_pages.js) | +| update page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.update_page.js) | +| create playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.create_playbook.js) | +| create playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.create_playbook_version.js) | +| delete playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook.js) | +| delete playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook_version.js) | +| export playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.export_playbook.js) | +| get playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.get_playbook.js) | +| get playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.get_playbook_version.js) | +| import playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.import_playbook.js) | +| list playbook versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.list_playbook_versions.js) | +| list playbooks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.list_playbooks.js) | +| restore playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.restore_playbook_version.js) | +| update playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.update_playbook.js) | +| create security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js) | +| delete security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js) | +| get security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js) | +| list security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js) | +| update security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js) | +| create session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js) | +| delete session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js) | +| get session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js) | +| list session entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js) | +| update session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js) | +| detect intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js) | +| fulfill intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js) | +| match intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.match_intent.js) | +| server streaming detect intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.server_streaming_detect_intent.js) | +| streaming detect intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js) | +| submit answer feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.submit_answer_feedback.js) | +| batch delete test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js) | +| batch run test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js) | +| calculate coverage | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js) | +| create test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js) | +| export test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js) | +| get test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js) | +| get test case result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js) | +| import test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js) | +| list test case results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js) | +| list test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js) | +| run test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js) | +| update test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js) | +| create tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.create_tool.js) | +| create tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.create_tool_version.js) | +| delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.delete_tool.js) | +| delete tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.delete_tool_version.js) | +| get tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.get_tool.js) | +| get tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.get_tool_version.js) | +| list tool versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.list_tool_versions.js) | +| list tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.list_tools.js) | +| restore tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.restore_tool_version.js) | +| update tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/tools.update_tool.js) | +| create transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js) | +| delete transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js) | +| get transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js) | +| list transition route groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js) | +| update transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js) | +| compare versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.compare_versions.js) | +| create version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.create_version.js) | +| delete version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.delete_version.js) | +| get version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.get_version.js) | +| list versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.list_versions.js) | +| load version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.load_version.js) | +| update version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.update_version.js) | +| create webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js) | +| delete webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js) | +| get webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js) | +| list webhooks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js) | +| update webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js) | +| create agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js) | +| delete agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js) | +| export agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js) | +| get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js) | +| get agent validation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js) | +| get generative settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_generative_settings.js) | +| list agents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js) | +| restore agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js) | +| update agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js) | +| update generative settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_generative_settings.js) | +| validate agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js) | +| get changelog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/changelogs.get_changelog.js) | +| list changelogs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/changelogs.list_changelogs.js) | +| delete conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.delete_conversation.js) | +| get conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.get_conversation.js) | +| list conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.list_conversations.js) | +| get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/deployments.get_deployment.js) | +| list deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/deployments.list_deployments.js) | +| create entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js) | +| delete entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js) | +| export entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.export_entity_types.js) | +| get entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js) | +| import entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.import_entity_types.js) | +| list entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js) | +| update entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js) | +| create environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js) | +| delete environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js) | +| deploy flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.deploy_flow.js) | +| get environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js) | +| list continuous test results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js) | +| list environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js) | +| lookup environment history | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js) | +| run continuous test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js) | +| update environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js) | +| create example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.create_example.js) | +| delete example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.delete_example.js) | +| get example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.get_example.js) | +| list examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.list_examples.js) | +| update example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.update_example.js) | +| create experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js) | +| delete experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js) | +| get experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js) | +| list experiments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js) | +| start experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js) | +| stop experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js) | +| update experiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js) | +| create flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js) | +| delete flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js) | +| export flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js) | +| get flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js) | +| get flow validation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js) | +| import flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js) | +| list flows | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js) | +| train flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js) | +| update flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js) | +| validate flow | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js) | +| create generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.create_generator.js) | +| delete generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.delete_generator.js) | +| get generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.get_generator.js) | +| list generators | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.list_generators.js) | +| update generator | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.update_generator.js) | +| create intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js) | +| delete intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js) | +| export intents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.export_intents.js) | +| get intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js) | +| import intents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.import_intents.js) | +| list intents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js) | +| update intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js) | +| create page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js) | +| delete page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js) | +| get page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js) | +| list pages | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js) | +| update page | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js) | +| create playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook.js) | +| create playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook_version.js) | +| delete playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook.js) | +| delete playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook_version.js) | +| export playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.export_playbook.js) | +| get playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook.js) | +| get playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook_version.js) | +| import playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.import_playbook.js) | +| list playbook versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbook_versions.js) | +| list playbooks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbooks.js) | +| restore playbook version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.restore_playbook_version.js) | +| update playbook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.update_playbook.js) | +| create security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js) | +| delete security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js) | +| get security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js) | +| list security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js) | +| update security settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js) | +| create session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js) | +| delete session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js) | +| get session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js) | +| list session entity types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js) | +| update session entity type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js) | +| detect intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js) | +| fulfill intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js) | +| match intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js) | +| server streaming detect intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.server_streaming_detect_intent.js) | +| streaming detect intent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js) | +| submit answer feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.submit_answer_feedback.js) | +| batch delete test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js) | +| batch run test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js) | +| calculate coverage | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js) | +| create test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js) | +| export test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js) | +| get test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js) | +| get test case result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js) | +| import test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js) | +| list test case results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js) | +| list test cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js) | +| run test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js) | +| update test case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js) | +| create tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.create_tool.js) | +| create tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.create_tool_version.js) | +| delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool.js) | +| delete tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool_version.js) | +| export tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.export_tools.js) | +| get tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.get_tool.js) | +| get tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.get_tool_version.js) | +| list tool versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.list_tool_versions.js) | +| list tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.list_tools.js) | +| restore tool version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.restore_tool_version.js) | +| update tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.update_tool.js) | +| create transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js) | +| delete transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js) | +| get transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js) | +| list transition route groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js) | +| update transition route group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js) | +| compare versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.compare_versions.js) | +| create version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js) | +| delete version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js) | +| get version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js) | +| list versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js) | +| load version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js) | +| update version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js) | +| create webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js) | +| delete webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js) | +| get webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js) | +| list webhooks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js) | +| update webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/dialogflow-cx@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=dialogflow.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dialogflow-cx diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto new file mode 100644 index 000000000000..0d8e5dff8cc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto @@ -0,0 +1,130 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; +import "google/cloud/dialogflow/cx/v3/gcs.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "AdvancedSettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Hierarchical advanced settings for agent/flow/page/fulfillment/parameter. +// Settings exposed at lower level overrides the settings exposed at higher +// level. Overriding occurs at the sub-setting level. For example, the +// playback_interruption_settings at fulfillment level only overrides the +// playback_interruption_settings at the agent level, leaving other settings +// at the agent level unchanged. +// +// DTMF settings does not override each other. DTMF settings set at different +// levels define DTMF detections running in parallel. +// +// Hierarchy: Agent->Flow->Page->Fulfillment/Parameter. +message AdvancedSettings { + // Define behaviors of speech to text detection. + message SpeechSettings { + // Sensitivity of the speech model that detects the end of speech. + // Scale from 0 to 100. + int32 endpointer_sensitivity = 1; + + // Timeout before detecting no speech. + google.protobuf.Duration no_speech_timeout = 2; + + // Use timeout based endpointing, interpreting endpointer sensitivity as + // seconds of timeout value. + bool use_timeout_based_endpointing = 3; + + // Mapping from language to Speech-to-Text model. The mapped Speech-to-Text + // model will be selected for requests from its corresponding language. + // For more information, see + // [Speech + // models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models). + map models = 5; + } + + // Define behaviors for DTMF (dual tone multi frequency). + message DtmfSettings { + // If true, incoming audio is processed for DTMF (dual tone multi frequency) + // events. For example, if the caller presses a button on their telephone + // keypad and DTMF processing is enabled, Dialogflow will detect the + // event (e.g. a "3" was pressed) in the incoming audio and pass the event + // to the bot to drive business logic (e.g. when 3 is pressed, return the + // account balance). + bool enabled = 1; + + // Max length of DTMF digits. + int32 max_digits = 2; + + // The digit that terminates a DTMF digit sequence. + string finish_digit = 3; + + // Interdigit timeout setting for matching dtmf input to regex. + google.protobuf.Duration interdigit_timeout_duration = 6; + + // Endpoint timeout setting for matching dtmf input to regex. + google.protobuf.Duration endpointing_timeout_duration = 7; + } + + // Define behaviors on logging. + message LoggingSettings { + // Enables Google Cloud Logging. + bool enable_stackdriver_logging = 2; + + // Enables DF Interaction logging. + bool enable_interaction_logging = 3; + + // Enables consent-based end-user input redaction, if true, a pre-defined + // session parameter `$session.params.conversation-redaction` will be + // used to determine if the utterance should be redacted. + bool enable_consent_based_redaction = 4; + } + + // If present, incoming audio is exported by Dialogflow to the configured + // Google Cloud Storage destination. + // Exposed at the following levels: + // - Agent level + // - Flow level + GcsDestination audio_export_gcs_destination = 2; + + // Settings for speech to text detection. + // Exposed at the following levels: + // - Agent level + // - Flow level + // - Page level + // - Parameter level + SpeechSettings speech_settings = 3; + + // Settings for DTMF. + // Exposed at the following levels: + // - Agent level + // - Flow level + // - Page level + // - Parameter level. + DtmfSettings dtmf_settings = 5; + + // Settings for logging. + // Settings for Dialogflow History, Contact Center messages, StackDriver logs, + // and speech logging. + // Exposed at the following levels: + // - Agent level. + LoggingSettings logging_settings = 6; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/agent.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/agent.proto new file mode 100644 index 000000000000..0dc2abe49609 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/agent.proto @@ -0,0 +1,752 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3/audio_config.proto"; +import "google/cloud/dialogflow/cx/v3/flow.proto"; +import "google/cloud/dialogflow/cx/v3/generative_settings.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; + +// Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. +service Agents { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all agents in the specified location. + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*}/agents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an agent in the specified location. + // + // Note: You should always train flows prior to sending them queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateAgent(CreateAgentRequest) returns (Agent) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}/agents" + body: "agent" + }; + option (google.api.method_signature) = "parent,agent"; + } + + // Updates the specified agent. + // + // Note: You should always train flows prior to sending them queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { + option (google.api.http) = { + patch: "/v3/{agent.name=projects/*/locations/*/agents/*}" + body: "agent" + }; + option (google.api.method_signature) = "agent,update_mask"; + } + + // Deletes the specified agent. + rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Exports the specified agent to a binary file. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: + // [ExportAgentResponse][google.cloud.dialogflow.cx.v3.ExportAgentResponse] + rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportAgentResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Restores the specified agent from a binary file. + // + // Replaces the current agent with a new one. Note that all existing resources + // in agent (e.g. intents, entity types, flows) will be removed. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: An [Empty + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + // + // Note: You should always train flows prior to sending them queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*}:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } + + // Validates the specified agent and creates or updates validation results. + // The agent in draft version is validated. Please call this API after the + // training is completed to get the complete validation results. + rpc ValidateAgent(ValidateAgentRequest) returns (AgentValidationResult) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*}:validate" + body: "*" + }; + } + + // Gets the latest agent validation result. Agent validation is performed + // when ValidateAgent is called. + rpc GetAgentValidationResult(GetAgentValidationResultRequest) + returns (AgentValidationResult) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/validationResult}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the generative settings for the agent. + rpc GetGenerativeSettings(GetGenerativeSettingsRequest) + returns (GenerativeSettings) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/generativeSettings}" + }; + option (google.api.method_signature) = "name,language_code"; + } + + // Updates the generative settings for the agent. + rpc UpdateGenerativeSettings(UpdateGenerativeSettingsRequest) + returns (GenerativeSettings) { + option (google.api.http) = { + patch: "/v3/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}" + body: "generative_settings" + }; + option (google.api.method_signature) = "generative_settings,update_mask"; + } +} + +// Settings related to speech recognition. +message SpeechToTextSettings { + // Whether to use speech adaptation for speech recognition. + bool enable_speech_adaptation = 1; +} + +// Agents are best described as Natural Language Understanding (NLU) modules +// that transform user requests into actionable data. You can include agents +// in your app, product, or service to determine user intent and respond to the +// user in a natural way. +// +// After you create an agent, you can add +// [Intents][google.cloud.dialogflow.cx.v3.Intent], [Entity +// Types][google.cloud.dialogflow.cx.v3.EntityType], +// [Flows][google.cloud.dialogflow.cx.v3.Flow], +// [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], +// [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], +// [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] +// and so on to manage the conversation flows. +message Agent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Agent" + pattern: "projects/{project}/locations/{location}/agents/{agent}" + }; + + // Settings for connecting to Git repository for an agent. + message GitIntegrationSettings { + // Settings of integration with GitHub. + message GithubSettings { + // The unique repository display name for the GitHub repository. + string display_name = 1; + + // The GitHub repository URI related to the agent. + string repository_uri = 2; + + // The branch of the GitHub repository tracked for this agent. + string tracking_branch = 3; + + // The access token used to authenticate the access to the GitHub + // repository. + string access_token = 4; + + // A list of branches configured to be used from Dialogflow. + repeated string branches = 5; + } + + // The git settings to specific systems. + oneof git_settings { + // GitHub settings. + GithubSettings github_settings = 1; + } + } + + // Settings for Gen App Builder. + message GenAppBuilderSettings { + // Required. The full name of the Gen App Builder engine related to this + // agent if there is one. Format: `projects/{Project ID}/locations/{Location + // ID}/collections/{Collection ID}/engines/{Engine ID}` + string engine = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Settings for answer feedback collection. + message AnswerFeedbackSettings { + // Optional. If enabled, end users will be able to provide + // [answer feedback][google.cloud.dialogflow.cx.v3.AnswerFeedback] to + // Dialogflow responses. Feature works only if interaction logging is + // enabled in the Dialogflow agent. + bool enable_answer_feedback = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for end user personalization. + message PersonalizationSettings { + // Optional. Default end user metadata, used when processing DetectIntent + // requests. Recommended to be filled as a template instead of hard-coded + // value, for example { "age": "$session.params.age" }. The data will be + // merged with the + // [QueryParameters.end_user_metadata][google.cloud.dialogflow.cx.v3.QueryParameters.end_user_metadata] + // in + // [DetectIntentRequest.query_params][google.cloud.dialogflow.cx.v3.DetectIntentRequest.query_params] + // during query processing. + google.protobuf.Struct default_end_user_metadata = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for custom client certificates. + message ClientCertificateSettings { + // Required. The ssl certificate encoded in PEM format. This string must + // include the begin header and end footer lines. + string ssl_certificate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing + // the private key encoded in PEM format. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string private_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Optional. The name of the SecretManager secret version resource storing + // the passphrase. 'passphrase' should be left unset if the private key is + // not encrypted. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string passphrase = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // The unique identifier of the agent. + // Required for the + // [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] + // method. + // [Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent] + // populates the name automatically. + // Format: `projects//locations//agents/`. + string name = 1; + + // Required. The human-readable name of the agent, unique within the location. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The default language of the agent as a language tag. + // See [Language + // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // for a list of the currently supported language codes. + // This field cannot be set by the + // [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] + // method. + string default_language_code = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The list of all languages supported by the agent (except for the + // `default_language_code`). + repeated string supported_language_codes = 4; + + // Required. The time zone of the agent from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. + string time_zone = 5 [(google.api.field_behavior) = REQUIRED]; + + // The description of the agent. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 6; + + // The URI of the agent's avatar. Avatars are used throughout the Dialogflow + // console and in the self-hosted [Web + // Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + // integration. + string avatar_uri = 7; + + // Speech recognition related settings. + SpeechToTextSettings speech_to_text_settings = 13; + + // The resource to start the conversations with for the agent. + oneof session_entry_resource { + // Name of the start flow in this agent. A start flow will be automatically + // created when the agent is created, and can only be deleted by deleting + // the agent. + // Format: + // `projects//locations//agents//flows/`. + // Currently only the default start flow with id + // "00000000-0000-0000-0000-000000000000" is allowed. + string start_flow = 16 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + + // Name of the start playbook in this agent. A start playbook will be + // automatically created when the agent is created, and can only be deleted + // by deleting the agent. + // Format: + // `projects//locations//agents//playbooks/`. + // Currently only the + // default playbook with id + // "00000000-0000-0000-0000-000000000000" is allowed. + string start_playbook = 39 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + }]; + } + + // Name of the + // [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] + // reference for the agent. Format: + // `projects//locations//securitySettings/`. + string security_settings = 17 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + }]; + + // Indicates if stackdriver logging is enabled for the agent. + // Please use + // [agent.advanced_settings][google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings] + // instead. + bool enable_stackdriver_logging = 18 [deprecated = true]; + + // Indicates if automatic spell correction is enabled in detect intent + // requests. + bool enable_spell_correction = 20; + + // Optional. Enable training multi-lingual models for this agent. These models + // will be trained on all the languages supported by the agent. + bool enable_multi_language_training = 40 + [(google.api.field_behavior) = OPTIONAL]; + + // Indicates whether the agent is locked for changes. If the agent is locked, + // modifications to the agent will be rejected except for [RestoreAgent][]. + bool locked = 27; + + // Hierarchical advanced settings for this agent. The settings exposed at the + // lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 22; + + // Git integration settings for this agent. + GitIntegrationSettings git_integration_settings = 30; + + // Settings on instructing the speech synthesizer on how to generate the + // output audio content. + TextToSpeechSettings text_to_speech_settings = 31; + + // Gen App Builder-related agent-level settings. + optional GenAppBuilderSettings gen_app_builder_settings = 33; + + // Optional. Answer feedback collection settings. + AnswerFeedbackSettings answer_feedback_settings = 38 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for end user personalization. + PersonalizationSettings personalization_settings = 42 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for custom client certificates. + ClientCertificateSettings client_certificate_settings = 43 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. A read only boolean field reflecting Zone Separation + // status of the agent. + optional bool satisfies_pzs = 45 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Output only. A read only boolean field reflecting Zone Isolation + // status of the agent. + optional bool satisfies_pzi = 46 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; +} + +// The request message for +// [Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents]. +message ListAgentsRequest { + // Required. The location to list all agents for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents]. +message ListAgentsResponse { + // The list of agents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Agent agents = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Agents.GetAgent][google.cloud.dialogflow.cx.v3.Agents.GetAgent]. +message GetAgentRequest { + // Required. The name of the agent. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for +// [Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent]. +message CreateAgentRequest { + // Required. The location to create a agent for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to create. + Agent agent = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent]. +message UpdateAgentRequest { + // Required. The agent to update. + Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3.Agents.DeleteAgent]. +message DeleteAgentRequest { + // Required. The name of the agent to delete. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for +// [Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent]. +message ExportAgentRequest { + // Data format of the exported agent. + enum DataFormat { + // Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0; + + // Agent content will be exported as raw bytes. + BLOB = 1; + + // Agent content will be exported in JSON Package format. + JSON_PACKAGE = 4; + } + + // Settings for exporting to a git branch. + message GitDestination { + // Tracking branch for the git push. + string tracking_branch = 1; + + // Commit message for the git push. + string commit_message = 2; + } + + // Required. The name of the agent to export. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the agent + // to. The format of this URI must be `gs:///`. If + // left unspecified, the serialized agent is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string agent_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data format of the exported agent. If not specified, `BLOB` + // is assumed. + DataFormat data_format = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Environment name. If not set, draft environment is assumed. + // Format: + // `projects//locations//agents//environments/`. + string environment = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Optional. The Git branch to export the agent to. + GitDestination git_destination = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include BigQuery Export setting. + bool include_bigquery_export_settings = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent]. +message ExportAgentResponse { + // The exported agent. + oneof agent { + // The URI to a file containing the exported agent. This field is populated + // if `agent_uri` is specified in + // [ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest]. + string agent_uri = 1; + + // Uncompressed raw byte content for agent. This field is populated + // if none of `agent_uri` and `git_destination` are specified in + // [ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest]. + bytes agent_content = 2; + + // Commit SHA of the git push. This field is populated if + // `git_destination` is specified in + // [ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest]. + string commit_sha = 3; + } +} + +// The request message for +// [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3.Agents.RestoreAgent]. +message RestoreAgentRequest { + // Settings for restoring from a git branch + message GitSource { + // tracking branch for the git pull + string tracking_branch = 1; + } + + // Restore option. + enum RestoreOption { + // Unspecified. Treated as KEEP. + RESTORE_OPTION_UNSPECIFIED = 0; + + // Always respect the settings from the exported agent file. It may cause + // a restoration failure if some settings (e.g. model type) are not + // supported in the target agent. + KEEP = 1; + + // Fallback to default settings if some settings are not supported in the + // target agent. + FALLBACK = 2; + } + + // Required. The name of the agent to restore into. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to restore. + oneof agent { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to restore agent from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string agent_uri = 2; + + // Uncompressed raw byte content for agent. + bytes agent_content = 3; + + // Setting for restoring from a git branch + GitSource git_source = 6; + } + + // Agent restore mode. If not specified, `KEEP` is assumed. + RestoreOption restore_option = 5; +} + +// The request message for +// [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3.Agents.ValidateAgent]. +message ValidateAgentRequest { + // Required. The agent to validate. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The request message for +// [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult]. +message GetAgentValidationResultRequest { + // Required. The agent name. + // Format: + // `projects//locations//agents//validationResult`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/AgentValidationResult" + } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The response message for +// [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult]. +message AgentValidationResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/AgentValidationResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/validationResult" + }; + + // The unique identifier of the agent validation result. + // Format: + // `projects//locations//agents//validationResult`. + string name = 1; + + // Contains all flow validation results. + repeated FlowValidationResult flow_validation_results = 2; +} + +// Request for +// [GetGenerativeSettings][google.cloud.dialogflow.cx.v3.Agents.GetGenerativeSettings] +// RPC. +message GetGenerativeSettingsRequest { + // Required. Format: + // `projects//locations//agents//generativeSettings`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/AgentGenerativeSettings" + } + ]; + + // Required. Language code of the generative settings. + string language_code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [UpdateGenerativeSettings][google.cloud.dialogflow.cx.v3.Agents.UpdateGenerativeSettings] +// RPC. +message UpdateGenerativeSettingsRequest { + // Required. Generative settings to update. + GenerativeSettings generative_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which fields get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/audio_config.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/audio_config.proto new file mode 100644 index 000000000000..8c17ea3b261a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/audio_config.proto @@ -0,0 +1,377 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "AudioConfigProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; +option (google.api.resource_definition) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" +}; + +// Audio encoding of the audio content sent in the conversational query request. +// Refer to the +// [Cloud Speech API +// documentation](https://cloud.google.com/speech-to-text/docs/basics) for more +// details. +enum AudioEncoding { + // Not specified. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // LINT: LEGACY_NAMES + AUDIO_ENCODING_LINEAR_16 = 1; + + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is lossless (therefore + // recognition is not compromised) and requires only about half the + // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + // 24-bit samples, however, not all fields in `STREAMINFO` are supported. + AUDIO_ENCODING_FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AUDIO_ENCODING_AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Dialogflow API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + + // 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + AUDIO_ENCODING_ALAW = 8; +} + +// Variant of the specified [Speech +// model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model] to use. +// +// See the [Cloud Speech +// documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) +// for which models have different variants. For example, the "phone_call" model +// has both a standard and an enhanced variant. When you use an enhanced model, +// you will generally receive higher quality results than for a standard model. +enum SpeechModelVariant { + // No model variant specified. In this case Dialogflow defaults to + // USE_BEST_AVAILABLE. + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + + // Use the best available variant of the [Speech + // model][InputAudioConfig.model] that the caller is eligible for. + USE_BEST_AVAILABLE = 1; + + // Use standard model variant even if an enhanced model is available. See the + // [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // for details about enhanced models. + USE_STANDARD = 2; + + // Use an enhanced model variant: + // + // * If an enhanced variant does not exist for the given + // [model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model] and request + // language, Dialogflow falls back to the standard variant. + // + // The [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // describes which models have enhanced variants. + USE_ENHANCED = 3; +} + +// Information for a word recognized by the speech recognizer. +message SpeechWordInfo { + // The word this info is for. + string word = 3; + + // Time offset relative to the beginning of the audio that corresponds to the + // start of the spoken word. This is an experimental feature and the accuracy + // of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio that corresponds to the + // end of the spoken word. This is an experimental feature and the accuracy of + // the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The Speech confidence between 0.0 and 1.0 for this word. A higher number + // indicates an estimated greater likelihood that the recognized word is + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. + // + // This field is not guaranteed to be fully stable over time for the same + // audio input. Users should also not rely on it to always be provided. + float confidence = 4; +} + +// Configuration of the barge-in behavior. Barge-in instructs the API to return +// a detected utterance at a proper time while the client is playing back the +// response audio from a previous request. When the client sees the +// utterance, it should stop the playback and immediately get ready for +// receiving the responses for the current request. +// +// The barge-in handling requires the client to start streaming audio input +// as soon as it starts playing back the audio from the previous response. The +// playback is modeled into two phases: +// +// * No barge-in phase: which goes first and during which speech detection +// should not be carried out. +// +// * Barge-in phase: which follows the no barge-in phase and during which +// the API starts speech detection and may inform the client that an utterance +// has been detected. Note that no-speech event is not expected in this +// phase. +// +// The client provides this configuration in terms of the durations of those +// two phases. The durations are measured in terms of the audio length from the +// start of the input audio. +// +// No-speech event is a response with END_OF_UTTERANCE without any transcript +// following up. +message BargeInConfig { + // Duration that is not eligible for barge-in at the beginning of the input + // audio. + google.protobuf.Duration no_barge_in_duration = 1; + + // Total duration for the playback at the beginning of the input audio. + google.protobuf.Duration total_duration = 2; +} + +// Instructs the speech recognizer on how to process the audio content. +message InputAudioConfig { + // Required. Audio encoding of the audio content to process. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Sample rate (in Hertz) of the audio content sent in the query. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics) for + // more details. + int32 sample_rate_hertz = 2; + + // Optional. If `true`, Dialogflow returns + // [SpeechWordInfo][google.cloud.dialogflow.cx.v3.SpeechWordInfo] in + // [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult] + // with information about the recognized speech words, e.g. start and end time + // offsets. If false or unspecified, Speech doesn't return any word-level + // information. + bool enable_word_info = 13; + + // Optional. A list of strings containing words and phrases that the speech + // recognizer should recognize with higher likelihood. + // + // See [the Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + // for more details. + repeated string phrase_hints = 4; + + // Optional. Which Speech model to select for the given request. + // For more information, see + // [Speech + // models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models). + string model = 7; + + // Optional. Which variant of the [Speech + // model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model] to use. + SpeechModelVariant model_variant = 10; + + // Optional. If `false` (default), recognition does not cease until the + // client closes the stream. + // If `true`, the recognizer will detect a single spoken utterance in input + // audio. Recognition ceases when it detects the audio's voice has + // stopped or paused. In this case, once a detected intent is received, the + // client should close the stream and start a new request with a new stream as + // needed. + // Note: This setting is relevant only for streaming methods. + bool single_utterance = 8; + + // Configuration of barge-in behavior during the streaming of input audio. + BargeInConfig barge_in_config = 15; + + // If `true`, the request will opt out for STT conformer model migration. + // This field will be deprecated once force migration takes place in June + // 2024. Please refer to [Dialogflow CX Speech model + // migration](https://cloud.google.com/dialogflow/cx/docs/concept/speech-model-migration). + bool opt_out_conformer_model_migration = 26; +} + +// Gender of the voice as described in +// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). +enum SsmlVoiceGender { + // An unspecified gender, which means that the client doesn't care which + // gender the selected voice will have. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + SSML_VOICE_GENDER_MALE = 1; + + // A female voice. + SSML_VOICE_GENDER_FEMALE = 2; + + // A gender-neutral voice. + SSML_VOICE_GENDER_NEUTRAL = 3; +} + +// Description of which voice to use for speech synthesis. +message VoiceSelectionParams { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and + // [ssml_gender][google.cloud.dialogflow.cx.v3.VoiceSelectionParams.ssml_gender]. + // + // For the list of available voices, please refer to [Supported voices and + // languages](https://cloud.google.com/text-to-speech/docs/voices). + string name = 1; + + // Optional. The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // [name][google.cloud.dialogflow.cx.v3.VoiceSelectionParams.name]. Note that + // this is only a preference, not requirement. If a voice of the appropriate + // gender is not available, the synthesizer substitutes a voice with a + // different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 2; +} + +// Configuration of how speech should be synthesized. +message SynthesizeSpeechConfig { + // Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + // native speed supported by the specific voice. 2.0 is twice as fast, and + // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + // other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 1; + + // Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + // semitones from the original pitch. -20 means decrease 20 semitones from the + // original pitch. + double pitch = 2; + + // Optional. Volume gain (in dB) of the normal native volume supported by the + // specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + // will play at approximately half the amplitude of the normal native signal + // amplitude. A value of +6.0 (dB) will play at approximately twice the + // amplitude of the normal native signal amplitude. We strongly recommend not + // to exceed +10 (dB) as there's usually no effective increase in loudness for + // any value greater than that. + double volume_gain_db = 3; + + // Optional. An identifier which selects 'audio effects' profiles that are + // applied on (post synthesized) text to speech. Effects are applied on top of + // each other in the order they are given. + repeated string effects_profile_id = 5; + + // Optional. The desired voice of the synthesized audio. + VoiceSelectionParams voice = 4; +} + +// Audio encoding of the output audio format in Text-To-Speech. +enum OutputAudioEncoding { + // Not specified. + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + // LINT: LEGACY_NAMES + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + + // MP3 audio at 64kbps. + OUTPUT_AUDIO_ENCODING_MP3 = 2 [deprecated = true]; + + // MP3 audio at 64kbps. + // LINT: LEGACY_NAMES + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + OUTPUT_AUDIO_ENCODING_MULAW = 5; + + // 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + OUTPUT_AUDIO_ENCODING_ALAW = 6; +} + +// Instructs the speech synthesizer how to generate the output audio content. +message OutputAudioConfig { + // Required. Audio encoding of the synthesized audio content. + OutputAudioEncoding audio_encoding = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The synthesis sample rate (in hertz) for this audio. If not + // provided, then the synthesizer will use the default sample rate based on + // the audio encoding. If this is different from the voice's natural sample + // rate, then the synthesizer will honor this request by converting to the + // desired sample rate (which might result in worse audio quality). + int32 sample_rate_hertz = 2; + + // Optional. Configuration of how speech should be synthesized. + // If not specified, + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3.Agent.text_to_speech_settings] + // is applied. + SynthesizeSpeechConfig synthesize_speech_config = 3; +} + +// Settings related to speech synthesizing. +message TextToSpeechSettings { + // Configuration of how speech should be synthesized, mapping from language + // (https://cloud.google.com/dialogflow/cx/docs/reference/language) to + // SynthesizeSpeechConfig. + // + // These settings affect: + // + // - The [phone + // gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway) + // synthesize configuration set via + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3.Agent.text_to_speech_settings]. + // + // - How speech is synthesized when invoking + // [session][google.cloud.dialogflow.cx.v3.Sessions] APIs. + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3.Agent.text_to_speech_settings] + // only applies if + // [OutputAudioConfig.synthesize_speech_config][google.cloud.dialogflow.cx.v3.OutputAudioConfig.synthesize_speech_config] + // is not specified. + map synthesize_speech_configs = 1; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/changelog.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/changelog.proto new file mode 100644 index 000000000000..f5c186b9f689 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/changelog.proto @@ -0,0 +1,158 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ChangelogProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Changelogs][google.cloud.dialogflow.cx.v3.Changelog]. +service Changelogs { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of Changelogs. + rpc ListChangelogs(ListChangelogsRequest) returns (ListChangelogsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/changelogs" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified Changelog. + rpc GetChangelog(GetChangelogRequest) returns (Changelog) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/changelogs/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogs]. +message ListChangelogsRequest { + // Required. The agent containing the changelogs. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Changelog" + } + ]; + + // The filter string. Supports filter by user_email, resource, type and + // create_time. Some examples: + // 1. By user email: + // user_email = "someone@google.com" + // 2. By resource name: + // resource = "projects/123/locations/global/agents/456/flows/789" + // 3. By resource display name: + // display_name = "my agent" + // 4. By action: + // action = "Create" + // 5. By type: + // type = "flows" + // 6. By create time. Currently predicates on `create_time` and + // `create_time_epoch_seconds` are supported: + // create_time_epoch_seconds > 1551790877 AND create_time <= + // 2017-01-15T01:30:15.01Z + // 7. Combination of above filters: + // resource = "projects/123/locations/global/agents/456/flows/789" + // AND user_email = "someone@google.com" + // AND create_time <= 2017-01-15T01:30:15.01Z + string filter = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogs]. +message ListChangelogsResponse { + // The list of changelogs. There will be a maximum number of items returned + // based on the page_size field in the request. The changelogs will be ordered + // by timestamp. + repeated Changelog changelogs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Changelogs.GetChangelog][google.cloud.dialogflow.cx.v3.Changelogs.GetChangelog]. +message GetChangelogRequest { + // Required. The name of the changelog to get. + // Format: + // `projects//locations//agents//changelogs/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Changelog" + } + ]; +} + +// Changelogs represents a change made to a given agent. +message Changelog { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Changelog" + pattern: "projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}" + }; + + // The unique identifier of the changelog. + // Format: + // `projects//locations//agents//changelogs/`. + string name = 1; + + // Email address of the authenticated user. + string user_email = 2; + + // The affected resource display name of the change. + string display_name = 7; + + // The action of the change. + string action = 11; + + // The affected resource type. + string type = 8; + + // The affected resource name of the change. + string resource = 3; + + // The timestamp of the change. + google.protobuf.Timestamp create_time = 4; + + // The affected language code of the change. + string language_code = 14; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/code_block.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/code_block.proto new file mode 100644 index 000000000000..f250d4afd902 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/code_block.proto @@ -0,0 +1,33 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "CodeBlockProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Represents a code block. +message CodeBlock { + // Optional. Source code of the block in Python. + string code = 1 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto new file mode 100644 index 000000000000..727fdc6b6820 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto @@ -0,0 +1,260 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "DataStoreConnectionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// A data store connection. It represents a data store in Discovery Engine and +// the type of the contents it contains. +message DataStoreConnection { + // The type of the connected data store. + DataStoreType data_store_type = 1; + + // The full name of the referenced data store. + // Formats: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + // `projects/{project}/locations/{location}/dataStores/{data_store}` + string data_store = 2; + + // The document processing mode for the data store connection. Should only be + // set for PUBLIC_WEB and UNSTRUCTURED data stores. If not set it is + // considered as DOCUMENTS, as this is the legacy mode. + DocumentProcessingMode document_processing_mode = 4; +} + +// Type of a data store. +// Determines how search is performed in the data store. +enum DataStoreType { + // Not specified. This value indicates that the data store type is not + // specified, so it will not be used during search. + DATA_STORE_TYPE_UNSPECIFIED = 0; + + // A data store that contains public web content. + PUBLIC_WEB = 1; + + // A data store that contains unstructured private data. + UNSTRUCTURED = 2; + + // A data store that contains structured data (for example FAQ). + STRUCTURED = 3; +} + +// Data store connection feature output signals. +// Might be only partially field if processing stop before the final answer. +// Reasons for this can be, but are not limited to: empty UCS search results, +// positive RAI check outcome, grounding failure, ... +message DataStoreConnectionSignals { + // Diagnostic info related to the rewriter model call. + message RewriterModelCallSignals { + // Prompt as sent to the model. + string rendered_prompt = 1; + + // Output of the generative model. + string model_output = 2; + + // Name of the generative model. For example, "gemini-ultra", "gemini-pro", + // "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. + string model = 3; + } + + // Search snippet details. + message SearchSnippet { + // Title of the enclosing document. + string document_title = 1; + + // Uri for the document. Present if specified for the document. + string document_uri = 2; + + // Text included in the prompt. + string text = 3; + + // Metadata associated with the document. + google.protobuf.Struct metadata = 5; + } + + // Diagnostic info related to the answer generation model call. + message AnswerGenerationModelCallSignals { + // Prompt as sent to the model. + string rendered_prompt = 1; + + // Output of the generative model. + string model_output = 2; + + // Name of the generative model. For example, "gemini-ultra", "gemini-pro", + // "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. + string model = 3; + } + + // Answer part with citation. + message AnswerPart { + // Substring of the answer. + string text = 1; + + // Citations for this answer part. Indices of `search_snippets`. + repeated int32 supporting_indices = 2; + } + + // Snippet cited by the answer generation model. + message CitedSnippet { + // Details of the snippet. + SearchSnippet search_snippet = 1; + + // Index of the snippet in `search_snippets` field. + int32 snippet_index = 2; + } + + // Grounding signals. + message GroundingSignals { + // Represents the decision of the grounding check. + enum GroundingDecision { + // Decision not specified. + GROUNDING_DECISION_UNSPECIFIED = 0; + + // Grounding have accepted the answer. + ACCEPTED_BY_GROUNDING = 1; + + // Grounding have rejected the answer. + REJECTED_BY_GROUNDING = 2; + } + + // Grounding score buckets. + enum GroundingScoreBucket { + // Score not specified. + GROUNDING_SCORE_BUCKET_UNSPECIFIED = 0; + + // We have very low confidence that the answer is grounded. + VERY_LOW = 1; + + // We have low confidence that the answer is grounded. + LOW = 3; + + // We have medium confidence that the answer is grounded. + MEDIUM = 4; + + // We have high confidence that the answer is grounded. + HIGH = 5; + + // We have very high confidence that the answer is grounded. + VERY_HIGH = 6; + } + + // Represents the decision of the grounding check. + GroundingDecision decision = 1; + + // Grounding score bucket setting. + GroundingScoreBucket score = 2; + } + + // Safety check results. + message SafetySignals { + // Safety decision. + // All kinds of check are incorporated into this final decision, including + // banned phrases check. + enum SafetyDecision { + // Decision not specified. + SAFETY_DECISION_UNSPECIFIED = 0; + + // No manual or automatic safety check fired. + ACCEPTED_BY_SAFETY_CHECK = 1; + + // One ore more safety checks fired. + REJECTED_BY_SAFETY_CHECK = 2; + } + + // Specifies banned phrase match subject. + enum BannedPhraseMatch { + // No banned phrase check was executed. + BANNED_PHRASE_MATCH_UNSPECIFIED = 0; + + // All banned phrase checks led to no match. + BANNED_PHRASE_MATCH_NONE = 1; + + // A banned phrase matched the query. + BANNED_PHRASE_MATCH_QUERY = 2; + + // A banned phrase matched the response. + BANNED_PHRASE_MATCH_RESPONSE = 3; + } + + // Safety decision. + SafetyDecision decision = 1; + + // Specifies banned phrase match subject. + BannedPhraseMatch banned_phrase_match = 2; + + // The matched banned phrase if there was a match. + string matched_banned_phrase = 3; + } + + // Optional. Diagnostic info related to the rewriter model call. + RewriterModelCallSignals rewriter_model_call_signals = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Rewritten string query used for search. + string rewritten_query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Search snippets included in the answer generation prompt. + repeated SearchSnippet search_snippets = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Diagnostic info related to the answer generation model call. + AnswerGenerationModelCallSignals answer_generation_model_call_signals = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The final compiled answer. + string answer = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Answer parts with relevant citations. + // Concatenation of texts should add up the `answer` (not counting + // whitespaces). + repeated AnswerPart answer_parts = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Snippets cited by the answer generation model from the most to + // least relevant. + repeated CitedSnippet cited_snippets = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Grounding signals. + GroundingSignals grounding_signals = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Safety check result. + SafetySignals safety_signals = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// The document processing mode of the data store. +enum DocumentProcessingMode { + // Not specified. This should be set for STRUCTURED type data stores. Due to + // legacy reasons this is considered as DOCUMENTS for STRUCTURED and + // PUBLIC_WEB data stores. + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0; + + // Documents are processed as documents. + DOCUMENTS = 1; + + // Documents are converted to chunks. + CHUNKS = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/deployment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/deployment.proto new file mode 100644 index 000000000000..5893d5782fcd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/deployment.proto @@ -0,0 +1,175 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "DeploymentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Deployments][google.cloud.dialogflow.cx.v3.Deployment]. +service Deployments { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all deployments in the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc ListDeployments(ListDeploymentsRequest) + returns (ListDeploymentsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents a deployment in an environment. A deployment happens when a flow +// version configured to be active in the environment. You can configure running +// pre-deployment steps, e.g. running validation test cases, experiment +// auto-rollout, etc. +message Deployment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Deployment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}" + }; + + // The state of the deployment. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // The deployment is running. + RUNNING = 1; + + // The deployment succeeded. + SUCCEEDED = 2; + + // The deployment failed. + FAILED = 3; + } + + // Result of the deployment. + message Result { + // Results of test cases running before the deployment. + // Format: + // `projects//locations//agents//testCases//results/`. + repeated string deployment_test_results = 1 + [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCaseResult" + }]; + + // The name of the experiment triggered by this deployment. + // Format: + // projects//locations//agents//environments//experiments/. + string experiment = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + }]; + } + + // The name of the deployment. + // Format: + // projects//locations//agents//environments//deployments/. + string name = 1; + + // The name of the flow version for this deployment. + // Format: + // projects//locations//agents//flows//versions/. + string flow_version = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; + + // The current state of the deployment. + State state = 3; + + // Result of the deployment. + Result result = 4; + + // Start time of this deployment. + google.protobuf.Timestamp start_time = 5; + + // End time of this deployment. + google.protobuf.Timestamp end_time = 6; +} + +// The request message for +// [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3.Deployments.ListDeployments]. +message ListDeploymentsRequest { + // Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to + // list all environments for. Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Deployment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3.Deployments.ListDeployments]. +message ListDeploymentsResponse { + // The list of deployments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Deployment deployments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3.Deployments.GetDeployment]. +message GetDeploymentRequest { + // Required. The name of the + // [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: + // `projects//locations//agents//environments//deployments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Deployment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/entity_type.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/entity_type.proto new file mode 100644 index 000000000000..676737b95203 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/entity_type.proto @@ -0,0 +1,607 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/inline.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType]. +service EntityTypes { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Retrieves the specified entity type. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an entity type in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes" + body: "entity_type" + }; + option (google.api.method_signature) = "parent,entity_type"; + } + + // Updates the specified entity type. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v3/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}" + body: "entity_type" + }; + option (google.api.method_signature) = "entity_type,update_mask"; + } + + // Deletes the specified entity type. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc DeleteEntityType(DeleteEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all entity types in the specified agent. + rpc ListEntityTypes(ListEntityTypesRequest) + returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Exports the selected entity types. + rpc ExportEntityTypes(ExportEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportEntityTypesResponse" + metadata_type: "ExportEntityTypesMetadata" + }; + } + + // Imports the specified entitytypes into the agent. + rpc ImportEntityTypes(ImportEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportEntityTypesResponse" + metadata_type: "ImportEntityTypesMetadata" + }; + } +} + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// When you define an entity, you can also include synonyms that all map to +// that entity. For example, "soft drink", "soda", "pop", and so on. +// +// There are three types of entities: +// +// * **System** - entities that are defined by the Dialogflow API for common +// data types such as date, time, currency, and so on. A system entity is +// represented by the `EntityType` type. +// +// * **Custom** - entities that are defined by you that represent +// actionable data that is meaningful to your application. For example, +// you could define a `pizza.sauce` entity for red or white pizza sauce, +// a `pizza.cheese` entity for the different types of cheese on a pizza, +// a `pizza.topping` entity for different toppings, and so on. A custom +// entity is represented by the `EntityType` type. +// +// * **User** - entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. A user entity is +// represented by the +// [SessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityType] +// type. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message EntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/EntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}" + }; + + // Represents kinds of entities. + enum Kind { + // Not specified. This value should be never used. + KIND_UNSPECIFIED = 0; + + // Map entity types allow mapping of a group of synonyms to a canonical + // value. + KIND_MAP = 1; + + // List entity types contain a set of entries that do not map to canonical + // values. However, list entity types can contain references to other entity + // types (with or without aliases). + KIND_LIST = 2; + + // Regexp entity types allow to specify regular expressions in entries + // values. + KIND_REGEXP = 3; + } + + // Represents different entity type expansion modes. Automated expansion + // allows an agent to recognize values that have not been explicitly listed in + // the entity (for example, new kinds of shopping list items). + enum AutoExpansionMode { + // Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + + // Allows an agent to recognize values that have not been explicitly + // listed in the entity. + AUTO_EXPANSION_MODE_DEFAULT = 1; + } + + // An **entity entry** for an associated entity type. + message Entity { + // Required. The primary value associated with this entity entry. + // For example, if the entity type is *vegetable*, the value could be + // *scallions*. + // + // For `KIND_MAP` entity types: + // + // * A canonical value to be used in place of synonyms. + // + // For `KIND_LIST` entity types: + // + // * A string that can contain references to other entity types (with or + // without aliases). + string value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A collection of value synonyms. For example, if the entity type + // is *vegetable*, and `value` is *scallions*, a synonym could be *green + // onions*. + // + // For `KIND_LIST` entity types: + // + // * This collection must contain exactly one synonym equal to `value`. + repeated string synonyms = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // An excluded entity phrase that should not be matched. + message ExcludedPhrase { + // Required. The word or phrase to be excluded. + string value = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The unique identifier of the entity type. + // Required for + // [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType]. + // Format: + // `projects//locations//agents//entityTypes/`. + string name = 1; + + // Required. The human-readable name of the entity type, unique within the + // agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates the kind of entity type. + Kind kind = 3 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the entity type can be automatically expanded. + AutoExpansionMode auto_expansion_mode = 4; + + // The collection of entity entries associated with the entity type. + repeated Entity entities = 5; + + // Collection of exceptional words and phrases that shouldn't be matched. + // For example, if you have a size entity type with entry `giant`(an + // adjective), you might consider adding `giants`(a noun) as an exclusion. + // If the kind of entity type is `KIND_MAP`, then the phrases specified by + // entities and excluded phrases should be mutually exclusive. + repeated ExcludedPhrase excluded_phrases = 6; + + // Enables fuzzy entity extraction during classification. + bool enable_fuzzy_extraction = 7; + + // Indicates whether parameters of the entity type should be redacted in log. + // If redaction is enabled, page parameters and intent parameters referring to + // the entity type will be replaced by parameter name when logging. + bool redact = 9; +} + +// The request message for +// [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes]. +message ExportEntityTypesRequest { + // Data format of the exported entity types. + enum DataFormat { + // Unspecified format. Treated as `BLOB`. + DATA_FORMAT_UNSPECIFIED = 0; + + // EntityTypes will be exported as raw bytes. + BLOB = 1; + + // EntityTypes will be exported in JSON Package format. + JSON_PACKAGE = 5; + } + + // Required. The name of the parent agent to export entity types. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The name of the entity types to export. + // Format: + // `projects//locations//agents//entityTypes/`. + repeated string entity_types = 2 [(google.api.field_behavior) = REQUIRED]; + + // The destination to export. + oneof destination { + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the entity + // types to. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string entity_types_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The option to return the serialized entity types inline. + bool entity_types_content_inline = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The data format of the exported entity types. If not specified, + // `BLOB` is assumed. + DataFormat data_format = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The language to retrieve the entity type for. The following + // fields are language dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, all language dependent fields will be retrieved. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes]. +message ExportEntityTypesResponse { + // Exported entity types can be either in cloud storage or local download. + oneof exported_entity_types { + // The URI to a file containing the exported entity types. This field is + // populated only if `entity_types_uri` is specified in + // [ExportEntityTypesRequest][google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest]. + string entity_types_uri = 1; + + // Uncompressed byte content for entity types. This field is populated only + // if `entity_types_content_inline` is set to true in + // [ExportEntityTypesRequest][google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest]. + InlineDestination entity_types_content = 2; + } +} + +// Metadata returned for the +// [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes] +// long running operation. +message ExportEntityTypesMetadata {} + +// The request message for +// [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes]. +message ImportEntityTypesRequest { + // Merge option when display name conflicts exist during import. + enum MergeOption { + // Unspecified. If used, system uses REPORT_CONFLICT as default. + MERGE_OPTION_UNSPECIFIED = 0; + + // Replace the original entity type in the agent with the new entity type + // when display name conflicts exist. + REPLACE = 1; + + // Merge the original entity type with the new entity type when display name + // conflicts exist. + MERGE = 2; + + // Create new entity types with new display names to differentiate them from + // the existing entity types when display name conflicts exist. + RENAME = 3; + + // Report conflict information if display names conflict is detected. + // Otherwise, import entity types. + REPORT_CONFLICT = 4; + + // Keep the original entity type and discard the conflicting new entity type + // when display name conflicts exist. + KEEP = 5; + } + + // Required. The agent to import the entity types into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The entity types to import. + oneof entity_types { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import entity types from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string entity_types_uri = 2; + + // Uncompressed byte content of entity types. + InlineSource entity_types_content = 3; + } + + // Required. Merge option for importing entity types. + MergeOption merge_option = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target entity type to import into. + // Format: + // `projects//locations//agents//entity_types/`. + // If set, there should be only one entity type included in + // [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types], + // of which the type should match the type of the target entity type. All + // [entities][google.cloud.dialogflow.cx.v3.EntityType.entities] in the + // imported entity type will be added to the target entity type. + string target_entity_type = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; +} + +// The response message for +// [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes]. +message ImportEntityTypesResponse { + // Conflicting resources detected during the import process. Only filled when + // [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] is set in the + // request and there are conflicts in the display names. + message ConflictingResources { + // Display names of conflicting entity types. + repeated string entity_type_display_names = 1; + + // Display names of conflicting entities. + repeated string entity_display_names = 2; + } + + // The unique identifier of the imported entity types. + // Format: + // `projects//locations//agents//entity_types/`. + repeated string entity_types = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + }]; + + // Info which resources have conflicts when + // [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] merge_option + // is set in ImportEntityTypesRequest. + ConflictingResources conflicting_resources = 2; +} + +// Metadata returned for the +// [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes] +// long running operation. +message ImportEntityTypesMetadata {} + +// The request message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The agent to list all entity types for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to list entity types for. The following fields are language + // dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes]. +message ListEntityTypesResponse { + // The list of entity types. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated EntityType entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the entity type. + // Format: + // `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to retrieve the entity type for. The following fields are + // language dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The agent to create a entity type for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The entity type to create. + EntityType entity_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The entity type to update. + EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType]. +message DeleteEntityTypeRequest { + // Required. The name of the entity type to delete. + // Format: + // `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // This field has no effect for entity type not being used. + // For entity types that are used by intents or pages: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referencing resources. + // * If `force` is set to true, Dialogflow will remove the entity type, as + // well as any references to the entity type (i.e. Page + // [parameter][google.cloud.dialogflow.cx.v3.Form.Parameter] of the entity + // type will be changed to + // '@sys.any' and intent + // [parameter][google.cloud.dialogflow.cx.v3.Intent.Parameter] of the + // entity type will be removed). + bool force = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/environment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/environment.proto new file mode 100644 index 000000000000..61e45323653f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/environment.proto @@ -0,0 +1,540 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/test_case.proto"; +import "google/cloud/dialogflow/cx/v3/webhook.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "EnvironmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing +// [Environments][google.cloud.dialogflow.cx.v3.Environment]. +service Environments { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all environments in the specified + // [Agent][google.cloud.dialogflow.cx.v3.Agent]. + rpc ListEnvironments(ListEnvironmentsRequest) + returns (ListEnvironmentsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/environments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the + // specified [Agent][google.cloud.dialogflow.cx.v3.Agent]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + rpc CreateEnvironment(CreateEnvironmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/environments" + body: "environment" + }; + option (google.api.method_signature) = "parent,environment"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Updates the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + rpc UpdateEnvironment(UpdateEnvironmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{environment.name=projects/*/locations/*/agents/*/environments/*}" + body: "environment" + }; + option (google.api.method_signature) = "environment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Deletes the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc DeleteEnvironment(DeleteEnvironmentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up the history of the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc LookupEnvironmentHistory(LookupEnvironmentHistoryRequest) + returns (LookupEnvironmentHistoryResponse) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory" + }; + option (google.api.method_signature) = "name"; + } + + // Kicks off a continuous test under the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata] + // - `response`: + // [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3.RunContinuousTestResponse] + rpc RunContinuousTest(RunContinuousTestRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RunContinuousTestResponse" + metadata_type: "RunContinuousTestMetadata" + }; + } + + // Fetches a list of continuous test results for a given environment. + rpc ListContinuousTestResults(ListContinuousTestResultsRequest) + returns (ListContinuousTestResultsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults" + }; + option (google.api.method_signature) = "parent"; + } + + // Deploys a flow to the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [DeployFlowMetadata][google.cloud.dialogflow.cx.v3.DeployFlowMetadata] + // - `response`: + // [DeployFlowResponse][google.cloud.dialogflow.cx.v3.DeployFlowResponse] + rpc DeployFlow(DeployFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "DeployFlowResponse" + metadata_type: "DeployFlowMetadata" + }; + } +} + +// Represents an environment for an agent. You can create multiple versions +// of your agent and publish them to separate environments. When you edit an +// agent, you are editing the draft agent. At any point, you can save the draft +// agent as an agent version, which is an immutable snapshot of your agent. When +// you save the draft agent, it is published to the default environment. When +// you create agent versions, you can publish them to custom environments. You +// can create a variety of custom environments for testing, development, +// production, etc. +message Environment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Environment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}" + }; + + // Configuration for the version. + message VersionConfig { + // Required. Flow, playbook and tool versions are supported. + // Format for flow version: + // projects//locations//agents//flows//versions/. + // Format for playbook version: + // projects//locations//agents//playbooks//versions/. + // Format for tool version: + // projects//locations//agents//tools//versions/. + string version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + } + + // The configuration for continuous tests. + message TestCasesConfig { + // A list of test case names to run. They should be under the same agent. + // Format of each test case name: + // `projects//locations//agents//testCases/` + repeated string test_cases = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + }]; + + // Whether to run test cases in + // [TestCasesConfig.test_cases][google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.test_cases] + // periodically. Default false. If set to true, run once a day. + bool enable_continuous_run = 2; + + // Whether to run test cases in + // [TestCasesConfig.test_cases][google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.test_cases] + // before deploying a flow version to the environment. Default false. + bool enable_predeployment_run = 3; + } + + // Configuration for webhooks. + message WebhookConfig { + // The list of webhooks to override for the agent environment. The webhook + // must exist in the agent. You can override fields in + // [`generic_web_service`][google.cloud.dialogflow.cx.v3.Webhook.generic_web_service] + // and + // [`service_directory`][google.cloud.dialogflow.cx.v3.Webhook.service_directory]. + repeated Webhook webhook_overrides = 1; + } + + // The name of the environment. + // Format: + // `projects//locations//agents//environments/`. + string name = 1; + + // Required. The human-readable name of the environment (unique in an agent). + // Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable description of the environment. The maximum length is + // 500 characters. If exceeded, the request is rejected. + string description = 3; + + // A list of configurations for flow versions. You should include version + // configs for all flows that are reachable from [`Start + // Flow`][Agent.start_flow] in the agent. Otherwise, an error will be + // returned. + repeated VersionConfig version_configs = 6; + + // Output only. Update time of this environment. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The test cases config for continuous tests of this environment. + TestCasesConfig test_cases_config = 7; + + // The webhook configuration for this environment. + WebhookConfig webhook_config = 10; +} + +// The request message for +// [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments]. +message ListEnvironmentsRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all + // environments for. Format: + // `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments]. +message ListEnvironmentsResponse { + // The list of environments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Environment environments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3.Environments.GetEnvironment]. +message GetEnvironmentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. Format: + // `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for +// [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment]. +message CreateEnvironmentRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an + // [Environment][google.cloud.dialogflow.cx.v3.Environment] for. Format: + // `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. The environment to create. + Environment environment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment]. +message UpdateEnvironmentRequest { + // Required. The environment to update. + Environment environment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment]. +message DeleteEnvironmentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3.Environment] to delete. Format: + // `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for +// [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryRequest { + // Required. Resource name of the environment to look up the history for. + // Format: + // `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryResponse { + // Represents a list of snapshots for an environment. Time of the snapshots is + // stored in + // [`update_time`][google.cloud.dialogflow.cx.v3.Environment.update_time]. + repeated Environment environments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Represents a result from running a test case in an agent environment. +message ContinuousTestResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/ContinuousTestResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}" + }; + + // The overall result for a continuous test run in an agent environment. + enum AggregatedTestResult { + // Not specified. Should never be used. + AGGREGATED_TEST_RESULT_UNSPECIFIED = 0; + + // All the tests passed. + PASSED = 1; + + // At least one test did not pass. + FAILED = 2; + } + + // The resource name for the continuous test result. Format: + // `projects//locations//agents//environments//continuousTestResults/`. + string name = 1; + + // The result of this continuous test run, i.e. whether all the tests in this + // continuous test run pass or not. + AggregatedTestResult result = 2; + + // A list of individual test case results names in this continuous test run. + repeated string test_case_results = 3 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCaseResult" + }]; + + // Time when the continuous testing run starts. + google.protobuf.Timestamp run_time = 4; +} + +// The request message for +// [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest]. +message RunContinuousTestRequest { + // Required. Format: + // `projects//locations//agents//environments/`. + string environment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The response message for +// [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest]. +message RunContinuousTestResponse { + // The result for a continuous test run. + ContinuousTestResult continuous_test_result = 1; +} + +// Metadata returned for the +// [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest] +// long running operation. +message RunContinuousTestMetadata { + // The test errors. + repeated TestError errors = 1; +} + +// The request message for +// [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults]. +message ListContinuousTestResultsRequest { + // Required. The environment to list results for. + // Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ContinuousTestResult" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Environments.ListTestCaseResults][]. +message ListContinuousTestResultsResponse { + // The list of continuous test results. + repeated ContinuousTestResult continuous_test_results = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow]. +message DeployFlowRequest { + // Required. The environment to deploy the flow to. + // Format: + // `projects//locations//agents//environments/`. + string environment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. The flow version to deploy. + // Format: + // `projects//locations//agents//flows//versions/`. + string flow_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The response message for +// [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow]. +message DeployFlowResponse { + // The updated environment where the flow is deployed. + Environment environment = 1; + + // The name of the flow version + // [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: + // `projects//locations//agents//environments//deployments/`. + string deployment = 2; +} + +// Metadata returned for the +// [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow] +// long running operation. +message DeployFlowMetadata { + // Errors of running deployment tests. + repeated TestError test_errors = 1; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/example.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/example.proto new file mode 100644 index 000000000000..29c8a833b8ef --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/example.proto @@ -0,0 +1,238 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/trace.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ExampleProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Examples][google.cloud.dialogflow.cx.v3.Example]. +service Examples { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates an example in the specified playbook. + rpc CreateExample(CreateExampleRequest) returns (Example) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples" + body: "example" + }; + option (google.api.method_signature) = "parent,example"; + } + + // Deletes the specified example. + rpc DeleteExample(DeleteExampleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of examples in the specified playbook. + rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified example. + rpc GetExample(GetExampleRequest) returns (Example) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the specified example. + rpc UpdateExample(UpdateExampleRequest) returns (Example) { + option (google.api.http) = { + patch: "/v3/{example.name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + body: "example" + }; + option (google.api.method_signature) = "example,update_mask"; + } +} + +// The request message for +// [Examples.CreateExample][google.cloud.dialogflow.cx.v3.Examples.CreateExample]. +message CreateExampleRequest { + // Required. The playbook to create an example for. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Example" + } + ]; + + // Required. The example to create. + Example example = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Examples.DeleteExample][google.cloud.dialogflow.cx.v3.Examples.DeleteExample]. +message DeleteExampleRequest { + // Required. The name of the example to delete. + // Format: + // `projects//locations//agents//playbooks//examples/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Example" + } + ]; +} + +// The request message for +// [Examples.ListExamples][google.cloud.dialogflow.cx.v3.Examples.ListExamples]. +message ListExamplesRequest { + // Required. The playbook to list the examples from. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Example" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The [next_page_token][ListExampleResponse.next_page_token] value + // returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The language to list examples for. + // If not specified, list all examples under the playbook. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Examples.ListExamples][google.cloud.dialogflow.cx.v3.Examples.ListExamples]. +message ListExamplesResponse { + // The list of examples. There will be a maximum number of items returned + // based on the + // [page_size][google.cloud.dialogflow.cx.v3.ListExamplesRequest.page_size] + // field in the request. + repeated Example examples = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Examples.GetExample][google.cloud.dialogflow.cx.v3.Examples.GetExample]. +message GetExampleRequest { + // Required. The name of the example. + // Format: + // `projects//locations//agents//playbooks//examples/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Example" + } + ]; +} + +// The request message for +// [Examples.UpdateExample][google.cloud.dialogflow.cx.v3.Examples.UpdateExample]. +message UpdateExampleRequest { + // Required. The example to update. + Example example = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which fields get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Example represents a sample execution of the playbook in the conversation. +// +// An example consists of a list of ordered actions performed by end user +// or Dialogflow agent according the playbook instructions to fulfill the task. +message Example { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Example" + pattern: "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}" + plural: "examples" + singular: "example" + }; + + // The unique identifier of the playbook example. + // Format: + // `projects//locations//agents//playbooks//examples/`. + string name = 1; + + // Optional. The input to the playbook in the example. + PlaybookInput playbook_input = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The output of the playbook in the example. + PlaybookOutput playbook_output = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ordered list of actions performed by the end user and the + // Dialogflow agent. + repeated Action actions = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The display name of the example. + string display_name = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The high level concise description of the example. The max number + // of characters is 200. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Estimated number of tokes current example takes when sent to + // the LLM. + int64 token_count = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of initial example creation. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the example was updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Example's output state. + OutputState conversation_state = 12 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The language code of the example. + // If not specified, the agent's default language is used. + // Note: languages must be enabled in the agent before they can be used. + // Note: example's language code is not currently used in dialogflow agents. + string language_code = 13 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/experiment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/experiment.proto new file mode 100644 index 000000000000..87b45ad9c98f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/experiment.proto @@ -0,0 +1,519 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ExperimentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Experiments][google.cloud.dialogflow.cx.v3.Experiment]. +service Experiments { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all experiments in the specified + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc ListExperiments(ListExperimentsRequest) + returns (ListExperimentsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + rpc GetExperiment(GetExperimentRequest) returns (Experiment) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [Experiment][google.cloud.dialogflow.cx.v3.Experiment] in the + // specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc CreateExperiment(CreateExperimentRequest) returns (Experiment) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments" + body: "experiment" + }; + option (google.api.method_signature) = "parent,experiment"; + } + + // Updates the specified + // [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + rpc UpdateExperiment(UpdateExperimentRequest) returns (Experiment) { + option (google.api.http) = { + patch: "/v3/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + body: "experiment" + }; + option (google.api.method_signature) = "experiment,update_mask"; + } + + // Deletes the specified + // [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + rpc DeleteExperiment(DeleteExperimentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Starts the specified + // [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. This rpc only + // changes the state of experiment from PENDING to RUNNING. + rpc StartExperiment(StartExperimentRequest) returns (Experiment) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Stops the specified [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + // This rpc only changes the state of experiment from RUNNING to DONE. + rpc StopExperiment(StopExperimentRequest) returns (Experiment) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents an experiment in an environment. +message Experiment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Experiment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}" + }; + + // The state of the experiment. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // The experiment is created but not started yet. + DRAFT = 1; + + // The experiment is running. + RUNNING = 2; + + // The experiment is done. + DONE = 3; + + // The experiment with auto-rollout enabled has failed. + ROLLOUT_FAILED = 4; + } + + // Definition of the experiment. + message Definition { + // The condition defines which subset of sessions are selected for + // this experiment. If not specified, all sessions are eligible. E.g. + // "query_input.language_code=en" See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string condition = 1; + + // The variants of the experiment. We currently only support single variant + // experiment. + oneof variants { + // The flow versions as the variants of this experiment. + VersionVariants version_variants = 2; + } + } + + // The inference result which includes an objective metric to optimize and the + // confidence interval. + message Result { + // Types of ratio-based metric for Dialogflow experiment. + enum MetricType { + // Metric unspecified. + METRIC_UNSPECIFIED = 0; + + // Percentage of contained sessions without user calling back in 24 hours. + CONTAINED_SESSION_NO_CALLBACK_RATE = 1; + + // Percentage of sessions that were handed to a human agent. + LIVE_AGENT_HANDOFF_RATE = 2; + + // Percentage of sessions with the same user calling back. + CALLBACK_SESSION_RATE = 3; + + // Percentage of sessions where user hung up. + ABANDONED_SESSION_RATE = 4; + + // Percentage of sessions reached Dialogflow 'END_PAGE' or + // 'END_SESSION'. + SESSION_END_RATE = 5; + } + + // Types of count-based metric for Dialogflow experiment. + enum CountType { + // Count type unspecified. + COUNT_TYPE_UNSPECIFIED = 0; + + // Total number of occurrences of a 'NO_MATCH'. + TOTAL_NO_MATCH_COUNT = 1; + + // Total number of turn counts. + TOTAL_TURN_COUNT = 2; + + // Average turn count in a session. + AVERAGE_TURN_COUNT = 3; + } + + // A confidence interval is a range of possible values for the experiment + // objective you are trying to measure. + message ConfidenceInterval { + // The confidence level used to construct the interval, i.e. there is X% + // chance that the true value is within this interval. + double confidence_level = 1; + + // The percent change between an experiment metric's value and the value + // for its control. + double ratio = 2; + + // Lower bound of the interval. + double lower_bound = 3; + + // Upper bound of the interval. + double upper_bound = 4; + } + + // Metric and corresponding confidence intervals. + message Metric { + // Ratio-based metric type. Only one of type or count_type is specified in + // each Metric. + MetricType type = 1; + + // Count-based metric type. Only one of type or count_type is specified in + // each Metric. + CountType count_type = 5; + + // The actual value of the metric. + oneof value { + // Ratio value of a metric. + double ratio = 2; + + // Count value of a metric. + double count = 4; + } + + // The probability that the treatment is better than all other treatments + // in the experiment + ConfidenceInterval confidence_interval = 3; + } + + // Version variant and associated metrics. + message VersionMetrics { + // The name of the flow [Version][google.cloud.dialogflow.cx.v3.Version]. + // Format: + // `projects//locations//agents//flows//versions/`. + string version = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; + + // The metrics and corresponding confidence intervals in the inference + // result. + repeated Metric metrics = 2; + + // Number of sessions that were allocated to this version. + int32 session_count = 3; + } + + // Version variants and metrics. + repeated VersionMetrics version_metrics = 1; + + // The last time the experiment's stats data was updated. Will have default + // value if stats have never been computed for this experiment. + google.protobuf.Timestamp last_update_time = 2; + } + + // The name of the experiment. + // Format: + // projects//locations//agents//environments//experiments/. + string name = 1; + + // Required. The human-readable name of the experiment (unique in an + // environment). Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable description of the experiment. + string description = 3; + + // The current state of the experiment. + // Transition triggered by Experiments.StartExperiment: DRAFT->RUNNING. + // Transition triggered by Experiments.CancelExperiment: DRAFT->DONE or + // RUNNING->DONE. + State state = 4; + + // The definition of the experiment. + Definition definition = 5; + + // The configuration for auto rollout. If set, there should be exactly two + // variants in the experiment (control variant being the default version of + // the flow), the traffic allocation for the non-control variant will + // gradually increase to 100% when conditions are met, and eventually + // replace the control variant to become the default version of the flow. + RolloutConfig rollout_config = 14; + + // State of the auto rollout process. + RolloutState rollout_state = 15; + + // The reason why rollout has failed. Should only be set when state is + // ROLLOUT_FAILED. + string rollout_failure_reason = 16; + + // Inference result of the experiment. + Result result = 6; + + // Creation time of this experiment. + google.protobuf.Timestamp create_time = 7; + + // Start time of this experiment. + google.protobuf.Timestamp start_time = 8; + + // End time of this experiment. + google.protobuf.Timestamp end_time = 9; + + // Last update time of this experiment. + google.protobuf.Timestamp last_update_time = 10; + + // Maximum number of days to run the experiment/rollout. If auto-rollout is + // not enabled, default value and maximum will be 30 days. If auto-rollout is + // enabled, default value and maximum will be 6 days. + google.protobuf.Duration experiment_length = 11; + + // The history of updates to the experiment variants. + repeated VariantsHistory variants_history = 12; +} + +// A list of flow version variants. +message VersionVariants { + // A single flow version with specified traffic allocation. + message Variant { + // The name of the flow version. + // Format: + // `projects//locations//agents//flows//versions/`. + string version = 1; + + // Percentage of the traffic which should be routed to this + // version of flow. Traffic allocation for a single flow must sum up to 1.0. + float traffic_allocation = 2; + + // Whether the variant is for the control group. + bool is_control_group = 3; + } + + // A list of flow version variants. + repeated Variant variants = 1; +} + +// The history of variants update. +message VariantsHistory { + // The variants updated. We currently only support single variant + // experiment. + oneof variants { + // The flow versions as the variants. + VersionVariants version_variants = 1; + } + + // Update time of the variants. + google.protobuf.Timestamp update_time = 2; +} + +// The configuration for auto rollout. +message RolloutConfig { + // A single rollout step with specified traffic allocation. + message RolloutStep { + // The name of the rollout step; + string display_name = 1; + + // The percentage of traffic allocated to the flow version of this rollout + // step. (0%, 100%]. + int32 traffic_percent = 2; + + // The minimum time that this step should last. Should be longer than 1 + // hour. If not set, the default minimum duration for each step will be 1 + // hour. + google.protobuf.Duration min_duration = 3; + } + + // Steps to roll out a flow version. Steps should be sorted by percentage in + // ascending order. + repeated RolloutStep rollout_steps = 1; + + // The conditions that are used to evaluate the success of a rollout + // step. If not specified, all rollout steps will proceed to the next one + // unless failure conditions are met. E.g. "containment_rate > 60% AND + // callback_rate < 20%". See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string rollout_condition = 2; + + // The conditions that are used to evaluate the failure of a rollout + // step. If not specified, no rollout steps will fail. E.g. "containment_rate + // < 10% OR average_turn_count < 3". See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string failure_condition = 3; +} + +// State of the auto-rollout process. +message RolloutState { + // Display name of the current auto rollout step. + string step = 1; + + // Index of the current step in the auto rollout steps list. + int32 step_index = 3; + + // Start time of the current step. + google.protobuf.Timestamp start_time = 2; +} + +// The request message for +// [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments]. +message ListExperimentsRequest { + // Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to + // list all environments for. Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Experiment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments]. +message ListExperimentsResponse { + // The list of experiments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Experiment experiments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3.Experiments.GetExperiment]. +message GetExperimentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3.Environment]. Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} + +// The request message for +// [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3.Experiments.CreateExperiment]. +message CreateExperimentRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an + // [Environment][google.cloud.dialogflow.cx.v3.Environment] for. Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Experiment" + } + ]; + + // Required. The experiment to create. + Experiment experiment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3.Experiments.UpdateExperiment]. +message UpdateExperimentRequest { + // Required. The experiment to update. + Experiment experiment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3.Experiments.DeleteExperiment]. +message DeleteExperimentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3.Environment] to delete. Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} + +// The request message for +// [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3.Experiments.StartExperiment]. +message StartExperimentRequest { + // Required. Resource name of the experiment to start. + // Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} + +// The request message for +// [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3.Experiments.StopExperiment]. +message StopExperimentRequest { + // Required. Resource name of the experiment to stop. + // Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/flow.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/flow.proto new file mode 100644 index 000000000000..c49afdc619c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/flow.proto @@ -0,0 +1,704 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3/import_strategy.proto"; +import "google/cloud/dialogflow/cx/v3/page.proto"; +import "google/cloud/dialogflow/cx/v3/parameter_definition.proto"; +import "google/cloud/dialogflow/cx/v3/validation_message.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "FlowProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. +service Flows { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a flow in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateFlow(CreateFlowRequest) returns (Flow) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/flows" + body: "flow" + }; + option (google.api.method_signature) = "parent,flow"; + } + + // Deletes a specified flow. + rpc DeleteFlow(DeleteFlowRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all flows in the specified agent. + rpc ListFlows(ListFlowsRequest) returns (ListFlowsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/flows" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified flow. + rpc GetFlow(GetFlowRequest) returns (Flow) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateFlow(UpdateFlowRequest) returns (Flow) { + option (google.api.http) = { + patch: "/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}" + body: "flow" + }; + option (google.api.method_signature) = "flow,update_mask"; + } + + // Trains the specified flow. Note that only the flow in 'draft' environment + // is trained. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: An [Empty + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc TrainFlow(TrainFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/flows/*}:train" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } + + // Validates the specified flow and creates or updates validation results. + // Please call this API after the training is completed to get the complete + // validation results. + rpc ValidateFlow(ValidateFlowRequest) returns (FlowValidationResult) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate" + body: "*" + }; + } + + // Gets the latest flow validation result. Flow validation is performed + // when ValidateFlow is called. + rpc GetFlowValidationResult(GetFlowValidationResultRequest) + returns (FlowValidationResult) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}" + }; + option (google.api.method_signature) = "name"; + } + + // Imports the specified flow to the specified agent from a binary file. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: + // [ImportFlowResponse][google.cloud.dialogflow.cx.v3.ImportFlowResponse] + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc ImportFlow(ImportFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/flows:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportFlowResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Exports the specified flow to a binary file. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: + // [ExportFlowResponse][google.cloud.dialogflow.cx.v3.ExportFlowResponse] + // + // Note that resources (e.g. intents, entities, webhooks) that the flow + // references will also be exported. + rpc ExportFlow(ExportFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/flows/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportFlowResponse" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Settings related to NLU. +message NluSettings { + // NLU model type. + enum ModelType { + // Not specified. `MODEL_TYPE_STANDARD` will be used. + MODEL_TYPE_UNSPECIFIED = 0; + + // Use standard NLU model. + MODEL_TYPE_STANDARD = 1; + + // Use advanced NLU model. + MODEL_TYPE_ADVANCED = 3; + } + + // NLU model training mode. + enum ModelTrainingMode { + // Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. + MODEL_TRAINING_MODE_UNSPECIFIED = 0; + + // NLU model training is automatically triggered when a flow gets modified. + // User can also manually trigger model training in this mode. + MODEL_TRAINING_MODE_AUTOMATIC = 1; + + // User needs to manually trigger NLU model training. Best for large flows + // whose models take long time to train. + MODEL_TRAINING_MODE_MANUAL = 2; + } + + // Indicates the type of NLU model. + ModelType model_type = 1; + + // To filter out false positive results and still get variety in matched + // natural language inputs for your agent, you can tune the machine learning + // classification threshold. If the returned score value is less than the + // threshold value, then a no-match event will be triggered. The score values + // range from 0.0 (completely uncertain) to 1.0 (completely certain). If set + // to 0.0, the default of 0.3 is used. You can set a separate classification + // threshold for the flow in each language enabled for the agent. + float classification_threshold = 3; + + // Indicates NLU model training mode. + ModelTrainingMode model_training_mode = 4; +} + +// Flows represents the conversation flows when you build your chatbot agent. +// +// A flow consists of many pages connected by the transition routes. +// Conversations always start with the built-in Start Flow (with an all-0 ID). +// Transition routes can direct the conversation session from the current flow +// (parent flow) to another flow (sub flow). When the sub flow is finished, +// Dialogflow will bring the session back to the parent flow, where the sub flow +// is started. +// +// Usually, when a transition route is followed by a matched intent, the intent +// will be "consumed". This means the intent won't activate more transition +// routes. However, when the followed transition route moves the conversation +// session into a different flow, the matched intent can be carried over and to +// be consumed in the target flow. +message Flow { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Flow" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}" + }; + + // Settings for multi-lingual agents. + message MultiLanguageSettings { + // Optional. Enable multi-language detection for this flow. This can be set + // only if [agent level multi language + // setting][Agent.enable_multi_language_training] is enabled. + bool enable_multi_language_detection = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Agent will respond in the detected language if the detected + // language code is in the supported resolved languages for this flow. This + // will be used only if multi-language training is enabled in the + // [agent][google.cloud.dialogflow.cx.v3.Agent.enable_multi_language_training] + // and multi-language detection is enabled in the + // [flow][google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.enable_multi_language_detection]. + // The supported languages must be a subset of the languages supported by + // the agent. + repeated string supported_response_language_codes = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The unique identifier of the flow. + // Format: + // `projects//locations//agents//flows/`. + string name = 1; + + // Required. The human-readable name of the flow. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the flow. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // A flow's transition routes serve two purposes: + // + // * They are responsible for matching the user's first utterances in the + // flow. + // * They are inherited by every page's [transition + // routes][Page.transition_routes] and can support use cases such as the user + // saying "help" or "can I talk to a human?", which can be handled in a common + // way regardless of the current page. Transition routes defined in the page + // have higher priority than those defined in the flow. + // + // TransitionRoutes are evaluated in the following order: + // + // * TransitionRoutes with intent specified. + // * TransitionRoutes with only condition specified. + // + // TransitionRoutes with intent specified are inherited by pages in the flow. + repeated TransitionRoute transition_routes = 4; + + // A flow's event handlers serve two purposes: + // + // * They are responsible for handling events (e.g. no match, + // webhook errors) in the flow. + // * They are inherited by every page's [event + // handlers][Page.event_handlers], which can be used to handle common events + // regardless of the current page. Event handlers defined in the page + // have higher priority than those defined in the flow. + // + // Unlike + // [transition_routes][google.cloud.dialogflow.cx.v3.Flow.transition_routes], + // these handlers are evaluated on a first-match basis. The first one that + // matches the event get executed, with the rest being ignored. + repeated EventHandler event_handlers = 10; + + // A flow's transition route group serve two purposes: + // + // * They are responsible for matching the user's first utterances in the + // flow. + // * They are inherited by every page's [transition + // route groups][Page.transition_route_groups]. Transition route groups + // defined in the page have higher priority than those defined in the flow. + // + // Format: + // `projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/` + // for agent-level groups. + repeated string transition_route_groups = 15 + [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + }]; + + // NLU related settings of the flow. + NluSettings nlu_settings = 11; + + // Hierarchical advanced settings for this flow. The settings exposed at the + // lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 14; + + // Optional. Knowledge connector configuration. + KnowledgeConnectorSettings knowledge_connector_settings = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defined structured input parameters for this flow. + repeated ParameterDefinition input_parameter_definitions = 26 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defined structured output parameters for this flow. + repeated ParameterDefinition output_parameter_definitions = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Multi-lingual agent settings for this flow. + MultiLanguageSettings multi_language_settings = 28 + [(google.api.field_behavior) = OPTIONAL]; + + // Indicates whether the flow is locked for changes. If the flow is locked, + // modifications to the flow will be rejected. + bool locked = 30; +} + +// The request message for +// [Flows.CreateFlow][google.cloud.dialogflow.cx.v3.Flows.CreateFlow]. +message CreateFlowRequest { + // Required. The agent to create a flow for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Required. The flow to create. + Flow flow = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3.Flows.DeleteFlow]. +message DeleteFlowRequest { + // Required. The name of the flow to delete. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // This field has no effect for flows with no incoming transitions. + // For flows with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the flow, as well as + // any transitions to the flow (i.e. [Target + // flow][EventHandler.target_flow] in event handlers or [Target + // flow][TransitionRoute.target_flow] in transition routes that point to + // this flow will be cleared). + bool force = 2; +} + +// The request message for +// [Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows]. +message ListFlowsRequest { + // Required. The agent containing the flows. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list flows for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for +// [Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows]. +message ListFlowsResponse { + // The list of flows. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Flow flows = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The response message for +// [Flows.GetFlow][google.cloud.dialogflow.cx.v3.Flows.GetFlow]. +message GetFlowRequest { + // Required. The name of the flow to get. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // The language to retrieve the flow for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3.Flows.UpdateFlow]. +message UpdateFlowRequest { + // Required. The flow to update. + Flow flow = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Flows.TrainFlow][google.cloud.dialogflow.cx.v3.Flows.TrainFlow]. +message TrainFlowRequest { + // Required. The flow to train. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; +} + +// The request message for +// [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3.Flows.ValidateFlow]. +message ValidateFlowRequest { + // Required. The flow to validate. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The request message for +// [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult]. +message GetFlowValidationResultRequest { + // Required. The flow name. + // Format: + // `projects//locations//agents//flows//validationResult`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/FlowValidationResult" + } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The response message for +// [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult]. +message FlowValidationResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/FlowValidationResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult" + }; + + // The unique identifier of the flow validation result. + // Format: + // `projects//locations//agents//flows//validationResult`. + string name = 1; + + // Contains all validation messages. + repeated ValidationMessage validation_messages = 2; + + // Last time the flow was validated. + google.protobuf.Timestamp update_time = 3; +} + +// The request message for +// [Flows.ImportFlow][google.cloud.dialogflow.cx.v3.Flows.ImportFlow]. +message ImportFlowRequest { + // Import option. + enum ImportOption { + // Unspecified. Treated as `KEEP`. + IMPORT_OPTION_UNSPECIFIED = 0; + + // Always respect settings in exported flow content. It may cause a + // import failure if some settings (e.g. custom NLU) are not supported in + // the agent to import into. + KEEP = 1; + + // Fallback to default settings if some settings are not supported in the + // agent to import into. E.g. Standard NLU will be used if custom NLU is + // not available. + FALLBACK = 2; + } + + // Required. The agent to import the flow into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Required. The flow to import. + oneof flow { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import flow from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string flow_uri = 2; + + // Uncompressed raw byte content for flow. + bytes flow_content = 3; + } + + // Flow import mode. If not specified, `KEEP` is assumed. + ImportOption import_option = 4; + + // Optional. Specifies the import strategy used when resolving resource + // conflicts. + FlowImportStrategy flow_import_strategy = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The flow import strategy used for resource conflict resolution associated +// with an [ImportFlowRequest][google.cloud.dialogflow.cx.v3.ImportFlowRequest]. +message FlowImportStrategy { + // Optional. Import strategy for resource conflict resolution, applied + // globally throughout the flow. It will be applied for all display name + // conflicts in the imported content. If not specified, 'CREATE_NEW' is + // assumed. + ImportStrategy global_import_strategy = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Flows.ImportFlow][google.cloud.dialogflow.cx.v3.Flows.ImportFlow]. +message ImportFlowResponse { + // The unique identifier of the new flow. + // Format: + // `projects//locations//agents//flows/`. + string flow = 1 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; +} + +// The request message for +// [Flows.ExportFlow][google.cloud.dialogflow.cx.v3.Flows.ExportFlow]. +message ExportFlowRequest { + // Required. The name of the flow to export. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. + // The format of this URI must be `gs:///`. If left + // unspecified, the serialized flow is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string flow_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to export flows referenced by the specified flow. + bool include_referenced_flows = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Flows.ExportFlow][google.cloud.dialogflow.cx.v3.Flows.ExportFlow]. +message ExportFlowResponse { + // The exported flow. + oneof flow { + // The URI to a file containing the exported flow. This field is populated + // only if `flow_uri` is specified in + // [ExportFlowRequest][google.cloud.dialogflow.cx.v3.ExportFlowRequest]. + string flow_uri = 1; + + // Uncompressed raw byte content for flow. + bytes flow_content = 2; + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto new file mode 100644 index 000000000000..6b29e1bca452 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto @@ -0,0 +1,170 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3/response_message.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "FulfillmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// A fulfillment can do one or more of the following actions at the same time: +// +// * Generate rich message responses. +// * Set parameter values. +// * Call the webhook. +// +// Fulfillments can be called at various stages in the +// [Page][google.cloud.dialogflow.cx.v3.Page] or +// [Form][google.cloud.dialogflow.cx.v3.Form] lifecycle. For example, when a +// [DetectIntentRequest][google.cloud.dialogflow.cx.v3.DetectIntentRequest] +// drives a session to enter a new page, the page's entry fulfillment can add a +// static response to the +// [QueryResult][google.cloud.dialogflow.cx.v3.QueryResult] in the returning +// [DetectIntentResponse][google.cloud.dialogflow.cx.v3.DetectIntentResponse], +// call the webhook (for example, to load user data from a database), or both. +message Fulfillment { + // Setting a parameter value. + message SetParameterAction { + // Display name of the parameter. + string parameter = 1; + + // The new value of the parameter. A null value clears the parameter. + google.protobuf.Value value = 2; + } + + // A list of cascading if-else conditions. Cases are mutually exclusive. + // The first one with a matching condition is selected, all the rest ignored. + message ConditionalCases { + // Each case has a Boolean condition. When it is evaluated to be True, the + // corresponding messages will be selected and evaluated recursively. + message Case { + // The list of messages or conditional cases to activate for this case. + message CaseContent { + // Either a message is returned or additional cases to be evaluated. + oneof cases_or_message { + // Returned message. + ResponseMessage message = 1; + + // Additional cases to be evaluated. + ConditionalCases additional_cases = 2; + } + } + + // The condition to activate and select this case. Empty means the + // condition is always true. The condition is evaluated against [form + // parameters][Form.parameters] or [session + // parameters][SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string condition = 1; + + // A list of case content. + repeated CaseContent case_content = 2; + } + + // A list of cascading if-else conditions. + repeated Case cases = 1; + } + + // Generator settings used by the LLM to generate a text response. + message GeneratorSettings { + // Required. The generator to call. + // Format: + // `projects//locations//agents//generators/`. + string generator = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Generator" + } + ]; + + // Map from [placeholder parameter][Generator.Parameter.id] in the + // [Generator][google.cloud.dialogflow.cx.v3.Generator] to corresponding + // session parameters. By default, Dialogflow uses the session parameter + // with the same name to fill in the generator template. e.g. If there is a + // placeholder parameter `city` in the Generator, Dialogflow default to fill + // in the `$city` with + // `$session.params.city`. However, you may choose to fill `$city` with + // `$session.params.desination-city`. + // - Map key: [parameter ID][Genrator.Parameter.id] + // - Map value: session parameter name + map input_parameters = 2; + + // Required. Output parameter which should contain the generator response. + string output_parameter = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // The webhook to call. + // Format: + // `projects//locations//agents//webhooks/`. + string webhook = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + }]; + + // Whether Dialogflow should return currently queued fulfillment response + // messages in streaming APIs. If a webhook is specified, it happens before + // Dialogflow invokes webhook. + // Warning: + // 1) This flag only affects streaming API. Responses are still queued + // and returned once in non-streaming API. + // 2) The flag can be enabled in any fulfillment but only the first 3 partial + // responses will be returned. You may only want to apply it to fulfillments + // that have slow webhooks. + bool return_partial_responses = 8; + + // The value of this field will be populated in the + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest] + // `fulfillmentInfo.tag` field by Dialogflow when the associated webhook is + // called. + // The tag is typically used by the webhook service to identify which + // fulfillment is being called, but it could be used for other purposes. + // This field is required if `webhook` is specified. + string tag = 3; + + // Set parameter values before executing the webhook. + repeated SetParameterAction set_parameter_actions = 4; + + // Conditional cases for this fulfillment. + repeated ConditionalCases conditional_cases = 5; + + // Hierarchical advanced settings for this fulfillment. The settings exposed + // at the lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 7; + + // If the flag is true, the agent will utilize LLM to generate a text + // response. If LLM generation fails, the defined + // [responses][google.cloud.dialogflow.cx.v3.Fulfillment.messages] in the + // fulfillment will be respected. This flag is only useful for fulfillments + // associated with no-match event handlers. + bool enable_generative_fallback = 12; + + // A list of Generators to be called during this fulfillment. + repeated GeneratorSettings generators = 13; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/gcs.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/gcs.proto new file mode 100644 index 000000000000..096e8c888c21 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/gcs.proto @@ -0,0 +1,36 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "GcsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Google Cloud Storage location for a Dialogflow operation that writes or +// exports objects (e.g. exported agent or transcripts) outside of Dialogflow. +message GcsDestination { + // Required. The Google Cloud Storage URI for the exported objects. A URI is + // of the form: `gs://bucket/object-name-or-prefix` Whether a full object + // name, or just a prefix, its usage depends on the Dialogflow operation. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generative_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generative_settings.proto new file mode 100644 index 000000000000..fa0d740193b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generative_settings.proto @@ -0,0 +1,118 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/safety_settings.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "GenerativeSettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Settings for Generative AI. +message GenerativeSettings { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/AgentGenerativeSettings" + pattern: "projects/{project}/locations/{location}/agents/{agent}/generativeSettings" + }; + + // Settings for Generative Fallback. + message FallbackSettings { + // Prompt template. + message PromptTemplate { + // Prompt name. + string display_name = 1; + + // Prompt text that is sent to a LLM on no-match default, placeholders are + // filled downstream. For example: "Here is a conversation $conversation, + // a response is: " + string prompt_text = 2; + + // If the flag is true, the prompt is frozen and cannot be modified by + // users. + bool frozen = 3; + } + + // Display name of the selected prompt. + string selected_prompt = 3; + + // Stored prompts that can be selected, for example default templates like + // "conservative" or "chatty", or user defined ones. + repeated PromptTemplate prompt_templates = 4; + } + + // Settings for knowledge connector. These parameters are used for LLM prompt + // like "You are . You are a helpful and verbose at + // , . Your task is to help humans on + // ". + message KnowledgeConnectorSettings { + // Name of the company, organization or other entity that the agent + // represents. Used for knowledge connector LLM prompt and for knowledge + // search. + string business = 1; + + // Name of the virtual agent. Used for LLM prompt. Can be left empty. + string agent = 2; + + // Identity of the agent, e.g. "virtual agent", "AI assistant". + string agent_identity = 3; + + // Company description, used for LLM prompt, e.g. "a family company selling + // freshly roasted coffee beans". + string business_description = 4; + + // Agent scope, e.g. "Example company website", "internal Example + // company website for employees", "manual of car owner". + string agent_scope = 5; + + // Whether to disable fallback to Data Store search results (in case the LLM + // couldn't pick a proper answer). Per default the feature is enabled. + bool disable_data_store_fallback = 8; + } + + // Format: + // `projects//locations//agents//generativeSettings`. + string name = 5; + + // Settings for Generative Fallback. + FallbackSettings fallback_settings = 1; + + // Settings for Generative Safety. + SafetySettings generative_safety_settings = 3; + + // Settings for knowledge connector. + KnowledgeConnectorSettings knowledge_connector_settings = 7; + + // Language for this settings. + string language_code = 4; + + // LLM model settings. + LlmModelSettings llm_model_settings = 8; +} + +// Settings for LLM models. +message LlmModelSettings { + // The selected LLM model. + string model = 1; + + // The custom prompt to use. + string prompt_text = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generator.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generator.proto new file mode 100644 index 000000000000..d491055b73e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generator.proto @@ -0,0 +1,274 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/generative_settings.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "GeneratorProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Generators][google.cloud.dialogflow.cx.v3.Generator] +service Generators { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all generators in the specified agent. + rpc ListGenerators(ListGeneratorsRequest) returns (ListGeneratorsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/generators" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified generator. + rpc GetGenerator(GetGeneratorRequest) returns (Generator) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/generators/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a generator in the specified agent. + rpc CreateGenerator(CreateGeneratorRequest) returns (Generator) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/generators" + body: "generator" + }; + option (google.api.method_signature) = "parent,generator"; + } + + // Update the specified generator. + rpc UpdateGenerator(UpdateGeneratorRequest) returns (Generator) { + option (google.api.http) = { + patch: "/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}" + body: "generator" + }; + option (google.api.method_signature) = "generator,update_mask"; + } + + // Deletes the specified generators. + rpc DeleteGenerator(DeleteGeneratorRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/generators/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Generators contain prompt to be sent to the LLM model to generate text. The +// prompt can contain parameters which will be resolved before calling the +// model. It can optionally contain banned phrases to ensure the model responses +// are safe. +message Generator { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Generator" + pattern: "projects/{project}/locations/{location}/agents/{agent}/generators/{generator}" + }; + + // Represents a custom placeholder in the prompt text. + message Placeholder { + // Unique ID used to map custom placeholder to parameters in fulfillment. + string id = 1; + + // Custom placeholder value in the prompt text. + string name = 2; + } + + // Parameters to be passed to the LLM. If not set, default values will be + // used. + message ModelParameter { + // The temperature used for sampling. Temperature sampling occurs after both + // topP and topK have been applied. + // Valid range: [0.0, 1.0] + // Low temperature = less random. High temperature = more random. + optional float temperature = 1; + + // The maximum number of tokens to generate. + optional int32 max_decode_steps = 2; + + // If set, only the tokens comprising the top top_p probability mass are + // considered. If both top_p and top_k are + // set, top_p will be used for further refining candidates selected with + // top_k. + // Valid range: (0.0, 1.0]. + // Small topP = less random. Large topP = more random. + optional float top_p = 3; + + // If set, the sampling process in each step is limited to the top_k tokens + // with highest probabilities. + // Valid range: [1, 40] or 1000+. + // Small topK = less random. Large topK = more random. + optional int32 top_k = 4; + } + + // The unique identifier of the generator. + // Must be set for the + // [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator] + // method. [Generators.CreateGenerate][] populates the name automatically. + // Format: + // `projects//locations//agents//generators/`. + string name = 1; + + // Required. The human-readable name of the generator, unique within the + // agent. The prompt contains pre-defined parameters such as $conversation, + // $last-user-utterance, etc. populated by Dialogflow. It can also contain + // custom placeholders which will be resolved during fulfillment. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Prompt for the LLM model. + Phrase prompt_text = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of custom placeholders in the prompt text. + repeated Placeholder placeholders = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // The LLM model settings. + LlmModelSettings llm_model_settings = 9; + + // Parameters passed to the LLM to configure its behavior. + ModelParameter model_parameter = 8; +} + +// Text input which can be used for prompt or banned phrases. +message Phrase { + // Required. Text input which can be used for prompt or banned phrases. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3.Generators.ListGenerators]. +message ListGeneratorsRequest { + // Required. The agent to list all generators for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Generator" + } + ]; + + // The language to list generators for. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3.Generators.ListGenerators]. +message ListGeneratorsResponse { + // The list of generators. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Generator generators = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Generators.GetGenerator][google.cloud.dialogflow.cx.v3.Generators.GetGenerator]. +message GetGeneratorRequest { + // Required. The name of the generator. + // Format: + // `projects//locations//agents//generators/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Generator" + } + ]; + + // The language to list generators for. + string language_code = 2; +} + +// The request message for +// [Generators.CreateGenerator][google.cloud.dialogflow.cx.v3.Generators.CreateGenerator]. +message CreateGeneratorRequest { + // Required. The agent to create a generator for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Generator" + } + ]; + + // Required. The generator to create. + Generator generator = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language to create generators for the following fields: + // * `Generator.prompt_text.text` + // If not specified, the agent's default language is used. + string language_code = 3; +} + +// The request message for +// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator]. +message UpdateGeneratorRequest { + // Required. The generator to update. + Generator generator = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language to list generators for. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [Generators.DeleteGenerator][google.cloud.dialogflow.cx.v3.Generators.DeleteGenerator]. +message DeleteGeneratorRequest { + // Required. The name of the generator to delete. + // Format: + // `projects//locations//agents//generators/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Generator" + } + ]; + + // This field has no effect for generators not being used. + // For generators that are used by pages/flows/transition route groups: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the generator, as well + // as any references to the generator (i.e. + // [Generator][Fulfillment.generator]) in fulfillments. + bool force = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/import_strategy.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/import_strategy.proto new file mode 100644 index 000000000000..a16daf0abc0b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/import_strategy.proto @@ -0,0 +1,51 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ImportStrategyProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Import strategies for the conflict resolution of resources (i.e. intents, +// entities, and webhooks) with identical display names during import +// operations. +enum ImportStrategy { + // Unspecified. Treated as 'CREATE_NEW'. + IMPORT_STRATEGY_UNSPECIFIED = 0; + + // Create a new resource with a numeric suffix appended to the end of the + // existing display name. + IMPORT_STRATEGY_CREATE_NEW = 1; + + // Replace existing resource with incoming resource in the content to be + // imported. + IMPORT_STRATEGY_REPLACE = 2; + + // Keep existing resource and discard incoming resource in the content to be + // imported. + IMPORT_STRATEGY_KEEP = 3; + + // Combine existing and incoming resources when a conflict is encountered. + IMPORT_STRATEGY_MERGE = 4; + + // Throw error if a conflict is encountered. + IMPORT_STRATEGY_THROW_ERROR = 5; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/inline.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/inline.proto new file mode 100644 index 000000000000..e641aeda0e6f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/inline.proto @@ -0,0 +1,42 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "InlineProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Inline destination for a Dialogflow operation that writes or exports objects +// (e.g. [intents][google.cloud.dialogflow.cx.v3.Intent]) outside of Dialogflow. +message InlineDestination { + // Output only. The uncompressed byte content for the objects. + // Only populated in responses. + bytes content = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Inline source for a Dialogflow operation that reads or imports objects +// (e.g. [intents][google.cloud.dialogflow.cx.v3.Intent]) into Dialogflow. +message InlineSource { + // The uncompressed byte content for the objects. + bytes content = 1; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/intent.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/intent.proto new file mode 100644 index 000000000000..38e3d9fb8332 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/intent.proto @@ -0,0 +1,611 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/inline.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "IntentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. +service Intents { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all intents in the specified agent. + rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/intents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified intent. + rpc GetIntent(GetIntentRequest) returns (Intent) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an intent in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateIntent(CreateIntentRequest) returns (Intent) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/intents" + body: "intent" + }; + option (google.api.method_signature) = "parent,intent"; + } + + // Updates the specified intent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateIntent(UpdateIntentRequest) returns (Intent) { + option (google.api.http) = { + patch: "/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}" + body: "intent" + }; + option (google.api.method_signature) = "intent,update_mask"; + } + + // Deletes the specified intent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Imports the specified intents into the agent. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ImportIntentsMetadata][google.cloud.dialogflow.cx.v3.ImportIntentsMetadata] + // - `response`: + // [ImportIntentsResponse][google.cloud.dialogflow.cx.v3.ImportIntentsResponse] + rpc ImportIntents(ImportIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/intents:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportIntentsResponse" + metadata_type: "ImportIntentsMetadata" + }; + } + + // Exports the selected intents. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ExportIntentsMetadata][google.cloud.dialogflow.cx.v3.ExportIntentsMetadata] + // - `response`: + // [ExportIntentsResponse][google.cloud.dialogflow.cx.v3.ExportIntentsResponse] + rpc ExportIntents(ExportIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/intents:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportIntentsResponse" + metadata_type: "ExportIntentsMetadata" + }; + } +} + +// An intent represents a user's intent to interact with a conversational agent. +// +// You can provide information for the Dialogflow API to use to match user input +// to an intent by adding training phrases (i.e., examples of user input) to +// your intent. +message Intent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Intent" + pattern: "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}" + }; + + // Represents an example that the agent is trained on to identify the intent. + message TrainingPhrase { + // Represents a part of a training phrase. + message Part { + // Required. The text for this part. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // The [parameter][google.cloud.dialogflow.cx.v3.Intent.Parameter] used to + // annotate this part of the training phrase. This field is required for + // annotated parts of the training phrase. + string parameter_id = 2; + } + + // Output only. The unique identifier of the training phrase. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The ordered list of training phrase parts. + // The parts are concatenated in order to form the training phrase. + // + // Note: The API does not automatically annotate training phrases like the + // Dialogflow Console does. + // + // Note: Do not forget to include whitespace at part boundaries, so the + // training phrase is well formatted when the parts are concatenated. + // + // If the training phrase does not need to be annotated with parameters, + // you just need a single part with only the + // [Part.text][google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.text] + // field set. + // + // If you want to annotate the training phrase, you must create multiple + // parts, where the fields of each part are populated in one of two ways: + // + // - `Part.text` is set to a part of the phrase that has no parameters. + // - `Part.text` is set to a part of the phrase that you want to annotate, + // and the `parameter_id` field is set. + repeated Part parts = 2 [(google.api.field_behavior) = REQUIRED]; + + // Indicates how many times this example was added to the intent. + int32 repeat_count = 3; + } + + // Represents an intent parameter. + message Parameter { + // Required. The unique identifier of the parameter. This field + // is used by [training + // phrases][google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase] to annotate + // their [parts][google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part]. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The entity type of the parameter. + // Format: + // `projects/-/locations/-/agents/-/entityTypes/` for + // system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` + // for developer entity types. + string entity_type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 3; + + // Indicates whether the parameter content should be redacted in log. If + // redaction is enabled, the parameter content will be replaced by parameter + // name during logging. + // Note: the parameter content is subject to redaction if either parameter + // level redaction or [entity type level + // redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is enabled. + bool redact = 4; + } + + // The unique identifier of the intent. + // Required for the + // [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent] + // method. + // [Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent] + // populates the name automatically. + // Format: + // `projects//locations//agents//intents/`. + string name = 1; + + // Required. The human-readable name of the intent, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The collection of training phrases the agent is trained on to identify the + // intent. + repeated TrainingPhrase training_phrases = 3; + + // The collection of parameters associated with the intent. + repeated Parameter parameters = 4; + + // The priority of this intent. Higher numbers represent higher + // priorities. + // + // - If the supplied value is unspecified or 0, the service + // translates the value to 500,000, which corresponds to the + // `Normal` priority in the console. + // - If the supplied value is negative, the intent is ignored + // in runtime detect intent requests. + int32 priority = 5; + + // Indicates whether this is a fallback intent. Currently only default + // fallback intent is allowed in the agent, which is added upon agent + // creation. + // Adding training phrases to fallback intent is useful in the case of + // requests that are mistakenly matched, since training phrases assigned to + // fallback intents act as negative examples that triggers no-match event. + bool is_fallback = 6; + + // The key/value metadata to label an intent. Labels can contain + // lowercase letters, digits and the symbols '-' and '_'. International + // characters are allowed, including letters from unicase alphabets. Keys must + // start with a letter. Keys and values can be no longer than 63 characters + // and no more than 128 bytes. + // + // Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed + // Dialogflow defined labels include: + // * sys-head + // * sys-contextual + // The above labels do not require value. "sys-head" means the intent is a + // head intent. "sys.contextual" means the intent is a contextual intent. + map labels = 7; + + // Human readable description for better understanding an intent like its + // scope, content, result etc. Maximum character limit: 140 characters. + string description = 8; + + // Optional. Matching DTMF pattern for the intent. + string dtmf_pattern = 16 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents]. +message ListIntentsRequest { + // Required. The agent to list all intents for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to list intents for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The resource view to apply to the returned intent. + IntentView intent_view = 5; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents]. +message ListIntentsResponse { + // The list of intents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Intent intents = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Intents.GetIntent][google.cloud.dialogflow.cx.v3.Intents.GetIntent]. +message GetIntentRequest { + // Required. The name of the intent. + // Format: + // `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to retrieve the intent for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent]. +message CreateIntentRequest { + // Required. The agent to create an intent for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The intent to create. + Intent intent = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent]. +message UpdateIntentRequest { + // Required. The intent to update. + Intent intent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3.Intents.DeleteIntent]. +message DeleteIntentRequest { + // Required. The name of the intent to delete. + // Format: + // `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the options for views of an intent. +// An intent can be a sizable object. Therefore, we provide a resource view that +// does not return training phrases in the response. +enum IntentView { + // Not specified. Treated as INTENT_VIEW_FULL. + INTENT_VIEW_UNSPECIFIED = 0; + + // Training phrases field is not populated in the response. + INTENT_VIEW_PARTIAL = 1; + + // All fields are populated. + INTENT_VIEW_FULL = 2; +} + +// The request message for +// [Intents.ImportIntents][google.cloud.dialogflow.cx.v3.Intents.ImportIntents]. +message ImportIntentsRequest { + // Merge option when display name conflicts exist during import. + enum MergeOption { + // Unspecified. Should not be used. + MERGE_OPTION_UNSPECIFIED = 0; + + // DEPRECATED: Please use + // [REPORT_CONFLICT][ImportIntentsRequest.REPORT_CONFLICT] instead. + // Fail the request if there are intents whose display names conflict with + // the display names of intents in the agent. + REJECT = 1 [deprecated = true]; + + // Replace the original intent in the agent with the new intent when display + // name conflicts exist. + REPLACE = 2; + + // Merge the original intent with the new intent when display name conflicts + // exist. + MERGE = 3; + + // Create new intents with new display names to differentiate them from the + // existing intents when display name conflicts exist. + RENAME = 4; + + // Report conflict information if display names conflict is detected. + // Otherwise, import intents. + REPORT_CONFLICT = 5; + + // Keep the original intent and discard the conflicting new intent when + // display name conflicts exist. + KEEP = 6; + } + + // Required. The agent to import the intents into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The intents to import. + oneof intents { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import intents from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string intents_uri = 2; + + // Uncompressed byte content of intents. + InlineSource intents_content = 3; + } + + // Merge option for importing intents. If not specified, `REJECT` is assumed. + MergeOption merge_option = 4; +} + +// The response message for +// [Intents.ImportIntents][google.cloud.dialogflow.cx.v3.Intents.ImportIntents]. +message ImportIntentsResponse { + // Conflicting resources detected during the import process. Only filled when + // [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] is set in the + // request and there are conflicts in the display names. + message ConflictingResources { + // Display names of conflicting intents. + repeated string intent_display_names = 1; + + // Display names of conflicting entities. + repeated string entity_display_names = 2; + } + + // The unique identifier of the imported intents. + // Format: + // `projects//locations//agents//intents/`. + repeated string intents = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Info which resources have conflicts when + // [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] merge_option is + // set in ImportIntentsRequest. + ConflictingResources conflicting_resources = 2; +} + +// Metadata returned for the +// [Intents.ImportIntents][google.cloud.dialogflow.cx.v3.Intents.ImportIntents] +// long running operation. +message ImportIntentsMetadata {} + +// The request message for +// [Intents.ExportIntents][google.cloud.dialogflow.cx.v3.Intents.ExportIntents]. +message ExportIntentsRequest { + // Data format of the exported intents. + enum DataFormat { + // Unspecified format. Treated as `BLOB`. + DATA_FORMAT_UNSPECIFIED = 0; + + // Intents will be exported as raw bytes. + BLOB = 1; + + // Intents will be exported in JSON format. + JSON = 2; + + // Intents will be exported in CSV format. + CSV = 3; + } + + // Required. The name of the parent agent to export intents. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The name of the intents to export. + // Format: + // `projects//locations//agents//intents/`. + repeated string intents = 2 [(google.api.field_behavior) = REQUIRED]; + + // The destination to export. + oneof destination { + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the + // intents to. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string intents_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The option to return the serialized intents inline. + bool intents_content_inline = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The data format of the exported intents. If not specified, `BLOB` + // is assumed. + DataFormat data_format = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Intents.ExportIntents][google.cloud.dialogflow.cx.v3.Intents.ExportIntents]. +message ExportIntentsResponse { + // The exported intents. + oneof intents { + // The URI to a file containing the exported intents. This field is + // populated only if `intents_uri` is specified in + // [ExportIntentsRequest][google.cloud.dialogflow.cx.v3.ExportIntentsRequest]. + string intents_uri = 1; + + // Uncompressed byte content for intents. This field is populated only if + // `intents_content_inline` is set to true in + // [ExportIntentsRequest][google.cloud.dialogflow.cx.v3.ExportIntentsRequest]. + InlineDestination intents_content = 2; + } +} + +// Metadata returned for the +// [Intents.ExportIntents][google.cloud.dialogflow.cx.v3.Intents.ExportIntents] +// long running operation. +message ExportIntentsMetadata {} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/page.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/page.proto new file mode 100644 index 000000000000..f97178266454 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/page.proto @@ -0,0 +1,661 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3/data_store_connection.proto"; +import "google/cloud/dialogflow/cx/v3/fulfillment.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "PageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. +service Pages { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all pages in the specified flow. + rpc ListPages(ListPagesRequest) returns (ListPagesResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified page. + rpc GetPage(GetPageRequest) returns (Page) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a page in the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreatePage(CreatePageRequest) returns (Page) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + body: "page" + }; + option (google.api.method_signature) = "parent,page"; + } + + // Updates the specified page. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdatePage(UpdatePageRequest) returns (Page) { + option (google.api.http) = { + patch: "/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}" + body: "page" + }; + option (google.api.method_signature) = "page,update_mask"; + } + + // Deletes the specified page. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc DeletePage(DeletePageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A Dialogflow CX conversation (session) can be described and visualized as a +// state machine. The states of a CX session are represented by pages. +// +// For each flow, you define many pages, where your combined pages can handle a +// complete conversation on the topics the flow is designed for. At any given +// moment, exactly one page is the current page, the current page is considered +// active, and the flow associated with that page is considered active. Every +// flow has a special start page. When a flow initially becomes active, the +// start page page becomes the current page. For each conversational turn, the +// current page will either stay the same or transition to another page. +// +// You configure each page to collect information from the end-user that is +// relevant for the conversational state represented by the page. +// +// For more information, see the +// [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). +message Page { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Page" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}" + }; + + // The unique identifier of the page. + // Required for the + // [Pages.UpdatePage][google.cloud.dialogflow.cx.v3.Pages.UpdatePage] method. + // [Pages.CreatePage][google.cloud.dialogflow.cx.v3.Pages.CreatePage] + // populates the name automatically. + // Format: + // `projects//locations//agents//flows//pages/`. + string name = 1; + + // Required. The human-readable name of the page, unique within the flow. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the page. The maximum length is 500 characters. + string description = 19; + + // The fulfillment to call when the session is entering the page. + Fulfillment entry_fulfillment = 7; + + // The form associated with the page, used for collecting parameters + // relevant to the page. + Form form = 4; + + // Ordered list of + // [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + // added to the page. Transition route groups must be unique within a page. If + // the page links both flow-level transition route groups and agent-level + // transition route groups, the flow-level ones will have higher priority and + // will be put before the agent-level ones. + // + // * If multiple transition routes within a page scope refer to the same + // intent, then the precedence order is: page's transition route -> page's + // transition route group -> flow's transition routes. + // + // * If multiple transition route groups within a page contain the same + // intent, then the first group in the ordered list takes precedence. + // + // Format:`projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/` + // for agent-level groups. + repeated string transition_route_groups = 11 + [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + }]; + + // A list of transitions for the transition rules of this page. + // They route the conversation to another page in the same flow, or another + // flow. + // + // When we are in a certain page, the TransitionRoutes are evaluated in the + // following order: + // + // * TransitionRoutes defined in the page with intent specified. + // * TransitionRoutes defined in the + // [transition route + // groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] + // with intent specified. + // * TransitionRoutes defined in flow with intent specified. + // * TransitionRoutes defined in the + // [transition route + // groups][google.cloud.dialogflow.cx.v3.Flow.transition_route_groups] + // with intent specified. + // * TransitionRoutes defined in the page with only condition specified. + // * TransitionRoutes defined in the + // [transition route + // groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] + // with only condition specified. + repeated TransitionRoute transition_routes = 9; + + // Handlers associated with the page to handle events such as webhook errors, + // no match or no input. + repeated EventHandler event_handlers = 10; + + // Hierarchical advanced settings for this page. The settings exposed at the + // lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 13; + + // Optional. Knowledge connector configuration. + KnowledgeConnectorSettings knowledge_connector_settings = 18 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A form is a data model that groups related parameters that can be collected +// from the user. The process in which the agent prompts the user and collects +// parameter values from the user is called form filling. A form can be added to +// a [page][google.cloud.dialogflow.cx.v3.Page]. When form filling is done, the +// filled parameters will be written to the +// [session][google.cloud.dialogflow.cx.v3.SessionInfo.parameters]. +message Form { + // Represents a form parameter. + message Parameter { + // Configuration for how the filling of a parameter should be handled. + message FillBehavior { + // Required. The fulfillment to provide the initial prompt that the agent + // can present to the user in order to fill the parameter. + Fulfillment initial_prompt_fulfillment = 3 + [(google.api.field_behavior) = REQUIRED]; + + // The handlers for parameter-level events, used to provide reprompt for + // the parameter or transition to a different page/flow. The supported + // events are: + // * `sys.no-match-`, where N can be from 1 to 6 + // * `sys.no-match-default` + // * `sys.no-input-`, where N can be from 1 to 6 + // * `sys.no-input-default` + // * `sys.invalid-parameter` + // + // `initial_prompt_fulfillment` provides the first prompt for the + // parameter. + // + // If the user's response does not fill the parameter, a + // no-match/no-input event will be triggered, and the fulfillment + // associated with the `sys.no-match-1`/`sys.no-input-1` handler (if + // defined) will be called to provide a prompt. The + // `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to + // the next no-match/no-input event, and so on. + // + // A `sys.no-match-default` or `sys.no-input-default` handler will be used + // to handle all following no-match/no-input events after all numbered + // no-match/no-input handlers for the parameter are consumed. + // + // A `sys.invalid-parameter` handler can be defined to handle the case + // where the parameter values have been `invalidated` by webhook. For + // example, if the user's response fill the parameter, however the + // parameter was invalidated by webhook, the fulfillment associated with + // the `sys.invalid-parameter` handler (if defined) will be called to + // provide a prompt. + // + // If the event handler for the corresponding event can't be found on the + // parameter, `initial_prompt_fulfillment` will be re-prompted. + repeated EventHandler reprompt_event_handlers = 5; + } + + // Required. The human-readable name of the parameter, unique within the + // form. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the parameter is required. Optional parameters will not + // trigger prompts; however, they are filled if the user specifies them. + // Required parameters must be filled before form filling concludes. + bool required = 2; + + // Required. The entity type of the parameter. + // Format: + // `projects/-/locations/-/agents/-/entityTypes/` for + // system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` + // for developer entity types. + string entity_type = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 4; + + // Required. Defines fill behavior for the parameter. + FillBehavior fill_behavior = 7 [(google.api.field_behavior) = REQUIRED]; + + // The default value of an optional parameter. If the parameter is required, + // the default value will be ignored. + google.protobuf.Value default_value = 9; + + // Indicates whether the parameter content should be redacted in log. If + // redaction is enabled, the parameter content will be replaced by parameter + // name during logging. + // Note: the parameter content is subject to redaction if either parameter + // level redaction or [entity type level + // redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is enabled. + bool redact = 11; + + // Hierarchical advanced settings for this parameter. The settings exposed + // at the lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 12; + } + + // Parameters to collect from the user. + repeated Parameter parameters = 1; +} + +// An event handler specifies an +// [event][google.cloud.dialogflow.cx.v3.EventHandler.event] that can be handled +// during a session. When the specified event happens, the following actions are +// taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3.EventHandler.trigger_fulfillment] +// associated with the event, it will be called. +// * If there is a +// [`target_page`][google.cloud.dialogflow.cx.v3.EventHandler.target_page] +// associated with the event, the session will transition into the specified +// page. +// * If there is a +// [`target_flow`][google.cloud.dialogflow.cx.v3.EventHandler.target_flow] +// associated with the event, the session will transition into the specified +// flow. +message EventHandler { + // Output only. The unique identifier of this event handler. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the event to handle. + string event = 4 [(google.api.field_behavior) = REQUIRED]; + + // The fulfillment to call when the event occurs. + // Handling webhook errors with a fulfillment enabled with webhook could + // cause infinite loop. It is invalid to specify such fulfillment for a + // handler handling webhooks. + Fulfillment trigger_fulfillment = 5; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this + // [TransitionRoute][google.cloud.dialogflow.cx.v3.TransitionRoute]), or + // another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 3 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + + // The target playbook to transition to. + // Format: + // `projects//locations//agents//playbooks/`. + string target_playbook = 7 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + }]; + } +} + +// A transition route specifies a [intent][google.cloud.dialogflow.cx.v3.Intent] +// that can be matched and/or a data condition that can be evaluated during a +// session. When a specified transition is matched, the following actions are +// taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3.TransitionRoute.trigger_fulfillment] +// associated with the transition, it will be called. +// * If there is a +// [`target_page`][google.cloud.dialogflow.cx.v3.TransitionRoute.target_page] +// associated with the transition, the session will transition into the +// specified page. +// * If there is a +// [`target_flow`][google.cloud.dialogflow.cx.v3.TransitionRoute.target_flow] +// associated with the transition, the session will transition into the +// specified flow. +message TransitionRoute { + // Output only. The unique identifier of this transition route. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The description of the transition route. The maximum length is + // 500 characters. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; + + // The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3.Intent]. + // Format: + // `projects//locations//agents//intents/`. + // Indicates that the transition can only happen when the given intent is + // matched. + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // The condition to evaluate against [form + // parameters][google.cloud.dialogflow.cx.v3.Form.parameters] or [session + // parameters][google.cloud.dialogflow.cx.v3.SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string condition = 2; + + // The fulfillment to call when the condition is satisfied. At least one of + // `trigger_fulfillment` and `target` must be specified. When both are + // defined, `trigger_fulfillment` is executed first. + Fulfillment trigger_fulfillment = 3; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this + // [TransitionRoute][google.cloud.dialogflow.cx.v3.TransitionRoute]), or + // another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// The request message for +// [Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages]. +message ListPagesRequest { + // Required. The flow to list all pages for. + // Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // The language to list pages for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages]. +message ListPagesResponse { + // The list of pages. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Page pages = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Pages.GetPage][google.cloud.dialogflow.cx.v3.Pages.GetPage]. +message GetPageRequest { + // Required. The name of the page. + // Format: + // `projects//locations//agents//flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // The language to retrieve the page for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [Pages.CreatePage][google.cloud.dialogflow.cx.v3.Pages.CreatePage]. +message CreatePageRequest { + // Required. The flow to create a page for. + // Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // Required. The page to create. + Page page = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Pages.UpdatePage][google.cloud.dialogflow.cx.v3.Pages.UpdatePage]. +message UpdatePageRequest { + // Required. The page to update. + Page page = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [Pages.DeletePage][google.cloud.dialogflow.cx.v3.Pages.DeletePage]. +message DeletePageRequest { + // Required. The name of the page to delete. + // Format: + // `projects//locations//agents//Flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // This field has no effect for pages with no incoming transitions. + // For pages with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the page, as well as + // any transitions to the page (i.e. [Target + // page][EventHandler.target_page] in event handlers or [Target + // page][TransitionRoute.target_page] in transition routes that point to + // this page will be cleared). + bool force = 2; +} + +// The Knowledge Connector settings for this page or flow. +// This includes information such as the attached Knowledge Bases, and the way +// to execute fulfillment. +message KnowledgeConnectorSettings { + // Whether Knowledge Connector is enabled or not. + bool enabled = 1; + + // The fulfillment to be triggered. + // + // When the answers from the Knowledge Connector are selected by Dialogflow, + // you can utitlize the request scoped parameter `$request.knowledge.answers` + // (contains up to the 5 highest confidence answers) and + // `$request.knowledge.questions` (contains the corresponding questions) to + // construct the fulfillment. + Fulfillment trigger_fulfillment = 3; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this + // [KnowledgeConnectorSettings][google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings]), + // or another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } + + // Optional. List of related data store connections. + repeated DataStoreConnection data_store_connections = 6 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto new file mode 100644 index 000000000000..62e6c6f4c78a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto @@ -0,0 +1,120 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ParameterDefinitionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Defines the properties of a parameter. +// Used to define parameters used in the agent and the +// input / output parameters for each fulfillment. +message ParameterDefinition { + // Parameter types are used for validation. + // These types are consistent with + // [google.protobuf.Value][google.protobuf.Value]. + enum ParameterType { + // Not specified. No validation will be performed. + PARAMETER_TYPE_UNSPECIFIED = 0; + + // Represents any string value. + STRING = 1; + + // Represents any number value. + NUMBER = 2; + + // Represents a boolean value. + BOOLEAN = 3; + + // Represents a null value. + NULL = 4; + + // Represents any object value. + OBJECT = 5; + + // Represents a repeated value. + LIST = 6; + } + + // Required. Name of parameter. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Type of parameter. + ParameterType type = 2 [deprecated = true]; + + // Optional. Type schema of parameter. + TypeSchema type_schema = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Human-readable description of the parameter. Limited to 300 characters. + string description = 3; +} + +// Encapsulates different type schema variations: either a reference to an +// a schema that's already defined by a tool, or an inline definition. +message TypeSchema { + // A reference to the schema of an existing tool. + message SchemaReference { + // The tool that contains this schema definition. + // Format: + // `projects//locations//agents//tools/`. + string tool = 1; + + // The name of the schema. + string schema = 2; + } + + // The encapsulated schema. + oneof schema { + // Set if this is an inline schema definition. + InlineSchema inline_schema = 1; + + // Set if this is a schema reference. + SchemaReference schema_reference = 2; + } +} + +// A type schema object that's specified inline. +message InlineSchema { + // Data type of the schema. + DataType type = 1; + + // Schema of the elements if this is an ARRAY type. + TypeSchema items = 2; +} + +// Defines data types that are supported for inlined schemas. These types are +// consistent with [google.protobuf.Value][google.protobuf.Value]. +enum DataType { + // Not specified. + DATA_TYPE_UNSPECIFIED = 0; + + // Represents any string value. + STRING = 1; + + // Represents any number value. + NUMBER = 2; + + // Represents a boolean value. + BOOLEAN = 3; + + // Represents a repeated value. + ARRAY = 6; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/playbook.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/playbook.proto new file mode 100644 index 000000000000..3c7b9ed532a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/playbook.proto @@ -0,0 +1,707 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/code_block.proto"; +import "google/cloud/dialogflow/cx/v3/example.proto"; +import "google/cloud/dialogflow/cx/v3/fulfillment.proto"; +import "google/cloud/dialogflow/cx/v3/generative_settings.proto"; +import "google/cloud/dialogflow/cx/v3/import_strategy.proto"; +import "google/cloud/dialogflow/cx/v3/parameter_definition.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "PlaybookProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Playbooks][google.cloud.dialogflow.cx.v3.Playbook]. +service Playbooks { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a playbook in a specified agent. + rpc CreatePlaybook(CreatePlaybookRequest) returns (Playbook) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/playbooks" + body: "playbook" + }; + option (google.api.method_signature) = "parent,playbook"; + } + + // Deletes a specified playbook. + rpc DeletePlaybook(DeletePlaybookRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of playbooks in the specified agent. + rpc ListPlaybooks(ListPlaybooksRequest) returns (ListPlaybooksResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/playbooks" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified Playbook. + rpc GetPlaybook(GetPlaybookRequest) returns (Playbook) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Exports the specified playbook to a binary file. + // + // Note that resources (e.g. examples, tools) that the playbook + // references will also be exported. + rpc ExportPlaybook(ExportPlaybookRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportPlaybookResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Imports the specified playbook to the specified agent from a binary file. + rpc ImportPlaybook(ImportPlaybookRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/playbooks:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportPlaybookResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Updates the specified Playbook. + rpc UpdatePlaybook(UpdatePlaybookRequest) returns (Playbook) { + option (google.api.http) = { + patch: "/v3/{playbook.name=projects/*/locations/*/agents/*/playbooks/*}" + body: "playbook" + }; + option (google.api.method_signature) = "playbook,update_mask"; + } + + // Creates a version for the specified Playbook. + rpc CreatePlaybookVersion(CreatePlaybookVersionRequest) + returns (PlaybookVersion) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions" + body: "playbook_version" + }; + option (google.api.method_signature) = "parent,playbook_version"; + } + + // Retrieves the specified version of the Playbook. + rpc GetPlaybookVersion(GetPlaybookVersionRequest) returns (PlaybookVersion) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the specified version of the Playbook and stores it as the + // current playbook draft, returning the playbook with resources updated. + rpc RestorePlaybookVersion(RestorePlaybookVersionRequest) + returns (RestorePlaybookVersionResponse) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Lists versions for the specified Playbook. + rpc ListPlaybookVersions(ListPlaybookVersionsRequest) + returns (ListPlaybookVersionsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the specified version of the Playbook. + rpc DeletePlaybookVersion(DeletePlaybookVersionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [Playbooks.CreatePlaybook][google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybook]. +message CreatePlaybookRequest { + // Required. The agent to create a playbook for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Required. The playbook to create. + Playbook playbook = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Playbooks.DeletePlaybook][google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybook]. +message DeletePlaybookRequest { + // Required. The name of the playbook to delete. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; +} + +// The request message for +// [Playbooks.ListPlaybooks][google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybooks]. +message ListPlaybooksRequest { + // Required. The agent to list playbooks from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Playbooks.ListPlaybooks][google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybooks]. +message ListPlaybooksResponse { + // The list of playbooks. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Playbook playbooks = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Playbooks.GetPlaybook][google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybook]. +message GetPlaybookRequest { + // Required. The name of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; +} + +// The request message for +// [Playbooks.UpdatePlaybook][google.cloud.dialogflow.cx.v3.Playbooks.UpdatePlaybook]. +message UpdatePlaybookRequest { + // Required. The playbook to update. + Playbook playbook = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Playbook is the basic building block to instruct the LLM how to execute a +// certain task. +// +// A playbook consists of a goal to accomplish, an optional list of step by step +// instructions (the step instruction may refers to name of the custom or +// default plugin tools to use) to perform the task, +// a list of contextual input data to be passed in at the beginning of the +// invoked, and a list of output parameters to store the playbook result. +message Playbook { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Playbook" + pattern: "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}" + }; + + // Message of single step execution. + message Step { + // Instruction on how to execute current step. + oneof instruction { + // Step instruction in text format. + string text = 1; + } + + // Sub-processing needed to execute the current step. + repeated Step steps = 2; + } + + // Message of the Instruction of the playbook. + message Instruction { + // General guidelines for the playbook. These are unstructured instructions + // that are not directly part of the goal, e.g. "Always be polite". It's + // valid for this text to be long and used instead of steps altogether. + string guidelines = 1; + + // Ordered list of step by step execution instructions to accomplish + // target goal. + repeated Step steps = 2; + } + + // Type of the playbook. + enum PlaybookType { + // Unspecified type. Default to TASK. + PLAYBOOK_TYPE_UNSPECIFIED = 0; + + // Task playbook. + TASK = 1; + + // Routine playbook. + ROUTINE = 3; + } + + // The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1; + + // Required. The human-readable name of the playbook, unique within an agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. High level description of the goal the playbook intend to + // accomplish. A goal should be concise since it's visible to other playbooks + // that may reference this playbook. + string goal = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Defined structured input parameters for this playbook. + repeated ParameterDefinition input_parameter_definitions = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defined structured output parameters for this playbook. + repeated ParameterDefinition output_parameter_definitions = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Instruction to accomplish target goal. + Instruction instruction = 17; + + // Output only. Estimated number of tokes current playbook takes when sent to + // the LLM. + int64 token_count = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of initial playbook creation. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the playbook version was updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of other playbooks referenced by the current + // playbook in the instructions. + repeated string referenced_playbooks = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The resource name of flows referenced by the current playbook + // in the instructions. + repeated string referenced_flows = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Optional. The resource name of tools referenced by the current playbook in + // the instructions. If not provided explicitly, they are will + // be implied using the tool being referenced in goal and steps. + repeated string referenced_tools = 13 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // Optional. Output only. Names of inline actions scoped to this playbook. + // These actions are in addition to those belonging to referenced tools, child + // playbooks, and flows, e.g. actions that are defined in the playbook's code + // block. + repeated string inline_actions = 22 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The playbook's scoped code block, which may implement handlers + // and actions. + CodeBlock code_block = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Llm model settings for the playbook. + LlmModelSettings llm_model_settings = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of registered handlers to execuate based on the specified + // triggers. + repeated Handler handlers = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the playbook. + PlaybookType playbook_type = 19 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Playbooks.CreatePlaybookVersion][google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookVersion]. +message CreatePlaybookVersionRequest { + // Required. The playbook to create a version for. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; + + // Required. The playbook version to create. + PlaybookVersion playbook_version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Playbook version is a snapshot of the playbook at certain timestamp. +message PlaybookVersion { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + pattern: "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}" + plural: "playbookVersions" + singular: "playbookVersion" + }; + + // The unique identifier of the playbook version. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1; + + // Optional. The description of the playbook version. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Snapshot of the playbook when the playbook version is created. + Playbook playbook = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Snapshot of the examples belonging to the playbook when the + // playbook version is created. + repeated Example examples = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the playbook version was created or modified. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for +// [Playbooks.GetPlaybookVersion][google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookVersion]. +message GetPlaybookVersionRequest { + // Required. The name of the playbook version. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; +} + +// The request message for +// [Playbooks.RestorePlaybookVersion][google.cloud.dialogflow.cx.v3.Playbooks.RestorePlaybookVersion]. +message RestorePlaybookVersionRequest { + // Required. The name of the playbook version. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; +} + +// The response message for +// [Playbooks.RestorePlaybookVersion][google.cloud.dialogflow.cx.v3.Playbooks.RestorePlaybookVersion]. +message RestorePlaybookVersionResponse { + // The updated playbook. + Playbook playbook = 2; +} + +// The request message for +// [Playbooks.ListPlaybookVersions][google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybookVersions]. +message ListPlaybookVersionsRequest { + // Required. The playbook to list versions for. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Playbooks.ListPlaybookVersions][google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybookVersions]. +message ListPlaybookVersionsResponse { + // The list of playbook version. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated PlaybookVersion playbook_versions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Playbooks.DeletePlaybookVersion][google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookVersion]. +message DeletePlaybookVersionRequest { + // Required. The name of the playbook version to delete. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; +} + +// The request message for +// [Playbooks.ExportPlaybook][google.cloud.dialogflow.cx.v3.Playbooks.ExportPlaybook]. +message ExportPlaybookRequest { + // Data format of the exported playbook. + enum DataFormat { + // Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0; + + // Flow content will be exported as raw bytes. + BLOB = 1; + + // Flow content will be exported in JSON format. + JSON = 2; + } + + // Required. The name of the playbook to export. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the playbook + // to. The format of this URI must be `gs:///`. If + // left unspecified, the serialized playbook is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string playbook_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data format of the exported agent. If not specified, `BLOB` + // is assumed. + DataFormat data_format = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Playbooks.ImportPlaybook][google.cloud.dialogflow.cx.v3.Playbooks.ImportPlaybook]. +message ImportPlaybookRequest { + // Required. The agent to import the playbook into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Required. The playbook to import. + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import playbook from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + oneof playbook { + // [Dialogflow access + // control] + // (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string playbook_uri = 2; + + // Uncompressed raw byte content for playbook. + bytes playbook_content = 3; + } + + // Optional. Specifies the import strategy used when resolving resource + // conflicts. + PlaybookImportStrategy import_strategy = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The playbook import strategy used for resource conflict resolution associated +// with an +// [ImportPlaybookRequest][google.cloud.dialogflow.cx.v3.ImportPlaybookRequest]. +message PlaybookImportStrategy { + // Optional. Specifies the import strategy used when resolving conflicts with + // the main playbook. If not specified, 'CREATE_NEW' is assumed. + ImportStrategy main_playbook_import_strategy = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the import strategy used when resolving referenced + // playbook/flow conflicts. If not specified, 'CREATE_NEW' is assumed. + ImportStrategy nested_resource_import_strategy = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the import strategy used when resolving tool conflicts. + // If not specified, 'CREATE_NEW' is assumed. This will be applied after the + // main playbook and nested resource import strategies, meaning if the + // playbook that references the tool is skipped, the tool will also be + // skipped. + ImportStrategy tool_import_strategy = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Playbooks.ImportPlaybook][google.cloud.dialogflow.cx.v3.Playbooks.ImportPlaybook]. +message ImportPlaybookResponse { + // Conflicting resources detected during the import process. Only filled when + // [REPORT_CONFLICTS][ImportPlaybookResponse.REPORT_CONFLICTS] is set in the + // request and there are conflicts in the display names. + message ConflictingResources { + // Display name of conflicting main playbook. + string main_playbook_display_name = 1; + + // Display names of conflicting nested playbooks. + repeated string nested_playbook_display_names = 2; + + // Display names of conflicting tools. + repeated string tool_display_names = 3; + } + + // The unique identifier of the new playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + }]; + + // Info which resources have conflicts when + // [REPORT_CONFLICTS][ImportPlaybookResponse.REPORT_CONFLICTS] import strategy + // is set for all resources in ImportPlaybookRequest. + ConflictingResources conflicting_resources = 2; +} + +// The response message for +// [Playbooks.ExportPlaybook][google.cloud.dialogflow.cx.v3.Playbooks.ExportPlaybook]. +message ExportPlaybookResponse { + // The exported playbook. + oneof playbook { + // The URI to a file containing the exported playbook. This field is + // populated only if `playbook_uri` is specified in + // [ExportPlaybookRequest][google.cloud.dialogflow.cx.v3.ExportPlaybookRequest]. + string playbook_uri = 1; + + // Uncompressed raw byte content for playbook. + bytes playbook_content = 2; + } +} + +// Handler can be used to define custom logic to be executed based on the +// user-specified triggers. +message Handler { + // A handler that is triggered by the specified + // [event][google.cloud.dialogflow.cx.v3.Handler.EventHandler.event]. + message EventHandler { + // Required. The name of the event that triggers this handler. + string event = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The condition that must be satisfied to trigger this handler. + string condition = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The fulfillment to call when the event occurs. + Fulfillment fulfillment = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A handler that is triggered on the specific + // [lifecycle_stage][google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.lifecycle_stage] + // of the playbook execution. + message LifecycleHandler { + // Required. The name of the lifecycle stage that triggers this handler. + // Supported values: + // * `playbook-start` + // * `pre-action-selection` + // * `pre-action-execution` + string lifecycle_stage = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The condition that must be satisfied to trigger this handler. + string condition = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The fulfillment to call when this handler is triggered. + Fulfillment fulfillment = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies the type of handler to invoke. + oneof handler { + // A handler triggered by event. + EventHandler event_handler = 1; + + // A handler triggered during specific lifecycle of the playbook execution. + LifecycleHandler lifecycle_handler = 3; + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/response_message.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/response_message.proto new file mode 100644 index 000000000000..776be9f43a09 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/response_message.proto @@ -0,0 +1,274 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; +import "google/cloud/dialogflow/cx/v3/tool_call.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ResponseMessageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Represents a response message that can be returned by a conversational agent. +// +// Response messages are also used for output audio synthesis. The approach is +// as follows: +// +// * If at least one OutputAudioText response is present, then all +// OutputAudioText responses are linearly concatenated, and the result is used +// for output audio synthesis. +// * If the OutputAudioText responses are a mixture of text and SSML, then the +// concatenated result is treated as SSML; otherwise, the result is treated as +// either text or SSML as appropriate. The agent designer should ideally use +// either text or SSML consistently throughout the bot design. +// * Otherwise, all Text responses are linearly concatenated, and the result is +// used for output audio synthesis. +// +// This approach allows for more sophisticated user experience scenarios, where +// the text displayed to the user may differ from what is heard. +message ResponseMessage { + // The text response message. + message Text { + // Required. A collection of text response variants. If multiple variants + // are defined, only one text response variant is returned at runtime. + repeated string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Whether the playback of this message can be interrupted by + // the end user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Indicates that the conversation should be handed off to a live agent. + // + // Dialogflow only uses this to determine which conversations were handed off + // to a human agent for measurement purposes. What else to do with this signal + // is up to you and your handoff procedures. + // + // You may set this, for example: + // * In the + // [entry_fulfillment][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment] + // of a [Page][google.cloud.dialogflow.cx.v3.Page] if + // entering the page indicates something went extremely wrong in the + // conversation. + // * In a webhook response when you determine that the customer issue can only + // be handled by a human. + message LiveAgentHandoff { + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that the conversation succeeded, i.e., the bot handled the issue + // that the customer talked to it about. + // + // Dialogflow only uses this to determine which conversations should be + // counted as successful and doesn't process the metadata in this message in + // any way. Note that Dialogflow also considers conversations that get to the + // conversation end page as successful even if they don't return + // [ConversationSuccess][google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess]. + // + // You may set this, for example: + // * In the + // [entry_fulfillment][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment] + // of a [Page][google.cloud.dialogflow.cx.v3.Page] if + // entering the page indicates that the conversation succeeded. + // * In a webhook response when you determine that you handled the customer + // issue. + message ConversationSuccess { + // Custom metadata. Dialogflow doesn't impose any structure on this. + google.protobuf.Struct metadata = 1; + } + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + message OutputAudioText { + // The source, which is either plain text or SSML. + oneof source { + // The raw text to be synthesized. + string text = 1; + + // The SSML text to be synthesized. For more information, see + // [SSML](/speech/text-to-speech/docs/ssml). + string ssml = 2; + } + + // Output only. Whether the playback of this message can be interrupted by + // the end user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Indicates that interaction with the Dialogflow agent has ended. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message EndInteraction {} + + // Specifies an audio clip to be played by the client as part of the response. + message PlayAudio { + // Required. URI of the audio clip. Dialogflow does not impose any + // validation on this value. It is specific to the client that reads it. + string audio_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Whether the playback of this message can be interrupted by + // the end user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Represents an audio message that is composed of both segments + // synthesized from the Dialogflow agent prompts and ones hosted externally + // at the specified URIs. + // The external URIs are specified via + // [play_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message MixedAudio { + // Represents one segment of audio. + message Segment { + // Content of the segment. + oneof content { + // Raw audio synthesized from the Dialogflow agent's response using + // the output config specified in the request. + bytes audio = 1; + + // Client-specific URI that points to an audio clip accessible to the + // client. Dialogflow does not impose any validation on it. + string uri = 2; + } + + // Output only. Whether the playback of this segment can be interrupted by + // the end user's speech and the client should then start the next + // Dialogflow request. + bool allow_playback_interruption = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Segments this audio response is composed of. + repeated Segment segments = 1; + } + + // Represents the signal that telles the client to transfer the phone call + // connected to the agent to a third-party endpoint. + message TelephonyTransferCall { + // Endpoint to transfer the call to. + oneof endpoint { + // Transfer the call to a phone number + // in [E.164 format](https://en.wikipedia.org/wiki/E.164). + string phone_number = 1; + } + } + + // Represents info card response. If the response contains generative + // knowledge prediction, Dialogflow will return a payload with Infobot + // Messenger compatible info card. + // + // Otherwise, the info card response is skipped. + message KnowledgeInfoCard {} + + // Represents different response types. + enum ResponseType { + // Not specified. + RESPONSE_TYPE_UNSPECIFIED = 0; + + // The response is from an [entry + // prompt][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment] in the + // page. + ENTRY_PROMPT = 1; + + // The response is from [form-filling + // prompt][google.cloud.dialogflow.cx.v3.Form.Parameter.fill_behavior] in + // the page. + PARAMETER_PROMPT = 2; + + // The response is from a [transition + // route][google.cloud.dialogflow.cx.v3.TransitionRoute] or an [event + // handler][EventHandler] in the page or flow or transition route group. + HANDLER_PROMPT = 3; + } + + // Required. The rich response message. + oneof message { + // Returns a text response. + Text text = 1; + + // Returns a response containing a custom, platform-specific payload. + google.protobuf.Struct payload = 2; + + // Indicates that the conversation succeeded. + ConversationSuccess conversation_success = 9; + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + OutputAudioText output_audio_text = 8; + + // Hands off conversation to a human agent. + LiveAgentHandoff live_agent_handoff = 10; + + // Output only. A signal that indicates the interaction with the Dialogflow + // agent has ended. This message is generated by Dialogflow only when the + // conversation reaches `END_SESSION` page. It is not supposed to be defined + // by the user. + // + // It's guaranteed that there is at most one such message in each response. + EndInteraction end_interaction = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Signal that the client should play an audio clip hosted at a + // client-specific URI. Dialogflow uses this to construct + // [mixed_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.mixed_audio]. + // However, Dialogflow itself does not try to read or process the URI in any + // way. + PlayAudio play_audio = 12; + + // Output only. An audio response message composed of both the synthesized + // Dialogflow agent responses and responses defined via + // [play_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + MixedAudio mixed_audio = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A signal that the client should transfer the phone call connected to + // this agent to a third-party endpoint. + TelephonyTransferCall telephony_transfer_call = 18; + + // Represents info card for knowledge answers, to be better rendered in + // Dialogflow Messenger. + KnowledgeInfoCard knowledge_info_card = 20; + + // Returns the definition of a tool call that should be executed by the + // client. + ToolCall tool_call = 22; + } + + // Response type. + ResponseType response_type = 4; + + // The channel which the response is associated with. Clients can specify the + // channel via + // [QueryParameters.channel][google.cloud.dialogflow.cx.v3.QueryParameters.channel], + // and only associated channel response will be returned. + string channel = 19; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/safety_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/safety_settings.proto new file mode 100644 index 000000000000..34ca5de09908 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/safety_settings.proto @@ -0,0 +1,133 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SafetySettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Settings for Generative Safety. +message SafetySettings { + // Text input which can be used for prompt or banned phrases. + message Phrase { + // Required. Text input which can be used for prompt or banned phrases. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Language code of the phrase. + string language_code = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Strategy for matching phrases. + enum PhraseMatchStrategy { + // Unspecified, defaults to PARTIAL_MATCH. + PHRASE_MATCH_STRATEGY_UNSPECIFIED = 0; + + // Text that contains the phrase as a substring will be matched, e.g. "foo" + // will match "afoobar". + PARTIAL_MATCH = 1; + + // Text that contains the tokenized words of the phrase will be matched, + // e.g. "foo" will match "a foo bar" and "foo bar", but not "foobar". + WORD_MATCH = 2; + } + + // Settings for Responsible AI. + message RaiSettings { + // Sensitivity level for RAI categories. + enum SafetyFilterLevel { + // Unspecified -- uses default sensitivity levels. + SAFETY_FILTER_LEVEL_UNSPECIFIED = 0; + + // Block no text -- effectively disables the category. + BLOCK_NONE = 1; + + // Block a few suspicious texts. + BLOCK_FEW = 2; + + // Block some suspicious texts. + BLOCK_SOME = 3; + + // Block most suspicious texts. + BLOCK_MOST = 4; + } + + // RAI categories to configure. + enum SafetyCategory { + // Unspecified. + SAFETY_CATEGORY_UNSPECIFIED = 0; + + // Dangerous content. + DANGEROUS_CONTENT = 1; + + // Hate speech. + HATE_SPEECH = 2; + + // Harassment. + HARASSMENT = 3; + + // Sexually explicit content. + SEXUALLY_EXPLICIT_CONTENT = 4; + } + + // Configuration of the sensitivity level for blocking an RAI category. + message CategoryFilter { + // RAI category to configure. + SafetyCategory category = 1; + + // Blocking sensitivity level to configure for the RAI category. + SafetyFilterLevel filter_level = 2; + } + + // Optional. RAI blocking configurations. + repeated CategoryFilter category_filters = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for prompt security checks. + message PromptSecuritySettings { + // Optional. Enable prompt security checks. + bool enable_prompt_security = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Default phrase match strategy for banned phrases. + PhraseMatchStrategy default_banned_phrase_match_strategy = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Banned phrases for generated text. + repeated Phrase banned_phrases = 1; + + // Optional. Settings for Responsible AI checks. + RaiSettings rai_settings = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Default RAI settings to be annotated on the agent, so + // that users will be able to restore their RAI configurations to the default + // settings. Read-only field for the API proto only. + RaiSettings default_rai_settings = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Settings for prompt security checks. + PromptSecuritySettings prompt_security_settings = 8 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/security_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/security_settings.proto new file mode 100644 index 000000000000..f322265e6378 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/security_settings.proto @@ -0,0 +1,406 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SecuritySettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/InspectTemplate" + pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" + pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" +}; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" + pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" +}; + +// Service for managing security settings for Dialogflow. +service SecuritySettingsService { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Create security settings in the specified location. + rpc CreateSecuritySettings(CreateSecuritySettingsRequest) + returns (SecuritySettings) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}/securitySettings" + body: "security_settings" + }; + option (google.api.method_signature) = "parent,security_settings"; + } + + // Retrieves the specified + // [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The + // returned settings may be stale by up to 1 minute. + rpc GetSecuritySettings(GetSecuritySettingsRequest) + returns (SecuritySettings) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/securitySettings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified + // [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. + rpc UpdateSecuritySettings(UpdateSecuritySettingsRequest) + returns (SecuritySettings) { + option (google.api.http) = { + patch: "/v3/{security_settings.name=projects/*/locations/*/securitySettings/*}" + body: "security_settings" + }; + option (google.api.method_signature) = "security_settings,update_mask"; + } + + // Returns the list of all security settings in the specified location. + rpc ListSecuritySettings(ListSecuritySettingsRequest) + returns (ListSecuritySettingsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*}/securitySettings" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the specified + // [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. + rpc DeleteSecuritySettings(DeleteSecuritySettingsRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/securitySettings/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [SecuritySettingsService.GetSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettings]. +message GetSecuritySettingsRequest { + // Required. Resource name of the settings. + // Format: + // `projects//locations//securitySettings/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; +} + +// The request message for +// [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings]. +message UpdateSecuritySettingsRequest { + // Required. [SecuritySettings] object that contains values for each of the + // fields to update. + SecuritySettings security_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SecuritySettings.ListSecuritySettings][]. +message ListSecuritySettingsRequest { + // Required. The location to list all security settings for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [SecuritySettings.ListSecuritySettings][]. +message ListSecuritySettingsResponse { + // The list of security settings. + repeated SecuritySettings security_settings = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [SecuritySettings.CreateSecuritySettings][]. +message CreateSecuritySettingsRequest { + // Required. The location to create an + // [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; + + // Required. The security settings to create. + SecuritySettings security_settings = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SecuritySettings.DeleteSecuritySettings][]. +message DeleteSecuritySettingsRequest { + // Required. The name of the + // [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] to + // delete. Format: + // `projects//locations//securitySettings/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; +} + +// Represents the settings related to security issues, such as data redaction +// and data retention. It may take hours for updates on the settings to +// propagate to all the related components and take effect. +message SecuritySettings { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/SecuritySettings" + pattern: "projects/{project}/locations/{location}/securitySettings/{security_settings}" + }; + + // Defines how we redact data. + enum RedactionStrategy { + // Do not redact. + REDACTION_STRATEGY_UNSPECIFIED = 0; + + // Call redaction service to clean up the data to be persisted. + REDACT_WITH_SERVICE = 1; + } + + // Defines what types of data to redact. + enum RedactionScope { + // Don't redact any kind of data. + REDACTION_SCOPE_UNSPECIFIED = 0; + + // On data to be written to disk or similar devices that are capable of + // holding data even if power is disconnected. This includes data that are + // temporarily saved on disk. + REDACT_DISK_STORAGE = 2; + } + + // Defines how long we retain persisted data that contains sensitive info. + enum RetentionStrategy { + // Retains the persisted data with Dialogflow's internal default 365d TTLs. + RETENTION_STRATEGY_UNSPECIFIED = 0; + + // Removes data when the conversation ends. If there is no [Conversation][] + // explicitly established, a default conversation ends when the + // corresponding Dialogflow session ends. + REMOVE_AFTER_CONVERSATION = 1; + } + + // Type of data we purge after retention settings triggers purge. + enum PurgeDataType { + // Unspecified. Do not use. + PURGE_DATA_TYPE_UNSPECIFIED = 0; + + // Dialogflow history. This does not include Cloud logging, which is + // owned by the user - not Dialogflow. + DIALOGFLOW_HISTORY = 1; + } + + // Settings for exporting audio. + message AudioExportSettings { + // File format for exported audio file. Currently only in telephony + // recordings. + enum AudioFormat { + // Unspecified. Do not use. + AUDIO_FORMAT_UNSPECIFIED = 0; + + // G.711 mu-law PCM with 8kHz sample rate. + MULAW = 1; + + // MP3 file format. + MP3 = 2; + + // OGG Vorbis. + OGG = 3; + } + + // Cloud Storage bucket to export audio record to. + // Setting this field would grant the Storage Object Creator role to + // the Dialogflow Service Agent. + // API caller that tries to modify this field should have the permission of + // storage.buckets.setIamPolicy. + string gcs_bucket = 1; + + // Filename pattern for exported audio. + // {conversation} and {timestamp} are placeholders that will be replaced + // with the conversation ID and epoch micros of the conversation. + // For example, "{conversation}/recording_{timestamp}.mulaw". + string audio_export_pattern = 2; + + // Enable audio redaction if it is true. + // Note that this only redacts end-user audio data; + // Synthesised audio from the virtual agent is not redacted. + bool enable_audio_redaction = 3; + + // File format for exported audio file. Currently only in telephony + // recordings. + AudioFormat audio_format = 4; + + // Whether to store TTS audio. By default, TTS audio from the virtual agent + // is not exported. + bool store_tts_audio = 6; + } + + // Settings for exporting conversations to + // [Insights](https://cloud.google.com/contact-center/insights/docs). + message InsightsExportSettings { + // If enabled, we will automatically exports + // conversations to Insights and Insights runs its analyzers. + bool enable_insights_export = 1; + } + + // Resource name of the settings. + // Required for the + // [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings] + // method. + // [SecuritySettingsService.CreateSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.CreateSecuritySettings] + // populates the name automatically. Format: + // `projects//locations//securitySettings/`. + string name = 1; + + // Required. The human-readable name of the security settings, unique within + // the location. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Strategy that defines how we do redaction. + RedactionStrategy redaction_strategy = 3; + + // Defines the data for which Dialogflow applies redaction. Dialogflow does + // not redact data that it does not have access to – for example, Cloud + // logging. + RedactionScope redaction_scope = 4; + + // [DLP](https://cloud.google.com/dlp/docs) inspect template name. Use this + // template to define inspect base settings. + // + // The `DLP Inspect Templates Reader` role is needed on the Dialogflow + // service identity service account (has the form + // `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) + // for your agent's project. + // + // If empty, we use the default DLP inspect config. + // + // The template name will have one of the following formats: + // `projects//locations//inspectTemplates/` + // OR + // `organizations//locations//inspectTemplates/` + // + // Note: `inspect_template` must be located in the same region as the + // `SecuritySettings`. + string inspect_template = 9 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/InspectTemplate" + }]; + + // [DLP](https://cloud.google.com/dlp/docs) deidentify template name. Use this + // template to define de-identification configuration for the content. + // + // The `DLP De-identify Templates Reader` role is needed on the Dialogflow + // service identity service account (has the form + // `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) + // for your agent's project. + // + // If empty, Dialogflow replaces sensitive info with `[redacted]` text. + // + // The template name will have one of the following formats: + // `projects//locations//deidentifyTemplates/` + // OR + // `organizations//locations//deidentifyTemplates/` + // + // Note: `deidentify_template` must be located in the same region as the + // `SecuritySettings`. + string deidentify_template = 17 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + }]; + + // Specifies how data is retained. Note that even if the data is + // purged due to retention policy, we may still hold it in backup storage for + // a few days without allowing direct readings. + oneof data_retention { + // Retains the data for the specified number of days. + // User must set a value lower than Dialogflow's default 365d TTL (30 days + // for Agent Assist traffic), higher value will be ignored and use default. + // Setting a value higher than that has no effect. A missing value or + // setting to 0 also means we use default TTL. + // When data retention configuration is changed, it only applies to the data + // created after the change; the TTL of existing data created before the + // change stays intact. + int32 retention_window_days = 6; + + // Specifies the retention behavior defined by + // [SecuritySettings.RetentionStrategy][google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy]. + RetentionStrategy retention_strategy = 7; + } + + // List of types of data to remove when retention settings triggers purge. + repeated PurgeDataType purge_data_types = 8; + + // Controls audio export settings for post-conversation analytics when + // ingesting audio to conversations via [Participants.AnalyzeContent][] or + // [Participants.StreamingAnalyzeContent][]. + // + // If + // [retention_strategy][google.cloud.dialogflow.cx.v3.SecuritySettings.retention_strategy] + // is set to REMOVE_AFTER_CONVERSATION or [audio_export_settings.gcs_bucket][] + // is empty, audio export is disabled. + // + // If audio export is enabled, audio is recorded and saved to + // [audio_export_settings.gcs_bucket][], subject to retention policy of + // [audio_export_settings.gcs_bucket][]. + // + // This setting won't effect audio input for implicit sessions via + // [Sessions.DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] + // or + // [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent]. + AudioExportSettings audio_export_settings = 12; + + // Controls conversation exporting settings to Insights after conversation is + // completed. + // + // If + // [retention_strategy][google.cloud.dialogflow.cx.v3.SecuritySettings.retention_strategy] + // is set to REMOVE_AFTER_CONVERSATION, Insights export is disabled no matter + // what you configure here. + InsightsExportSettings insights_export_settings = 13; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto new file mode 100644 index 000000000000..498d06d63a2c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto @@ -0,0 +1,1420 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3/audio_config.proto"; +import "google/cloud/dialogflow/cx/v3/data_store_connection.proto"; +import "google/cloud/dialogflow/cx/v3/flow.proto"; +import "google/cloud/dialogflow/cx/v3/generative_settings.proto"; +import "google/cloud/dialogflow/cx/v3/intent.proto"; +import "google/cloud/dialogflow/cx/v3/page.proto"; +import "google/cloud/dialogflow/cx/v3/response_message.proto"; +import "google/cloud/dialogflow/cx/v3/session_entity_type.proto"; +import "google/cloud/dialogflow/cx/v3/tool_call.proto"; +import "google/cloud/dialogflow/cx/v3/trace.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/rpc/status.proto"; +import "google/type/latlng.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; +option (google.api.resource_definition) = { + type: "dialogflow.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/DataStore" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}" +}; + +// A session represents an interaction with a user. You retrieve user input +// and pass it to the +// [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to +// determine user intent and respond. +service Sessions { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Processes a natural language query and returns structured, actionable data + // as a result. This method is not idempotent, because it may cause session + // entity types to be updated, which in turn might affect results of future + // queries. + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { + option (google.api.http) = { + post: "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent" + body: "*" + additional_bindings { + post: "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent" + body: "*" + } + }; + } + + // Processes a natural language query and returns structured, actionable data + // as a result through server-side streaming. Server-side streaming allows + // Dialogflow to send [partial + // responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) + // earlier in a single request. + rpc ServerStreamingDetectIntent(DetectIntentRequest) + returns (stream DetectIntentResponse) { + option (google.api.http) = { + post: "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent" + body: "*" + additional_bindings { + post: "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent" + body: "*" + } + }; + } + + // Processes a natural language query in audio format in a streaming fashion + // and returns structured, actionable data as a result. This method is only + // available via the gRPC API (not REST). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) + returns (stream StreamingDetectIntentResponse) {} + + // Returns preliminary intent match results, doesn't change the session + // status. + rpc MatchIntent(MatchIntentRequest) returns (MatchIntentResponse) { + option (google.api.http) = { + post: "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent" + body: "*" + additional_bindings { + post: "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent" + body: "*" + } + }; + } + + // Fulfills a matched intent returned by + // [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be + // called after + // [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with + // input from + // [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. + // Otherwise, the behavior is undefined. + rpc FulfillIntent(FulfillIntentRequest) returns (FulfillIntentResponse) { + option (google.api.http) = { + post: "/v3/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent" + body: "*" + additional_bindings { + post: "/v3/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent" + body: "*" + } + }; + } + + // Updates the feedback received from the user for a single turn of the bot + // response. + rpc SubmitAnswerFeedback(SubmitAnswerFeedbackRequest) + returns (AnswerFeedback) { + option (google.api.http) = { + post: "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback" + body: "*" + }; + } +} + +// Stores information about feedback provided by users about a response. +message AnswerFeedback { + // Represents thumbs up/down rating provided by user about a response. + enum Rating { + // Rating not specified. + RATING_UNSPECIFIED = 0; + + // Thumbs up feedback from user. + THUMBS_UP = 1; + + // Thumbs down feedback from user. + THUMBS_DOWN = 2; + } + + // Stores extra information about why users provided thumbs down rating. + message RatingReason { + // Optional. Custom reason labels for thumbs down rating provided by the + // user. The maximum number of labels allowed is 10 and the maximum length + // of a single label is 128 characters. + repeated string reason_labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional feedback about the rating. + // This field can be populated without choosing a predefined `reason`. + string feedback = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Rating from user for the specific Dialogflow response. + Rating rating = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. In case of thumbs down rating provided, users can optionally + // provide context about the rating. + RatingReason rating_reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom rating from the user about the provided answer, with + // maximum length of 1024 characters. For example, client could use a + // customized JSON object to indicate the rating. + string custom_rating = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request to set the feedback for a bot answer. +message SubmitAnswerFeedbackRequest { + // Required. The name of the session the feedback was sent to. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // Required. ID of the response to update its feedback. This is the same as + // DetectIntentResponse.response_id. + string response_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Feedback provided for a bot answer. + AnswerFeedback answer_feedback = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which fields to update. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The request to detect user's intent. +message DetectIntentRequest { + // Required. The name of the session this query is sent to. + // Format: + // `projects//locations//agents//sessions/` or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + // + // For more information, see the [sessions + // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; + + // Optional. Specifies which fields in the + // [QueryResult][google.cloud.dialogflow.cx.v3.QueryResult] to return. If not + // set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + DetectIntentResponseView response_view = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The message returned from the DetectIntent method. +message DetectIntentResponse { + // Represents different DetectIntentResponse types. + enum ResponseType { + // Not specified. This should never happen. + RESPONSE_TYPE_UNSPECIFIED = 0; + + // Partial response. e.g. Aggregated responses in a Fulfillment that enables + // `return_partial_response` can be returned as partial response. + // WARNING: partial response is not eligible for barge-in. + PARTIAL = 1; + + // Final response. + FINAL = 2; + } + + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages] + // field. If multiple default text responses exist, they will be concatenated + // when generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 4; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 5; + + // Response type. + ResponseType response_type = 6; + + // Indicates whether the partial response can be cancelled when a later + // response arrives. e.g. if the agent specified some music as partial + // response, it can be cancelled. + bool allow_cancellation = 7; +} + +// The top-level message sent by the client to the +// [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent] +// method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain +// [session][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.session], +// [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] +// plus optionally +// [query_params][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_params]. +// If the client wants to receive an audio response, it should also contain +// [output_audio_config][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.output_audio_config]. +// +// 2. If +// [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] +// was set to +// [query_input.audio.config][google.cloud.dialogflow.cx.v3.AudioInput.config], +// all subsequent messages must contain +// [query_input.audio.audio][google.cloud.dialogflow.cx.v3.AudioInput.audio] +// to continue with Speech recognition. If you decide to rather detect an +// intent from text input after you already started Speech recognition, +// please send a message with +// [query_input.text][google.cloud.dialogflow.cx.v3.QueryInput.text]. +// +// However, note that: +// +// * Dialogflow will bill you for the audio duration so far. +// * Dialogflow discards all Speech recognition results in favor of the +// input text. +// * Dialogflow will use the language code from the first message. +// +// After you sent all input, you must half-close or abort the request stream. +message StreamingDetectIntentRequest { + // The name of the session this query is sent to. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + // Note: session must be set in the first request. + // + // For more information, see the [sessions + // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; + + // Enable partial detect intent response. If this flag is not enabled, + // response stream still contains only one final `DetectIntentResponse` even + // if some `Fulfillment`s in the agent have been configured to return partial + // responses. + bool enable_partial_response = 5; + + // If true, `StreamingDetectIntentResponse.debugging_info` will get populated. + bool enable_debugging_info = 8; + + // Optional. Specifies which fields in the + // [QueryResult][google.cloud.dialogflow.cx.v3.QueryResult] to return. If not + // set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + DetectIntentResponseView response_view = 16 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Cloud conversation info for easier debugging. +// It will get populated in `StreamingDetectIntentResponse` or +// `StreamingAnalyzeContentResponse` when the flag `enable_debugging_info` is +// set to true in corresponding requests. +message CloudConversationDebuggingInfo { + // Number of input audio data chunks in streaming requests. + int32 audio_data_chunks = 1; + + // Time offset of the end of speech utterance relative to the + // beginning of the first audio chunk. + google.protobuf.Duration result_end_time_offset = 2; + + // Duration of first audio chunk. + google.protobuf.Duration first_audio_duration = 3; + + // Whether client used single utterance mode. + bool single_utterance = 5; + + // Time offsets of the speech partial results relative to the beginning of + // the stream. + repeated google.protobuf.Duration speech_partial_results_end_times = 6; + + // Time offsets of the speech final results (is_final=true) relative to the + // beginning of the stream. + repeated google.protobuf.Duration speech_final_results_end_times = 7; + + // Total number of partial responses. + int32 partial_responses = 8; + + // Time offset of Speaker ID stream close time relative to the Speech stream + // close time in milliseconds. Only meaningful for conversations involving + // passive verification. + int32 speaker_id_passive_latency_ms_offset = 9; + + // Whether a barge-in event is triggered in this request. + bool bargein_event_triggered = 10; + + // Whether speech uses single utterance mode. + bool speech_single_utterance = 11; + + // Time offsets of the DTMF partial results relative to the beginning of + // the stream. + repeated google.protobuf.Duration dtmf_partial_results_times = 12; + + // Time offsets of the DTMF final results relative to the beginning of + // the stream. + repeated google.protobuf.Duration dtmf_final_results_times = 13; + + // Time offset of the end-of-single-utterance signal relative to the + // beginning of the stream. + google.protobuf.Duration single_utterance_end_time_offset = 14; + + // No speech timeout settings for the stream. + google.protobuf.Duration no_speech_timeout = 15; + + // Speech endpointing timeout settings for the stream. + google.protobuf.Duration endpointing_timeout = 19; + + // Whether the streaming terminates with an injected text query. + bool is_input_text = 16; + + // Client half close time in terms of input audio duration. + google.protobuf.Duration client_half_close_time_offset = 17; + + // Client half close time in terms of API streaming duration. + google.protobuf.Duration client_half_close_streaming_time_offset = 18; +} + +// The top-level message returned from the +// [StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent] +// method. +// +// Multiple response messages can be returned in order: +// +// * If the `StreamingDetectIntentRequest.query_input.audio` field was +// set, the first M messages contain `recognition_result`. +// Each `recognition_result` represents a more complete transcript of what +// the user said. The last `recognition_result` has `is_final` set to +// `true`. +// +// * If the `StreamingDetectIntentRequest.enable_partial_response` field was +// true, the `detect_intent_response` field is populated for each +// of the following N responses, where 0 <= N <= 5. +// These responses set the +// [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] +// field to `PARTIAL`. +// +// For the last response message, the `detect_intent_response` is fully +// populated, and +// [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] +// is set to `FINAL`. +message StreamingDetectIntentResponse { + // The output response. + oneof response { + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 1; + + // The response from detect intent. + DetectIntentResponse detect_intent_response = 2; + } + + // Debugging info that would get populated when + // `StreamingDetectIntentRequest.enable_debugging_info` is set to true. + CloudConversationDebuggingInfo debugging_info = 4; +} + +// Contains a speech recognition result corresponding to a portion of the audio +// that is currently being processed or an indication that this is the end +// of the single requested utterance. +// +// While end-user audio is being processed, Dialogflow sends a series of +// results. Each result may contain a `transcript` value. A transcript +// represents a portion of the utterance. While the recognizer is processing +// audio, transcript values may be interim values or finalized values. +// Once a transcript is finalized, the `is_final` value is set to true and +// processing continues for the next transcript. +// +// If `StreamingDetectIntentRequest.query_input.audio.config.single_utterance` +// was true, and the recognizer has completed processing audio, +// the `message_type` value is set to `END_OF_SINGLE_UTTERANCE and the +// following (last) result contains the last finalized transcript. +// +// The complete end-user utterance is determined by concatenating the +// finalized transcript values received for the series of results. +// +// In the following example, single utterance is enabled. In the case where +// single utterance is not enabled, result 7 would not occur. +// +// ``` +// Num | transcript | message_type | is_final +// --- | ----------------------- | ----------------------- | -------- +// 1 | "tube" | TRANSCRIPT | false +// 2 | "to be a" | TRANSCRIPT | false +// 3 | "to be" | TRANSCRIPT | false +// 4 | "to be or not to be" | TRANSCRIPT | true +// 5 | "that's" | TRANSCRIPT | false +// 6 | "that is | TRANSCRIPT | false +// 7 | unset | END_OF_SINGLE_UTTERANCE | unset +// 8 | " that is the question" | TRANSCRIPT | true +// ``` +// +// Concatenating the finalized transcripts with `is_final` set to true, +// the complete utterance becomes "to be or not to be that is the question". +message StreamingRecognitionResult { + // Type of the response message. + enum MessageType { + // Not specified. Should never be used. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // Message contains a (possibly partial) transcript. + TRANSCRIPT = 1; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This message is only sent if + // [`single_utterance`][google.cloud.dialogflow.cx.v3.InputAudioConfig.single_utterance] + // was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 2; + } + + // Type of the result message. + MessageType message_type = 1; + + // Transcript text representing the words that the user spoke. + // Populated if and only if `message_type` = `TRANSCRIPT`. + string transcript = 2; + + // If `false`, the `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, the recognizer will not return + // any further hypotheses about this piece of the audio. May only be populated + // for `message_type` = `TRANSCRIPT`. + bool is_final = 3; + + // The Speech confidence between 0.0 and 1.0 for the current portion of audio. + // A higher number indicates an estimated greater likelihood that the + // recognized words are correct. The default of 0.0 is a sentinel value + // indicating that confidence was not set. + // + // This field is typically only provided if `is_final` is true and you should + // not rely on it being accurate or even set. + float confidence = 4; + + // An estimate of the likelihood that the speech recognizer will + // not change its guess about this interim recognition result: + // * If the value is unspecified or 0.0, Dialogflow didn't compute the + // stability. In particular, Dialogflow will only provide stability for + // `TRANSCRIPT` results with `is_final = false`. + // * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely + // unstable and 1.0 means completely stable. + float stability = 6; + + // Word-specific information for the words recognized by Speech in + // [transcript][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.transcript]. + // Populated if and only if `message_type` = `TRANSCRIPT` and + // [InputAudioConfig.enable_word_info] is set. + repeated SpeechWordInfo speech_word_info = 7; + + // Time offset of the end of this Speech recognition result relative to the + // beginning of the audio. Only populated for `message_type` = + // `TRANSCRIPT`. + google.protobuf.Duration speech_end_offset = 8; + + // Detected language code for the transcript. + string language_code = 10; +} + +// Represents the parameters of a conversational query. +message QueryParameters { + // The time zone of this conversational query from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. If not provided, the time zone specified in the agent is + // used. + string time_zone = 1; + + // The geo location of this conversational query. + google.type.LatLng geo_location = 2; + + // Additional session entity types to replace or extend developer entity types + // with. The entity synonyms apply to all languages and persist for the + // session of this query. + repeated SessionEntityType session_entity_types = 3; + + // This field can be used to pass custom data into the webhook associated with + // the agent. Arbitrary JSON objects are supported. + // Some integrations that query a Dialogflow agent may provide additional + // information in the payload. + // In particular, for the Dialogflow Phone Gateway integration, this field has + // the form: + // ``` + // { + // "telephony": { + // "caller_id": "+18558363987" + // } + // } + // ``` + google.protobuf.Struct payload = 4; + + // Additional parameters to be put into [session + // parameters][SessionInfo.parameters]. To remove a + // parameter from the session, clients should explicitly set the parameter + // value to null. + // + // You can reference the session parameters in the agent with the following + // format: $session.params.parameter-id. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // * MapKey type: string + // * MapKey value: parameter name + // * MapValue type: If parameter's entity type is a composite entity then use + // map, otherwise, depending on the parameter value type, it could be one of + // string, number, boolean, null, list or map. + // * MapValue value: If parameter's entity type is a composite entity then use + // map from composite entity property names to property values, otherwise, + // use parameter value. + google.protobuf.Struct parameters = 5; + + // Scope for the parameters. If not specified, parameters will be treated as + // session parameters. Parameters with custom scope will not be put into + // [session parameters][google.cloud.dialogflow.cx.v3.SessionInfo.parameters]. + // + // You can reference the parameters with custom scope in the agent with the + // following format: $parameter-scope.params.parameter-id. + string parameter_scope = 12; + + // The unique identifier of the [page][google.cloud.dialogflow.cx.v3.Page] to + // override the [current page][QueryResult.current_page] in the session. + // Format: + // `projects//locations//agents//flows//pages/`. + // + // If `current_page` is specified, the previous state of the session will be + // ignored by Dialogflow, including the [previous + // page][QueryResult.current_page] and the [previous session + // parameters][QueryResult.parameters]. + // In most cases, + // [current_page][google.cloud.dialogflow.cx.v3.QueryParameters.current_page] + // and [parameters][google.cloud.dialogflow.cx.v3.QueryParameters.parameters] + // should be configured together to direct a session to a specific state. + string current_page = 6 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // Whether to disable webhook calls for this request. + bool disable_webhook = 7; + + // Configures whether sentiment analysis should be performed. If not + // provided, sentiment analysis is not performed. + bool analyze_query_text_sentiment = 8; + + // This field can be used to pass HTTP headers for a webhook + // call. These headers will be sent to webhook along with the headers that + // have been configured through Dialogflow web console. The headers defined + // within this field will overwrite the headers configured through Dialogflow + // console if there is a conflict. Header names are case-insensitive. + // Google's specified headers are not allowed. Including: "Host", + // "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding", + // "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc. + map webhook_headers = 10; + + // A list of flow versions to override for the request. + // Format: + // `projects//locations//agents//flows//versions/`. + // + // If version 1 of flow X is included in this list, the traffic of + // flow X will go through version 1 regardless of the version configuration in + // the environment. Each flow can have at most one version specified in this + // list. + repeated string flow_versions = 14 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; + + // Optional. The unique identifier of the + // [playbook][google.cloud.dialogflow.cx.v3.Playbook] to start or continue the + // session with. If `current_playbook` is specified, the previous state of the + // session will be ignored by Dialogflow. + // + // Format: + // `projects//locations//agents//playbooks/`. + string current_playbook = 19 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Optional. Use the specified LLM model settings for processing the request. + LlmModelSettings llm_model_settings = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // The channel which this query is for. + // + // If specified, only the + // [ResponseMessage][google.cloud.dialogflow.cx.v3.ResponseMessage] associated + // with the channel will be returned. If no + // [ResponseMessage][google.cloud.dialogflow.cx.v3.ResponseMessage] is + // associated with the channel, it falls back to the + // [ResponseMessage][google.cloud.dialogflow.cx.v3.ResponseMessage] with + // unspecified channel. + // + // If unspecified, the + // [ResponseMessage][google.cloud.dialogflow.cx.v3.ResponseMessage] with + // unspecified channel will be returned. + string channel = 15; + + // Optional. Configure lifetime of the Dialogflow session. + // By default, a Dialogflow session remains active and its data is stored for + // 30 minutes after the last request is sent for the session. + // This value should be no longer than 1 day. + google.protobuf.Duration session_ttl = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information about the end-user to improve the relevance and + // accuracy of generative answers. + // + // This will be interpreted and used by a language model, so, for good + // results, the data should be self-descriptive, and in a simple structure. + // + // Example: + // + // ```json + // { + // "subscription plan": "Business Premium Plus", + // "devices owned": [ + // {"model": "Google Pixel 7"}, + // {"model": "Google Pixel Tablet"} + // ] + // } + // ``` + google.protobuf.Struct end_user_metadata = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Search configuration for UCS search queries. + SearchConfig search_config = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true and data stores are involved in serving the + // request then + // DetectIntentResponse.query_result.data_store_connection_signals + // will be filled with data that can help evaluations. + bool populate_data_store_connection_signals = 25 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Search configuration for UCS search queries. +message SearchConfig { + // Optional. Boosting configuration for the datastores. + // + // Maps from datastore name to their boost configuration. Do not specify more + // than one BoostSpecs for each datastore name. If multiple BoostSpecs are + // provided for the same datastore name, the behavior is undefined. + repeated BoostSpecs boost_specs = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter configuration for the datastores. + // + // Maps from datastore name to the filter expression for that datastore. Do + // not specify more than one FilterSpecs for each datastore name. If multiple + // FilterSpecs are provided for the same datastore name, the behavior is + // undefined. + repeated FilterSpecs filter_specs = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Boost specification to boost certain documents. +// A copy of google.cloud.discoveryengine.v1main.BoostSpec, field documentation +// is available at +// https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec +message BoostSpec { + // Boost applies to documents which match a condition. + message ConditionBoostSpec { + // Specification for custom ranking based on customer specified attribute + // value. It provides more controls for customized ranking than the simple + // (condition, boost) combination above. + message BoostControlSpec { + // The attribute(or function) for which the custom ranking is to be + // applied. + enum AttributeType { + // Unspecified AttributeType. + ATTRIBUTE_TYPE_UNSPECIFIED = 0; + + // The value of the numerical field will be used to dynamically update + // the boost amount. In this case, the attribute_value (the x value) + // of the control point will be the actual value of the numerical + // field for which the boost_amount is specified. + NUMERICAL = 1; + + // For the freshness use case the attribute value will be the duration + // between the current time and the date in the datetime field + // specified. The value must be formatted as an XSD `dayTimeDuration` + // value (a restricted subset of an ISO 8601 duration value). The + // pattern for this is: `[nD][T[nH][nM][nS]]`. + // E.g. `5D`, `3DT12H30M`, `T24H`. + FRESHNESS = 2; + } + + // The interpolation type to be applied. Default will be linear + // (Piecewise Linear). + enum InterpolationType { + // Interpolation type is unspecified. In this case, it defaults to + // Linear. + INTERPOLATION_TYPE_UNSPECIFIED = 0; + + // Piecewise linear interpolation will be applied. + LINEAR = 1; + } + + // The control points used to define the curve. The curve defined + // through these control points can only be monotonically increasing + // or decreasing(constant values are acceptable). + message ControlPoint { + // Optional. Can be one of: + // 1. The numerical field value. + // 2. The duration spec for freshness: + // The value must be formatted as an XSD `dayTimeDuration` value (a + // restricted subset of an ISO 8601 duration value). The pattern for + // this is: `[nD][T[nH][nM][nS]]`. + string attribute_value = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value between -1 to 1 by which to boost the score if + // the attribute_value evaluates to the value specified above. + float boost_amount = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The name of the field whose value will be used to determine + // the boost amount. + string field_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The attribute type to be used to determine the boost amount. + // The attribute value can be derived from the field value of the + // specified field_name. In the case of numerical it is straightforward + // i.e. attribute_value = numerical_field_value. In the case of freshness + // however, attribute_value = (time.now() - datetime_field_value). + AttributeType attribute_type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The interpolation type to be applied to connect the control + // points listed below. + InterpolationType interpolation_type = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The control points used to define the curve. The monotonic + // function (defined through the interpolation_type above) passes through + // the control points listed here. + repeated ControlPoint control_points = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. An expression which specifies a boost condition. The syntax and + // supported fields are the same as a filter expression. + // Examples: + // + // * To boost documents with document ID "doc_1" or "doc_2", and + // color + // "Red" or "Blue": + // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + string condition = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Strength of the condition boost, which should be in [-1, 1]. + // Negative boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the document a big promotion. However, it does not + // necessarily mean that the boosted document will be the top result at + // all times, nor that other documents will be excluded. Results could + // still be shown even when none of them matches the condition. And + // results that are significantly more relevant to the search query can + // still trump your heavily favored but irrelevant documents. + // + // Setting to -1.0 gives the document a big demotion. However, results + // that are deeply relevant might still be shown. The document will have + // an upstream battle to get a fairly high ranking, but it is not blocked + // out completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Complex specification for custom ranking based on customer + // defined attribute value. + BoostControlSpec boost_control_spec = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Condition boost specifications. If a document matches multiple + // conditions in the specifications, boost scores from these specifications + // are all applied and combined in a non-linear way. Maximum number of + // specifications is 20. + repeated ConditionBoostSpec condition_boost_specs = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Boost specifications for data stores. +message BoostSpecs { + // Optional. Data Stores where the boosting configuration is applied. The full + // names of the referenced data stores. Formats: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + // `projects/{project}/locations/{location}/dataStores/{data_store}` + repeated string data_stores = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Optional. A list of boosting specifications. + repeated BoostSpec spec = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Filter specifications for data stores. +message FilterSpecs { + // Optional. Data Stores where the boosting configuration is applied. The full + // names of the referenced data stores. Formats: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + // `projects/{project}/locations/{location}/dataStores/{data_store}` + repeated string data_stores = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Optional. The filter expression to be applied. + // Expression syntax is documented at + // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the query input. It can contain one of: +// +// 1. A conversational query in the form of text. +// +// 2. An intent query that specifies which intent to trigger. +// +// 3. Natural language speech audio to be processed. +// +// 4. An event to be triggered. +// +// 5. DTMF digits to invoke an intent and fill in parameter value. +// +// 6. The results of a tool executed by the client. +message QueryInput { + // Required. The input specification. + oneof input { + // The natural language text to be processed. + TextInput text = 2; + + // The intent to be triggered. + IntentInput intent = 3; + + // The natural language speech audio to be processed. + AudioInput audio = 5; + + // The event to be triggered. + EventInput event = 6; + + // The DTMF event to be handled. + DtmfInput dtmf = 7; + + // The results of a tool executed by the client. + ToolCallResult tool_call_result = 11; + } + + // Required. The language of the input. See [Language + // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // for a list of the currently supported language codes. Note that queries in + // the same session do not necessarily need to specify the same language. + string language_code = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the result of a conversational query. +message QueryResult { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3.TextInput] was + // provided as input, this field will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3.IntentInput] was provided as + // input, this field will contain a copy of the intent identifier. Format: + // `projects//locations//agents//intents/`. + string trigger_intent = 11 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // If [natural language speech + // audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, + // this field will contain the transcript for the audio. + string transcript = 12; + + // If an [event][google.cloud.dialogflow.cx.v3.EventInput] was provided as + // input, this field will contain the name of the event. + string trigger_event = 14; + + // If a [DTMF][google.cloud.dialogflow.cx.v3.DtmfInput] was provided as + // input, this field will contain a copy of the + // [DtmfInput][google.cloud.dialogflow.cx.v3.DtmfInput]. + DtmfInput dtmf = 23; + } + + // The language that was triggered during intent detection. + // See [Language + // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // for a list of the currently supported language codes. + string language_code = 2; + + // The collected [session + // parameters][google.cloud.dialogflow.cx.v3.SessionInfo.parameters]. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // * MapKey type: string + // * MapKey value: parameter name + // * MapValue type: If parameter's entity type is a composite entity then use + // map, otherwise, depending on the parameter value type, it could be one of + // string, number, boolean, null, list or map. + // * MapValue value: If parameter's entity type is a composite entity then use + // map from composite entity property names to property values, otherwise, + // use parameter value. + google.protobuf.Struct parameters = 3; + + // The list of rich messages returned to the client. Responses vary from + // simple text messages to more sophisticated, structured payloads used + // to drive complex logic. + repeated ResponseMessage response_messages = 4; + + // The list of webhook call status in the order of call sequence. + repeated google.rpc.Status webhook_statuses = 13; + + // The list of webhook payload in + // [WebhookResponse.payload][google.cloud.dialogflow.cx.v3.WebhookResponse.payload], + // in the order of call sequence. If some webhook call fails or doesn't return + // any payload, an empty `Struct` would be used instead. + repeated google.protobuf.Struct webhook_payloads = 6; + + // The current [Page][google.cloud.dialogflow.cx.v3.Page]. Some, not all + // fields are filled in this message, including but not limited to `name` and + // `display_name`. + Page current_page = 7; + + // The current [Flow][google.cloud.dialogflow.cx.v3.Flow]. Some, not all + // fields are filled in this message, including but not limited to `name` and + // `display_name`. + Flow current_flow = 31; + + // The [Intent][google.cloud.dialogflow.cx.v3.Intent] that matched the + // conversational query. Some, not all fields are filled in this message, + // including but not limited to: `name` and `display_name`. This field is + // deprecated, please use + // [QueryResult.match][google.cloud.dialogflow.cx.v3.QueryResult.match] + // instead. + Intent intent = 8 [deprecated = true]; + + // The intent detection confidence. Values range from 0.0 (completely + // uncertain) to 1.0 (completely certain). + // This value is for informational purpose only and is only used to + // help match the best intent within the classification threshold. + // This value may change for the same end-user expression at any time due to a + // model retraining or change in implementation. + // This field is deprecated, please use + // [QueryResult.match][google.cloud.dialogflow.cx.v3.QueryResult.match] + // instead. + float intent_detection_confidence = 9 [deprecated = true]; + + // Intent match result, could be an intent or an event. + Match match = 15; + + // The free-form diagnostic info. For example, this field could contain + // webhook call latency. The fields of this data can change without notice, + // so you should not write code that depends on its structure. + // + // One of the fields is called "Alternative Matched Intents", which may + // aid with debugging. The following describes these intent results: + // + // - The list is empty if no intent was matched to end-user input. + // - Only intents that are referenced in the currently active flow are + // included. + // - The matched intent is included. + // - Other intents that could have matched end-user input, but did not match + // because they are referenced by intent routes that are out of + // [scope](https://cloud.google.com/dialogflow/cx/docs/concept/handler#scope), + // are included. + // - Other intents referenced by intent routes in scope that matched end-user + // input, but had a lower confidence score. + google.protobuf.Struct diagnostic_info = 10; + + // The sentiment analyss result, which depends on + // [`analyze_query_text_sentiment`] + // [google.cloud.dialogflow.cx.v3.QueryParameters.analyze_query_text_sentiment], + // specified in the request. + SentimentAnalysisResult sentiment_analysis_result = 17; + + // Returns the current advanced settings including IVR settings. Even though + // the operations configured by these settings are performed by Dialogflow, + // the client may need to perform special logic at the moment. For example, if + // Dialogflow exports audio to Google Cloud Storage, then the client may need + // to wait for the resulting object to appear in the bucket before proceeding. + AdvancedSettings advanced_settings = 21; + + // Indicates whether the Thumbs up/Thumbs down rating controls are need to be + // shown for the response in the Dialogflow Messenger widget. + bool allow_answer_feedback = 32; + + // Optional. Data store connection feature output signals. + // Filled only when data stores are involved in serving the query. + DataStoreConnectionSignals data_store_connection_signals = 35 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contains the sequence of trace blocks from the current + // conversation turn. Trace blocks are ordered chronologically and contain + // detailed traces of runtime behavior such as tool calls, LLM calls, flow and + // playbook invocations, agent utterances and user utterances. + repeated TraceBlock trace_blocks = 37 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the natural language text to be processed. +message TextInput { + // Required. The UTF-8 encoded natural language text to be processed. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the intent to trigger programmatically rather than as a result of +// natural language processing. +message IntentInput { + // Required. The unique identifier of the intent. + // Format: + // `projects//locations//agents//intents/`. + string intent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the natural speech audio to be processed. +message AudioInput { + // Required. Instructs the speech recognizer how to process the speech audio. + InputAudioConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The natural language speech audio to be processed. + // A single request can contain up to 2 minutes of speech audio data. + // The [transcribed + // text][google.cloud.dialogflow.cx.v3.QueryResult.transcript] cannot contain + // more than 256 bytes. + // + // For non-streaming audio detect intent, both `config` and `audio` must be + // provided. + // For streaming audio detect intent, `config` must be provided in + // the first request and `audio` must be provided in all following requests. + bytes audio = 2; +} + +// Represents the event to trigger. +message EventInput { + // Name of the event. + string event = 1; +} + +// Represents the input for dtmf event. +message DtmfInput { + // The dtmf digits. + string digits = 1; + + // The finish digit (if any). + string finish_digit = 2; +} + +// Represents one match result of [MatchIntent][]. +message Match { + // Type of a Match. + enum MatchType { + // Not specified. Should never be used. + MATCH_TYPE_UNSPECIFIED = 0; + + // The query was matched to an intent. + INTENT = 1; + + // The query directly triggered an intent. + DIRECT_INTENT = 2; + + // The query was used for parameter filling. + PARAMETER_FILLING = 3; + + // No match was found for the query. + NO_MATCH = 4; + + // Indicates an empty query. + NO_INPUT = 5; + + // The query directly triggered an event. + EVENT = 6; + + // The query was matched to a Knowledge Connector answer. + KNOWLEDGE_CONNECTOR = 8; + + // The query was handled by a + // [`Playbook`][google.cloud.dialogflow.cx.v3.Playbook]. + PLAYBOOK = 9; + } + + // The [Intent][google.cloud.dialogflow.cx.v3.Intent] that matched the query. + // Some, not all fields are filled in this message, including but not limited + // to: `name` and `display_name`. Only filled for + // [`INTENT`][google.cloud.dialogflow.cx.v3.Match.MatchType] match type. + Intent intent = 1; + + // The event that matched the query. Filled for + // [`EVENT`][google.cloud.dialogflow.cx.v3.Match.MatchType], + // [`NO_MATCH`][google.cloud.dialogflow.cx.v3.Match.MatchType] and + // [`NO_INPUT`][google.cloud.dialogflow.cx.v3.Match.MatchType] match types. + string event = 6; + + // The collection of parameters extracted from the query. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // * MapKey type: string + // * MapKey value: parameter name + // * MapValue type: If parameter's entity type is a composite entity then use + // map, otherwise, depending on the parameter value type, it could be one of + // string, number, boolean, null, list or map. + // * MapValue value: If parameter's entity type is a composite entity then use + // map from composite entity property names to property values, otherwise, + // use parameter value. + google.protobuf.Struct parameters = 2; + + // Final text input which was matched during MatchIntent. This value can be + // different from original input sent in request because of spelling + // correction or other processing. + string resolved_input = 3; + + // Type of this [Match][google.cloud.dialogflow.cx.v3.Match]. + MatchType match_type = 4; + + // The confidence of this match. Values range from 0.0 (completely uncertain) + // to 1.0 (completely certain). + // This value is for informational purpose only and is only used to help match + // the best intent within the classification threshold. This value may change + // for the same end-user expression at any time due to a model retraining or + // change in implementation. + float confidence = 5; +} + +// Request of [MatchIntent][]. +message MatchIntentRequest { + // Required. The name of the session this query is sent to. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + // + // For more information, see the [sessions + // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Persist session parameter changes from `query_params`. + bool persist_parameter_changes = 5; +} + +// Response of [MatchIntent][]. +message MatchIntentResponse { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3.TextInput] was + // provided as input, this field will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3.IntentInput] was provided as + // input, this field will contain a copy of the intent identifier. Format: + // `projects//locations//agents//intents/`. + string trigger_intent = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // If [natural language speech + // audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, + // this field will contain the transcript for the audio. + string transcript = 3; + + // If an [event][google.cloud.dialogflow.cx.v3.EventInput] was provided as + // input, this field will contain a copy of the event name. + string trigger_event = 6; + } + + // Match results, if more than one, ordered descendingly by the confidence + // we have that the particular intent matches the query. + repeated Match matches = 4; + + // The current [Page][google.cloud.dialogflow.cx.v3.Page]. Some, not all + // fields are filled in this message, including but not limited to `name` and + // `display_name`. + Page current_page = 5; +} + +// Request of [FulfillIntent][] +message FulfillIntentRequest { + // Must be same as the corresponding MatchIntent request, otherwise the + // behavior is undefined. + MatchIntentRequest match_intent_request = 1; + + // The matched intent/event to fulfill. + Match match = 2; + + // Instructs the speech synthesizer how to generate output audio. + OutputAudioConfig output_audio_config = 3; +} + +// Response of [FulfillIntent][] +message FulfillIntentResponse { + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages] + // field. If multiple default text responses exist, they will be concatenated + // when generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 3; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} + +// The result of sentiment analysis. Sentiment analysis inspects user input +// and identifies the prevailing subjective opinion, especially to determine a +// user's attitude as positive, negative, or neutral. +message SentimentAnalysisResult { + // Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + // sentiment). + float score = 1; + + // A non-negative number in the [0, +inf) range, which represents the absolute + // magnitude of sentiment, regardless of score (positive or negative). + float magnitude = 2; +} + +// The response view specifies which fields in the +// [QueryResult][google.cloud.dialogflow.cx.v3.QueryResult] to return. +enum DetectIntentResponseView { + // Not specified. `DETECT_INTENT_RESPONSE_VIEW_DEFAULT` will be used. + DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED = 0; + + // Full response view includes all fields. + DETECT_INTENT_RESPONSE_VIEW_FULL = 1; + + // Basic response view omits the following fields: + // - + // [QueryResult.diagnostic_info][google.cloud.dialogflow.cx.v3.QueryResult.diagnostic_info] + // - [QueryResult.generative_info][] + // - + // [QueryResult.trace_blocks][google.cloud.dialogflow.cx.v3.QueryResult.trace_blocks] + // - + // [QueryResult.data_store_connection_signals][google.cloud.dialogflow.cx.v3.QueryResult.data_store_connection_signals] + DETECT_INTENT_RESPONSE_VIEW_BASIC = 2; + + // Default response view omits the following fields: + // - + // [QueryResult.trace_blocks][google.cloud.dialogflow.cx.v3.QueryResult.trace_blocks] + DETECT_INTENT_RESPONSE_VIEW_DEFAULT = 3; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto new file mode 100644 index 000000000000..1dd4b057f690 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto @@ -0,0 +1,280 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/entity_type.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionEntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing +// [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. +service SessionEntityTypes { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all session entity types in the specified session. + rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) + returns (ListSessionEntityTypesResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + additional_bindings { + get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified session entity type. + rpc GetSessionEntityType(GetSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + additional_bindings { + get: "/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a session entity type. + rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + body: "session_entity_type" + additional_bindings { + post: "/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes" + body: "session_entity_type" + } + }; + option (google.api.method_signature) = "parent,session_entity_type"; + } + + // Updates the specified session entity type. + rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + patch: "/v3/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + body: "session_entity_type" + additional_bindings { + patch: "/v3/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + body: "session_entity_type" + } + }; + option (google.api.method_signature) = "session_entity_type,update_mask"; + } + + // Deletes the specified session entity type. + rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + additional_bindings { + delete: "/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Session entity types are referred to as **User** entity types and are +// entities that are built for an individual user such as favorites, +// preferences, playlists, and so on. +// +// You can redefine a session entity type at the session level to extend or +// replace a [custom entity type][google.cloud.dialogflow.cx.v3.EntityType] at +// the user session level (we refer to the entity types defined at the agent +// level as "custom entity types"). +// +// Note: session entity types apply to all queries, regardless of the language. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message SessionEntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/SessionEntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}" + }; + + // The types of modifications for the session entity type. + enum EntityOverrideMode { + // Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + + // The collection of session entities overrides the collection of entities + // in the corresponding custom entity type. + ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + + // The collection of session entities extends the collection of entities in + // the corresponding custom entity type. + // + // Note: Even in this override mode calls to `ListSessionEntityTypes`, + // `GetSessionEntityType`, `CreateSessionEntityType` and + // `UpdateSessionEntityType` only return the additional entities added in + // this session entity type. If you want to get the supplemented list, + // please call + // [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType] + // on the custom entity type and merge. + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + } + + // Required. The unique identifier of the session entity type. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates whether the additional data should override or + // supplement the custom entity type definition. + EntityOverrideMode entity_override_mode = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The collection of entities to override or supplement the custom + // entity type. + repeated EntityType.Entity entities = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesRequest { + // Required. The session to list all session entity types from. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesResponse { + // The list of session entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated SessionEntityType session_entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityType]. +message GetSessionEntityTypeRequest { + // Required. The name of the session entity type. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} + +// The request message for +// [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityType]. +message CreateSessionEntityTypeRequest { + // Required. The session to create a session entity type for. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // Required. The session entity type to create. + SessionEntityType session_entity_type = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityType]. +message UpdateSessionEntityTypeRequest { + // Required. The session entity type to update. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, + // we assume default 'draft' environment. + SessionEntityType session_entity_type = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityType]. +message DeleteSessionEntityTypeRequest { + // Required. The name of the session entity type to delete. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, + // we assume default 'draft' environment. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/test_case.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/test_case.proto new file mode 100644 index 000000000000..e445e090a734 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/test_case.proto @@ -0,0 +1,999 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/flow.proto"; +import "google/cloud/dialogflow/cx/v3/intent.proto"; +import "google/cloud/dialogflow/cx/v3/page.proto"; +import "google/cloud/dialogflow/cx/v3/response_message.proto"; +import "google/cloud/dialogflow/cx/v3/session.proto"; +import "google/cloud/dialogflow/cx/v3/transition_route_group.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "TestCaseProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Test Cases][google.cloud.dialogflow.cx.v3.TestCase] and +// [Test Case Results][google.cloud.dialogflow.cx.v3.TestCaseResult]. +service TestCases { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Fetches a list of test cases for a given agent. + rpc ListTestCases(ListTestCasesRequest) returns (ListTestCasesResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/testCases" + }; + option (google.api.method_signature) = "parent"; + } + + // Batch deletes test cases. + rpc BatchDeleteTestCases(BatchDeleteTestCasesRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a test case. + rpc GetTestCase(GetTestCaseRequest) returns (TestCase) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/testCases/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a test case for the given agent. + rpc CreateTestCase(CreateTestCaseRequest) returns (TestCase) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases" + body: "test_case" + }; + option (google.api.method_signature) = "parent,test_case"; + } + + // Updates the specified test case. + rpc UpdateTestCase(UpdateTestCaseRequest) returns (TestCase) { + option (google.api.http) = { + patch: "/v3/{test_case.name=projects/*/locations/*/agents/*/testCases/*}" + body: "test_case" + }; + option (google.api.method_signature) = "test_case,update_mask"; + } + + // Kicks off a test case run. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3.RunTestCaseMetadata] + // - `response`: + // [RunTestCaseResponse][google.cloud.dialogflow.cx.v3.RunTestCaseResponse] + rpc RunTestCase(RunTestCaseRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/testCases/*}:run" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RunTestCaseResponse" + metadata_type: "RunTestCaseMetadata" + }; + } + + // Kicks off a batch run of test cases. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata] + // - `response`: + // [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse] + rpc BatchRunTestCases(BatchRunTestCasesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchRun" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchRunTestCasesResponse" + metadata_type: "BatchRunTestCasesMetadata" + }; + } + + // Calculates the test coverage for an agent. + rpc CalculateCoverage(CalculateCoverageRequest) + returns (CalculateCoverageResponse) { + option (google.api.http) = { + get: "/v3/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage" + }; + } + + // Imports the test cases from a Cloud Storage bucket or a local file. It + // always creates new test cases and won't overwrite any existing ones. The + // provided ID in the imported test case is neglected. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata] + // - `response`: + // [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3.ImportTestCasesResponse] + rpc ImportTestCases(ImportTestCasesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportTestCasesResponse" + metadata_type: "ImportTestCasesMetadata" + }; + } + + // Exports the test cases under the agent to a Cloud Storage bucket or a local + // file. Filter can be applied to export a subset of test cases. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata] + // - `response`: + // [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3.ExportTestCasesResponse] + rpc ExportTestCases(ExportTestCasesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportTestCasesResponse" + metadata_type: "ExportTestCasesMetadata" + }; + } + + // Fetches the list of run results for the given test case. A maximum of 100 + // results are kept for each test case. + rpc ListTestCaseResults(ListTestCaseResultsRequest) + returns (ListTestCaseResultsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/testCases/*}/results" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a test case result. + rpc GetTestCaseResult(GetTestCaseResultRequest) returns (TestCaseResult) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/testCases/*/results/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents a test case. +message TestCase { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TestCase" + pattern: "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}" + }; + + // The unique identifier of the test case. + // [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase] + // will populate the name automatically. Otherwise use format: + // `projects//locations//agents//testCases/`. + string name = 1; + + // Tags are short descriptions that users may apply to test cases for + // organizational and filtering purposes. Each tag should start with "#" and + // has a limit of 30 characters. + repeated string tags = 2; + + // Required. The human-readable name of the test case, unique within the + // agent. Limit of 200 characters. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Additional freeform notes about the test case. Limit of 400 characters. + string notes = 4; + + // Config for the test case. + TestConfig test_config = 13; + + // The conversation turns uttered when the test case was created, in + // chronological order. These include the canonical set of agent utterances + // that should occur when the agent is working properly. + repeated ConversationTurn test_case_conversation_turns = 5; + + // Output only. When the test was created. + google.protobuf.Timestamp creation_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest test result. + TestCaseResult last_test_result = 12; +} + +// Represents a result from running a test case in an agent environment. +message TestCaseResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TestCaseResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}" + }; + + // The resource name for the test case result. Format: + // `projects//locations//agents//testCases//results/`. + string name = 1; + + // Environment where the test was run. If not set, it indicates the draft + // environment. + string environment = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + }]; + + // The conversation turns uttered during the test case replay in chronological + // order. + repeated ConversationTurn conversation_turns = 3; + + // Whether the test case passed in the agent environment. + TestResult test_result = 4; + + // The time that the test was run. + google.protobuf.Timestamp test_time = 5; +} + +// Represents configurations for a test case. +message TestConfig { + // Session parameters to be compared when calculating differences. + repeated string tracking_parameters = 1; + + // Flow name to start the test case with. + // Format: + // `projects//locations//agents//flows/`. + // + // Only one of `flow` and `page` should be set to indicate the starting point + // of the test case. If neither is set, the test case will start with start + // page on the default start flow. + string flow = 2 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // The [page][google.cloud.dialogflow.cx.v3.Page] to start the test case with. + // Format: + // `projects//locations//agents//flows//pages/`. + // + // Only one of `flow` and `page` should be set to indicate the starting point + // of the test case. If neither is set, the test case will start with start + // page on the default start flow. + string page = 3 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; +} + +// One interaction between a human and virtual agent. The human provides some +// input and the virtual agent provides a response. +message ConversationTurn { + // The input from the human user. + message UserInput { + // Supports [text input][google.cloud.dialogflow.cx.v3.QueryInput.text], + // [event input][google.cloud.dialogflow.cx.v3.QueryInput.event], [dtmf + // input][google.cloud.dialogflow.cx.v3.QueryInput.dtmf] in the test case. + QueryInput input = 5; + + // Parameters that need to be injected into the conversation during intent + // detection. + google.protobuf.Struct injected_parameters = 2; + + // If webhooks should be allowed to trigger in response to the user + // utterance. Often if parameters are injected, webhooks should not be + // enabled. + bool is_webhook_enabled = 3; + + // Whether sentiment analysis is enabled. + bool enable_sentiment_analysis = 7; + } + + // The output from the virtual agent. + message VirtualAgentOutput { + // The session parameters available to the bot at this point. + google.protobuf.Struct session_parameters = 4; + + // Output only. If this is part of a [result conversation + // turn][TestCaseResult.conversation_turns], the list of differences + // between the original run and the replay for this output, if any. + repeated TestRunDifference differences = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Input only. The diagnostic + // [info][Session.DetectIntentResponse.QueryResult.diagnostic_info] + // output for the turn. Required to calculate the testing coverage. + google.protobuf.Struct diagnostic_info = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // The [Intent][google.cloud.dialogflow.cx.v3.Intent] that triggered the + // response. Only name and displayName will be set. + Intent triggered_intent = 7; + + // The [Page][google.cloud.dialogflow.cx.v3.Page] on which the utterance was + // spoken. Only name and displayName will be set. + Page current_page = 8; + + // The [text][google.cloud.dialogflow.cx.v3.ResponseMessage.Text] responses + // from the agent for the turn. + repeated ResponseMessage.Text text_responses = 9; + + // Response error from the agent in the test result. If set, other output + // is empty. + google.rpc.Status status = 10; + } + + // The user input. + UserInput user_input = 1; + + // The virtual agent output. + VirtualAgentOutput virtual_agent_output = 2; +} + +// The description of differences between original and replayed agent output. +message TestRunDifference { + // What part of the message replay differs from the test case. + enum DiffType { + // Should never be used. + DIFF_TYPE_UNSPECIFIED = 0; + + // The intent. + INTENT = 1; + + // The page. + PAGE = 2; + + // The parameters. + PARAMETERS = 3; + + // The message utterance. + UTTERANCE = 4; + + // The flow. + FLOW = 5; + } + + // The type of diff. + DiffType type = 1; + + // A human readable description of the diff, showing the actual output vs + // expected output. + string description = 2; +} + +// Transition coverage represents the percentage of all possible page +// transitions (page-level transition routes and event handlers, excluding +// transition route groups) present within any of a parent's test cases. +message TransitionCoverage { + // The source or target of a transition. + message TransitionNode { + // A TransitionNode can be either a page or a flow. + oneof kind { + // Indicates a transition to a [Page][google.cloud.dialogflow.cx.v3.Page]. + // Only some fields such as name and displayname will be set. + Page page = 1; + + // Indicates a transition to a [Flow][google.cloud.dialogflow.cx.v3.Flow]. + // Only some fields such as name and displayname will be set. + Flow flow = 2; + } + } + + // A transition in a page. + message Transition { + // The start node of a transition. + TransitionNode source = 1; + + // The index of a transition in the transition list. Starting from 0. + int32 index = 4; + + // The end node of a transition. + TransitionNode target = 2; + + // Whether the transition is covered by at least one of the + // agent's test cases. + bool covered = 3; + + // The detailed transition. + oneof detail { + // Intent route or condition route. + TransitionRoute transition_route = 5; + + // Event handler. + EventHandler event_handler = 6; + } + } + + // The list of Transitions present in the agent. + repeated Transition transitions = 1; + + // The percent of transitions in the agent that are covered. + float coverage_score = 2; +} + +// Transition route group coverage represents the percentage of all possible +// transition routes present within any of a parent's test cases. The results +// are grouped by the transition route group. +message TransitionRouteGroupCoverage { + // Coverage result message for one transition route group. + message Coverage { + // A transition coverage in a transition route group. + message Transition { + // Intent route or condition route. + TransitionRoute transition_route = 1; + + // Whether the transition route is covered by at least one of the + // agent's test cases. + bool covered = 2; + } + + // Transition route group metadata. Only name and displayName will be set. + TransitionRouteGroup route_group = 1; + + // The list of transition routes and coverage in the transition route group. + repeated Transition transitions = 2; + + // The percent of transition routes in the transition route group that are + // covered. + float coverage_score = 3; + } + + // Transition route group coverages. + repeated Coverage coverages = 1; + + // The percent of transition routes in all the transition route groups that + // are covered. + float coverage_score = 2; +} + +// Intent coverage represents the percentage of all possible intents in the +// agent that are triggered in any of a parent's test cases. +message IntentCoverage { + // The agent's intent. + message Intent { + // The intent full resource name + string intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Whether the intent is covered by at least one of the agent's + // test cases. + bool covered = 2; + } + + // The list of Intents present in the agent + repeated Intent intents = 1; + + // The percent of intents in the agent that are covered. + float coverage_score = 2; +} + +// The request message for +// [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage]. +message CalculateCoverageRequest { + // The type of coverage score requested. + enum CoverageType { + // Should never be used. + COVERAGE_TYPE_UNSPECIFIED = 0; + + // Intent coverage. + INTENT = 1; + + // Page transition coverage. + PAGE_TRANSITION = 2; + + // Transition route group coverage. + TRANSITION_ROUTE_GROUP = 3; + } + + // Required. The agent to calculate coverage for. + // Format: `projects//locations//agents/`. + string agent = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The type of coverage requested. + CoverageType type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response message for +// [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage]. +message CalculateCoverageResponse { + // The agent to calculate coverage for. + // Format: `projects//locations//agents/`. + string agent = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + }]; + + // The type of coverage requested. + oneof coverage_type { + // Intent coverage. + IntentCoverage intent_coverage = 2; + + // Transition (excluding transition route groups) coverage. + TransitionCoverage transition_coverage = 4; + + // Transition route group coverage. + TransitionRouteGroupCoverage route_group_coverage = 6; + } +} + +// The request message for +// [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3.TestCases.ListTestCases]. +message ListTestCasesRequest { + // Specifies how much test case information to include in the response. + enum TestCaseView { + // The default / unset value. + // The API will default to the BASIC view. + TEST_CASE_VIEW_UNSPECIFIED = 0; + + // Include basic metadata about the test case, but not the conversation + // turns. This is the default value. + BASIC = 1; + + // Include everything. + FULL = 2; + } + + // Required. The agent to list all pages for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // The maximum number of items to return in a single page. By default 20. + // Note that when TestCaseView = FULL, the maximum page size allowed is 20. + // When TestCaseView = BASIC, the maximum page size allowed is 500. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // Specifies whether response should include all fields or just the metadata. + TestCaseView view = 4; +} + +// The response message for +// [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3.TestCases.ListTestCases]. +message ListTestCasesResponse { + // The list of test cases. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated TestCase test_cases = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [TestCases.BatchDeleteTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCases]. +message BatchDeleteTestCasesRequest { + // Required. The agent to delete test cases from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Required. Format of test case names: + // `projects//locations//agents//testCases/`. + repeated string names = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; +} + +// The request message for +// [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase]. +message CreateTestCaseRequest { + // Required. The agent to create the test case for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Required. The test case to create. + TestCase test_case = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [TestCases.UpdateTestCase][google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCase]. +message UpdateTestCaseRequest { + // Required. The test case to update. + TestCase test_case = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to specify which fields should be updated. The + // [`creationTime`][google.cloud.dialogflow.cx.v3.TestCase.creation_time] and + // [`lastTestResult`][google.cloud.dialogflow.cx.v3.TestCase.last_test_result] + // cannot be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [TestCases.GetTestCase][google.cloud.dialogflow.cx.v3.TestCases.GetTestCase]. +message GetTestCaseRequest { + // Required. The name of the testcase. + // Format: + // `projects//locations//agents//testCases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; +} + +// The request message for +// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase]. +message RunTestCaseRequest { + // Required. Format of test case name to run: + // `projects//locations//agents//testCases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Optional. Environment name. If not set, draft environment is assumed. + // Format: + // `projects//locations//agents//environments/`. + string environment = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The response message for +// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase]. +message RunTestCaseResponse { + // The result. + TestCaseResult result = 2; +} + +// Metadata returned for the +// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase] +// long running operation. This message currently has no fields. +message RunTestCaseMetadata {} + +// The request message for +// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases]. +message BatchRunTestCasesRequest { + // Required. Agent name. Format: + // `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Optional. If not set, draft environment is assumed. Format: + // `projects//locations//agents//environments/`. + string environment = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. Format: + // `projects//locations//agents//testCases/`. + repeated string test_cases = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; +} + +// The response message for +// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases]. +message BatchRunTestCasesResponse { + // The test case results. The detailed + // [conversation + // turns][google.cloud.dialogflow.cx.v3.TestCaseResult.conversation_turns] are + // empty in this response. + repeated TestCaseResult results = 1; +} + +// Metadata returned for the +// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases] +// long running operation. +message BatchRunTestCasesMetadata { + // The test errors. + repeated TestError errors = 1; +} + +// Error info for running a test. +message TestError { + // The test case resource name. + string test_case = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + }]; + + // The status associated with the test. + google.rpc.Status status = 2; + + // The timestamp when the test was completed. + google.protobuf.Timestamp test_time = 3; +} + +// The request message for +// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases]. +message ImportTestCasesRequest { + // Required. The agent to import test cases to. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Required. The source to import. + oneof source { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import test cases from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string gcs_uri = 2; + + // Uncompressed raw byte content for test cases. + bytes content = 3; + } +} + +// The response message for +// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases]. +message ImportTestCasesResponse { + // The unique identifiers of the new test cases. + // Format: + // `projects//locations//agents//testCases/`. + repeated string names = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + }]; +} + +// Metadata returned for the +// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases] +// long running operation. +message ImportTestCasesMetadata { + // Errors for failed test cases. + repeated TestCaseError errors = 1; +} + +// Error info for importing a test. +message TestCaseError { + // The test case. + TestCase test_case = 1; + + // The status associated with the test case. + google.rpc.Status status = 2; +} + +// The request message for +// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases]. +message ExportTestCasesRequest { + // Data format of the exported test cases. + enum DataFormat { + // Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0; + + // Raw bytes. + BLOB = 1; + + // JSON format. + JSON = 2; + } + + // Required. The agent where to export test cases from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // The destination to export. + oneof destination { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + // export the test cases to. The format of this URI must be + // `gs:///`. If unspecified, the serialized test + // cases is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string gcs_uri = 2; + } + + // The data format of the exported test cases. If not specified, `BLOB` is + // assumed. + DataFormat data_format = 3; + + // The filter expression used to filter exported test cases, see + // [API Filtering](https://aip.dev/160). The expression is case insensitive + // and supports the following syntax: + // + // name = [OR name = ] ... + // + // For example: + // + // * "name = t1 OR name = t2" matches the test case with the exact resource + // name "t1" or "t2". + string filter = 4; +} + +// The response message for +// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases]. +message ExportTestCasesResponse { + // The exported test cases. + oneof destination { + // The URI to a file containing the exported test cases. This field is + // populated only if `gcs_uri` is specified in + // [ExportTestCasesRequest][google.cloud.dialogflow.cx.v3.ExportTestCasesRequest]. + string gcs_uri = 1; + + // Uncompressed raw byte content for test cases. + bytes content = 2; + } +} + +// Metadata returned for the +// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases] +// long running operation. This message currently has no fields. +message ExportTestCasesMetadata {} + +// The request message for +// [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults]. +message ListTestCaseResultsRequest { + // Required. The test case to list results for. + // Format: + // `projects//locations//agents//testCases/`. + // Specify a `-` as a wildcard for TestCase ID to + // list results across multiple test cases. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCaseResult" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The filter expression used to filter test case results. See + // [API Filtering](https://aip.dev/160). + // + // The expression is case insensitive. Only 'AND' is supported for logical + // operators. The supported syntax is listed below in detail: + // + // [AND ] ... + // [AND latest] + // + // The supported fields and operators are: + // field operator + // `environment` `=`, `IN` (Use value `draft` for draft environment) + // `test_time` `>`, `<` + // + // `latest` only returns the latest test result in all results for each test + // case. + // + // Examples: + // * "environment=draft AND latest" matches the latest test result for each + // test case in the draft environment. + // * "environment IN (e1,e2)" matches any test case results with an + // environment resource name of either "e1" or "e2". + // * "test_time > 1602540713" matches any test case results with test time + // later than a unix timestamp in seconds 1602540713. + string filter = 4; +} + +// The response message for +// [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults]. +message ListTestCaseResultsResponse { + // The list of test case results. + repeated TestCaseResult test_case_results = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [TestCases.GetTestCaseResult][google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResult]. +message GetTestCaseResultRequest { + // Required. The name of the testcase. + // Format: + // `projects//locations//agents//testCases//results/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCaseResult" + } + ]; +} + +// The test result for a test case and an agent environment. +enum TestResult { + // Not specified. Should never be used. + TEST_RESULT_UNSPECIFIED = 0; + + // The test passed. + PASSED = 1; + + // The test did not pass. + FAILED = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/tool.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/tool.proto new file mode 100644 index 000000000000..231784cd7d79 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/tool.proto @@ -0,0 +1,687 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/data_store_connection.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ToolProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Tools][google.cloud.dialogflow.cx.v3.Tool]. +service Tools { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a [Tool][google.cloud.dialogflow.cx.v3.Tool] in the specified + // agent. + rpc CreateTool(CreateToolRequest) returns (Tool) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/tools" + body: "tool" + }; + option (google.api.method_signature) = "parent,tool"; + } + + // Returns a list of [Tools][google.cloud.dialogflow.cx.v3.Tool] in the + // specified agent. + rpc ListTools(ListToolsRequest) returns (ListToolsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/tools" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc GetTool(GetToolRequest) returns (Tool) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc UpdateTool(UpdateToolRequest) returns (Tool) { + option (google.api.http) = { + patch: "/v3/{tool.name=projects/*/locations/*/agents/*/tools/*}" + body: "tool" + }; + option (google.api.method_signature) = "tool,update_mask"; + } + + // Deletes a specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc DeleteTool(DeleteToolRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List versions of the specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc ListToolVersions(ListToolVersionsRequest) + returns (ListToolVersionsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a version for the specified + // [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc CreateToolVersion(CreateToolVersionRequest) returns (ToolVersion) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions" + body: "tool_version" + }; + option (google.api.method_signature) = "parent,tool_version"; + } + + // Retrieves the specified version of the + // [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc GetToolVersion(GetToolVersionRequest) returns (ToolVersion) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified version of the + // [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc DeleteToolVersion(DeleteToolVersionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the specified version of the Tool and stores it as the + // current tool draft, returning the tool with resources updated. + rpc RestoreToolVersion(RestoreToolVersionRequest) + returns (RestoreToolVersionResponse) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [Tools.CreateTool][google.cloud.dialogflow.cx.v3.Tools.CreateTool]. +message CreateToolRequest { + // Required. The agent to create a Tool for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Tool" + } + ]; + + // Required. The Tool to be created. + Tool tool = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Tools.ListTools][google.cloud.dialogflow.cx.v3.Tools.ListTools]. +message ListToolsRequest { + // Required. The agent to list the Tools from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Tool" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Tools.ListTools][google.cloud.dialogflow.cx.v3.Tools.ListTools]. +message ListToolsResponse { + // The list of Tools. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Tool tools = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Tools.GetTool][google.cloud.dialogflow.cx.v3.Tools.GetTool]. +message GetToolRequest { + // Required. The name of the Tool. + // Format: + // `projects//locations//agents//tools/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; +} + +// The request message for +// [Tools.UpdateTool][google.cloud.dialogflow.cx.v3.Tools.UpdateTool]. +message UpdateToolRequest { + // Required. The Tool to be updated. + Tool tool = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Tools.DeleteTool][google.cloud.dialogflow.cx.v3.Tools.DeleteTool]. +message DeleteToolRequest { + // Required. The name of the Tool to be deleted. + // Format: + // `projects//locations//agents//tools/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // This field has no effect for Tools not being used. + // For Tools that are used: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the tool, as well + // as any references to the tool. + bool force = 2; +} + +// A tool provides a list of actions which are available to the +// [Playbook][google.cloud.dialogflow.cx.v3.Playbook] to attain its goal. A Tool +// consists of a description of the tool's usage and a specification of the tool +// which contains the schema and authentication information. +message Tool { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Tool" + pattern: "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}" + }; + + // An OpenAPI tool is a way to provide the Tool specifications in the Open API + // schema format. + message OpenApiTool { + // Schema representation. + oneof schema { + // Required. The OpenAPI schema specified as a text. + string text_schema = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Authentication information required by the API. + Authentication authentication = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. TLS configuration for the HTTPS verification. + TLSConfig tls_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration. + ServiceDirectoryConfig service_directory_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // A DataStoreTool is a way to provide specifications needed to search a + // list of data stores. + message DataStoreTool { + // A FallbackPrompt is a way to provide specifications for the Data Store + // fallback prompt when generating responses. + message FallbackPrompt {} + + // Required. List of data stores to search. + repeated DataStoreConnection data_store_connections = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Fallback prompt configurations to use. + FallbackPrompt fallback_prompt = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // A Function tool describes the functions to be invoked on the client side. + message FunctionTool { + // Optional. The JSON schema is encapsulated in a + // [google.protobuf.Struct][google.protobuf.Struct] to describe the input of + // the function. This input is a JSON object that contains the function's + // parameters as properties of the object. + google.protobuf.Struct input_schema = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The JSON schema is encapsulated in a + // [google.protobuf.Struct][google.protobuf.Struct] to describe the output + // of the function. This output is a JSON object that contains the + // function's parameters as properties of the object. + google.protobuf.Struct output_schema = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Authentication information required for API calls + message Authentication { + // Config for authentication with API key. + message ApiKeyConfig { + // Required. The parameter name or the header name of the API key. + // E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + string key_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The API key. If the `secret_version_for_api_key` field is + // set, this field will be ignored. + string api_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the API key. If this field is set, the `api_key` field will be ignored. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_api_key = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. Key location in the request. + RequestLocation request_location = 3 + [(google.api.field_behavior) = REQUIRED]; + } + + // The location of the API key in the request. + enum RequestLocation { + // Default value. This value is unused. + REQUEST_LOCATION_UNSPECIFIED = 0; + + // Represents the key in http header. + HEADER = 1; + + // Represents the key in query string. + QUERY_STRING = 2; + } + + // Config for authentication with OAuth. + message OAuthConfig { + // OAuth grant types. Only [client credential + // grant](https://oauth.net/2/grant-types/client-credentials) is + // supported. + enum OauthGrantType { + // Default value. This value is unused. + OAUTH_GRANT_TYPE_UNSPECIFIED = 0; + + // Represents the [client credential + // flow](https://oauth.net/2/grant-types/client-credentials). + CLIENT_CREDENTIAL = 1; + } + + // Required. OAuth grant types. + OauthGrantType oauth_grant_type = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The client ID from the OAuth provider. + string client_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The client secret from the OAuth provider. If the + // `secret_version_for_client_secret` field is set, this field will be + // ignored. + string client_secret = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the client secret. If this field is set, the `client_secret` field will + // be ignored. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_client_secret = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. The token endpoint in the OAuth provider to exchange for an + // access token. + string token_endpoint = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. + repeated string scopes = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for auth using [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + message ServiceAgentAuthConfig { + // Indicate the auth token type generated from the [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + enum ServiceAgentAuth { + // Service agent auth type unspecified. Default to ID_TOKEN. + SERVICE_AGENT_AUTH_UNSPECIFIED = 0; + + // Use [ID + // token](https://cloud.google.com/docs/authentication/token-types#id) + // generated from service agent. This can be used to access Cloud + // Function and Cloud Run after you grant Invoker role to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ID_TOKEN = 1; + + // Use [access + // token](https://cloud.google.com/docs/authentication/token-types#access) + // generated from service agent. This can be used to access other Google + // Cloud APIs after you grant required roles to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ACCESS_TOKEN = 2; + } + + // Optional. Indicate the auth token type generated from the [Diglogflow + // service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + // The generated token is sent in the Authorization header. + ServiceAgentAuth service_agent_auth = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for authentication using bearer token. + message BearerTokenConfig { + // Optional. The text token appended to the text `Bearer` to the request + // Authorization header. + // [Session parameters + // reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + // can be used to pass the token dynamically, e.g. + // `$session.params.parameter-id`. + string token = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the Bearer token. If this field is set, the `token` field will be + // ignored. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_token = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // Configuration for authentication using a service account. + message ServiceAccountAuthConfig { + // Required. The email address of the service account used to authenticate + // the tool call. Dialogflow uses this service account to exchange an + // access token and the access token is then sent in the `Authorization` + // header of the tool request. + // + // The service account must have the + // `roles/iam.serviceAccountTokenCreator` role granted to the + // [Dialogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + string service_account = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The auth configuration. + oneof auth_config { + // Config for API key auth. + ApiKeyConfig api_key_config = 1; + + // Config for OAuth. + OAuthConfig oauth_config = 2; + + // Config for [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) + // auth. + ServiceAgentAuthConfig service_agent_auth_config = 3; + + // Config for bearer token auth. + BearerTokenConfig bearer_token_config = 4; + + // Configuration for service account authentication. + ServiceAccountAuthConfig service_account_auth_config = 5; + } + } + + // The TLS configuration. + message TLSConfig { + // The CA certificate. + message CACert { + // Required. The name of the allowed custom CA certificates. This + // can be used to disambiguate the custom CA certificates. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The allowed custom CA certificates (in DER format) for + // HTTPS verification. This overrides the default SSL trust store. If this + // is empty or unspecified, Dialogflow will use Google's default trust + // store to verify certificates. N.B. Make sure the HTTPS server + // certificates are signed with "subject alt name". For instance a + // certificate can be self-signed using the following command: + // + // ``` + // openssl x509 -req -days 200 -in example.com.csr \ + // -signkey example.com.key \ + // -out example.com.crt \ + // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + // ``` + bytes cert = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specifies a list of allowed custom CA certificates for HTTPS + // verification. + repeated CACert ca_certs = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration for tools using Service Directory. + message ServiceDirectoryConfig { + // Required. The name of [Service + // Directory](https://cloud.google.com/service-directory) service. + // Format: + // `projects//locations//namespaces//services/`. + // `LocationID` of the service directory must be the same as the location + // of the agent. + string service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; + } + + // Represents the type of the tool. + enum ToolType { + // Default value. This value is unused. + TOOL_TYPE_UNSPECIFIED = 0; + + // Customer provided tool. + CUSTOMIZED_TOOL = 1; + + // First party built-in tool created by Dialogflow which cannot be modified. + BUILTIN_TOOL = 2; + } + + // The unique identifier of the Tool. + // Format: + // `projects//locations//agents//tools/`. + string name = 1; + + // Required. The human-readable name of the Tool, unique within an agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. High level description of the Tool and its usage. + string description = 3 [(google.api.field_behavior) = REQUIRED]; + + // Specification of the Tool. + oneof specification { + // OpenAPI specification of the Tool. + OpenApiTool open_api_spec = 4; + + // Data store search tool specification. + DataStoreTool data_store_spec = 8; + + // Client side executed function specification. + FunctionTool function_spec = 13; + } + + // Output only. The tool type. + ToolType tool_type = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for +// [Tools.ListToolVersions][google.cloud.dialogflow.cx.v3.Tools.ListToolVersions]. +message ListToolVersionsRequest { + // Required. The parent of the tool versions. + // Format: + // `projects//locations//agents//tools/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ToolVersion" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Tools.ListToolVersions][google.cloud.dialogflow.cx.v3.Tools.ListToolVersions]. +message ListToolVersionsResponse { + // The list of tool versions. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated ToolVersion tool_versions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Tools.CreateToolVersion][google.cloud.dialogflow.cx.v3.Tools.CreateToolVersion]. +// The request message for +// [Tools.CreateToolVersion][google.cloud.dialogflow.cx.v3.Tools.CreateToolVersion]. +message CreateToolVersionRequest { + // Required. The tool to create a version for. + // Format: + // `projects//locations//agents//tools/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ToolVersion" + } + ]; + + // Required. The tool version to create. + ToolVersion tool_version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Tools.GetToolVersion][google.cloud.dialogflow.cx.v3.Tools.GetToolVersion]. +message GetToolVersionRequest { + // Required. The name of the tool version. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ToolVersion" + } + ]; +} + +// The request message for +// [Tools.DeleteToolVersion][google.cloud.dialogflow.cx.v3.Tools.DeleteToolVersion]. +message DeleteToolVersionRequest { + // Required. The name of the tool version to delete. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ToolVersion" + } + ]; + + // Optional. This field has no effect for Tools not being used. + // For Tools that are used: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the tool, as well + // as any references to the tool. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Tools.RestoreToolVersion][google.cloud.dialogflow.cx.v3.Tools.RestoreToolVersion]. +message RestoreToolVersionRequest { + // Required. The name of the tool version. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ToolVersion" + } + ]; +} + +// The response message for +// [Tools.RestoreToolVersion][google.cloud.dialogflow.cx.v3.Tools.RestoreToolVersion]. +message RestoreToolVersionResponse { + // The updated tool. + Tool tool = 2; +} + +// Tool version is a snapshot of the tool at certain timestamp. +message ToolVersion { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/ToolVersion" + pattern: "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}" + plural: "toolVersions" + singular: "toolVersion" + }; + + // Identifier. The unique identifier of the tool version. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the tool version. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Snapshot of the tool to be associated with this version. + Tool tool = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Last time the tool version was created or modified. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the tool version was created or modified. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/tool_call.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/tool_call.proto new file mode 100644 index 000000000000..c2773853f769 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/tool_call.proto @@ -0,0 +1,76 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ToolCallProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Represents a call of a specific tool's action with the specified inputs. +message ToolCall { + // Required. The [tool][google.cloud.dialogflow.cx.v3.Tool] associated with + // this call. Format: + // `projects//locations//agents//tools/`. + string tool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // Required. The name of the tool's action associated with this call. + string action = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The action's input parameters. + google.protobuf.Struct input_parameters = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The result of calling a tool's action that has been executed by the client. +message ToolCallResult { + // An error produced by the tool call. + message Error { + // Optional. The error message of the function. + string message = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The [tool][google.cloud.dialogflow.cx.v3.Tool] associated with + // this call. Format: + // `projects//locations//agents//tools/`. + string tool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // Required. The name of the tool's action associated with this call. + string action = 2 [(google.api.field_behavior) = REQUIRED]; + + // The tool call's result. + oneof result { + // The tool call's error. + Error error = 3; + + // The tool call's output parameters. + google.protobuf.Struct output_parameters = 4; + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/trace.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/trace.proto new file mode 100644 index 000000000000..c9473dcc749b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/trace.proto @@ -0,0 +1,287 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "TraceProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// The trace block tracks a sequence of actions taken by the agent in a flow or +// a playbook. +message TraceBlock { + // Metadata of the trace. + oneof trace_metadata { + // Metadata of the playbook trace. + PlaybookTraceMetadata playbook_trace_metadata = 1; + + // Metadata of the flow trace. + FlowTraceMetadata flow_trace_metadata = 2; + + // Metadata of the speech-to-text and speech-to-text processing. + SpeechProcessingMetadata speech_processing_metadata = 8; + } + + // The actions performed by the agent and the user during this session. + repeated Action actions = 3; + + // Output only. Timestamp of the start of the trace block. + google.protobuf.Timestamp start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the end of the trace block. + google.protobuf.Timestamp complete_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A list of input parameters of the trace block. + google.protobuf.Struct input_parameters = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of output parameters of the trace block. + google.protobuf.Struct output_parameters = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. The end state of the trace block. + OutputState end_state = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Metadata of the speech-to-text and text-to-speech processing. +message SpeechProcessingMetadata { + // Output only. The display name of the speech processing. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata of the playbook trace. +message PlaybookTraceMetadata { + // Required. The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The display name of the playbook. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata of the flow trace. +message FlowTraceMetadata { + // Required. The unique identifier of the flow. + // Format: + // `projects//locations//agents//flows/`. + string flow = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Output only. The display name of the flow. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Input of the playbook. +message PlaybookInput { + // Optional. Summary string of the preceding conversation for the child + // playbook invocation. + string preceding_conversation_summary = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Output of the playbook. +message PlaybookOutput { + // Optional. Summary string of the execution result of the child playbook. + string execution_summary = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Action performed by end user or Dialogflow agent in the conversation. +message Action { + // Action details. + oneof action { + // Optional. Agent obtained a message from the customer. + UserUtterance user_utterance = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed by the agent as a message. + AgentUtterance agent_utterance = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by calling a plugin + // tool. + ToolUse tool_use = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by invoking a child + // playbook. + PlaybookInvocation playbook_invocation = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by invoking a CX flow. + FlowInvocation flow_invocation = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by transitioning to a + // target playbook. + PlaybookTransition playbook_transition = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by transitioning to a + // target CX flow. + FlowTransition flow_transition = 13 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// UserUtterance represents one message sent by the customer. +message UserUtterance { + // Required. Message content in text. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// AgentUtterance represents one message sent by the agent. +message AgentUtterance { + // Required. Message content in text. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Stores metadata of the invocation of an action supported by a tool. +message ToolUse { + // Required. The [tool][google.cloud.dialogflow.cx.v3.Tool] that should be + // used. Format: + // `projects//locations//agents//tools/`. + string tool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // Output only. The display name of the tool. + string display_name = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Name of the action to be called during the tool use. + string action = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of input parameters for the action. + google.protobuf.Struct input_action_parameters = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of output parameters generated by the action. + google.protobuf.Struct output_action_parameters = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Stores metadata of the invocation of a child playbook. +message PlaybookInvocation { + // Required. The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The display name of the playbook. + string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input of the child playbook invocation. + PlaybookInput playbook_input = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output of the child playbook invocation. + PlaybookOutput playbook_output = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Playbook invocation's output state. + OutputState playbook_state = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Stores metadata of the invocation of a CX flow. +message FlowInvocation { + // Required. The unique identifier of the flow. + // Format: + // `projects//locations//agents//flows/`. + string flow = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Output only. The display name of the flow. + string display_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Flow invocation's output state. + OutputState flow_state = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Stores metadata of the transition to another target playbook. Playbook +// transition actions exit the caller playbook and enter the target playbook. +message PlaybookTransition { + // Required. The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The display name of the playbook. + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Stores metadata of the transition to a target CX flow. Flow transition +// actions exit the caller playbook and enter the child flow. +message FlowTransition { + // Required. The unique identifier of the flow. + // Format: + // `projects//locations//agents/`. + string flow = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Output only. The display name of the flow. + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Output state. +enum OutputState { + // Unspecified output. + OUTPUT_STATE_UNSPECIFIED = 0; + + // Succeeded. + OUTPUT_STATE_OK = 1; + + // Cancelled. + OUTPUT_STATE_CANCELLED = 2; + + // Failed. + OUTPUT_STATE_FAILED = 3; + + // Escalated. + OUTPUT_STATE_ESCALATED = 4; + + // Pending. + OUTPUT_STATE_PENDING = 5; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto new file mode 100644 index 000000000000..40523f9132d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto @@ -0,0 +1,316 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/page.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "TransitionRouteGroupProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing +// [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. +service TransitionRouteGroups { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all transition route groups in the specified flow. + rpc ListTransitionRouteGroups(ListTransitionRouteGroupsRequest) + returns (ListTransitionRouteGroupsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + additional_bindings { + get: "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + rpc GetTransitionRouteGroup(GetTransitionRouteGroupRequest) + returns (TransitionRouteGroup) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + additional_bindings { + get: "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates an + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + // in the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateTransitionRouteGroup(CreateTransitionRouteGroupRequest) + returns (TransitionRouteGroup) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + body: "transition_route_group" + additional_bindings { + post: "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups" + body: "transition_route_group" + } + }; + option (google.api.method_signature) = "parent,transition_route_group"; + } + + // Updates the specified + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateTransitionRouteGroup(UpdateTransitionRouteGroupRequest) + returns (TransitionRouteGroup) { + option (google.api.http) = { + patch: "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + body: "transition_route_group" + additional_bindings { + patch: "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + body: "transition_route_group" + } + }; + option (google.api.method_signature) = "transition_route_group,update_mask"; + } + + // Deletes the specified + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + additional_bindings { + delete: "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// A TransitionRouteGroup represents a group of +// [`TransitionRoutes`][google.cloud.dialogflow.cx.v3.TransitionRoute] to be +// used by a [Page][google.cloud.dialogflow.cx.v3.Page]. +message TransitionRouteGroup { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}" + plural: "transitionRouteGroups" + singular: "transitionRouteGroup" + }; + + // The unique identifier of the transition route group. + // [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup] + // populates the name automatically. Format: + // `projects//locations//agents//flows//transitionRouteGroups/` + // . + string name = 1; + + // Required. The human-readable name of the transition route group, unique + // within the flow. The display name can be no longer than 30 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Transition routes associated with the + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + repeated TransitionRoute transition_routes = 5; +} + +// The request message for +// [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsRequest { + // Required. The flow to list all transition route groups for. + // Format: + // `projects//locations//agents//flows/` + // or `projects//locations//agents/. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list transition route groups for. The following fields are + // language dependent: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for +// [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsResponse { + // The list of transition route groups. There will be a maximum number of + // items returned based on the page_size field in the request. The list may in + // some cases be empty or contain fewer entries than page_size even if this + // isn't the last page. + repeated TransitionRouteGroup transition_route_groups = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.GetTransitionRouteGroup]. +message GetTransitionRouteGroupRequest { + // Required. The name of the + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + // Format: + // `projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The language to retrieve the transition route group for. The following + // fields are language dependent: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup]. +message CreateTransitionRouteGroupRequest { + // Required. The flow to create an + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + // for. Format: + // `projects//locations//agents//flows/` + // or `projects//locations//agents/` + // for agent-level groups. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // Required. The transition route group to create. + TransitionRouteGroup transition_route_group = 2 + [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `TransitionRouteGroup`: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.UpdateTransitionRouteGroup]. +message UpdateTransitionRouteGroupRequest { + // Required. The transition route group to update. + TransitionRouteGroup transition_route_group = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; + + // The language of the following fields in `TransitionRouteGroup`: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.DeleteTransitionRouteGroup]. +message DeleteTransitionRouteGroupRequest { + // Required. The name of the + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + // to delete. Format: + // `projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // This field has no effect for transition route group that no page is using. + // If the transition route group is referenced by any page: + // + // * If `force` is set to false, an error will be returned with message + // indicating pages that reference the transition route group. + // * If `force` is set to true, Dialogflow will remove the transition route + // group, as well as any reference to it. + bool force = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/validation_message.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/validation_message.proto new file mode 100644 index 000000000000..cd81683a32dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/validation_message.proto @@ -0,0 +1,115 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ValidationMessageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Agent/flow validation message. +message ValidationMessage { + // Resource types. + enum ResourceType { + // Unspecified. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Agent. + AGENT = 1; + + // Intent. + INTENT = 2; + + // Intent training phrase. + INTENT_TRAINING_PHRASE = 8; + + // Intent parameter. + INTENT_PARAMETER = 9; + + // Multiple intents. + INTENTS = 10; + + // Multiple training phrases. + INTENT_TRAINING_PHRASES = 11; + + // Entity type. + ENTITY_TYPE = 3; + + // Multiple entity types. + ENTITY_TYPES = 12; + + // Webhook. + WEBHOOK = 4; + + // Flow. + FLOW = 5; + + // Page. + PAGE = 6; + + // Multiple pages. + PAGES = 13; + + // Transition route group. + TRANSITION_ROUTE_GROUP = 7; + + // Agent transition route group. + AGENT_TRANSITION_ROUTE_GROUP = 14; + } + + // Severity level. + enum Severity { + // Unspecified. + SEVERITY_UNSPECIFIED = 0; + + // The agent doesn't follow Dialogflow best practices. + INFO = 1; + + // The agent may not behave as expected. + WARNING = 2; + + // The agent may experience failures. + ERROR = 3; + } + + // The type of the resources where the message is found. + ResourceType resource_type = 1; + + // The names of the resources where the message is found. + repeated string resources = 2 [deprecated = true]; + + // The resource names of the resources where the message is found. + repeated ResourceName resource_names = 6; + + // Indicates the severity of the message. + Severity severity = 3; + + // The message detail. + string detail = 4; +} + +// Resource name and display name. +message ResourceName { + // Name. + string name = 1; + + // Display name. + string display_name = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/version.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/version.proto new file mode 100644 index 000000000000..c79f4ecd359d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/version.proto @@ -0,0 +1,351 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/flow.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "VersionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; + +// Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version]. +service Versions { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all versions in the specified + // [Flow][google.cloud.dialogflow.cx.v3.Flow]. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version]. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified + // [Flow][google.cloud.dialogflow.cx.v3.Flow]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] + // - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] + rpc CreateVersion(CreateVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + body: "version" + }; + option (google.api.method_signature) = "parent,version"; + option (google.longrunning.operation_info) = { + response_type: "Version" + metadata_type: "CreateVersionOperationMetadata" + }; + } + + // Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version]. + rpc UpdateVersion(UpdateVersionRequest) returns (Version) { + option (google.api.http) = { + patch: "/v3/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}" + body: "version" + }; + option (google.api.method_signature) = "version,update_mask"; + } + + // Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version]. + rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Loads resources in the specified version to the draft flow. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: An [Empty + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + rpc LoadVersion(LoadVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } + + // Compares the specified base version with target version. + rpc CompareVersions(CompareVersionsRequest) + returns (CompareVersionsResponse) { + option (google.api.http) = { + post: "/v3/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions" + body: "*" + }; + option (google.api.method_signature) = "base_version"; + } +} + +// Metadata associated with the long running operation for +// [Versions.CreateVersion][google.cloud.dialogflow.cx.v3.Versions.CreateVersion]. +message CreateVersionOperationMetadata { + // Name of the created version. + // Format: + // `projects//locations//agents//flows//versions/`. + string version = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; +} + +// Represents a version of a flow. +message Version { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Version" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}" + }; + + // The state of the version. + enum State { + // Not specified. This value is not used. + STATE_UNSPECIFIED = 0; + + // Version is not ready to serve (e.g. training is running). + RUNNING = 1; + + // Training has succeeded and this version is ready to serve. + SUCCEEDED = 2; + + // Version training failed. + FAILED = 3; + } + + // Format: + // projects//locations//agents//flows//versions/. + // Version ID is a self-increasing number generated by Dialogflow upon version + // creation. + string name = 1; + + // Required. The human-readable name of the version. Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the version. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // Output only. The NLU settings of the flow at version creation. + NluSettings nlu_settings = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time of the version. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this version. This field is read-only and cannot + // be set by create and update methods. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for +// [Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions]. +message ListVersionsRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all + // versions for. Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions]. +message ListVersionsResponse { + // A list of versions. There will be a maximum number of items returned based + // on the page_size field in the request. The list may in some cases be empty + // or contain fewer entries than page_size even if this isn't the last page. + repeated Version versions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Versions.GetVersion][google.cloud.dialogflow.cx.v3.Versions.GetVersion]. +message GetVersionRequest { + // Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. + // Format: + // `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for +// [Versions.CreateVersion][google.cloud.dialogflow.cx.v3.Versions.CreateVersion]. +message CreateVersionRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an + // [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // Required. The version to create. + Version version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3.Versions.UpdateVersion]. +message UpdateVersionRequest { + // Required. The version to update. + Version version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. Currently only + // `description` and `display_name` can be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3.Versions.DeleteVersion]. +message DeleteVersionRequest { + // Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] + // to delete. Format: + // `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for +// [Versions.LoadVersion][google.cloud.dialogflow.cx.v3.Versions.LoadVersion]. +message LoadVersionRequest { + // Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded + // to draft flow. Format: + // `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // This field is used to prevent accidental overwrite of other agent + // resources, which can potentially impact other flow's behavior. If + // `allow_override_agent_resources` is false, conflicted agent-level resources + // will not be overridden (i.e. intents, entities, webhooks). + bool allow_override_agent_resources = 2; +} + +// The request message for +// [Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions]. +message CompareVersionsRequest { + // Required. Name of the base flow version to compare with the target version. + // Use version ID `0` to indicate the draft version of the specified flow. + // + // Format: + // `projects//locations//agents//flows//versions/`. + string base_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // Required. Name of the target flow version to compare with the + // base version. Use version ID `0` to indicate the draft version of the + // specified flow. Format: + // `projects//locations//agents//flows//versions/`. + string target_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // The language to compare the flow versions for. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) are + // supported. Note: languages must be enabled in the agent before they can be + // used. + string language_code = 3; +} + +// The response message for +// [Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions]. +message CompareVersionsResponse { + // JSON representation of the base version content. + string base_version_content_json = 1; + + // JSON representation of the target version content. + string target_version_content_json = 2; + + // The timestamp when the two version compares. + google.protobuf.Timestamp compare_time = 3; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/webhook.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/webhook.proto new file mode 100644 index 000000000000..099436a64c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/webhook.proto @@ -0,0 +1,779 @@ +// Copyright 2026 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.dialogflow.cx.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3/response_message.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "WebhookProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; +option (google.api.resource_definition) = { + type: "servicedirectory.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" +}; + +// Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook]. +service Webhooks { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all webhooks in the specified agent. + rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*}/webhooks" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified webhook. + rpc GetWebhook(GetWebhookRequest) returns (Webhook) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a webhook in the specified agent. + rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*/agents/*}/webhooks" + body: "webhook" + }; + option (google.api.method_signature) = "parent,webhook"; + } + + // Updates the specified webhook. + rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + patch: "/v3/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}" + body: "webhook" + }; + option (google.api.method_signature) = "webhook,update_mask"; + } + + // Deletes the specified webhook. + rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Webhooks host the developer's business logic. During a session, webhooks +// allow the developer to use the data extracted by Dialogflow's natural +// language processing to generate dynamic responses, validate collected data, +// or trigger actions on the backend. +message Webhook { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Webhook" + pattern: "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}" + }; + + // Represents configuration for a generic web service. + message GenericWebService { + // Represents the value of an HTTP header stored in a SecretManager secret + // version. + message SecretVersionHeaderValue { + // Required. The SecretManager secret version resource storing the header + // value. Format: `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // Represents configuration of OAuth client credential flow for 3rd party + // API authentication. + message OAuthConfig { + // Required. The client ID provided by the 3rd party platform. + string client_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The client secret provided by the 3rd party platform. + string client_secret = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the client secret. If this field is set, the `client_secret` field will + // be ignored. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_client_secret = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. The token endpoint provided by the 3rd party platform to + // exchange an access token. + string token_endpoint = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. + repeated string scopes = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Indicate the auth token type generated from the [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + enum ServiceAgentAuth { + // Service agent auth type unspecified. Default to ID_TOKEN. + SERVICE_AGENT_AUTH_UNSPECIFIED = 0; + + // No token used. + NONE = 1; + + // Use [ID + // token](https://cloud.google.com/docs/authentication/token-types#id) + // generated from service agent. This can be used to access Cloud Function + // and Cloud Run after you grant Invoker role to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ID_TOKEN = 2; + + // Use [access + // token](https://cloud.google.com/docs/authentication/token-types#access) + // generated from service agent. This can be used to access other Google + // Cloud APIs after you grant required roles to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ACCESS_TOKEN = 3; + } + + // Configuration for authentication using a service account. + message ServiceAccountAuthConfig { + // Required. The email address of the service account used to authenticate + // the webhook call. Dialogflow uses this service account to exchange an + // access token and the access token is then sent in the `Authorization` + // header of the webhook request. + // + // The service account must have the + // `roles/iam.serviceAccountTokenCreator` role granted to the + // [Dialogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + string service_account = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents the type of webhook configuration. + enum WebhookType { + // Default value. This value is unused. + WEBHOOK_TYPE_UNSPECIFIED = 0; + + // Represents a standard webhook. + STANDARD = 1; + + // Represents a flexible webhook. + FLEXIBLE = 2; + } + + // HTTP method to use when calling webhooks. + enum HttpMethod { + // HTTP method not specified. + HTTP_METHOD_UNSPECIFIED = 0; + + // HTTP POST Method. + POST = 1; + + // HTTP GET Method. + GET = 2; + + // HTTP HEAD Method. + HEAD = 3; + + // HTTP PUT Method. + PUT = 4; + + // HTTP DELETE Method. + DELETE = 5; + + // HTTP PATCH Method. + PATCH = 6; + + // HTTP OPTIONS Method. + OPTIONS = 7; + } + + // Required. The webhook URI for receiving POST requests. It must use https + // protocol. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // The user name for HTTP Basic authentication. + string username = 2 [deprecated = true]; + + // The password for HTTP Basic authentication. + string password = 3 [deprecated = true]; + + // Optional. The SecretManager secret version resource storing the + // username:password pair for HTTP Basic authentication. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_username_password = 19 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // The HTTP request headers to send together with webhook requests. + map request_headers = 4; + + // Optional. The HTTP request headers to send together with webhook + // requests. Header values are stored in SecretManager secret versions. + // + // When the same header name is specified in both `request_headers` and + // `secret_versions_for_request_headers`, the value in + // `secret_versions_for_request_headers` will be used. + map secret_versions_for_request_headers = + 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a list of allowed custom CA certificates (in DER + // format) for HTTPS verification. This overrides the default SSL trust + // store. If this is empty or unspecified, Dialogflow will use Google's + // default trust store to verify certificates. N.B. Make sure the HTTPS + // server certificates are signed with "subject alt name". For instance a + // certificate can be self-signed using the following command, + // ``` + // openssl x509 -req -days 200 -in example.com.csr \ + // -signkey example.com.key \ + // -out example.com.crt \ + // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + // ``` + repeated bytes allowed_ca_certs = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The OAuth configuration of the webhook. If specified, + // Dialogflow will initiate the OAuth client credential flow to exchange an + // access token from the 3rd party platform and put it in the auth header. + OAuthConfig oauth_config = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the auth token type generated from the [Diglogflow + // service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + // The generated token is sent in the Authorization header. + ServiceAgentAuth service_agent_auth = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for service account authentication. + ServiceAccountAuthConfig service_account_auth_config = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the webhook. + WebhookType webhook_type = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HTTP method for the flexible webhook calls. Standard webhook + // always uses POST. + HttpMethod http_method = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines a custom JSON object as request body to send to + // flexible webhook. + string request_body = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maps the values extracted from specific fields of the flexible + // webhook response into session parameters. + // - Key: session parameter name + // - Value: field path in the webhook response + map parameter_mapping = 9 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Represents configuration for a [Service + // Directory](https://cloud.google.com/service-directory) service. + message ServiceDirectoryConfig { + // Required. The name of [Service + // Directory](https://cloud.google.com/service-directory) service. + // Format: + // `projects//locations//namespaces//services/`. + // `Location ID` of the service directory must be the same as the location + // of the agent. + string service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; + + // Generic Service configuration of this webhook. + GenericWebService generic_web_service = 2; + } + + // The unique identifier of the webhook. + // Required for the + // [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhook] + // method. + // [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhook] + // populates the name automatically. Format: + // `projects//locations//agents//webhooks/`. + string name = 1; + + // Required. The human-readable name of the webhook, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The webhook configuration. + oneof webhook { + // Configuration for a generic web service. + GenericWebService generic_web_service = 4; + + // Configuration for a [Service + // Directory](https://cloud.google.com/service-directory) service. + ServiceDirectoryConfig service_directory = 7; + } + + // Webhook execution timeout. Execution is considered failed if Dialogflow + // doesn't receive a response from webhook at the end of the timeout period. + // Defaults to 5 seconds, maximum allowed timeout is 30 seconds. + google.protobuf.Duration timeout = 6; + + // Indicates whether the webhook is disabled. + bool disabled = 5; +} + +// The request message for +// [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooks]. +message ListWebhooksRequest { + // Required. The agent to list all webhooks for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooks]. +message ListWebhooksResponse { + // The list of webhooks. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Webhook webhooks = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3.Webhooks.GetWebhook]. +message GetWebhookRequest { + // Required. The name of the webhook. + // Format: + // `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; +} + +// The request message for +// [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhook]. +message CreateWebhookRequest { + // Required. The agent to create a webhook for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // Required. The webhook to create. + Webhook webhook = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhook]. +message UpdateWebhookRequest { + // Required. The webhook to update. + Webhook webhook = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3.Webhooks.DeleteWebhook]. +message DeleteWebhookRequest { + // Required. The name of the webhook to delete. + // Format: + // `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // This field has no effect for webhook not being used. + // For webhooks that are used by pages/flows/transition route groups: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the webhook, as well + // as any references to the webhook (i.e. + // [Webhook][google.cloud.dialogflow.cx.v3.Fulfillment.webhook] and + // [tag][google.cloud.dialogflow.cx.v3.Fulfillment.tag]in fulfillments that + // point to this webhook will be removed). + bool force = 2; +} + +// The request message for a webhook call. The request is sent as a JSON object +// and the field names will be presented in camel cases. +// +// You may see undocumented fields in an actual request. These fields are used +// internally by Dialogflow and should be ignored. +message WebhookRequest { + // Represents fulfillment information communicated to the webhook. + message FulfillmentInfo { + // Always present. + // The value of the + // [Fulfillment.tag][google.cloud.dialogflow.cx.v3.Fulfillment.tag] field + // will be populated in this field by Dialogflow when the associated webhook + // is called. The tag is typically used by the webhook service to identify + // which fulfillment is being called, but it could be used for other + // purposes. + string tag = 1; + } + + // Represents intent information communicated to the webhook. + message IntentInfo { + // Represents a value for an intent parameter. + message IntentParameterValue { + // Always present. Original text value extracted from user utterance. + string original_value = 1; + + // Always present. Structured value for the parameter extracted from user + // utterance. + google.protobuf.Value resolved_value = 2; + } + + // Always present. The unique identifier of the last matched + // [intent][google.cloud.dialogflow.cx.v3.Intent]. + // Format: + // `projects//locations//agents//intents/`. + string last_matched_intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Always present. The display name of the last matched + // [intent][google.cloud.dialogflow.cx.v3.Intent]. + string display_name = 3; + + // Parameters identified as a result of intent matching. This is a map of + // the name of the identified parameter to the value of the parameter + // identified from the user's utterance. All parameters defined in the + // matched intent that are identified will be surfaced here. + map parameters = 2; + + // The confidence of the matched intent. Values range from 0.0 (completely + // uncertain) to 1.0 (completely certain). + float confidence = 4; + } + + // Represents the result of sentiment analysis. + message SentimentAnalysisResult { + // Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + // sentiment). + float score = 1; + + // A non-negative number in the [0, +inf) range, which represents the + // absolute magnitude of sentiment, regardless of score (positive or + // negative). + float magnitude = 2; + } + + // Always present. The unique identifier of the + // [DetectIntentResponse][google.cloud.dialogflow.cx.v3.DetectIntentResponse] + // that will be returned to the API caller. + string detect_intent_response_id = 1; + + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3.TextInput] was + // provided as input, this field will contain a copy of the text. + string text = 10; + + // If an [intent][google.cloud.dialogflow.cx.v3.IntentInput] was provided as + // input, this field will contain a copy of the intent identifier. Format: + // `projects//locations//agents//intents/`. + string trigger_intent = 11 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // If [natural language speech + // audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, + // this field will contain the transcript for the audio. + string transcript = 12; + + // If an [event][google.cloud.dialogflow.cx.v3.EventInput] was provided as + // input, this field will contain the name of the event. + string trigger_event = 14; + + // If [DTMF][google.cloud.dialogflow.cx.v3.DtmfInput] was provided as input, + // this field will contain the DTMF digits. + string dtmf_digits = 17; + } + + // The language code specified in the [original + // request][QueryInput.language_code]. + string language_code = 15; + + // Always present. Information about the fulfillment that triggered this + // webhook call. + FulfillmentInfo fulfillment_info = 6; + + // Information about the last matched intent. + IntentInfo intent_info = 3; + + // Information about page status. + PageInfo page_info = 4; + + // Information about session status. + SessionInfo session_info = 5; + + // The list of rich message responses to present to the user. Webhook can + // choose to append or replace this list in + // [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3.WebhookResponse.fulfillment_response]; + repeated ResponseMessage messages = 7; + + // Custom data set in + // [QueryParameters.payload][google.cloud.dialogflow.cx.v3.QueryParameters.payload]. + google.protobuf.Struct payload = 8; + + // The sentiment analysis result of the current user request. The field is + // filled when sentiment analysis is configured to be enabled for the request. + SentimentAnalysisResult sentiment_analysis_result = 9; + + // Information about the language of the request. + LanguageInfo language_info = 18; +} + +// The response message for a webhook call. +message WebhookResponse { + // Represents a fulfillment response to the user. + message FulfillmentResponse { + // Defines merge behavior for `messages`. + enum MergeBehavior { + // Not specified. `APPEND` will be used. + MERGE_BEHAVIOR_UNSPECIFIED = 0; + + // `messages` will be appended to the list of messages waiting to be sent + // to the user. + APPEND = 1; + + // `messages` will replace the list of messages waiting to be sent to the + // user. + REPLACE = 2; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // Merge behavior for `messages`. + MergeBehavior merge_behavior = 2; + } + + // The fulfillment response to send to the user. This field can be omitted by + // the webhook if it does not intend to send any response to the user. + FulfillmentResponse fulfillment_response = 1; + + // Information about page status. This field can be omitted by the webhook if + // it does not intend to modify page status. + PageInfo page_info = 2; + + // Information about session status. This field can be omitted by the webhook + // if it does not intend to modify session status. + SessionInfo session_info = 3; + + // Value to append directly to + // [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3.QueryResult.webhook_payloads]. + google.protobuf.Struct payload = 4; + + // The target to transition to. This can be set optionally to indicate an + // immediate transition to a different page in the same host flow, or a + // different flow in the same agent. + oneof transition { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 6 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// Represents page information communicated to and from the webhook. +message PageInfo { + // Represents form information. + message FormInfo { + // Represents parameter information. + message ParameterInfo { + // Represents the state of a parameter. + enum ParameterState { + // Not specified. This value should be never used. + PARAMETER_STATE_UNSPECIFIED = 0; + + // Indicates that the parameter does not have a value. + EMPTY = 1; + + // Indicates that the parameter value is invalid. This field can be used + // by the webhook to invalidate the parameter and ask the server to + // collect it from the user again. + INVALID = 2; + + // Indicates that the parameter has a value. + FILLED = 3; + } + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. + // Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. + // The human-readable name of the parameter, unique within the form. This + // field cannot be modified by the webhook. + string display_name = 1; + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. + // Indicates whether the parameter is required. Optional parameters will + // not trigger prompts; however, they are filled if the user specifies + // them. Required parameters must be filled before form filling concludes. + bool required = 2; + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. + // Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The + // state of the parameter. This field can be set to + // [INVALID][google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] + // by the webhook to invalidate the parameter; other values set by the + // webhook will be ignored. + ParameterState state = 3; + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The + // value of the parameter. This field can be set by the webhook to change + // the parameter value. + google.protobuf.Value value = 4; + + // Optional for + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored + // for [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. + // Indicates if the parameter value was just collected on the last + // conversation turn. + bool just_collected = 5; + } + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The + // parameters contained in the form. Note that the webhook cannot add or + // remove any form parameter. + repeated ParameterInfo parameter_info = 2; + } + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored for + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The + // unique identifier of the current page. Format: + // `projects//locations//agents//flows//pages/`. + string current_page = 1 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored for + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The + // display name of the current page. + string display_name = 4; + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. + // Information about the form. + FormInfo form_info = 3; +} + +// Represents session information communicated to and from the webhook. +message SessionInfo { + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Ignored for + // [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. The + // unique identifier of the + // [session][google.cloud.dialogflow.cx.v3.DetectIntentRequest.session]. This + // field can be used by the webhook to identify a session. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/` + // if environment is specified. + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // Optional for + // [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Optional + // for [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. All + // parameters collected from forms and intents during the session. Parameters + // can be created, updated, or removed by the webhook. To remove a parameter + // from the session, the webhook should explicitly set the parameter value to + // null in [WebhookResponse][google.cloud.dialogflow.cx.v3.WebhookResponse]. + // The map is keyed by parameters' display names. + map parameters = 2; +} + +// Represents the language information of the request. +message LanguageInfo { + // The language code specified in the original + // [request][google.cloud.dialogflow.cx.v3.QueryInput.language_code]. + string input_language_code = 1; + + // The language code detected for this request based on the user + // conversation. + string resolved_language_code = 2; + + // The confidence score of the detected language between 0 and 1. + float confidence_score = 3; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto new file mode 100644 index 000000000000..679fd12b9b72 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto @@ -0,0 +1,130 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/dialogflow/cx/v3beta1/gcs.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "AdvancedSettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Hierarchical advanced settings for agent/flow/page/fulfillment/parameter. +// Settings exposed at lower level overrides the settings exposed at higher +// level. Overriding occurs at the sub-setting level. For example, the +// playback_interruption_settings at fulfillment level only overrides the +// playback_interruption_settings at the agent level, leaving other settings +// at the agent level unchanged. +// +// DTMF settings does not override each other. DTMF settings set at different +// levels define DTMF detections running in parallel. +// +// Hierarchy: Agent->Flow->Page->Fulfillment/Parameter. +message AdvancedSettings { + // Define behaviors of speech to text detection. + message SpeechSettings { + // Sensitivity of the speech model that detects the end of speech. + // Scale from 0 to 100. + int32 endpointer_sensitivity = 1; + + // Timeout before detecting no speech. + google.protobuf.Duration no_speech_timeout = 2; + + // Use timeout based endpointing, interpreting endpointer sensitivity as + // seconds of timeout value. + bool use_timeout_based_endpointing = 3; + + // Mapping from language to Speech-to-Text model. The mapped Speech-to-Text + // model will be selected for requests from its corresponding language. + // For more information, see + // [Speech + // models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models). + map models = 5; + } + + // Define behaviors for DTMF (dual tone multi frequency). + message DtmfSettings { + // If true, incoming audio is processed for DTMF (dual tone multi frequency) + // events. For example, if the caller presses a button on their telephone + // keypad and DTMF processing is enabled, Dialogflow will detect the + // event (e.g. a "3" was pressed) in the incoming audio and pass the event + // to the bot to drive business logic (e.g. when 3 is pressed, return the + // account balance). + bool enabled = 1; + + // Max length of DTMF digits. + int32 max_digits = 2; + + // The digit that terminates a DTMF digit sequence. + string finish_digit = 3; + + // Interdigit timeout setting for matching dtmf input to regex. + google.protobuf.Duration interdigit_timeout_duration = 6; + + // Endpoint timeout setting for matching dtmf input to regex. + google.protobuf.Duration endpointing_timeout_duration = 7; + } + + // Define behaviors on logging. + message LoggingSettings { + // Enables Google Cloud Logging. + bool enable_stackdriver_logging = 2; + + // Enables DF Interaction logging. + bool enable_interaction_logging = 3; + + // Enables consent-based end-user input redaction, if true, a pre-defined + // session parameter `$session.params.conversation-redaction` will be + // used to determine if the utterance should be redacted. + bool enable_consent_based_redaction = 4; + } + + // If present, incoming audio is exported by Dialogflow to the configured + // Google Cloud Storage destination. + // Exposed at the following levels: + // - Agent level + // - Flow level + GcsDestination audio_export_gcs_destination = 2; + + // Settings for speech to text detection. + // Exposed at the following levels: + // - Agent level + // - Flow level + // - Page level + // - Parameter level + SpeechSettings speech_settings = 3; + + // Settings for DTMF. + // Exposed at the following levels: + // - Agent level + // - Flow level + // - Page level + // - Parameter level. + DtmfSettings dtmf_settings = 5; + + // Settings for logging. + // Settings for Dialogflow History, Contact Center messages, StackDriver logs, + // and speech logging. + // Exposed at the following levels: + // - Agent level. + LoggingSettings logging_settings = 6; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto new file mode 100644 index 000000000000..f2c54c2d0db0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto @@ -0,0 +1,789 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/audio_config.proto"; +import "google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/cloud/dialogflow/cx/v3beta1/generative_settings.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; + +// Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent]. +service Agents { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all agents in the specified location. + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*}/agents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an agent in the specified location. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateAgent(CreateAgentRequest) returns (Agent) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}/agents" + body: "agent" + }; + option (google.api.method_signature) = "parent,agent"; + } + + // Updates the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { + option (google.api.http) = { + patch: "/v3beta1/{agent.name=projects/*/locations/*/agents/*}" + body: "agent" + }; + option (google.api.method_signature) = "agent,update_mask"; + } + + // Deletes the specified agent. + rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Exports the specified agent to a binary file. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: + // [ExportAgentResponse][google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse] + rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportAgentResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Restores the specified agent from a binary file. + // + // Replaces the current agent with a new one. Note that all existing resources + // in agent (e.g. intents, entity types, flows) will be removed. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: An [Empty + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*}:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } + + // Validates the specified agent and creates or updates validation results. + // The agent in draft version is validated. Please call this API after the + // training is completed to get the complete validation results. + rpc ValidateAgent(ValidateAgentRequest) returns (AgentValidationResult) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*}:validate" + body: "*" + }; + } + + // Gets the latest agent validation result. Agent validation is performed + // when ValidateAgent is called. + rpc GetAgentValidationResult(GetAgentValidationResultRequest) + returns (AgentValidationResult) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/validationResult}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the generative settings for the agent. + rpc GetGenerativeSettings(GetGenerativeSettingsRequest) + returns (GenerativeSettings) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/generativeSettings}" + }; + option (google.api.method_signature) = "name,language_code"; + } + + // Updates the generative settings for the agent. + rpc UpdateGenerativeSettings(UpdateGenerativeSettingsRequest) + returns (GenerativeSettings) { + option (google.api.http) = { + patch: "/v3beta1/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}" + body: "generative_settings" + }; + option (google.api.method_signature) = "generative_settings,update_mask"; + } +} + +// Settings related to speech recognition. +message SpeechToTextSettings { + // Whether to use speech adaptation for speech recognition. + bool enable_speech_adaptation = 1; +} + +// Agents are best described as Natural Language Understanding (NLU) modules +// that transform user requests into actionable data. You can include agents +// in your app, product, or service to determine user intent and respond to the +// user in a natural way. +// +// After you create an agent, you can add +// [Intents][google.cloud.dialogflow.cx.v3beta1.Intent], [Entity +// Types][google.cloud.dialogflow.cx.v3beta1.EntityType], +// [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], +// [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], +// [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], +// [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] +// and so on to manage the conversation flows. +message Agent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Agent" + pattern: "projects/{project}/locations/{location}/agents/{agent}" + }; + + // Settings for connecting to Git repository for an agent. + message GitIntegrationSettings { + // Settings of integration with GitHub. + message GithubSettings { + // The unique repository display name for the GitHub repository. + string display_name = 1; + + // The GitHub repository URI related to the agent. + string repository_uri = 2; + + // The branch of the GitHub repository tracked for this agent. + string tracking_branch = 3; + + // The access token used to authenticate the access to the GitHub + // repository. + string access_token = 4; + + // A list of branches configured to be used from Dialogflow. + repeated string branches = 5; + } + + // Integration settings for a Git service hosted on Cloud Run. + message GitConnectionSettings { + // Required. Display name for the repository + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Git server reporitory URI. + string repository_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Default branch of the repository. + string tracking_branch = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of branches configured for the repository. + repeated string branches = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Support auth types. + oneof git_authentication { + // The name of the SecretManager secret version resource storing the + // git access token. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string access_token_secret = 5 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; + } + } + + // The git settings to specific systems. + oneof git_settings { + // GitHub settings. + GithubSettings github_settings = 1; + + // Git connection settings. + GitConnectionSettings git_connection_settings = 2; + } + } + + // Settings for Gen App Builder. + message GenAppBuilderSettings { + // Required. The full name of the Gen App Builder engine related to this + // agent if there is one. Format: `projects/{Project ID}/locations/{Location + // ID}/collections/{Collection ID}/engines/{Engine ID}` + string engine = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Settings for answer feedback collection. + message AnswerFeedbackSettings { + // Optional. If enabled, end users will be able to provide + // [answer feedback][google.cloud.dialogflow.cx.v3beta1.AnswerFeedback] to + // Dialogflow responses. Feature works only if interaction logging is + // enabled in the Dialogflow agent. + bool enable_answer_feedback = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for end user personalization. + message PersonalizationSettings { + // Optional. Default end user metadata, used when processing DetectIntent + // requests. Recommended to be filled as a template instead of hard-coded + // value, for example { "age": "$session.params.age" }. The data will be + // merged with the + // [QueryParameters.end_user_metadata][google.cloud.dialogflow.cx.v3beta1.QueryParameters.end_user_metadata] + // in + // [DetectIntentRequest.query_params][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.query_params] + // during query processing. + google.protobuf.Struct default_end_user_metadata = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for custom client certificates. + message ClientCertificateSettings { + // Required. The ssl certificate encoded in PEM format. This string must + // include the begin header and end footer lines. + string ssl_certificate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing + // the private key encoded in PEM format. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string private_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Optional. The name of the SecretManager secret version resource storing + // the passphrase. 'passphrase' should be left unset if the private key is + // not encrypted. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string passphrase = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // The unique identifier of the agent. + // Required for the + // [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] + // method. + // [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent] + // populates the name automatically. + // Format: `projects//locations//agents/`. + string name = 1; + + // Required. The human-readable name of the agent, unique within the location. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The default language of the agent as a language tag. + // See [Language + // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // for a list of the currently supported language codes. + // This field cannot be set by the + // [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] + // method. + string default_language_code = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The list of all languages supported by the agent (except for the + // `default_language_code`). + repeated string supported_language_codes = 4; + + // Required. The time zone of the agent from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. + string time_zone = 5 [(google.api.field_behavior) = REQUIRED]; + + // The description of the agent. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 6; + + // The URI of the agent's avatar. Avatars are used throughout the Dialogflow + // console and in the self-hosted [Web + // Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + // integration. + string avatar_uri = 7; + + // Speech recognition related settings. + SpeechToTextSettings speech_to_text_settings = 13; + + // The resource to start the conversations with for the agent. + oneof session_entry_resource { + // Name of the start flow in this agent. A start flow will be automatically + // created when the agent is created, and can only be deleted by deleting + // the agent. + // Format: + // `projects//locations//agents//flows/`. + // Currently only the default start flow with id + // "00000000-0000-0000-0000-000000000000" is allowed. + string start_flow = 16 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + + // Name of the start playbook in this agent. A start playbook will be + // automatically created when the agent is created, and can only be deleted + // by deleting the agent. + // Format: + // `projects//locations//agents//playbooks/`. + // Currently only the + // default playbook with id + // "00000000-0000-0000-0000-000000000000" is allowed. + string start_playbook = 39 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + }]; + } + + // Name of the + // [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] + // reference for the agent. Format: + // `projects//locations//securitySettings/`. + string security_settings = 17 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + }]; + + // Indicates if stackdriver logging is enabled for the agent. + // Please use + // [agent.advanced_settings][google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings] + // instead. + bool enable_stackdriver_logging = 18 [deprecated = true]; + + // Indicates if automatic spell correction is enabled in detect intent + // requests. + bool enable_spell_correction = 20; + + // Optional. Enable training multi-lingual models for this agent. These models + // will be trained on all the languages supported by the agent. + bool enable_multi_language_training = 40 + [(google.api.field_behavior) = OPTIONAL]; + + // Indicates whether the agent is locked for changes. If the agent is locked, + // modifications to the agent will be rejected except for [RestoreAgent][]. + bool locked = 27; + + // Hierarchical advanced settings for this agent. The settings exposed at the + // lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 22; + + // Git integration settings for this agent. + GitIntegrationSettings git_integration_settings = 30; + + // Optional. The BigQuery export settings for this agent. The conversation + // data will be exported to BigQuery tables if it is enabled. By default, + // BigQuery export settings will not be exported with agent. You need to set + // [include_bigquery_export_settings][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.include_bigquery_export_settings] + // to include it in the exported agent. + BigQueryExportSettings bigquery_export_settings = 29 + [(google.api.field_behavior) = OPTIONAL]; + + // Settings on instructing the speech synthesizer on how to generate the + // output audio content. + TextToSpeechSettings text_to_speech_settings = 31; + + // Gen App Builder-related agent-level settings. + optional GenAppBuilderSettings gen_app_builder_settings = 33; + + // Optional. Answer feedback collection settings. + AnswerFeedbackSettings answer_feedback_settings = 38 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for end user personalization. + PersonalizationSettings personalization_settings = 42 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for custom client certificates. + ClientCertificateSettings client_certificate_settings = 43 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. A read only boolean field reflecting Zone Separation + // status of the agent. + optional bool satisfies_pzs = 45 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Output only. A read only boolean field reflecting Zone Isolation + // status of the agent. + optional bool satisfies_pzi = 46 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; +} + +// The request message for +// [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. +message ListAgentsRequest { + // Required. The location to list all agents for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. +message ListAgentsResponse { + // The list of agents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Agent agents = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Agents.GetAgent][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgent]. +message GetAgentRequest { + // Required. The name of the agent. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for +// [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]. +message CreateAgentRequest { + // Required. The location to create a agent for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to create. + Agent agent = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent]. +message UpdateAgentRequest { + // Required. The agent to update. + Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgent]. +message DeleteAgentRequest { + // Required. The name of the agent to delete. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for +// [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. +message ExportAgentRequest { + // Data format of the exported agent. + enum DataFormat { + // Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0; + + // Agent content will be exported as raw bytes. + BLOB = 1; + + // Agent content will be exported in JSON Package format. + JSON_PACKAGE = 4; + } + + // Settings for exporting to a git branch. + message GitDestination { + // Tracking branch for the git push. + string tracking_branch = 1; + + // Commit message for the git push. + string commit_message = 2; + } + + // Required. The name of the agent to export. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the agent + // to. The format of this URI must be `gs:///`. If + // left unspecified, the serialized agent is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string agent_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data format of the exported agent. If not specified, `BLOB` + // is assumed. + DataFormat data_format = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Environment name. If not set, draft environment is assumed. + // Format: + // `projects//locations//agents//environments/`. + string environment = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Optional. The Git branch to export the agent to. + GitDestination git_destination = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include BigQuery Export setting. + bool include_bigquery_export_settings = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. +message ExportAgentResponse { + // The exported agent. + oneof agent { + // The URI to a file containing the exported agent. This field is populated + // if `agent_uri` is specified in + // [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest]. + string agent_uri = 1; + + // Uncompressed raw byte content for agent. This field is populated + // if none of `agent_uri` and `git_destination` are specified in + // [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest]. + bytes agent_content = 2; + + // Commit SHA of the git push. This field is populated if + // `git_destination` is specified in + // [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest]. + string commit_sha = 3; + } +} + +// The request message for +// [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgent]. +message RestoreAgentRequest { + // Settings for restoring from a git branch + message GitSource { + // tracking branch for the git pull + string tracking_branch = 1; + } + + // Restore option. + enum RestoreOption { + // Unspecified. Treated as KEEP. + RESTORE_OPTION_UNSPECIFIED = 0; + + // Always respect the settings from the exported agent file. It may cause + // a restoration failure if some settings (e.g. model type) are not + // supported in the target agent. + KEEP = 1; + + // Fallback to default settings if some settings are not supported in the + // target agent. + FALLBACK = 2; + } + + // Required. The name of the agent to restore into. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to restore. + oneof agent { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to restore agent from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string agent_uri = 2; + + // Uncompressed raw byte content for agent. + bytes agent_content = 3; + + // Setting for restoring from a git branch + GitSource git_source = 6; + } + + // Agent restore mode. If not specified, `KEEP` is assumed. + RestoreOption restore_option = 5; +} + +// The request message for +// [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ValidateAgent]. +message ValidateAgentRequest { + // Required. The agent to validate. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The request message for +// [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentValidationResult]. +message GetAgentValidationResultRequest { + // Required. The agent name. + // Format: + // `projects//locations//agents//validationResult`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/AgentValidationResult" + } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The response message for +// [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentValidationResult]. +message AgentValidationResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/AgentValidationResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/validationResult" + }; + + // The unique identifier of the agent validation result. + // Format: + // `projects//locations//agents//validationResult`. + string name = 1; + + // Contains all flow validation results. + repeated FlowValidationResult flow_validation_results = 2; +} + +// Request for +// [GetGenerativeSettings][google.cloud.dialogflow.cx.v3beta1.Agents.GetGenerativeSettings] +// RPC. +message GetGenerativeSettingsRequest { + // Required. Format: + // `projects//locations//agents//generativeSettings`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/AgentGenerativeSettings" + } + ]; + + // Required. Language code of the generative settings. + string language_code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [UpdateGenerativeSettings][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateGenerativeSettings] +// RPC. +message UpdateGenerativeSettingsRequest { + // Required. Generative settings to update. + GenerativeSettings generative_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which fields get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto new file mode 100644 index 000000000000..9ae05c99f8f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto @@ -0,0 +1,377 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "AudioConfigProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; +option (google.api.resource_definition) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" +}; + +// Audio encoding of the audio content sent in the conversational query request. +// Refer to the +// [Cloud Speech API +// documentation](https://cloud.google.com/speech-to-text/docs/basics) for more +// details. +enum AudioEncoding { + // Not specified. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // LINT: LEGACY_NAMES + AUDIO_ENCODING_LINEAR_16 = 1; + + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is lossless (therefore + // recognition is not compromised) and requires only about half the + // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + // 24-bit samples, however, not all fields in `STREAMINFO` are supported. + AUDIO_ENCODING_FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AUDIO_ENCODING_AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Dialogflow API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + + // 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + AUDIO_ENCODING_ALAW = 8; +} + +// Variant of the specified [Speech +// model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use. +// +// See the [Cloud Speech +// documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) +// for which models have different variants. For example, the "phone_call" model +// has both a standard and an enhanced variant. When you use an enhanced model, +// you will generally receive higher quality results than for a standard model. +enum SpeechModelVariant { + // No model variant specified. In this case Dialogflow defaults to + // USE_BEST_AVAILABLE. + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + + // Use the best available variant of the [Speech + // model][InputAudioConfig.model] that the caller is eligible for. + USE_BEST_AVAILABLE = 1; + + // Use standard model variant even if an enhanced model is available. See the + // [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // for details about enhanced models. + USE_STANDARD = 2; + + // Use an enhanced model variant: + // + // * If an enhanced variant does not exist for the given + // [model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] and + // request language, Dialogflow falls back to the standard variant. + // + // The [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // describes which models have enhanced variants. + USE_ENHANCED = 3; +} + +// Information for a word recognized by the speech recognizer. +message SpeechWordInfo { + // The word this info is for. + string word = 3; + + // Time offset relative to the beginning of the audio that corresponds to the + // start of the spoken word. This is an experimental feature and the accuracy + // of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio that corresponds to the + // end of the spoken word. This is an experimental feature and the accuracy of + // the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The Speech confidence between 0.0 and 1.0 for this word. A higher number + // indicates an estimated greater likelihood that the recognized word is + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. + // + // This field is not guaranteed to be fully stable over time for the same + // audio input. Users should also not rely on it to always be provided. + float confidence = 4; +} + +// Configuration of the barge-in behavior. Barge-in instructs the API to return +// a detected utterance at a proper time while the client is playing back the +// response audio from a previous request. When the client sees the +// utterance, it should stop the playback and immediately get ready for +// receiving the responses for the current request. +// +// The barge-in handling requires the client to start streaming audio input +// as soon as it starts playing back the audio from the previous response. The +// playback is modeled into two phases: +// +// * No barge-in phase: which goes first and during which speech detection +// should not be carried out. +// +// * Barge-in phase: which follows the no barge-in phase and during which +// the API starts speech detection and may inform the client that an utterance +// has been detected. Note that no-speech event is not expected in this +// phase. +// +// The client provides this configuration in terms of the durations of those +// two phases. The durations are measured in terms of the audio length from the +// start of the input audio. +// +// No-speech event is a response with END_OF_UTTERANCE without any transcript +// following up. +message BargeInConfig { + // Duration that is not eligible for barge-in at the beginning of the input + // audio. + google.protobuf.Duration no_barge_in_duration = 1; + + // Total duration for the playback at the beginning of the input audio. + google.protobuf.Duration total_duration = 2; +} + +// Instructs the speech recognizer on how to process the audio content. +message InputAudioConfig { + // Required. Audio encoding of the audio content to process. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Sample rate (in Hertz) of the audio content sent in the query. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics) for + // more details. + int32 sample_rate_hertz = 2; + + // Optional. If `true`, Dialogflow returns + // [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in + // [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] + // with information about the recognized speech words, e.g. start and end time + // offsets. If false or unspecified, Speech doesn't return any word-level + // information. + bool enable_word_info = 13; + + // Optional. A list of strings containing words and phrases that the speech + // recognizer should recognize with higher likelihood. + // + // See [the Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + // for more details. + repeated string phrase_hints = 4; + + // Optional. Which Speech model to select for the given request. + // For more information, see + // [Speech + // models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models). + string model = 7; + + // Optional. Which variant of the [Speech + // model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use. + SpeechModelVariant model_variant = 10; + + // Optional. If `false` (default), recognition does not cease until the + // client closes the stream. + // If `true`, the recognizer will detect a single spoken utterance in input + // audio. Recognition ceases when it detects the audio's voice has + // stopped or paused. In this case, once a detected intent is received, the + // client should close the stream and start a new request with a new stream as + // needed. + // Note: This setting is relevant only for streaming methods. + bool single_utterance = 8; + + // Configuration of barge-in behavior during the streaming of input audio. + BargeInConfig barge_in_config = 15; + + // If `true`, the request will opt out for STT conformer model migration. + // This field will be deprecated once force migration takes place in June + // 2024. Please refer to [Dialogflow CX Speech model + // migration](https://cloud.google.com/dialogflow/cx/docs/concept/speech-model-migration). + bool opt_out_conformer_model_migration = 26; +} + +// Gender of the voice as described in +// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). +enum SsmlVoiceGender { + // An unspecified gender, which means that the client doesn't care which + // gender the selected voice will have. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + SSML_VOICE_GENDER_MALE = 1; + + // A female voice. + SSML_VOICE_GENDER_FEMALE = 2; + + // A gender-neutral voice. + SSML_VOICE_GENDER_NEUTRAL = 3; +} + +// Description of which voice to use for speech synthesis. +message VoiceSelectionParams { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and + // [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender]. + // + // For the list of available voices, please refer to [Supported voices and + // languages](https://cloud.google.com/text-to-speech/docs/voices). + string name = 1; + + // Optional. The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note + // that this is only a preference, not requirement. If a voice of the + // appropriate gender is not available, the synthesizer should substitute a + // voice with a different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 2; +} + +// Configuration of how speech should be synthesized. +message SynthesizeSpeechConfig { + // Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + // native speed supported by the specific voice. 2.0 is twice as fast, and + // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + // other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 1; + + // Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + // semitones from the original pitch. -20 means decrease 20 semitones from the + // original pitch. + double pitch = 2; + + // Optional. Volume gain (in dB) of the normal native volume supported by the + // specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + // will play at approximately half the amplitude of the normal native signal + // amplitude. A value of +6.0 (dB) will play at approximately twice the + // amplitude of the normal native signal amplitude. We strongly recommend not + // to exceed +10 (dB) as there's usually no effective increase in loudness for + // any value greater than that. + double volume_gain_db = 3; + + // Optional. An identifier which selects 'audio effects' profiles that are + // applied on (post synthesized) text to speech. Effects are applied on top of + // each other in the order they are given. + repeated string effects_profile_id = 5; + + // Optional. The desired voice of the synthesized audio. + VoiceSelectionParams voice = 4; +} + +// Audio encoding of the output audio format in Text-To-Speech. +enum OutputAudioEncoding { + // Not specified. + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + // LINT: LEGACY_NAMES + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + + // MP3 audio at 64kbps. + OUTPUT_AUDIO_ENCODING_MP3 = 2 [deprecated = true]; + + // MP3 audio at 64kbps. + // LINT: LEGACY_NAMES + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + OUTPUT_AUDIO_ENCODING_MULAW = 5; + + // 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + OUTPUT_AUDIO_ENCODING_ALAW = 6; +} + +// Instructs the speech synthesizer how to generate the output audio content. +message OutputAudioConfig { + // Required. Audio encoding of the synthesized audio content. + OutputAudioEncoding audio_encoding = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The synthesis sample rate (in hertz) for this audio. If not + // provided, then the synthesizer will use the default sample rate based on + // the audio encoding. If this is different from the voice's natural sample + // rate, then the synthesizer will honor this request by converting to the + // desired sample rate (which might result in worse audio quality). + int32 sample_rate_hertz = 2; + + // Optional. Configuration of how speech should be synthesized. + // If not specified, + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3beta1.Agent.text_to_speech_settings] + // is applied. + SynthesizeSpeechConfig synthesize_speech_config = 3; +} + +// Settings related to speech synthesizing. +message TextToSpeechSettings { + // Configuration of how speech should be synthesized, mapping from language + // (https://cloud.google.com/dialogflow/cx/docs/reference/language) to + // SynthesizeSpeechConfig. + // + // These settings affect: + // + // - The [phone + // gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway) + // synthesize configuration set via + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3beta1.Agent.text_to_speech_settings]. + // + // - How speech is synthesized when invoking + // [session][google.cloud.dialogflow.cx.v3beta1.Sessions] APIs. + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3beta1.Agent.text_to_speech_settings] + // only applies if + // [OutputAudioConfig.synthesize_speech_config][google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.synthesize_speech_config] + // is not specified. + map synthesize_speech_configs = 1; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto new file mode 100644 index 000000000000..229216477929 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto @@ -0,0 +1,34 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "BigQueryExportProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// The settings of BigQuery export. +message BigQueryExportSettings { + // The field to indicate whether the BigQuery export is enabled. + bool enabled = 1; + + // The BigQuery table to export. + // Format: `projects//datasets//tables/`. + string bigquery_table = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto new file mode 100644 index 000000000000..f01fb39afd46 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto @@ -0,0 +1,159 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ChangelogProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [Changelogs][google.cloud.dialogflow.cx.v3beta1.Changelog]. +service Changelogs { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of Changelogs. + rpc ListChangelogs(ListChangelogsRequest) returns (ListChangelogsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/changelogs" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified Changelog. + rpc GetChangelog(GetChangelogRequest) returns (Changelog) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/changelogs/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3beta1.Changelogs.ListChangelogs]. +message ListChangelogsRequest { + // Required. The agent containing the changelogs. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Changelog" + } + ]; + + // The filter string. Supports filter by user_email, resource, type and + // create_time. Some examples: + // 1. By user email: + // user_email = "someone@google.com" + // 2. By resource name: + // resource = "projects/123/locations/global/agents/456/flows/789" + // 3. By resource display name: + // display_name = "my agent" + // 4. By action: + // action = "Create" + // 5. By type: + // type = "flows" + // 6. By create time. Currently predicates on `create_time` and + // `create_time_epoch_seconds` are supported: + // create_time_epoch_seconds > 1551790877 AND create_time <= + // 2017-01-15T01:30:15.01Z + // 7. Combination of above filters: + // resource = "projects/123/locations/global/agents/456/flows/789" + // AND user_email = "someone@google.com" + // AND create_time <= 2017-01-15T01:30:15.01Z + string filter = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3beta1.Changelogs.ListChangelogs]. +message ListChangelogsResponse { + // The list of changelogs. There will be a maximum number of items returned + // based on the page_size field in the request. The changelogs will be ordered + // by timestamp. + repeated Changelog changelogs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Changelogs.GetChangelog][google.cloud.dialogflow.cx.v3beta1.Changelogs.GetChangelog]. +message GetChangelogRequest { + // Required. The name of the changelog to get. + // Format: + // `projects//locations//agents//changelogs/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Changelog" + } + ]; +} + +// Changelogs represents a change made to a given agent. +message Changelog { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Changelog" + pattern: "projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}" + }; + + // The unique identifier of the changelog. + // Format: + // `projects//locations//agents//changelogs/`. + string name = 1; + + // Email address of the authenticated user. + string user_email = 2; + + // The affected resource display name of the change. + string display_name = 7; + + // The action of the change. + string action = 11; + + // The affected resource type. + string type = 8; + + // The affected resource name of the change. + string resource = 3; + + // The timestamp of the change. + google.protobuf.Timestamp create_time = 4; + + // The affected language code of the change. + string language_code = 14; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto new file mode 100644 index 000000000000..13490ac0ac25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto @@ -0,0 +1,32 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "CodeBlockProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Represents a code block. +message CodeBlock { + // Optional. Source code of the block in Python. + string code = 1 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto new file mode 100644 index 000000000000..81ed6c662b77 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto @@ -0,0 +1,386 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/environment.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/cloud/dialogflow/cx/v3beta1/intent.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/cloud/dialogflow/cx/v3beta1/session.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ConversationHistoryProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing conversation history. +service ConversationHistory { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all conversations. + rpc ListConversations(ListConversationsRequest) + returns (ListConversationsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/conversations" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified conversation. + rpc GetConversation(GetConversationRequest) returns (Conversation) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified conversation. + rpc DeleteConversation(DeleteConversationRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for [Conversations.GetConversation][]. +message GetConversationRequest { + // Required. The name of the conversation. + // Format: + // `projects//locations//agents//conversations/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; +} + +// The request message for [Conversations.DeleteConversation][]. +message DeleteConversationRequest { + // Required. The name of the conversation. + // Format: + // `projects//locations//agents//conversations/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; +} + +// The request message for [Conversations.ListConversations][]. +message ListConversationsRequest { + // Required. The agent to list all conversations for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Conversation" + } + ]; + + // Optional. The filter string. Supports filter by create_time, + // metrics.has_end_interaction, metrics.has_live_agent_handoff, + // intents.display_name, pages.display_name and flows.display_name. Timestamps + // expect an [RFC-3339][https://datatracker.ietf.org/doc/html/rfc3339] + // formatted string (e.g. 2012-04-21T11:30:00-04:00). UTC offsets are + // supported. Some examples: + // 1. By create time: + // create_time > "2022-04-21T11:30:00-04:00" + // 2. By intent display name: + // intents.display_name : "billing" + // 3. By end interaction signal: + // metrics.has_end_interaction = true + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Conversations.ListConversations][]. +message ListConversationsResponse { + // The list of conversations. There will be a maximum number of items returned + // based on the + // [page_size][google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest.page_size] + // field. The returned conversations will be sorted by start_time in + // descending order (newest conversation first). + repeated Conversation conversations = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Represents a conversation. +message Conversation { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Conversation" + pattern: "projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}" + plural: "conversations" + singular: "conversation" + }; + + // Represents the type of a conversation. + enum Type { + // Not specified. This value should never be used. + TYPE_UNSPECIFIED = 0; + + // Audio conversation. A conversation is classified as an audio conversation + // if any request has STT input audio or any response has TTS output audio. + AUDIO = 1; + + // Text conversation. A conversation is classified as a text conversation + // if any request has text input and no request has STT input audio and no + // response has TTS output audio. + TEXT = 2; + + // Default conversation type for a conversation. A conversation is + // classified as undetermined if none of the requests contain text or audio + // input (eg. event or intent input). + UNDETERMINED = 3; + } + + // Represents metrics for the conversation. + message Metrics { + // Count by types of + // [QueryInput][google.cloud.dialogflow.cx.v3beta1.QueryInput] of the + // requests in the conversation. + message QueryInputCount { + // The number of [TextInput][google.cloud.dialogflow.cx.v3beta1.TextInput] + // in the conversation. + int32 text_count = 1; + + // The number of + // [IntentInput][google.cloud.dialogflow.cx.v3beta1.IntentInput] in the + // conversation. + int32 intent_count = 2; + + // The number of + // [AudioInput][google.cloud.dialogflow.cx.v3beta1.AudioInput] in the + // conversation. + int32 audio_count = 3; + + // The number of + // [EventInput][google.cloud.dialogflow.cx.v3beta1.EventInput] in the + // conversation. + int32 event_count = 4; + + // The number of [DtmfInput][google.cloud.dialogflow.cx.v3beta1.DtmfInput] + // in the conversation. + int32 dtmf_count = 5; + } + + // Count by + // [Match.MatchType][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] of + // the matches in the conversation. + message MatchTypeCount { + // The number of matches with type + // [Match.MatchType.MATCH_TYPE_UNSPECIFIED][google.cloud.dialogflow.cx.v3beta1.Match.MatchType.MATCH_TYPE_UNSPECIFIED]. + int32 unspecified_count = 1; + + // The number of matches with type + // [Match.MatchType.INTENT][google.cloud.dialogflow.cx.v3beta1.Match.MatchType.INTENT]. + int32 intent_count = 2; + + // The number of matches with type + // [Match.MatchType.DIRECT_INTENT][google.cloud.dialogflow.cx.v3beta1.Match.MatchType.DIRECT_INTENT]. + int32 direct_intent_count = 3; + + // The number of matches with type + // [Match.MatchType.PARAMETER_FILLING][google.cloud.dialogflow.cx.v3beta1.Match.MatchType.PARAMETER_FILLING]. + int32 parameter_filling_count = 4; + + // The number of matches with type + // [Match.MatchType.NO_MATCH][google.cloud.dialogflow.cx.v3beta1.Match.MatchType.NO_MATCH]. + int32 no_match_count = 5; + + // The number of matches with type + // [Match.MatchType.NO_INPUT][google.cloud.dialogflow.cx.v3beta1.Match.MatchType.NO_INPUT]. + int32 no_input_count = 6; + + // The number of matches with type + // [Match.MatchType.EVENT][google.cloud.dialogflow.cx.v3beta1.Match.MatchType.EVENT]. + int32 event_count = 7; + } + + // The number of interactions in the conversation. + int32 interaction_count = 1; + + // Duration of all the input's audio in the conversation. + google.protobuf.Duration input_audio_duration = 2; + + // Duration of all the output's audio in the conversation. + google.protobuf.Duration output_audio_duration = 3; + + // Maximum latency of the + // [Webhook][google.cloud.dialogflow.cx.v3beta1.Webhook] calls in the + // conversation. + google.protobuf.Duration max_webhook_latency = 4; + + // A signal that indicates the interaction with the Dialogflow agent has + // ended. + // If any response has the + // [ResponseMessage.end_interaction][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.end_interaction] + // signal, this is set to true. + bool has_end_interaction = 5; + + // Hands off conversation to a human agent. + // If any response has the + // [ResponseMessage.live_agent_handoff][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.live_agent_handoff]signal, + // this is set to true. + bool has_live_agent_handoff = 6; + + // The average confidence all of the + // [Match][google.cloud.dialogflow.cx.v3beta1.Match] in the conversation. + // Values range from 0.0 (completely uncertain) to 1.0 (completely certain). + float average_match_confidence = 7; + + // Query input counts. + QueryInputCount query_input_count = 8; + + // Match type counts. + MatchTypeCount match_type_count = 9; + } + + // Represents an interaction between an end user and a Dialogflow CX agent + // using V3 (Streaming)DetectIntent API, or an interaction between an end user + // and a Dialogflow CX agent using V2 (Streaming)AnalyzeContent API. + message Interaction { + // Information collected for DF CX agents in case NLU predicted an intent + // that was filtered out as being inactive which may indicate a missing + // transition and/or absent functionality. + message MissingTransition { + // Name of the intent that could have triggered. + string intent_display_name = 1; + + // Score of the above intent. The higher it is the more likely a + // transition was missed on a given page. + float score = 2; + } + + // Metrics of each processing step. + message StepMetrics { + // Name of the request processing step. + string name = 1; + + // Processing latency of the step. + google.protobuf.Duration latency = 2; + } + + // The request of the interaction. + DetectIntentRequest request = 1; + + // The final response of the interaction. + DetectIntentResponse response = 2; + + // The partial responses of the interaction. Empty if there is no partial + // response in the interaction. + // See the + // [partial response + // documentation][https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#queue]. + repeated DetectIntentResponse partial_responses = 3; + + // The input text or the transcript of the input audio in the request. + string request_utterances = 4; + + // The output text or the transcript of the output audio in the responses. + // If multiple output messages are returned, they will be concatenated into + // one. + string response_utterances = 5; + + // The time that the interaction was created. + google.protobuf.Timestamp create_time = 6; + + // Answer feedback for the final response. + AnswerFeedback answer_feedback = 7; + + // Missing transition predicted for the interaction. This field is set only + // if the interaction match type was no-match. + MissingTransition missing_transition = 8; + + // Metrics associated with different processing steps. Names and number of + // steps depend on the request and can change without a notice. + repeated StepMetrics step_metrics = 9; + } + + // Identifier. The identifier of the conversation. + // If conversation ID is reused, interactions happened later than 48 hours of + // the conversation's create time will be ignored. Format: + // `projects//locations//agents//conversations/` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The type of the conversation. + Type type = 2; + + // The language of the conversation, which is the language of the first + // request in the conversation. + string language_code = 3; + + // Start time of the conversation, which is the time of the first request of + // the conversation. + google.protobuf.Timestamp start_time = 4; + + // Duration of the conversation. + google.protobuf.Duration duration = 5; + + // Conversation metrics. + Metrics metrics = 6; + + // All the matched [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] in the + // conversation. Only `name` and `display_name` are filled in this message. + repeated Intent intents = 7; + + // All the [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] the conversation + // has went through. Only `name` and `display_name` are filled in this + // message. + repeated Flow flows = 8; + + // All the [Page][google.cloud.dialogflow.cx.v3beta1.Page] the conversation + // has went through. Only `name` and `display_name` are filled in this + // message. + repeated Page pages = 9; + + // Interactions of the conversation. + // Only populated for `GetConversation` and empty for `ListConversations`. + repeated Interaction interactions = 10; + + // Environment of the conversation. + // Only `name` and `display_name` are filled in this message. + Environment environment = 11; + + // Flow versions used in the conversation. + map flow_versions = 12; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto new file mode 100644 index 000000000000..9fd98d8f92e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto @@ -0,0 +1,260 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "DataStoreConnectionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// A data store connection. It represents a data store in Discovery Engine and +// the type of the contents it contains. +message DataStoreConnection { + // The type of the connected data store. + DataStoreType data_store_type = 1; + + // The full name of the referenced data store. + // Formats: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + // `projects/{project}/locations/{location}/dataStores/{data_store}` + string data_store = 2; + + // The document processing mode for the data store connection. Should only be + // set for PUBLIC_WEB and UNSTRUCTURED data stores. If not set it is + // considered as DOCUMENTS, as this is the legacy mode. + DocumentProcessingMode document_processing_mode = 4; +} + +// Data store connection feature output signals. +// Might be only partially field if processing stop before the final answer. +// Reasons for this can be, but are not limited to: empty UCS search results, +// positive RAI check outcome, grounding failure, ... +message DataStoreConnectionSignals { + // Diagnostic info related to the rewriter model call. + message RewriterModelCallSignals { + // Prompt as sent to the model. + string rendered_prompt = 1; + + // Output of the generative model. + string model_output = 2; + + // Name of the generative model. For example, "gemini-ultra", "gemini-pro", + // "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. + string model = 3; + } + + // Search snippet details. + message SearchSnippet { + // Title of the enclosing document. + string document_title = 1; + + // Uri for the document. Present if specified for the document. + string document_uri = 2; + + // Text included in the prompt. + string text = 3; + + // Metadata associated with the document. + google.protobuf.Struct metadata = 5; + } + + // Diagnostic info related to the answer generation model call. + message AnswerGenerationModelCallSignals { + // Prompt as sent to the model. + string rendered_prompt = 1; + + // Output of the generative model. + string model_output = 2; + + // Name of the generative model. For example, "gemini-ultra", "gemini-pro", + // "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. + string model = 3; + } + + // Answer part with citation. + message AnswerPart { + // Substring of the answer. + string text = 1; + + // Citations for this answer part. Indices of `search_snippets`. + repeated int32 supporting_indices = 2; + } + + // Snippet cited by the answer generation model. + message CitedSnippet { + // Details of the snippet. + SearchSnippet search_snippet = 1; + + // Index of the snippet in `search_snippets` field. + int32 snippet_index = 2; + } + + // Grounding signals. + message GroundingSignals { + // Represents the decision of the grounding check. + enum GroundingDecision { + // Decision not specified. + GROUNDING_DECISION_UNSPECIFIED = 0; + + // Grounding have accepted the answer. + ACCEPTED_BY_GROUNDING = 1; + + // Grounding have rejected the answer. + REJECTED_BY_GROUNDING = 2; + } + + // Grounding score buckets. + enum GroundingScoreBucket { + // Score not specified. + GROUNDING_SCORE_BUCKET_UNSPECIFIED = 0; + + // We have very low confidence that the answer is grounded. + VERY_LOW = 1; + + // We have low confidence that the answer is grounded. + LOW = 3; + + // We have medium confidence that the answer is grounded. + MEDIUM = 4; + + // We have high confidence that the answer is grounded. + HIGH = 5; + + // We have very high confidence that the answer is grounded. + VERY_HIGH = 6; + } + + // Represents the decision of the grounding check. + GroundingDecision decision = 1; + + // Grounding score bucket setting. + GroundingScoreBucket score = 2; + } + + // Safety check results. + message SafetySignals { + // Safety decision. + // All kinds of check are incorporated into this final decision, including + // banned phrases check. + enum SafetyDecision { + // Decision not specified. + SAFETY_DECISION_UNSPECIFIED = 0; + + // No manual or automatic safety check fired. + ACCEPTED_BY_SAFETY_CHECK = 1; + + // One ore more safety checks fired. + REJECTED_BY_SAFETY_CHECK = 2; + } + + // Specifies banned phrase match subject. + enum BannedPhraseMatch { + // No banned phrase check was executed. + BANNED_PHRASE_MATCH_UNSPECIFIED = 0; + + // All banned phrase checks led to no match. + BANNED_PHRASE_MATCH_NONE = 1; + + // A banned phrase matched the query. + BANNED_PHRASE_MATCH_QUERY = 2; + + // A banned phrase matched the response. + BANNED_PHRASE_MATCH_RESPONSE = 3; + } + + // Safety decision. + SafetyDecision decision = 1; + + // Specifies banned phrase match subject. + BannedPhraseMatch banned_phrase_match = 2; + + // The matched banned phrase if there was a match. + string matched_banned_phrase = 3; + } + + // Optional. Diagnostic info related to the rewriter model call. + RewriterModelCallSignals rewriter_model_call_signals = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Rewritten string query used for search. + string rewritten_query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Search snippets included in the answer generation prompt. + repeated SearchSnippet search_snippets = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Diagnostic info related to the answer generation model call. + AnswerGenerationModelCallSignals answer_generation_model_call_signals = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The final compiled answer. + string answer = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Answer parts with relevant citations. + // Concatenation of texts should add up the `answer` (not counting + // whitespaces). + repeated AnswerPart answer_parts = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Snippets cited by the answer generation model from the most to + // least relevant. + repeated CitedSnippet cited_snippets = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Grounding signals. + GroundingSignals grounding_signals = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Safety check result. + SafetySignals safety_signals = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Type of a data store. +// Determines how search is performed in the data store. +enum DataStoreType { + // Not specified. This value indicates that the data store type is not + // specified, so it will not be used during search. + DATA_STORE_TYPE_UNSPECIFIED = 0; + + // A data store that contains public web content. + PUBLIC_WEB = 1; + + // A data store that contains unstructured private data. + UNSTRUCTURED = 2; + + // A data store that contains structured data (for example FAQ). + STRUCTURED = 3; +} + +// The document processing mode of the data store. +enum DocumentProcessingMode { + // Not specified. This should be set for STRUCTURED type data stores. Due to + // legacy reasons this is considered as DOCUMENTS for STRUCTURED and + // PUBLIC_WEB data stores. + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0; + + // Documents are processed as documents. + DOCUMENTS = 1; + + // Documents are converted to chunks. + CHUNKS = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto new file mode 100644 index 000000000000..483b01b7ce7e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto @@ -0,0 +1,176 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "DeploymentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [Deployments][google.cloud.dialogflow.cx.v3beta1.Deployment]. +service Deployments { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all deployments in the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc ListDeployments(ListDeploymentsRequest) + returns (ListDeploymentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [Deployment][google.cloud.dialogflow.cx.v3beta1.Deployment]. + rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents a deployment in an environment. A deployment happens when a flow +// version configured to be active in the environment. You can configure running +// pre-deployment steps, e.g. running validation test cases, experiment +// auto-rollout, etc. +message Deployment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Deployment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}" + }; + + // The state of the deployment. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // The deployment is running. + RUNNING = 1; + + // The deployment succeeded. + SUCCEEDED = 2; + + // The deployment failed. + FAILED = 3; + } + + // Result of the deployment. + message Result { + // Results of test cases running before the deployment. + // Format: + // `projects//locations//agents//testCases//results/`. + repeated string deployment_test_results = 1 + [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCaseResult" + }]; + + // The name of the experiment triggered by this deployment. + // Format: + // projects//locations//agents//environments//experiments/. + string experiment = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + }]; + } + + // The name of the deployment. + // Format: + // projects//locations//agents//environments//deployments/. + string name = 1; + + // The name of the flow version for this deployment. + // Format: + // projects//locations//agents//flows//versions/. + string flow_version = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; + + // The current state of the deployment. + State state = 3; + + // Result of the deployment. + Result result = 4; + + // Start time of this deployment. + google.protobuf.Timestamp start_time = 5; + + // End time of this deployment. + google.protobuf.Timestamp end_time = 6; +} + +// The request message for +// [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments]. +message ListDeploymentsRequest { + // Required. The [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] + // to list all environments for. Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Deployment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments]. +message ListDeploymentsResponse { + // The list of deployments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Deployment deployments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeployment]. +message GetDeploymentRequest { + // Required. The name of the + // [Deployment][google.cloud.dialogflow.cx.v3beta1.Deployment]. Format: + // `projects//locations//agents//environments//deployments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Deployment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto new file mode 100644 index 000000000000..160439656483 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto @@ -0,0 +1,604 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/inline.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType]. +service EntityTypes { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Retrieves the specified entity type. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an entity type in the specified agent. + rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes" + body: "entity_type" + }; + option (google.api.method_signature) = "parent,entity_type"; + } + + // Updates the specified entity type. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v3beta1/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}" + body: "entity_type" + }; + option (google.api.method_signature) = "entity_type,update_mask"; + } + + // Deletes the specified entity type. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc DeleteEntityType(DeleteEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all entity types in the specified agent. + rpc ListEntityTypes(ListEntityTypesRequest) + returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Exports the selected entity types. + rpc ExportEntityTypes(ExportEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportEntityTypesResponse" + metadata_type: "ExportEntityTypesMetadata" + }; + } + + // Imports the specified entitytypes into the agent. + rpc ImportEntityTypes(ImportEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportEntityTypesResponse" + metadata_type: "ImportEntityTypesMetadata" + }; + } +} + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// When you define an entity, you can also include synonyms that all map to +// that entity. For example, "soft drink", "soda", "pop", and so on. +// +// There are three types of entities: +// +// * **System** - entities that are defined by the Dialogflow API for common +// data types such as date, time, currency, and so on. A system entity is +// represented by the `EntityType` type. +// +// * **Custom** - entities that are defined by you that represent +// actionable data that is meaningful to your application. For example, +// you could define a `pizza.sauce` entity for red or white pizza sauce, +// a `pizza.cheese` entity for the different types of cheese on a pizza, +// a `pizza.topping` entity for different toppings, and so on. A custom +// entity is represented by the `EntityType` type. +// +// * **User** - entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. A user entity is +// represented by the +// [SessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityType] +// type. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message EntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/EntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}" + }; + + // Represents kinds of entities. + enum Kind { + // Not specified. This value should be never used. + KIND_UNSPECIFIED = 0; + + // Map entity types allow mapping of a group of synonyms to a canonical + // value. + KIND_MAP = 1; + + // List entity types contain a set of entries that do not map to canonical + // values. However, list entity types can contain references to other entity + // types (with or without aliases). + KIND_LIST = 2; + + // Regexp entity types allow to specify regular expressions in entries + // values. + KIND_REGEXP = 3; + } + + // Represents different entity type expansion modes. Automated expansion + // allows an agent to recognize values that have not been explicitly listed in + // the entity (for example, new kinds of shopping list items). + enum AutoExpansionMode { + // Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + + // Allows an agent to recognize values that have not been explicitly + // listed in the entity. + AUTO_EXPANSION_MODE_DEFAULT = 1; + } + + // An **entity entry** for an associated entity type. + message Entity { + // Required. The primary value associated with this entity entry. + // For example, if the entity type is *vegetable*, the value could be + // *scallions*. + // + // For `KIND_MAP` entity types: + // + // * A canonical value to be used in place of synonyms. + // + // For `KIND_LIST` entity types: + // + // * A string that can contain references to other entity types (with or + // without aliases). + string value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A collection of value synonyms. For example, if the entity type + // is *vegetable*, and `value` is *scallions*, a synonym could be *green + // onions*. + // + // For `KIND_LIST` entity types: + // + // * This collection must contain exactly one synonym equal to `value`. + repeated string synonyms = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // An excluded entity phrase that should not be matched. + message ExcludedPhrase { + // Required. The word or phrase to be excluded. + string value = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The unique identifier of the entity type. + // Required for + // [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. + // Format: + // `projects//locations//agents//entityTypes/`. + string name = 1; + + // Required. The human-readable name of the entity type, unique within the + // agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates the kind of entity type. + Kind kind = 3 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the entity type can be automatically expanded. + AutoExpansionMode auto_expansion_mode = 4; + + // The collection of entity entries associated with the entity type. + repeated Entity entities = 5; + + // Collection of exceptional words and phrases that shouldn't be matched. + // For example, if you have a size entity type with entry `giant`(an + // adjective), you might consider adding `giants`(a noun) as an exclusion. + // If the kind of entity type is `KIND_MAP`, then the phrases specified by + // entities and excluded phrases should be mutually exclusive. + repeated ExcludedPhrase excluded_phrases = 6; + + // Enables fuzzy entity extraction during classification. + bool enable_fuzzy_extraction = 7; + + // Indicates whether parameters of the entity type should be redacted in log. + // If redaction is enabled, page parameters and intent parameters referring to + // the entity type will be replaced by parameter name during logging. + bool redact = 9; +} + +// The request message for +// [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ExportEntityTypes]. +message ExportEntityTypesRequest { + // Data format of the exported entity types. + enum DataFormat { + // Unspecified format. Treated as `BLOB`. + DATA_FORMAT_UNSPECIFIED = 0; + + // EntityTypes will be exported as raw bytes. + BLOB = 1; + + // EntityTypes will be exported in JSON Package format. + JSON_PACKAGE = 5; + } + + // Required. The name of the parent agent to export entity types. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The name of the entity types to export. + // Format: + // `projects//locations//agents//entityTypes/`. + repeated string entity_types = 2 [(google.api.field_behavior) = REQUIRED]; + + // The destination to export. + oneof destination { + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the entity + // types to. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string entity_types_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The option to return the serialized entity types inline. + bool entity_types_content_inline = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The data format of the exported entity types. If not specified, + // `BLOB` is assumed. + DataFormat data_format = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The language to retrieve the entity type for. The following + // fields are language dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, all language dependent fields will be retrieved. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ExportEntityTypes]. +message ExportEntityTypesResponse { + // Exported entity types can be either in cloud storage or local download. + oneof exported_entity_types { + // The URI to a file containing the exported entity types. This field is + // populated only if `entity_types_uri` is specified in + // [ExportEntityTypesRequest][google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest]. + string entity_types_uri = 1; + + // Uncompressed byte content for entity types. This field is populated only + // if `entity_types_content_inline` is set to true in + // [ExportEntityTypesRequest][google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest]. + InlineDestination entity_types_content = 2; + } +} + +// Metadata returned for the +// [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ExportEntityTypes] +// long running operation. +message ExportEntityTypesMetadata {} + +// The request message for +// [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ImportEntityTypes]. +message ImportEntityTypesRequest { + // Merge option when display name conflicts exist during import. + enum MergeOption { + // Unspecified. If used, system uses REPORT_CONFLICT as default. + MERGE_OPTION_UNSPECIFIED = 0; + + // Replace the original entity type in the agent with the new entity type + // when display name conflicts exist. + REPLACE = 1; + + // Merge the original entity type with the new entity type when display name + // conflicts exist. + MERGE = 2; + + // Create new entity types with new display names to differentiate them from + // the existing entity types when display name conflicts exist. + RENAME = 3; + + // Report conflict information if display names conflict is detected. + // Otherwise, import entity types. + REPORT_CONFLICT = 4; + + // Keep the original entity type and discard the conflicting new entity type + // when display name conflicts exist. + KEEP = 5; + } + + // Required. The agent to import the entity types into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The entity types to import. + oneof entity_types { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import entity types from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string entity_types_uri = 2; + + // Uncompressed byte content of entity types. + InlineSource entity_types_content = 3; + } + + // Required. Merge option for importing entity types. + MergeOption merge_option = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target entity type to import into. + // Format: + // `projects//locations//agents//entity_types/`. + // If set, there should be only one entity type included in + // [entity_types][google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.entity_types], + // of which the type should match the type of the target entity type. All + // [entities][google.cloud.dialogflow.cx.v3beta1.EntityType.entities] in the + // imported entity type will be added to the target entity type. + string target_entity_type = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; +} + +// The response message for +// [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ImportEntityTypes]. +message ImportEntityTypesResponse { + // Conflicting resources detected during the import process. Only filled when + // [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] is set in the + // request and there are conflicts in the display names. + message ConflictingResources { + // Display names of conflicting entity types. + repeated string entity_type_display_names = 1; + + // Display names of conflicting entities. + repeated string entity_display_names = 2; + } + + // The unique identifier of the imported entity types. + // Format: + // `projects//locations//agents//entity_types/`. + repeated string entity_types = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + }]; + + // Info which resources have conflicts when + // [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] merge_option + // is set in ImportEntityTypesRequest. + ConflictingResources conflicting_resources = 2; +} + +// Metadata returned for the +// [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ImportEntityTypes] +// long running operation. +message ImportEntityTypesMetadata {} + +// The request message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The agent to list all entity types for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to list entity types for. The following fields are language + // dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesResponse { + // The list of entity types. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated EntityType entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the entity type. + // Format: + // `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to retrieve the entity type for. The following fields are + // language dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The agent to create a entity type for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The entity type to create. + EntityType entity_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The entity type to update. + EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType]. +message DeleteEntityTypeRequest { + // Required. The name of the entity type to delete. + // Format: + // `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // This field has no effect for entity type not being used. + // For entity types that are used by intents or pages: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referencing resources. + // * If `force` is set to true, Dialogflow will remove the entity type, as + // well as any references to the entity type (i.e. Page + // [parameter][google.cloud.dialogflow.cx.v3beta1.Form.Parameter] of the + // entity type will be changed to + // '@sys.any' and intent + // [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] of the + // entity type will be removed). + bool force = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/environment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/environment.proto new file mode 100644 index 000000000000..863447fe8f50 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/environment.proto @@ -0,0 +1,541 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/test_case.proto"; +import "google/cloud/dialogflow/cx/v3beta1/webhook.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "EnvironmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [Environments][google.cloud.dialogflow.cx.v3beta1.Environment]. +service Environments { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all environments in the specified + // [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + rpc ListEnvironments(ListEnvironmentsRequest) + returns (ListEnvironmentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in + // the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] + rpc CreateEnvironment(CreateEnvironmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments" + body: "environment" + }; + option (google.api.method_signature) = "parent,environment"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Updates the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] + rpc UpdateEnvironment(UpdateEnvironmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3beta1/{environment.name=projects/*/locations/*/agents/*/environments/*}" + body: "environment" + }; + option (google.api.method_signature) = "environment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Deletes the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc DeleteEnvironment(DeleteEnvironmentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up the history of the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc LookupEnvironmentHistory(LookupEnvironmentHistoryRequest) + returns (LookupEnvironmentHistoryResponse) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory" + }; + option (google.api.method_signature) = "name"; + } + + // Kicks off a continuous test under the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata] + // - `response`: + // [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse] + rpc RunContinuousTest(RunContinuousTestRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RunContinuousTestResponse" + metadata_type: "RunContinuousTestMetadata" + }; + } + + // Fetches a list of continuous test results for a given environment. + rpc ListContinuousTestResults(ListContinuousTestResultsRequest) + returns (ListContinuousTestResultsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults" + }; + option (google.api.method_signature) = "parent"; + } + + // Deploys a flow to the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [DeployFlowMetadata][google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata] + // - `response`: + // [DeployFlowResponse][google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse] + rpc DeployFlow(DeployFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "DeployFlowResponse" + metadata_type: "DeployFlowMetadata" + }; + } +} + +// Represents an environment for an agent. You can create multiple versions +// of your agent and publish them to separate environments. When you edit an +// agent, you are editing the draft agent. At any point, you can save the draft +// agent as an agent version, which is an immutable snapshot of your agent. When +// you save the draft agent, it is published to the default environment. When +// you create agent versions, you can publish them to custom environments. You +// can create a variety of custom environments for testing, development, +// production, etc. +message Environment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Environment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}" + }; + + // Configuration for the version. + message VersionConfig { + // Required. Flow, playbook and tool versions are supported. + // Format for flow version: + // projects//locations//agents//flows//versions/. + // Format for playbook version: + // projects//locations//agents//playbooks//versions/. + // Format for tool version: + // projects//locations//agents//tools//versions/. + string version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + } + + // The configuration for continuous tests. + message TestCasesConfig { + // A list of test case names to run. They should be under the same agent. + // Format of each test case name: + // `projects//locations//agents//testCases/` + repeated string test_cases = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + }]; + + // Whether to run test cases in + // [TestCasesConfig.test_cases][google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.test_cases] + // periodically. Default false. If set to true, run once a day. + bool enable_continuous_run = 2; + + // Whether to run test cases in + // [TestCasesConfig.test_cases][google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.test_cases] + // before deploying a flow version to the environment. Default false. + bool enable_predeployment_run = 3; + } + + // Configuration for webhooks. + message WebhookConfig { + // The list of webhooks to override for the agent environment. The webhook + // must exist in the agent. You can override fields in + // [`generic_web_service`][google.cloud.dialogflow.cx.v3beta1.Webhook.generic_web_service] + // and + // [`service_directory`][google.cloud.dialogflow.cx.v3beta1.Webhook.service_directory]. + repeated Webhook webhook_overrides = 1; + } + + // The name of the environment. + // Format: + // `projects//locations//agents//environments/`. + string name = 1; + + // Required. The human-readable name of the environment (unique in an agent). + // Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable description of the environment. The maximum length is + // 500 characters. If exceeded, the request is rejected. + string description = 3; + + // A list of configurations for flow versions. You should include version + // configs for all flows that are reachable from [`Start + // Flow`][Agent.start_flow] in the agent. Otherwise, an error will be + // returned. + repeated VersionConfig version_configs = 6; + + // Output only. Update time of this environment. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The test cases config for continuous tests of this environment. + TestCasesConfig test_cases_config = 7; + + // The webhook configuration for this environment. + WebhookConfig webhook_config = 10; +} + +// The request message for +// [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. +message ListEnvironmentsRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all + // environments for. Format: + // `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. +message ListEnvironmentsResponse { + // The list of environments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Environment environments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironment]. +message GetEnvironmentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. Format: + // `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for +// [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironment]. +message CreateEnvironmentRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create + // an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. The environment to create. + Environment environment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironment]. +message UpdateEnvironmentRequest { + // Required. The environment to update. + Environment environment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironment]. +message DeleteEnvironmentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. + // Format: + // `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for +// [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryRequest { + // Required. Resource name of the environment to look up the history for. + // Format: + // `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryResponse { + // Represents a list of snapshots for an environment. Time of the snapshots is + // stored in + // [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time]. + repeated Environment environments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Represents a result from running a test case in an agent environment. +message ContinuousTestResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/ContinuousTestResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}" + }; + + // The overall result for a continuous test run in an agent environment. + enum AggregatedTestResult { + // Not specified. Should never be used. + AGGREGATED_TEST_RESULT_UNSPECIFIED = 0; + + // All the tests passed. + PASSED = 1; + + // At least one test did not pass. + FAILED = 2; + } + + // The resource name for the continuous test result. Format: + // `projects//locations//agents//environments//continuousTestResults/`. + string name = 1; + + // The result of this continuous test run, i.e. whether all the tests in this + // continuous test run pass or not. + AggregatedTestResult result = 2; + + // A list of individual test case results names in this continuous test run. + repeated string test_case_results = 3 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCaseResult" + }]; + + // Time when the continuous testing run starts. + google.protobuf.Timestamp run_time = 4; +} + +// The request message for +// [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest]. +message RunContinuousTestRequest { + // Required. Format: + // `projects//locations//agents//environments/`. + string environment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The response message for +// [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest]. +message RunContinuousTestResponse { + // The result for a continuous test run. + ContinuousTestResult continuous_test_result = 1; +} + +// Metadata returned for the +// [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest] +// long running operation. +message RunContinuousTestMetadata { + // The test errors. + repeated TestError errors = 1; +} + +// The request message for +// [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3beta1.Environments.ListContinuousTestResults]. +message ListContinuousTestResultsRequest { + // Required. The environment to list results for. + // Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ContinuousTestResult" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Environments.ListTestCaseResults][]. +message ListContinuousTestResultsResponse { + // The list of continuous test results. + repeated ContinuousTestResult continuous_test_results = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Environments.DeployFlow][google.cloud.dialogflow.cx.v3beta1.Environments.DeployFlow]. +message DeployFlowRequest { + // Required. The environment to deploy the flow to. + // Format: + // `projects//locations//agents//environments/`. + string environment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. The flow version to deploy. + // Format: + // `projects//locations//agents//flows//versions/`. + string flow_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The response message for +// [Environments.DeployFlow][google.cloud.dialogflow.cx.v3beta1.Environments.DeployFlow]. +message DeployFlowResponse { + // The updated environment where the flow is deployed. + Environment environment = 1; + + // The name of the flow version deployment. + // Format: + // `projects//locations//agents//environments//deployments/`. + string deployment = 2; +} + +// Metadata returned for the +// [Environments.DeployFlow][google.cloud.dialogflow.cx.v3beta1.Environments.DeployFlow] +// long running operation. +message DeployFlowMetadata { + // Errors of running deployment tests. + repeated TestError test_errors = 1; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/example.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/example.proto new file mode 100644 index 000000000000..08e19715dd5b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/example.proto @@ -0,0 +1,237 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/trace.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ExampleProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Examples][google.cloud.dialogflow.cx.v3beta1.Example]. +service Examples { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates an example in the specified playbook. + rpc CreateExample(CreateExampleRequest) returns (Example) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples" + body: "example" + }; + option (google.api.method_signature) = "parent,example"; + } + + // Deletes the specified example. + rpc DeleteExample(DeleteExampleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of examples in the specified playbook. + rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified example. + rpc GetExample(GetExampleRequest) returns (Example) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the specified example. + rpc UpdateExample(UpdateExampleRequest) returns (Example) { + option (google.api.http) = { + patch: "/v3beta1/{example.name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + body: "example" + }; + option (google.api.method_signature) = "example,update_mask"; + } +} + +// The request message for +// [Examples.CreateExample][google.cloud.dialogflow.cx.v3beta1.Examples.CreateExample]. +message CreateExampleRequest { + // Required. The playbook to create an example for. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Example" + } + ]; + + // Required. The example to create. + Example example = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Examples.DeleteExample][google.cloud.dialogflow.cx.v3beta1.Examples.DeleteExample]. +message DeleteExampleRequest { + // Required. The name of the example to delete. + // Format: + // `projects//locations//agents//playbooks//examples/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Example" + } + ]; +} + +// The request message for +// [Examples.ListExamples][google.cloud.dialogflow.cx.v3beta1.Examples.ListExamples]. +message ListExamplesRequest { + // Required. The playbook to list the examples from. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Example" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The [next_page_token][ListExampleResponse.next_page_token] value + // returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The language to list examples for. + // If not specified, list all examples under the playbook. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Examples.ListExamples][google.cloud.dialogflow.cx.v3beta1.Examples.ListExamples]. +message ListExamplesResponse { + // The list of examples. There will be a maximum number of items returned + // based on the + // [page_size][google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest.page_size] + // field in the request. + repeated Example examples = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Examples.GetExample][google.cloud.dialogflow.cx.v3beta1.Examples.GetExample]. +message GetExampleRequest { + // Required. The name of the example. + // Format: + // `projects//locations//agents//playbooks//examples/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Example" + } + ]; +} + +// The request message for +// [Examples.UpdateExample][google.cloud.dialogflow.cx.v3beta1.Examples.UpdateExample]. +message UpdateExampleRequest { + // Required. The example to update. + Example example = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which fields get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Example represents a sample execution of the playbook in the conversation. +// +// An example consists of a list of ordered actions performed by end user +// or Dialogflow agent according the playbook instructions to fulfill the task. +message Example { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Example" + pattern: "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}" + plural: "examples" + singular: "example" + }; + + // The unique identifier of the playbook example. + // Format: + // `projects//locations//agents//playbooks//examples/`. + string name = 1; + + // Optional. The input to the playbook in the example. + PlaybookInput playbook_input = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The output of the playbook in the example. + PlaybookOutput playbook_output = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ordered list of actions performed by the end user and the + // Dialogflow agent. + repeated Action actions = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The display name of the example. + string display_name = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The high level concise description of the example. The max number + // of characters is 200. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Estimated number of tokes current example takes when sent to + // the LLM. + int64 token_count = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of initial example creation. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the example was updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Example's output state. + OutputState conversation_state = 12 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The language code of the example. + // If not specified, the agent's default language is used. + // Note: languages must be enabled in the agent before they can be used. + // Note: example's language code is not currently used in dialogflow agents. + string language_code = 13 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto new file mode 100644 index 000000000000..cce0e3874582 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto @@ -0,0 +1,524 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ExperimentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [Experiments][google.cloud.dialogflow.cx.v3beta1.Experiment]. +service Experiments { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all experiments in the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc ListExperiments(ListExperimentsRequest) + returns (ListExperimentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. + rpc GetExperiment(GetExperimentRequest) returns (Experiment) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment] in + // the specified + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc CreateExperiment(CreateExperimentRequest) returns (Experiment) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments" + body: "experiment" + }; + option (google.api.method_signature) = "parent,experiment"; + } + + // Updates the specified + // [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. + rpc UpdateExperiment(UpdateExperimentRequest) returns (Experiment) { + option (google.api.http) = { + patch: "/v3beta1/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + body: "experiment" + }; + option (google.api.method_signature) = "experiment,update_mask"; + } + + // Deletes the specified + // [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. + rpc DeleteExperiment(DeleteExperimentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Starts the specified + // [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. This rpc only + // changes the state of experiment from PENDING to RUNNING. + rpc StartExperiment(StartExperimentRequest) returns (Experiment) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Stops the specified + // [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. This rpc only + // changes the state of experiment from RUNNING to DONE. + rpc StopExperiment(StopExperimentRequest) returns (Experiment) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents an experiment in an environment. +message Experiment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Experiment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}" + }; + + // The state of the experiment. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // The experiment is created but not started yet. + DRAFT = 1; + + // The experiment is running. + RUNNING = 2; + + // The experiment is done. + DONE = 3; + + // The experiment with auto-rollout enabled has failed. + ROLLOUT_FAILED = 4; + } + + // Definition of the experiment. + message Definition { + // The condition defines which subset of sessions are selected for + // this experiment. If not specified, all sessions are eligible. E.g. + // "query_input.language_code=en" See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string condition = 1; + + // The variants of the experiment. We currently only support single variant + // experiment. + oneof variants { + // The flow versions as the variants of this experiment. + VersionVariants version_variants = 2; + } + } + + // The inference result which includes an objective metric to optimize and the + // confidence interval. + message Result { + // Types of ratio-based metric for Dialogflow experiment. + enum MetricType { + // Metric unspecified. + METRIC_UNSPECIFIED = 0; + + // Percentage of contained sessions without user calling back in 24 hours. + CONTAINED_SESSION_NO_CALLBACK_RATE = 1; + + // Percentage of sessions that were handed to a human agent. + LIVE_AGENT_HANDOFF_RATE = 2; + + // Percentage of sessions with the same user calling back. + CALLBACK_SESSION_RATE = 3; + + // Percentage of sessions where user hung up. + ABANDONED_SESSION_RATE = 4; + + // Percentage of sessions reached Dialogflow 'END_PAGE' or + // 'END_SESSION'. + SESSION_END_RATE = 5; + } + + // types of count-based metric for Dialogflow experiment. + enum CountType { + // Count type unspecified. + COUNT_TYPE_UNSPECIFIED = 0; + + // Total number of occurrences of a 'NO_MATCH'. + TOTAL_NO_MATCH_COUNT = 1; + + // Total number of turn counts. + TOTAL_TURN_COUNT = 2; + + // Average turn count in a session. + AVERAGE_TURN_COUNT = 3; + } + + // A confidence interval is a range of possible values for the experiment + // objective you are trying to measure. + message ConfidenceInterval { + // The confidence level used to construct the interval, i.e. there is X% + // chance that the true value is within this interval. + double confidence_level = 1; + + // The percent change between an experiment metric's value and the value + // for its control. + double ratio = 2; + + // Lower bound of the interval. + double lower_bound = 3; + + // Upper bound of the interval. + double upper_bound = 4; + } + + // Metric and corresponding confidence intervals. + message Metric { + // Ratio-based metric type. Only one of type or count_type is specified in + // each Metric. + MetricType type = 1; + + // Count-based metric type. Only one of type or count_type is specified in + // each Metric. + CountType count_type = 5; + + // The actual value of the metric. + oneof value { + // Ratio value of a metric. + double ratio = 2; + + // Count value of a metric. + double count = 4; + } + + // The probability that the treatment is better than all other treatments + // in the experiment + ConfidenceInterval confidence_interval = 3; + } + + // Version variant and associated metrics. + message VersionMetrics { + // The name of the flow + // [Version][google.cloud.dialogflow.cx.v3beta1.Version]. Format: + // `projects//locations//agents//flows//versions/`. + string version = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; + + // The metrics and corresponding confidence intervals in the inference + // result. + repeated Metric metrics = 2; + + // Number of sessions that were allocated to this version. + int32 session_count = 3; + } + + // Version variants and metrics. + repeated VersionMetrics version_metrics = 1; + + // The last time the experiment's stats data was updated. Will have default + // value if stats have never been computed for this experiment. + google.protobuf.Timestamp last_update_time = 2; + } + + // The name of the experiment. + // Format: + // projects//locations//agents//environments//experiments/. + string name = 1; + + // Required. The human-readable name of the experiment (unique in an + // environment). Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable description of the experiment. + string description = 3; + + // The current state of the experiment. + // Transition triggered by Experiments.StartExperiment: DRAFT->RUNNING. + // Transition triggered by Experiments.CancelExperiment: DRAFT->DONE or + // RUNNING->DONE. + State state = 4; + + // The definition of the experiment. + Definition definition = 5; + + // The configuration for auto rollout. If set, there should be exactly two + // variants in the experiment (control variant being the default version of + // the flow), the traffic allocation for the non-control variant will + // gradually increase to 100% when conditions are met, and eventually + // replace the control variant to become the default version of the flow. + RolloutConfig rollout_config = 14; + + // State of the auto rollout process. + RolloutState rollout_state = 15; + + // The reason why rollout has failed. Should only be set when state is + // ROLLOUT_FAILED. + string rollout_failure_reason = 16; + + // Inference result of the experiment. + Result result = 6; + + // Creation time of this experiment. + google.protobuf.Timestamp create_time = 7; + + // Start time of this experiment. + google.protobuf.Timestamp start_time = 8; + + // End time of this experiment. + google.protobuf.Timestamp end_time = 9; + + // Last update time of this experiment. + google.protobuf.Timestamp last_update_time = 10; + + // Maximum number of days to run the experiment. If auto-rollout is + // not enabled, default value and maximum will be 30 days. If auto-rollout is + // enabled, default value and maximum will be 6 days. + google.protobuf.Duration experiment_length = 11; + + // The history of updates to the experiment variants. + repeated VariantsHistory variants_history = 12; +} + +// A list of flow version variants. +message VersionVariants { + // A single flow version with specified traffic allocation. + message Variant { + // The name of the flow version. + // Format: + // `projects//locations//agents//flows//versions/`. + string version = 1; + + // Percentage of the traffic which should be routed to this + // version of flow. Traffic allocation for a single flow must sum up to 1.0. + float traffic_allocation = 2; + + // Whether the variant is for the control group. + bool is_control_group = 3; + } + + // A list of flow version variants. + repeated Variant variants = 1; +} + +// The configuration for auto rollout. +message RolloutConfig { + // A single rollout step with specified traffic allocation. + message RolloutStep { + // The name of the rollout step; + string display_name = 1; + + // The percentage of traffic allocated to the flow version of this rollout + // step. (0%, 100%]. + int32 traffic_percent = 2; + + // The minimum time that this step should last. Should be longer than 1 + // hour. If not set, the default minimum duration for each step will be 1 + // hour. + google.protobuf.Duration min_duration = 3; + } + + // Steps to roll out a flow version. Steps should be sorted by percentage in + // ascending order. + repeated RolloutStep rollout_steps = 1; + + // The conditions that are used to evaluate the success of a rollout + // step. If not specified, all rollout steps will proceed to the next one + // unless failure conditions are met. E.g. "containment_rate > 60% AND + // callback_rate < 20%". See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string rollout_condition = 2; + + // The conditions that are used to evaluate the failure of a rollout + // step. If not specified, no rollout steps will fail. E.g. "containment_rate + // < 10% OR average_turn_count < 3". See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string failure_condition = 3; +} + +// State of the auto-rollout process. +message RolloutState { + // Display name of the current auto rollout step. + string step = 1; + + // Index of the current step in the auto rollout steps list. + int32 step_index = 3; + + // Start time of the current step. + google.protobuf.Timestamp start_time = 2; +} + +// The history of variants update. +message VariantsHistory { + // The variants updated. We currently only support single variant + // experiment. + oneof variants { + // The flow versions as the variants. + VersionVariants version_variants = 1; + } + + // Update time of the variants. + google.protobuf.Timestamp update_time = 2; +} + +// The request message for +// [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments]. +message ListExperimentsRequest { + // Required. The [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] + // to list all environments for. Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Experiment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments]. +message ListExperimentsResponse { + // The list of experiments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Experiment experiments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.GetExperiment]. +message GetExperimentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} + +// The request message for +// [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.CreateExperiment]. +message CreateExperimentRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create + // an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. + // Format: + // `projects//locations//agents//environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Experiment" + } + ]; + + // Required. The experiment to create. + Experiment experiment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.UpdateExperiment]. +message UpdateExperimentRequest { + // Required. The experiment to update. + Experiment experiment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.DeleteExperiment]. +message DeleteExperimentRequest { + // Required. The name of the + // [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. + // Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} + +// The request message for +// [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StartExperiment]. +message StartExperimentRequest { + // Required. Resource name of the experiment to start. + // Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} + +// The request message for +// [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StopExperiment]. +message StopExperimentRequest { + // Required. Resource name of the experiment to stop. + // Format: + // `projects//locations//agents//environments//experiments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Experiment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/flow.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/flow.proto new file mode 100644 index 000000000000..0d13e5781d4c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/flow.proto @@ -0,0 +1,705 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/import_strategy.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto"; +import "google/cloud/dialogflow/cx/v3beta1/validation_message.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "FlowProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. +service Flows { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a flow in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateFlow(CreateFlowRequest) returns (Flow) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows" + body: "flow" + }; + option (google.api.method_signature) = "parent,flow"; + } + + // Deletes a specified flow. + rpc DeleteFlow(DeleteFlowRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all flows in the specified agent. + rpc ListFlows(ListFlowsRequest) returns (ListFlowsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified flow. + rpc GetFlow(GetFlowRequest) returns (Flow) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateFlow(UpdateFlowRequest) returns (Flow) { + option (google.api.http) = { + patch: "/v3beta1/{flow.name=projects/*/locations/*/agents/*/flows/*}" + body: "flow" + }; + option (google.api.method_signature) = "flow,update_mask"; + } + + // Trains the specified flow. Note that only the flow in 'draft' environment + // is trained. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: An [Empty + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc TrainFlow(TrainFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:train" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } + + // Validates the specified flow and creates or updates validation results. + // Please call this API after the training is completed to get the complete + // validation results. + rpc ValidateFlow(ValidateFlowRequest) returns (FlowValidationResult) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:validate" + body: "*" + }; + } + + // Gets the latest flow validation result. Flow validation is performed + // when ValidateFlow is called. + rpc GetFlowValidationResult(GetFlowValidationResultRequest) + returns (FlowValidationResult) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/validationResult}" + }; + option (google.api.method_signature) = "name"; + } + + // Imports the specified flow to the specified agent from a binary file. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: + // [ImportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse] + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc ImportFlow(ImportFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportFlowResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Exports the specified flow to a binary file. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: + // [ExportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse] + // + // Note that resources (e.g. intents, entities, webhooks) that the flow + // references will also be exported. + rpc ExportFlow(ExportFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportFlowResponse" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Settings related to NLU. +message NluSettings { + // NLU model type. + enum ModelType { + // Not specified. `MODEL_TYPE_STANDARD` will be used. + MODEL_TYPE_UNSPECIFIED = 0; + + // Use standard NLU model. + MODEL_TYPE_STANDARD = 1; + + // Use advanced NLU model. + MODEL_TYPE_ADVANCED = 3; + } + + // NLU model training mode. + enum ModelTrainingMode { + // Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. + MODEL_TRAINING_MODE_UNSPECIFIED = 0; + + // NLU model training is automatically triggered when a flow gets modified. + // User can also manually trigger model training in this mode. + MODEL_TRAINING_MODE_AUTOMATIC = 1; + + // User needs to manually trigger NLU model training. Best for large flows + // whose models take long time to train. + MODEL_TRAINING_MODE_MANUAL = 2; + } + + // Indicates the type of NLU model. + ModelType model_type = 1; + + // To filter out false positive results and still get variety in matched + // natural language inputs for your agent, you can tune the machine learning + // classification threshold. If the returned score value is less than the + // threshold value, then a no-match event will be triggered. The score values + // range from 0.0 (completely uncertain) to 1.0 (completely certain). If set + // to 0.0, the default of 0.3 is used. You can set a separate classification + // threshold for the flow in each language enabled for the agent. + float classification_threshold = 3; + + // Indicates NLU model training mode. + ModelTrainingMode model_training_mode = 4; +} + +// Flows represents the conversation flows when you build your chatbot agent. +// +// A flow consists of many pages connected by the transition routes. +// Conversations always start with the built-in Start Flow (with an all-0 ID). +// Transition routes can direct the conversation session from the current flow +// (parent flow) to another flow (sub flow). When the sub flow is finished, +// Dialogflow will bring the session back to the parent flow, where the sub flow +// is started. +// +// Usually, when a transition route is followed by a matched intent, the intent +// will be "consumed". This means the intent won't activate more transition +// routes. However, when the followed transition route moves the conversation +// session into a different flow, the matched intent can be carried over and to +// be consumed in the target flow. +message Flow { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Flow" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}" + }; + + // Settings for multi-lingual agents. + message MultiLanguageSettings { + // Optional. Enable multi-language detection for this flow. This can be set + // only if [agent level multi language + // setting][Agent.enable_multi_language_training] is enabled. + bool enable_multi_language_detection = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Agent will respond in the detected language if the detected + // language code is in the supported resolved languages for this flow. This + // will be used only if multi-language training is enabled in the + // [agent][google.cloud.dialogflow.cx.v3beta1.Agent.enable_multi_language_training] + // and multi-language detection is enabled in the + // [flow][google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.enable_multi_language_detection]. + // The supported languages must be a subset of the languages supported by + // the agent. + repeated string supported_response_language_codes = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The unique identifier of the flow. + // Format: + // `projects//locations//agents//flows/`. + string name = 1; + + // Required. The human-readable name of the flow. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the flow. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // A flow's transition routes serve two purposes: + // + // * They are responsible for matching the user's first utterances in the + // flow. + // * They are inherited by every page's [transition + // routes][Page.transition_routes] and can support use cases such as the user + // saying "help" or "can I talk to a human?", which can be handled in a common + // way regardless of the current page. Transition routes defined in the page + // have higher priority than those defined in the flow. + // + // TransitionRoutes are evaluated in the following order: + // + // * TransitionRoutes with intent specified. + // * TransitionRoutes with only condition specified. + // + // TransitionRoutes with intent specified are inherited by pages in the flow. + repeated TransitionRoute transition_routes = 4; + + // A flow's event handlers serve two purposes: + // + // * They are responsible for handling events (e.g. no match, + // webhook errors) in the flow. + // * They are inherited by every page's [event + // handlers][Page.event_handlers], which can be used to handle common events + // regardless of the current page. Event handlers defined in the page + // have higher priority than those defined in the flow. + // + // Unlike + // [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], + // these handlers are evaluated on a first-match basis. The first one that + // matches the event get executed, with the rest being ignored. + repeated EventHandler event_handlers = 10; + + // A flow's transition route group serve two purposes: + // + // * They are responsible for matching the user's first utterances in the + // flow. + // * They are inherited by every page's [transition + // route groups][Page.transition_route_groups]. Transition route groups + // defined in the page have higher priority than those defined in the flow. + // + // Format:`projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/` + // for agent-level groups. + repeated string transition_route_groups = 15 + [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + }]; + + // NLU related settings of the flow. + NluSettings nlu_settings = 11; + + // Hierarchical advanced settings for this flow. The settings exposed at the + // lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 14; + + // Optional. Knowledge connector configuration. + KnowledgeConnectorSettings knowledge_connector_settings = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defined structured input parameters for this flow. + repeated ParameterDefinition input_parameter_definitions = 26 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defined structured output parameters for this flow. + repeated ParameterDefinition output_parameter_definitions = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Multi-lingual agent settings for this flow. + MultiLanguageSettings multi_language_settings = 28 + [(google.api.field_behavior) = OPTIONAL]; + + // Indicates whether the flow is locked for changes. If the flow is locked, + // modifications to the flow will be rejected. + bool locked = 30; +} + +// The request message for +// [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow]. +message CreateFlowRequest { + // Required. The agent to create a flow for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Required. The flow to create. + Flow flow = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow]. +message DeleteFlowRequest { + // Required. The name of the flow to delete. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // This field has no effect for flows with no incoming transitions. + // For flows with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the flow, as well as + // any transitions to the flow (i.e. [Target + // flow][EventHandler.target_flow] in event handlers or [Target + // flow][TransitionRoute.target_flow] in transition routes that point to + // this flow will be cleared). + bool force = 2; +} + +// The request message for +// [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. +message ListFlowsRequest { + // Required. The agent containing the flows. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list flows for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for +// [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. +message ListFlowsResponse { + // The list of flows. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Flow flows = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The response message for +// [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow]. +message GetFlowRequest { + // Required. The name of the flow to get. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // The language to retrieve the flow for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow]. +message UpdateFlowRequest { + // Required. The flow to update. + Flow flow = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow]. +message TrainFlowRequest { + // Required. The flow to train. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; +} + +// The request message for +// [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ValidateFlow]. +message ValidateFlowRequest { + // Required. The flow to validate. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The request message for +// [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowValidationResult]. +message GetFlowValidationResultRequest { + // Required. The flow name. + // Format: + // `projects//locations//agents//flows//validationResult`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/FlowValidationResult" + } + ]; + + // If not specified, the agent's default language is used. + string language_code = 2; +} + +// The response message for +// [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowValidationResult]. +message FlowValidationResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/FlowValidationResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult" + }; + + // The unique identifier of the flow validation result. + // Format: + // `projects//locations//agents//flows//validationResult`. + string name = 1; + + // Contains all validation messages. + repeated ValidationMessage validation_messages = 2; + + // Last time the flow was validated. + google.protobuf.Timestamp update_time = 3; +} + +// The request message for +// [Flows.ImportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlow]. +message ImportFlowRequest { + // Import option. + enum ImportOption { + // Unspecified. Treated as `KEEP`. + IMPORT_OPTION_UNSPECIFIED = 0; + + // Always respect settings in exported flow content. It may cause a + // import failure if some settings (e.g. custom NLU) are not supported in + // the agent to import into. + KEEP = 1; + + // Fallback to default settings if some settings are not supported in the + // agent to import into. E.g. Standard NLU will be used if custom NLU is + // not available. + FALLBACK = 2; + } + + // Required. The agent to import the flow into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Required. The flow to import. + oneof flow { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import flow from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string flow_uri = 2; + + // Uncompressed raw byte content for flow. + bytes flow_content = 3; + } + + // Flow import mode. If not specified, `KEEP` is assumed. + ImportOption import_option = 4; + + // Optional. Specifies the import strategy used when resolving resource + // conflicts. + FlowImportStrategy flow_import_strategy = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The flow import strategy used for resource conflict resolution associated +// with an +// [ImportFlowRequest][google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest]. +message FlowImportStrategy { + // Optional. Global flow import strategy for resource conflict resolution. The + // import Import strategy for resource conflict resolution, applied globally + // throughout the flow. It will be applied for all + // display name conflicts in the imported content. If not specified, + // 'CREATE_NEW' is assumed. + ImportStrategy global_import_strategy = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Flows.ImportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlow]. +message ImportFlowResponse { + // The unique identifier of the new flow. + // Format: + // `projects//locations//agents//flows/`. + string flow = 1 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; +} + +// The request message for +// [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow]. +message ExportFlowRequest { + // Required. The name of the flow to export. + // Format: + // `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. + // The format of this URI must be `gs:///`. If left + // unspecified, the serialized flow is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string flow_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to export flows referenced by the specified flow. + bool include_referenced_flows = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow]. +message ExportFlowResponse { + // The exported flow. + oneof flow { + // The URI to a file containing the exported flow. This field is populated + // only if `flow_uri` is specified in + // [ExportFlowRequest][google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest]. + string flow_uri = 1; + + // Uncompressed raw byte content for flow. + bytes flow_content = 2; + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto new file mode 100644 index 000000000000..76cfacf1b337 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto @@ -0,0 +1,172 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "FulfillmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// A fulfillment can do one or more of the following actions at the same time: +// +// * Generate rich message responses. +// * Set parameter values. +// * Call the webhook. +// +// Fulfillments can be called at various stages in the +// [Page][google.cloud.dialogflow.cx.v3beta1.Page] or +// [Form][google.cloud.dialogflow.cx.v3beta1.Form] lifecycle. For example, when +// a +// [DetectIntentRequest][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest] +// drives a session to enter a new page, the page's entry fulfillment can add a +// static response to the +// [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] in the +// returning +// [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse], +// call the webhook (for example, to load user data from a database), or both. +message Fulfillment { + // Setting a parameter value. + message SetParameterAction { + // Display name of the parameter. + string parameter = 1; + + // The new value of the parameter. A null value clears the parameter. + google.protobuf.Value value = 2; + } + + // A list of cascading if-else conditions. Cases are mutually exclusive. + // The first one with a matching condition is selected, all the rest ignored. + message ConditionalCases { + // Each case has a Boolean condition. When it is evaluated to be True, the + // corresponding messages will be selected and evaluated recursively. + message Case { + // The list of messages or conditional cases to activate for this case. + message CaseContent { + // Either a message is returned or additional cases to be evaluated. + oneof cases_or_message { + // Returned message. + ResponseMessage message = 1; + + // Additional cases to be evaluated. + ConditionalCases additional_cases = 2; + } + } + + // The condition to activate and select this case. Empty means the + // condition is always true. The condition is evaluated against [form + // parameters][Form.parameters] or [session + // parameters][SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string condition = 1; + + // A list of case content. + repeated CaseContent case_content = 2; + } + + // A list of cascading if-else conditions. + repeated Case cases = 1; + } + + // Generator settings used by the LLM to generate a text response. + message GeneratorSettings { + // Required. The generator to call. + // Format: + // `projects//locations//agents//generators/`. + string generator = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Generator" + } + ]; + + // Map from [placeholder parameter][Generator.Parameter.id] in the + // [Generator][google.cloud.dialogflow.cx.v3beta1.Generator] to + // corresponding session parameters. By default, Dialogflow uses the session + // parameter with the same name to fill in the generator template. e.g. If + // there is a placeholder parameter `city` in the Generator, Dialogflow + // default to fill in the `$city` with + // `$session.params.city`. However, you may choose to fill `$city` with + // `$session.params.desination-city`. + // - Map key: [parameter ID][Genrator.Parameter.id] + // - Map value: session parameter name + map input_parameters = 2; + + // Required. Output parameter which should contain the generator response. + string output_parameter = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // The webhook to call. + // Format: + // `projects//locations//agents//webhooks/`. + string webhook = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + }]; + + // Whether Dialogflow should return currently queued fulfillment response + // messages in streaming APIs. If a webhook is specified, it happens before + // Dialogflow invokes webhook. + // Warning: + // 1) This flag only affects streaming API. Responses are still queued + // and returned once in non-streaming API. + // 2) The flag can be enabled in any fulfillment but only the first 3 partial + // responses will be returned. You may only want to apply it to fulfillments + // that have slow webhooks. + bool return_partial_responses = 8; + + // The value of this field will be populated in the + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] + // `fulfillmentInfo.tag` field by Dialogflow when the associated webhook is + // called. + // The tag is typically used by the webhook service to identify which + // fulfillment is being called, but it could be used for other purposes. + // This field is required if `webhook` is specified. + string tag = 3; + + // Set parameter values before executing the webhook. + repeated SetParameterAction set_parameter_actions = 4; + + // Conditional cases for this fulfillment. + repeated ConditionalCases conditional_cases = 5; + + // Hierarchical advanced settings for this fulfillment. The settings exposed + // at the lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 7; + + // If the flag is true, the agent will utilize LLM to generate a text + // response. If LLM generation fails, the defined + // [responses][google.cloud.dialogflow.cx.v3beta1.Fulfillment.messages] in the + // fulfillment will be respected. This flag is only useful for fulfillments + // associated with no-match event handlers. + bool enable_generative_fallback = 12; + + // A list of Generators to be called during this fulfillment. + repeated GeneratorSettings generators = 13; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto new file mode 100644 index 000000000000..ab18e3608b4c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto @@ -0,0 +1,36 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "GcsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Google Cloud Storage location for a Dialogflow operation that writes or +// exports objects (e.g. exported agent or transcripts) outside of Dialogflow. +message GcsDestination { + // Required. The Google Cloud Storage URI for the exported objects. A URI is + // of the form: `gs://bucket/object-name-or-prefix` Whether a full object + // name, or just a prefix, its usage depends on the Dialogflow operation. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto new file mode 100644 index 000000000000..aa63c1b9aa84 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto @@ -0,0 +1,176 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/safety_settings.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "GenerativeSettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Settings for Generative AI. +message GenerativeSettings { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/AgentGenerativeSettings" + pattern: "projects/{project}/locations/{location}/agents/{agent}/generativeSettings" + }; + + // Settings for Generative Fallback. + message FallbackSettings { + // Prompt template. + message PromptTemplate { + // Prompt name. + string display_name = 1; + + // Prompt text that is sent to a LLM on no-match default, placeholders are + // filled downstream. For example: "Here is a conversation $conversation, + // a response is: " + string prompt_text = 2; + + // If the flag is true, the prompt is frozen and cannot be modified by + // users. + bool frozen = 3; + } + + // Display name of the selected prompt. + string selected_prompt = 3; + + // Stored prompts that can be selected, for example default templates like + // "conservative" or "chatty", or user defined ones. + repeated PromptTemplate prompt_templates = 4; + } + + // Settings for knowledge connector. These parameters are used for LLM prompt + // like "You are . You are a helpful and verbose at + // , . Your task is to help humans on + // ". + message KnowledgeConnectorSettings { + // Name of the company, organization or other entity that the agent + // represents. Used for knowledge connector LLM prompt and for knowledge + // search. + string business = 1; + + // Name of the virtual agent. Used for LLM prompt. Can be left empty. + string agent = 2; + + // Identity of the agent, e.g. "virtual agent", "AI assistant". + string agent_identity = 3; + + // Company description, used for LLM prompt, e.g. "a family company selling + // freshly roasted coffee beans". + string business_description = 4; + + // Agent scope, e.g. "Example company website", "internal Example + // company website for employees", "manual of car owner". + string agent_scope = 5; + + // Whether to disable fallback to Data Store search results (in case the LLM + // couldn't pick a proper answer). Per default the feature is enabled. + bool disable_data_store_fallback = 8; + } + + // Format: + // `projects//locations//agents//generativeSettings`. + string name = 5; + + // Settings for Generative Fallback. + FallbackSettings fallback_settings = 1; + + // Settings for Generative Safety. + SafetySettings generative_safety_settings = 3; + + // Settings for knowledge connector. + KnowledgeConnectorSettings knowledge_connector_settings = 7; + + // Language for this settings. + string language_code = 4; + + // LLM model settings. + LlmModelSettings llm_model_settings = 8; +} + +// Settings for LLM models. +message LlmModelSettings { + // Generative model parameters to control the model behavior. + message Parameters { + // The input token limits for 1 LLM call. For the limit of each model, see + // https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models for + // more information. + enum InputTokenLimit { + // Limit not specified. Treated as 'INPUT_TOKEN_LIMIT_SHORT'. + INPUT_TOKEN_LIMIT_UNSPECIFIED = 0; + + // Input token limit up to 8k. + INPUT_TOKEN_LIMIT_SHORT = 1; + + // Input token limit up to 32k. + INPUT_TOKEN_LIMIT_MEDIUM = 2; + + // Input token limit up to 100k. + INPUT_TOKEN_LIMIT_LONG = 3; + } + + // The output token limits for 1 LLM call. The limits are subject to change. + // For the limit of each model, see + // https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models for + // more information. + enum OutputTokenLimit { + // Limit not specified. + OUTPUT_TOKEN_LIMIT_UNSPECIFIED = 0; + + // Input token limit up to 512 tokens. + OUTPUT_TOKEN_LIMIT_SHORT = 1; + + // Input token limit up to 1k. + OUTPUT_TOKEN_LIMIT_MEDIUM = 2; + + // Input token limit up to 2k. + OUTPUT_TOKEN_LIMIT_LONG = 3; + } + + // The temperature used for sampling during response generation. Value + // ranges from 0 to 1. Temperature controls the degree of randomness in + // token selection. Lower temperature means less randomness, while higher + // temperature means more randomness. + // Valid range: [0.0, 1.0] + optional float temperature = 1; + + // The input token limit. + // This setting is currently only supported by playbooks. + optional InputTokenLimit input_token_limit = 2; + + // The output token limit. + // This setting is currently only supported by playbooks. + // Only one of output_token_limit and max_output_tokens is allowed to be + // set. + optional OutputTokenLimit output_token_limit = 3; + } + + // The selected LLM model. + string model = 1; + + // The custom prompt to use. + string prompt_text = 2; + + // Generative model parameters. + Parameters parameters = 4; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generator.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generator.proto new file mode 100644 index 000000000000..a823be3ec7fe --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generator.proto @@ -0,0 +1,275 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/generative_settings.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "GeneratorProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [Generators][google.cloud.dialogflow.cx.v3beta1.Generator] +service Generators { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all generators in the specified agent. + rpc ListGenerators(ListGeneratorsRequest) returns (ListGeneratorsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified generator. + rpc GetGenerator(GetGeneratorRequest) returns (Generator) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a generator in the specified agent. + rpc CreateGenerator(CreateGeneratorRequest) returns (Generator) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators" + body: "generator" + }; + option (google.api.method_signature) = "parent,generator"; + } + + // Update the specified generator. + rpc UpdateGenerator(UpdateGeneratorRequest) returns (Generator) { + option (google.api.http) = { + patch: "/v3beta1/{generator.name=projects/*/locations/*/agents/*/generators/*}" + body: "generator" + }; + option (google.api.method_signature) = "generator,update_mask"; + } + + // Deletes the specified generators. + rpc DeleteGenerator(DeleteGeneratorRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Generators contain prompt to be sent to the LLM model to generate text. The +// prompt can contain parameters which will be resolved before calling the +// model. It can optionally contain banned phrases to ensure the model responses +// are safe. +message Generator { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Generator" + pattern: "projects/{project}/locations/{location}/agents/{agent}/generators/{generator}" + }; + + // Represents a custom placeholder in the prompt text. + message Placeholder { + // Unique ID used to map custom placeholder to parameters in fulfillment. + string id = 1; + + // Custom placeholder value in the prompt text. + string name = 2; + } + + // Parameters to be passed to the LLM. If not set, default values will be + // used. + message ModelParameter { + // The temperature used for sampling. Temperature sampling occurs after both + // topP and topK have been applied. + // Valid range: [0.0, 1.0] + // Low temperature = less random. High temperature = more random. + optional float temperature = 1; + + // The maximum number of tokens to generate. + optional int32 max_decode_steps = 2; + + // If set, only the tokens comprising the top top_p probability mass are + // considered. If both top_p and top_k are + // set, top_p will be used for further refining candidates selected with + // top_k. + // Valid range: (0.0, 1.0]. + // Small topP = less random. Large topP = more random. + optional float top_p = 3; + + // If set, the sampling process in each step is limited to the top_k tokens + // with highest probabilities. + // Valid range: [1, 40] or 1000+. + // Small topK = less random. Large topK = more random. + optional int32 top_k = 4; + } + + // The unique identifier of the generator. + // Must be set for the + // [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator] + // method. [Generators.CreateGenerate][] populates the name automatically. + // Format: + // `projects//locations//agents//generators/`. + string name = 1; + + // Required. The human-readable name of the generator, unique within the + // agent. The prompt contains pre-defined parameters such as $conversation, + // $last-user-utterance, etc. populated by Dialogflow. It can also contain + // custom placeholders which will be resolved during fulfillment. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Prompt for the LLM model. + Phrase prompt_text = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of custom placeholders in the prompt text. + repeated Placeholder placeholders = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // The LLM model settings. + LlmModelSettings llm_model_settings = 9; + + // Parameters passed to the LLM to configure its behavior. + ModelParameter model_parameter = 8; +} + +// Text input which can be used for prompt or banned phrases. +message Phrase { + // Required. Text input which can be used for prompt or banned phrases. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators]. +message ListGeneratorsRequest { + // Required. The agent to list all generators for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Generator" + } + ]; + + // The language to list generators for. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators]. +message ListGeneratorsResponse { + // The list of generators. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Generator generators = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Generators.GetGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.GetGenerator]. +message GetGeneratorRequest { + // Required. The name of the generator. + // Format: + // `projects//locations//agents//generators/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Generator" + } + ]; + + // The language to list generators for. + string language_code = 2; +} + +// The request message for +// [Generators.CreateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.CreateGenerator]. +message CreateGeneratorRequest { + // Required. The agent to create a generator for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Generator" + } + ]; + + // Required. The generator to create. + Generator generator = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language to create generators for the following fields: + // * `Generator.prompt_text.text` + // If not specified, the agent's default language is used. + string language_code = 3; +} + +// The request message for +// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator]. +message UpdateGeneratorRequest { + // Required. The generator to update. + Generator generator = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language to list generators for. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [Generators.DeleteGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGenerator]. +message DeleteGeneratorRequest { + // Required. The name of the generator to delete. + // Format: + // `projects//locations//agents//generators/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Generator" + } + ]; + + // This field has no effect for generators not being used. + // For generators that are used by pages/flows/transition route groups: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the generator, as well + // as any references to the generator (i.e. + // [Generator][Fulfillment.generator]) in fulfillments. + bool force = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto new file mode 100644 index 000000000000..66f4022b24f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto @@ -0,0 +1,51 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ImportStrategyProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Import strategies for the conflict resolution of resources (i.e. intents, +// entities, and webhooks) with identical display names during import +// operations. +enum ImportStrategy { + // Unspecified. Treated as 'CREATE_NEW'. + IMPORT_STRATEGY_UNSPECIFIED = 0; + + // Create a new resource with a numeric suffix appended to the end of the + // existing display name. + IMPORT_STRATEGY_CREATE_NEW = 1; + + // Replace existing resource with incoming resource in the content to be + // imported. + IMPORT_STRATEGY_REPLACE = 2; + + // Keep existing resource and discard incoming resource in the content to be + // imported. + IMPORT_STRATEGY_KEEP = 3; + + // Combine existing and incoming resources when a conflict is encountered. + IMPORT_STRATEGY_MERGE = 4; + + // Throw error if a conflict is encountered. + IMPORT_STRATEGY_THROW_ERROR = 5; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/inline.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/inline.proto new file mode 100644 index 000000000000..af522f263110 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/inline.proto @@ -0,0 +1,43 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "InlineProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Inline destination for a Dialogflow operation that writes or exports objects +// (e.g. [intents][google.cloud.dialogflow.cx.v3beta1.Intent]) outside of +// Dialogflow. +message InlineDestination { + // Output only. The uncompressed byte content for the objects. + // Only populated in responses. + bytes content = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Inline source for a Dialogflow operation that reads or imports objects +// (e.g. [intents][google.cloud.dialogflow.cx.v3beta1.Intent]) into Dialogflow. +message InlineSource { + // The uncompressed byte content for the objects. + bytes content = 1; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/intent.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/intent.proto new file mode 100644 index 000000000000..18701c220c17 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/intent.proto @@ -0,0 +1,613 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/inline.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "IntentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent]. +service Intents { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all intents in the specified agent. + rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified intent. + rpc GetIntent(GetIntentRequest) returns (Intent) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an intent in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateIntent(CreateIntentRequest) returns (Intent) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents" + body: "intent" + }; + option (google.api.method_signature) = "parent,intent"; + } + + // Updates the specified intent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateIntent(UpdateIntentRequest) returns (Intent) { + option (google.api.http) = { + patch: "/v3beta1/{intent.name=projects/*/locations/*/agents/*/intents/*}" + body: "intent" + }; + option (google.api.method_signature) = "intent,update_mask"; + } + + // Deletes the specified intent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Imports the specified intents into the agent. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ImportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata] + // - `response`: + // [ImportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse] + rpc ImportIntents(ImportIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportIntentsResponse" + metadata_type: "ImportIntentsMetadata" + }; + } + + // Exports the selected intents. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ExportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata] + // - `response`: + // [ExportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse] + rpc ExportIntents(ExportIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportIntentsResponse" + metadata_type: "ExportIntentsMetadata" + }; + } +} + +// An intent represents a user's intent to interact with a conversational agent. +// +// You can provide information for the Dialogflow API to use to match user input +// to an intent by adding training phrases (i.e., examples of user input) to +// your intent. +message Intent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Intent" + pattern: "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}" + }; + + // Represents an example that the agent is trained on to identify the intent. + message TrainingPhrase { + // Represents a part of a training phrase. + message Part { + // Required. The text for this part. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] + // used to annotate this part of the training phrase. This field is + // required for annotated parts of the training phrase. + string parameter_id = 2; + } + + // Output only. The unique identifier of the training phrase. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The ordered list of training phrase parts. + // The parts are concatenated in order to form the training phrase. + // + // Note: The API does not automatically annotate training phrases like the + // Dialogflow Console does. + // + // Note: Do not forget to include whitespace at part boundaries, so the + // training phrase is well formatted when the parts are concatenated. + // + // If the training phrase does not need to be annotated with parameters, + // you just need a single part with only the + // [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] + // field set. + // + // If you want to annotate the training phrase, you must create multiple + // parts, where the fields of each part are populated in one of two ways: + // + // - `Part.text` is set to a part of the phrase that has no parameters. + // - `Part.text` is set to a part of the phrase that you want to annotate, + // and the `parameter_id` field is set. + repeated Part parts = 2 [(google.api.field_behavior) = REQUIRED]; + + // Indicates how many times this example was added to the intent. + int32 repeat_count = 3; + } + + // Represents an intent parameter. + message Parameter { + // Required. The unique identifier of the parameter. This field + // is used by [training + // phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to + // annotate their + // [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part]. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The entity type of the parameter. + // Format: + // `projects/-/locations/-/agents/-/entityTypes/` for + // system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` + // for developer entity types. + string entity_type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 3; + + // Indicates whether the parameter content should be redacted in log. If + // redaction is enabled, the parameter content will be replaced by parameter + // name during logging. + // Note: the parameter content is subject to redaction if either parameter + // level redaction or [entity type level + // redaction][google.cloud.dialogflow.cx.v3beta1.EntityType.redact] is + // enabled. + bool redact = 4; + } + + // The unique identifier of the intent. + // Required for the + // [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] + // method. + // [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent] + // populates the name automatically. + // Format: + // `projects//locations//agents//intents/`. + string name = 1; + + // Required. The human-readable name of the intent, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The collection of training phrases the agent is trained on to identify the + // intent. + repeated TrainingPhrase training_phrases = 3; + + // The collection of parameters associated with the intent. + repeated Parameter parameters = 4; + + // The priority of this intent. Higher numbers represent higher + // priorities. + // + // - If the supplied value is unspecified or 0, the service + // translates the value to 500,000, which corresponds to the + // `Normal` priority in the console. + // - If the supplied value is negative, the intent is ignored + // in runtime detect intent requests. + int32 priority = 5; + + // Indicates whether this is a fallback intent. Currently only default + // fallback intent is allowed in the agent, which is added upon agent + // creation. + // Adding training phrases to fallback intent is useful in the case of + // requests that are mistakenly matched, since training phrases assigned to + // fallback intents act as negative examples that triggers no-match event. + bool is_fallback = 6; + + // The key/value metadata to label an intent. Labels can contain + // lowercase letters, digits and the symbols '-' and '_'. International + // characters are allowed, including letters from unicase alphabets. Keys must + // start with a letter. Keys and values can be no longer than 63 characters + // and no more than 128 bytes. + // + // Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed + // Dialogflow defined labels include: + // * sys-head + // * sys-contextual + // The above labels do not require value. "sys-head" means the intent is a + // head intent. "sys-contextual" means the intent is a contextual intent. + map labels = 7; + + // Human readable description for better understanding an intent like its + // scope, content, result etc. Maximum character limit: 140 characters. + string description = 8; + + // Optional. Matching DTMF pattern for the intent. + string dtmf_pattern = 16 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. +message ListIntentsRequest { + // Required. The agent to list all intents for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to list intents for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The resource view to apply to the returned intent. + IntentView intent_view = 5; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. +message ListIntentsResponse { + // The list of intents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Intent intents = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Intents.GetIntent][google.cloud.dialogflow.cx.v3beta1.Intents.GetIntent]. +message GetIntentRequest { + // Required. The name of the intent. + // Format: + // `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to retrieve the intent for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]. +message CreateIntentRequest { + // Required. The agent to create an intent for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The intent to create. + Intent intent = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent]. +message UpdateIntentRequest { + // Required. The intent to update. + Intent intent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntent]. +message DeleteIntentRequest { + // Required. The name of the intent to delete. + // Format: + // `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the options for views of an intent. +// An intent can be a sizable object. Therefore, we provide a resource view that +// does not return training phrases in the response. +enum IntentView { + // Not specified. Treated as INTENT_VIEW_FULL. + INTENT_VIEW_UNSPECIFIED = 0; + + // Training phrases field is not populated in the response. + INTENT_VIEW_PARTIAL = 1; + + // All fields are populated. + INTENT_VIEW_FULL = 2; +} + +// The request message for +// [Intents.ImportIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ImportIntents]. +message ImportIntentsRequest { + // Merge option when display name conflicts exist during import. + enum MergeOption { + // Unspecified. Should not be used. + MERGE_OPTION_UNSPECIFIED = 0; + + // DEPRECATED: Please use + // [REPORT_CONFLICT][ImportIntentsRequest.REPORT_CONFLICT] instead. + // Fail the request if there are intents whose display names conflict with + // the display names of intents in the agent. + REJECT = 1 [deprecated = true]; + + // Replace the original intent in the agent with the new intent when display + // name conflicts exist. + REPLACE = 2; + + // Merge the original intent with the new intent when display name conflicts + // exist. + MERGE = 3; + + // Create new intents with new display names to differentiate them from the + // existing intents when display name conflicts exist. + RENAME = 4; + + // Report conflict information if display names conflict is detected. + // Otherwise, import intents. + REPORT_CONFLICT = 5; + + // Keep the original intent and discard the conflicting new intent when + // display name conflicts exist. + KEEP = 6; + } + + // Required. The agent to import the intents into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The intents to import. + oneof intents { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import intents from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string intents_uri = 2; + + // Uncompressed byte content of intents. + InlineSource intents_content = 3; + } + + // Merge option for importing intents. If not specified, `REJECT` is assumed. + MergeOption merge_option = 4; +} + +// The response message for +// [Intents.ImportIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ImportIntents]. +message ImportIntentsResponse { + // Conflicting resources detected during the import process. Only filled when + // [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] is set in the + // request and there are conflicts in the display names. + message ConflictingResources { + // Display names of conflicting intents. + repeated string intent_display_names = 1; + + // Display names of conflicting entities. + repeated string entity_display_names = 2; + } + + // The unique identifier of the imported intents. + // Format: + // `projects//locations//agents//intents/`. + repeated string intents = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Info which resources have conflicts when + // [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] merge_option is + // set in ImportIntentsRequest. + ConflictingResources conflicting_resources = 2; +} + +// Metadata returned for the +// [Intents.ImportIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ImportIntents] +// long running operation. +message ImportIntentsMetadata {} + +// The request message for +// [Intents.ExportIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ExportIntents]. +message ExportIntentsRequest { + // Data format of the exported intents. + enum DataFormat { + // Unspecified format. Treated as `BLOB`. + DATA_FORMAT_UNSPECIFIED = 0; + + // Intents will be exported as raw bytes. + BLOB = 1; + + // Intents will be exported in JSON format. + JSON = 2; + + // Intents will be exported in CSV format. + CSV = 3; + } + + // Required. The name of the parent agent to export intents. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The name of the intents to export. + // Format: + // `projects//locations//agents//intents/`. + repeated string intents = 2 [(google.api.field_behavior) = REQUIRED]; + + // The destination to export. + oneof destination { + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the + // intents to. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string intents_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The option to return the serialized intents inline. + bool intents_content_inline = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The data format of the exported intents. If not specified, `BLOB` + // is assumed. + DataFormat data_format = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Intents.ExportIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ExportIntents]. +message ExportIntentsResponse { + // The exported intents. + oneof intents { + // The URI to a file containing the exported intents. This field is + // populated only if `intents_uri` is specified in + // [ExportIntentsRequest][google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest]. + string intents_uri = 1; + + // Uncompressed byte content for intents. This field is populated only if + // `intents_content_inline` is set to true in + // [ExportIntentsRequest][google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest]. + InlineDestination intents_content = 2; + } +} + +// Metadata returned for the +// [Intents.ExportIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ExportIntents] +// long running operation. +message ExportIntentsMetadata {} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/page.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/page.proto new file mode 100644 index 000000000000..00d12a327959 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/page.proto @@ -0,0 +1,651 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto"; +import "google/cloud/dialogflow/cx/v3beta1/fulfillment.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "PageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. +service Pages { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all pages in the specified flow. + rpc ListPages(ListPagesRequest) returns (ListPagesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified page. + rpc GetPage(GetPageRequest) returns (Page) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a page in the specified flow. + rpc CreatePage(CreatePageRequest) returns (Page) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + body: "page" + }; + option (google.api.method_signature) = "parent,page"; + } + + // Updates the specified page. + rpc UpdatePage(UpdatePageRequest) returns (Page) { + option (google.api.http) = { + patch: "/v3beta1/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}" + body: "page" + }; + option (google.api.method_signature) = "page,update_mask"; + } + + // Deletes the specified page. + rpc DeletePage(DeletePageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A Dialogflow CX conversation (session) can be described and visualized as a +// state machine. The states of a CX session are represented by pages. +// +// For each flow, you define many pages, where your combined pages can handle a +// complete conversation on the topics the flow is designed for. At any given +// moment, exactly one page is the current page, the current page is considered +// active, and the flow associated with that page is considered active. Every +// flow has a special start page. When a flow initially becomes active, the +// start page page becomes the current page. For each conversational turn, the +// current page will either stay the same or transition to another page. +// +// You configure each page to collect information from the end-user that is +// relevant for the conversational state represented by the page. +// +// For more information, see the +// [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). +message Page { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Page" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}" + }; + + // The unique identifier of the page. + // Required for the + // [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] + // method. + // [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage] + // populates the name automatically. + // Format: + // `projects//locations//agents//flows//pages/`. + string name = 1; + + // Required. The human-readable name of the page, unique within the flow. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the page. The maximum length is 500 characters. + string description = 19; + + // The fulfillment to call when the session is entering the page. + Fulfillment entry_fulfillment = 7; + + // The form associated with the page, used for collecting parameters + // relevant to the page. + Form form = 4; + + // Ordered list of + // [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + // added to the page. Transition route groups must be unique within a page. If + // the page links both flow-level transition route groups and agent-level + // transition route groups, the flow-level ones will have higher priority and + // will be put before the agent-level ones. + // + // * If multiple transition routes within a page scope refer to the same + // intent, then the precedence order is: page's transition route -> page's + // transition route group -> flow's transition routes. + // + // * If multiple transition route groups within a page contain the same + // intent, then the first group in the ordered list takes precedence. + // + // Format:`projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/` + // for agent-level groups. + repeated string transition_route_groups = 11 + [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + }]; + + // A list of transitions for the transition rules of this page. + // They route the conversation to another page in the same flow, or another + // flow. + // + // When we are in a certain page, the TransitionRoutes are evaluated in the + // following order: + // + // * TransitionRoutes defined in the page with intent specified. + // * TransitionRoutes defined in the + // [transition route + // groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups] + // with intent specified. + // * TransitionRoutes defined in flow with intent specified. + // * TransitionRoutes defined in the + // [transition route + // groups][google.cloud.dialogflow.cx.v3beta1.Flow.transition_route_groups] + // with intent specified. + // * TransitionRoutes defined in the page with only condition specified. + // * TransitionRoutes defined in the + // [transition route + // groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups] + // with only condition specified. + repeated TransitionRoute transition_routes = 9; + + // Handlers associated with the page to handle events such as webhook errors, + // no match or no input. + repeated EventHandler event_handlers = 10; + + // Hierarchical advanced settings for this page. The settings exposed at the + // lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 13; + + // Optional. Knowledge connector configuration. + KnowledgeConnectorSettings knowledge_connector_settings = 18 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A form is a data model that groups related parameters that can be collected +// from the user. The process in which the agent prompts the user and collects +// parameter values from the user is called form filling. A form can be added to +// a [page][google.cloud.dialogflow.cx.v3beta1.Page]. When form filling is done, +// the filled parameters will be written to the +// [session][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. +message Form { + // Represents a form parameter. + message Parameter { + // Configuration for how the filling of a parameter should be handled. + message FillBehavior { + // Required. The fulfillment to provide the initial prompt that the agent + // can present to the user in order to fill the parameter. + Fulfillment initial_prompt_fulfillment = 3 + [(google.api.field_behavior) = REQUIRED]; + + // The handlers for parameter-level events, used to provide reprompt for + // the parameter or transition to a different page/flow. The supported + // events are: + // * `sys.no-match-`, where N can be from 1 to 6 + // * `sys.no-match-default` + // * `sys.no-input-`, where N can be from 1 to 6 + // * `sys.no-input-default` + // * `sys.invalid-parameter` + // + // `initial_prompt_fulfillment` provides the first prompt for the + // parameter. + // + // If the user's response does not fill the parameter, a + // no-match/no-input event will be triggered, and the fulfillment + // associated with the `sys.no-match-1`/`sys.no-input-1` handler (if + // defined) will be called to provide a prompt. The + // `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to + // the next no-match/no-input event, and so on. + // + // A `sys.no-match-default` or `sys.no-input-default` handler will be used + // to handle all following no-match/no-input events after all numbered + // no-match/no-input handlers for the parameter are consumed. + // + // A `sys.invalid-parameter` handler can be defined to handle the case + // where the parameter values have been `invalidated` by webhook. For + // example, if the user's response fill the parameter, however the + // parameter was invalidated by webhook, the fulfillment associated with + // the `sys.invalid-parameter` handler (if defined) will be called to + // provide a prompt. + // + // If the event handler for the corresponding event can't be found on the + // parameter, `initial_prompt_fulfillment` will be re-prompted. + repeated EventHandler reprompt_event_handlers = 5; + } + + // Required. The human-readable name of the parameter, unique within the + // form. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the parameter is required. Optional parameters will not + // trigger prompts; however, they are filled if the user specifies them. + // Required parameters must be filled before form filling concludes. + bool required = 2; + + // Required. The entity type of the parameter. + // Format: + // `projects/-/locations/-/agents/-/entityTypes/` for + // system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` + // for developer entity types. + string entity_type = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 4; + + // Required. Defines fill behavior for the parameter. + FillBehavior fill_behavior = 7 [(google.api.field_behavior) = REQUIRED]; + + // The default value of an optional parameter. If the parameter is required, + // the default value will be ignored. + google.protobuf.Value default_value = 9; + + // Indicates whether the parameter content should be redacted in log. If + // redaction is enabled, the parameter content will be replaced by parameter + // name during logging. + // Note: the parameter content is subject to redaction if either parameter + // level redaction or [entity type level + // redaction][google.cloud.dialogflow.cx.v3beta1.EntityType.redact] is + // enabled. + bool redact = 11; + + // Hierarchical advanced settings for this parameter. The settings exposed + // at the lower level overrides the settings exposed at the higher level. + AdvancedSettings advanced_settings = 12; + } + + // Parameters to collect from the user. + repeated Parameter parameters = 1; +} + +// An event handler specifies an +// [event][google.cloud.dialogflow.cx.v3beta1.EventHandler.event] that can be +// handled during a session. When the specified event happens, the following +// actions are taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.EventHandler.trigger_fulfillment] +// associated with the event, it will be called. +// * If there is a +// [`target_page`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_page] +// associated with the event, the session will transition into the specified +// page. +// * If there is a +// [`target_flow`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_flow] +// associated with the event, the session will transition into the specified +// flow. +message EventHandler { + // Output only. The unique identifier of this event handler. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the event to handle. + string event = 4 [(google.api.field_behavior) = REQUIRED]; + + // The fulfillment to call when the event occurs. + // Handling webhook errors with a fulfillment enabled with webhook could + // cause infinite loop. It is invalid to specify such fulfillment for a + // handler handling webhooks. + Fulfillment trigger_fulfillment = 5; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute]), or + // another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 3 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + + // The target playbook to transition to. + // Format: + // `projects//locations//agents//playbooks/`. + string target_playbook = 7 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + }]; + } +} + +// A transition route specifies a +// [intent][google.cloud.dialogflow.cx.v3beta1.Intent] that can be matched +// and/or a data condition that can be evaluated during a session. When a +// specified transition is matched, the following actions are taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.trigger_fulfillment] +// associated with the transition, it will be called. +// * If there is a +// [`target_page`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_page] +// associated with the transition, the session will transition into the +// specified page. +// * If there is a +// [`target_flow`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_flow] +// associated with the transition, the session will transition into the +// specified flow. +message TransitionRoute { + // Output only. The unique identifier of this transition route. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The description of the transition route. The maximum length is + // 500 characters. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; + + // The unique identifier of an + // [Intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: + // `projects//locations//agents//intents/`. + // Indicates that the transition can only happen when the given intent is + // matched. + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // The condition to evaluate against [form + // parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or [session + // parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string condition = 2; + + // The fulfillment to call when the condition is satisfied. At least one of + // `trigger_fulfillment` and `target` must be specified. When both are + // defined, `trigger_fulfillment` is executed first. + Fulfillment trigger_fulfillment = 3; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute]), or + // another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// The request message for +// [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. +message ListPagesRequest { + // Required. The flow to list all pages for. + // Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // The language to list pages for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. +message ListPagesResponse { + // The list of pages. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Page pages = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Pages.GetPage][google.cloud.dialogflow.cx.v3beta1.Pages.GetPage]. +message GetPageRequest { + // Required. The name of the page. + // Format: + // `projects//locations//agents//flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // The language to retrieve the page for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]. +message CreatePageRequest { + // Required. The flow to create a page for. + // Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // Required. The page to create. + Page page = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage]. +message UpdatePageRequest { + // Required. The page to update. + Page page = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.entry_fulfillment.conditional_cases` + // * `Page.event_handlers.trigger_fulfillment.messages` + // * `Page.event_handlers.trigger_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * + // `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * + // `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + // * `Page.transition_routes.trigger_fulfillment.messages` + // * `Page.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [Pages.DeletePage][google.cloud.dialogflow.cx.v3beta1.Pages.DeletePage]. +message DeletePageRequest { + // Required. The name of the page to delete. + // Format: + // `projects//locations//agents//Flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // This field has no effect for pages with no incoming transitions. + // For pages with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the page, as well as + // any transitions to the page (i.e. [Target + // page][EventHandler.target_page] in event handlers or [Target + // page][TransitionRoute.target_page] in transition routes that point to + // this page will be cleared). + bool force = 2; +} + +// The Knowledge Connector settings for this page or flow. +// This includes information such as the attached Knowledge Bases, and the way +// to execute fulfillment. +message KnowledgeConnectorSettings { + // Whether Knowledge Connector is enabled or not. + bool enabled = 1; + + // The fulfillment to be triggered. + // + // When the answers from the Knowledge Connector are selected by Dialogflow, + // you can utitlize the request scoped parameter `$request.knowledge.answers` + // (contains up to the 5 highest confidence answers) and + // `$request.knowledge.questions` (contains the corresponding questions) to + // construct the fulfillment. + Fulfillment trigger_fulfillment = 3; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this + // [KnowledgeConnectorSettings][google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings]), + // or another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } + + // Optional. List of related data store connections. + repeated DataStoreConnection data_store_connections = 6 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto new file mode 100644 index 000000000000..7e5f4b7d608d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto @@ -0,0 +1,119 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ParameterDefinitionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; + +// Defines the properties of a parameter. +// Used to define parameters used in the agent and the +// input / output parameters for each fulfillment. +message ParameterDefinition { + // Parameter types are used for validation. + // These types are consistent with + // [google.protobuf.Value][google.protobuf.Value]. + enum ParameterType { + // Not specified. No validation will be performed. + PARAMETER_TYPE_UNSPECIFIED = 0; + + // Represents any string value. + STRING = 1; + + // Represents any number value. + NUMBER = 2; + + // Represents a boolean value. + BOOLEAN = 3; + + // Represents a null value. + NULL = 4; + + // Represents any object value. + OBJECT = 5; + + // Represents a repeated value. + LIST = 6; + } + + // Required. Name of parameter. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Type of parameter. + ParameterType type = 2 [deprecated = true]; + + // Optional. Type schema of parameter. + TypeSchema type_schema = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Human-readable description of the parameter. Limited to 300 characters. + string description = 3; +} + +// Encapsulates different type schema variations: either a reference to an +// a schema that's already defined by a tool, or an inline definition. +message TypeSchema { + // A reference to the schema of an existing tool. + message SchemaReference { + // The tool that contains this schema definition. + // Format: + // `projects//locations//agents//tools/`. + string tool = 1; + + // The name of the schema. + string schema = 2; + } + + // The encapsulated schema. + oneof schema { + // Set if this is an inline schema definition. + InlineSchema inline_schema = 1; + + // Set if this is a schema reference. + SchemaReference schema_reference = 2; + } +} + +// A type schema object that's specified inline. +message InlineSchema { + // Data type of the schema. + DataType type = 1; + + // Schema of the elements if this is an ARRAY type. + TypeSchema items = 2; +} + +// Defines data types that are supported for inlined schemas. These types are +// consistent with [google.protobuf.Value][google.protobuf.Value]. +enum DataType { + // Not specified. + DATA_TYPE_UNSPECIFIED = 0; + + // Represents any string value. + STRING = 1; + + // Represents any number value. + NUMBER = 2; + + // Represents a boolean value. + BOOLEAN = 3; + + // Represents a repeated value. + ARRAY = 6; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto new file mode 100644 index 000000000000..a7974b4a6465 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto @@ -0,0 +1,712 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/code_block.proto"; +import "google/cloud/dialogflow/cx/v3beta1/example.proto"; +import "google/cloud/dialogflow/cx/v3beta1/fulfillment.proto"; +import "google/cloud/dialogflow/cx/v3beta1/generative_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/import_strategy.proto"; +import "google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "PlaybookProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing +// [Playbooks][google.cloud.dialogflow.cx.v3beta1.Playbook]. +service Playbooks { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a playbook in a specified agent. + rpc CreatePlaybook(CreatePlaybookRequest) returns (Playbook) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks" + body: "playbook" + }; + option (google.api.method_signature) = "parent,playbook"; + } + + // Deletes a specified playbook. + rpc DeletePlaybook(DeletePlaybookRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of playbooks in the specified agent. + rpc ListPlaybooks(ListPlaybooksRequest) returns (ListPlaybooksResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified Playbook. + rpc GetPlaybook(GetPlaybookRequest) returns (Playbook) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Exports the specified playbook to a binary file. + // + // Note that resources (e.g. examples, tools) that the playbook + // references will also be exported. + rpc ExportPlaybook(ExportPlaybookRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportPlaybookResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Imports the specified playbook to the specified agent from a binary file. + rpc ImportPlaybook(ImportPlaybookRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportPlaybookResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Updates the specified Playbook. + rpc UpdatePlaybook(UpdatePlaybookRequest) returns (Playbook) { + option (google.api.http) = { + patch: "/v3beta1/{playbook.name=projects/*/locations/*/agents/*/playbooks/*}" + body: "playbook" + }; + option (google.api.method_signature) = "playbook,update_mask"; + } + + // Creates a version for the specified Playbook. + rpc CreatePlaybookVersion(CreatePlaybookVersionRequest) + returns (PlaybookVersion) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions" + body: "playbook_version" + }; + option (google.api.method_signature) = "parent,playbook_version"; + } + + // Retrieves the specified version of the Playbook. + rpc GetPlaybookVersion(GetPlaybookVersionRequest) returns (PlaybookVersion) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the specified version of the Playbook and stores it as the + // current playbook draft, returning the playbook with resources updated. + rpc RestorePlaybookVersion(RestorePlaybookVersionRequest) + returns (RestorePlaybookVersionResponse) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Lists versions for the specified Playbook. + rpc ListPlaybookVersions(ListPlaybookVersionsRequest) + returns (ListPlaybookVersionsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the specified version of the Playbook. + rpc DeletePlaybookVersion(DeletePlaybookVersionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [Playbooks.CreatePlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.CreatePlaybook]. +message CreatePlaybookRequest { + // Required. The agent to create a playbook for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Required. The playbook to create. + Playbook playbook = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Playbooks.DeletePlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.DeletePlaybook]. +message DeletePlaybookRequest { + // Required. The name of the playbook to delete. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; +} + +// The request message for +// [Playbooks.ListPlaybooks][google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybooks]. +message ListPlaybooksRequest { + // Required. The agent to list playbooks from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Playbooks.ListPlaybooks][google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybooks]. +message ListPlaybooksResponse { + // The list of playbooks. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Playbook playbooks = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Playbooks.GetPlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.GetPlaybook]. +message GetPlaybookRequest { + // Required. The name of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; +} + +// The request message for +// [Playbooks.UpdatePlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.UpdatePlaybook]. +message UpdatePlaybookRequest { + // Required. The playbook to update. + Playbook playbook = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Playbook is the basic building block to instruct the LLM how to execute a +// certain task. +// +// A playbook consists of a goal to accomplish, an optional list of step by step +// instructions (the step instruction may refers to name of the custom or +// default plugin tools to use) to perform the task, +// a list of contextual input data to be passed in at the beginning of the +// invoked, and a list of output parameters to store the playbook result. +message Playbook { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Playbook" + pattern: "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}" + }; + + // Message of single step execution. + message Step { + // Instruction on how to execute current step. + oneof instruction { + // Step instruction in text format. + string text = 1; + } + + // Sub-processing needed to execute the current step. + repeated Step steps = 2; + } + + // Message of the Instruction of the playbook. + message Instruction { + // General guidelines for the playbook. These are unstructured instructions + // that are not directly part of the goal, e.g. "Always be polite". It's + // valid for this text to be long and used instead of steps altogether. + string guidelines = 1; + + // Ordered list of step by step execution instructions to accomplish + // target goal. + repeated Step steps = 2; + } + + // Type of the playbook. + enum PlaybookType { + // Unspecified type. Default to TASK. + PLAYBOOK_TYPE_UNSPECIFIED = 0; + + // Task playbook. + TASK = 1; + + // Routine playbook. + ROUTINE = 3; + } + + // The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1; + + // Required. The human-readable name of the playbook, unique within an agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. High level description of the goal the playbook intend to + // accomplish. A goal should be concise since it's visible to other playbooks + // that may reference this playbook. + string goal = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Defined structured input parameters for this playbook. + repeated ParameterDefinition input_parameter_definitions = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defined structured output parameters for this playbook. + repeated ParameterDefinition output_parameter_definitions = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Instruction to accomplish target goal. + Instruction instruction = 17; + + // Output only. Estimated number of tokes current playbook takes when sent to + // the LLM. + int64 token_count = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of initial playbook creation. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the playbook version was updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of other playbooks referenced by the current + // playbook in the instructions. + repeated string referenced_playbooks = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The resource name of flows referenced by the current playbook + // in the instructions. + repeated string referenced_flows = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Optional. The resource name of tools referenced by the current playbook in + // the instructions. If not provided explicitly, they are will + // be implied using the tool being referenced in goal and steps. + repeated string referenced_tools = 13 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // Optional. Output only. Names of inline actions scoped to this playbook. + // These actions are in addition to those belonging to referenced tools, child + // playbooks, and flows, e.g. actions that are defined in the playbook's code + // block. + repeated string inline_actions = 22 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The playbook's scoped code block, which may implement handlers + // and actions. + CodeBlock code_block = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Llm model settings for the playbook. + LlmModelSettings llm_model_settings = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Playbook level Settings for speech to text detection. + AdvancedSettings.SpeechSettings speech_settings = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of registered handlers to execute based on the specified + // triggers. + repeated Handler handlers = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the playbook. + PlaybookType playbook_type = 19 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Playbooks.CreatePlaybookVersion][google.cloud.dialogflow.cx.v3beta1.Playbooks.CreatePlaybookVersion]. +message CreatePlaybookVersionRequest { + // Required. The playbook to create a version for. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; + + // Required. The playbook version to create. + PlaybookVersion playbook_version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Playbook version is a snapshot of the playbook at certain timestamp. +message PlaybookVersion { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + pattern: "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}" + plural: "playbookVersions" + singular: "playbookVersion" + }; + + // The unique identifier of the playbook version. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1; + + // Optional. The description of the playbook version. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Snapshot of the playbook when the playbook version is created. + Playbook playbook = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Snapshot of the examples belonging to the playbook when the + // playbook version is created. + repeated Example examples = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the playbook version was created or modified. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for +// [Playbooks.GetPlaybookVersion][google.cloud.dialogflow.cx.v3beta1.Playbooks.GetPlaybookVersion]. +message GetPlaybookVersionRequest { + // Required. The name of the playbook version. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; +} + +// The request message for +// [Playbooks.RestorePlaybookVersion][google.cloud.dialogflow.cx.v3beta1.Playbooks.RestorePlaybookVersion]. +message RestorePlaybookVersionRequest { + // Required. The name of the playbook version. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; +} + +// The response message for +// [Playbooks.RestorePlaybookVersion][google.cloud.dialogflow.cx.v3beta1.Playbooks.RestorePlaybookVersion]. +message RestorePlaybookVersionResponse { + // The updated playbook. + Playbook playbook = 2; +} + +// The request message for +// [Playbooks.ListPlaybookVersions][google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybookVersions]. +message ListPlaybookVersionsRequest { + // Required. The playbook to list versions for. + // Format: + // `projects//locations//agents//playbooks/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Playbooks.ListPlaybookVersions][google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybookVersions]. +message ListPlaybookVersionsResponse { + // The list of playbook version. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated PlaybookVersion playbook_versions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Playbooks.DeletePlaybookVersion][google.cloud.dialogflow.cx.v3beta1.Playbooks.DeletePlaybookVersion]. +message DeletePlaybookVersionRequest { + // Required. The name of the playbook version to delete. + // Format: + // `projects//locations//agents//playbooks//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/PlaybookVersion" + } + ]; +} + +// The request message for +// [Playbooks.ExportPlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.ExportPlaybook]. +message ExportPlaybookRequest { + // Data format of the exported playbook. + enum DataFormat { + // Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0; + + // Flow content will be exported as raw bytes. + BLOB = 1; + + // Flow content will be exported in JSON format. + JSON = 2; + } + + // Required. The name of the playbook to export. + // Format: + // `projects//locations//agents//playbooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the playbook + // to. The format of this URI must be `gs:///`. If + // left unspecified, the serialized playbook is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string playbook_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data format of the exported agent. If not specified, `BLOB` + // is assumed. + DataFormat data_format = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Playbooks.ImportPlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.ImportPlaybook]. +message ImportPlaybookRequest { + // Required. The agent to import the playbook into. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Required. The playbook to import. + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import playbook from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + oneof playbook { + // [Dialogflow access + // control] + // (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string playbook_uri = 2; + + // Uncompressed raw byte content for playbook. + bytes playbook_content = 3; + } + + // Optional. Specifies the import strategy used when resolving resource + // conflicts. + PlaybookImportStrategy import_strategy = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The playbook import strategy used for resource conflict resolution associated +// with an +// [ImportPlaybookRequest][google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest]. +message PlaybookImportStrategy { + // Optional. Specifies the import strategy used when resolving conflicts with + // the main playbook. If not specified, 'CREATE_NEW' is assumed. + ImportStrategy main_playbook_import_strategy = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the import strategy used when resolving referenced + // playbook/flow conflicts. If not specified, 'CREATE_NEW' is assumed. + ImportStrategy nested_resource_import_strategy = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the import strategy used when resolving tool conflicts. + // If not specified, 'CREATE_NEW' is assumed. This will be applied after the + // main playbook and nested resource import strategies, meaning if the + // playbook that references the tool is skipped, the tool will also be + // skipped. + ImportStrategy tool_import_strategy = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Playbooks.ImportPlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.ImportPlaybook]. +message ImportPlaybookResponse { + // Conflicting resources detected during the import process. Only filled when + // [REPORT_CONFLICTS][ImportPlaybookResponse.REPORT_CONFLICTS] is set in the + // request and there are conflicts in the display names. + message ConflictingResources { + // Display name of conflicting main playbook. + string main_playbook_display_name = 1; + + // Display names of conflicting nested playbooks. + repeated string nested_playbook_display_names = 2; + + // Display names of conflicting tools. + repeated string tool_display_names = 3; + } + + // The unique identifier of the new playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + }]; + + // Info which resources have conflicts when + // [REPORT_CONFLICTS][ImportPlaybookResponse.REPORT_CONFLICTS] import strategy + // is set for all resources in ImportPlaybookRequest. + ConflictingResources conflicting_resources = 2; +} + +// The response message for +// [Playbooks.ExportPlaybook][google.cloud.dialogflow.cx.v3beta1.Playbooks.ExportPlaybook]. +message ExportPlaybookResponse { + // The exported playbook. + oneof playbook { + // The URI to a file containing the exported playbook. This field is + // populated only if `playbook_uri` is specified in + // [ExportPlaybookRequest][google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest]. + string playbook_uri = 1; + + // Uncompressed raw byte content for playbook. + bytes playbook_content = 2; + } +} + +// Handler can be used to define custom logic to be executed based on the +// user-specified triggers. +message Handler { + // A handler that is triggered by the specified + // [event][google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.event]. + message EventHandler { + // Required. The name of the event that triggers this handler. + string event = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The condition that must be satisfied to trigger this handler. + string condition = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The fulfillment to call when the event occurs. + Fulfillment fulfillment = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A handler that is triggered on the specific + // [lifecycle_stage][google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.lifecycle_stage] + // of the playbook execution. + message LifecycleHandler { + // Required. The name of the lifecycle stage that triggers this handler. + // Supported values: + // * `playbook-start` + // * `pre-action-selection` + // * `pre-action-execution` + string lifecycle_stage = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The condition that must be satisfied to trigger this handler. + string condition = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The fulfillment to call when this handler is triggered. + Fulfillment fulfillment = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies the type of handler to invoke. + oneof handler { + // A handler triggered by event. + EventHandler event_handler = 1; + + // A handler triggered during specific lifecycle of the playbook execution. + LifecycleHandler lifecycle_handler = 3; + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto new file mode 100644 index 000000000000..14393f5132e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto @@ -0,0 +1,250 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/dialogflow/cx/v3beta1/tool_call.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ResponseMessageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Represents a response message that can be returned by a conversational agent. +// +// Response messages are also used for output audio synthesis. The approach is +// as follows: +// +// * If at least one OutputAudioText response is present, then all +// OutputAudioText responses are linearly concatenated, and the result is used +// for output audio synthesis. +// * If the OutputAudioText responses are a mixture of text and SSML, then the +// concatenated result is treated as SSML; otherwise, the result is treated as +// either text or SSML as appropriate. The agent designer should ideally use +// either text or SSML consistently throughout the bot design. +// * Otherwise, all Text responses are linearly concatenated, and the result is +// used for output audio synthesis. +// +// This approach allows for more sophisticated user experience scenarios, where +// the text displayed to the user may differ from what is heard. +message ResponseMessage { + // The text response message. + message Text { + // Required. A collection of text response variants. If multiple variants + // are defined, only one text response variant is returned at runtime. + repeated string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Whether the playback of this message can be interrupted by + // the end user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Indicates that the conversation should be handed off to a live agent. + // + // Dialogflow only uses this to determine which conversations were handed off + // to a human agent for measurement purposes. What else to do with this signal + // is up to you and your handoff procedures. + // + // You may set this, for example: + // * In the + // [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] + // of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates something went extremely wrong in the + // conversation. + // * In a webhook response when you determine that the customer issue can only + // be handled by a human. + message LiveAgentHandoff { + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that the conversation succeeded, i.e., the bot handled the issue + // that the customer talked to it about. + // + // Dialogflow only uses this to determine which conversations should be + // counted as successful and doesn't process the metadata in this message in + // any way. Note that Dialogflow also considers conversations that get to the + // conversation end page as successful even if they don't return + // [ConversationSuccess][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess]. + // + // You may set this, for example: + // * In the + // [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] + // of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates that the conversation succeeded. + // * In a webhook response when you determine that you handled the customer + // issue. + message ConversationSuccess { + // Custom metadata. Dialogflow doesn't impose any structure on this. + google.protobuf.Struct metadata = 1; + } + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + message OutputAudioText { + // The source, which is either plain text or SSML. + oneof source { + // The raw text to be synthesized. + string text = 1; + + // The SSML text to be synthesized. For more information, see + // [SSML](/speech/text-to-speech/docs/ssml). + string ssml = 2; + } + + // Output only. Whether the playback of this message can be interrupted by + // the end user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Indicates that interaction with the Dialogflow agent has ended. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message EndInteraction {} + + // Specifies an audio clip to be played by the client as part of the response. + message PlayAudio { + // Required. URI of the audio clip. Dialogflow does not impose any + // validation on this value. It is specific to the client that reads it. + string audio_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Whether the playback of this message can be interrupted by + // the end user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Represents an audio message that is composed of both segments + // synthesized from the Dialogflow agent prompts and ones hosted externally + // at the specified URIs. + // The external URIs are specified via + // [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message MixedAudio { + // Represents one segment of audio. + message Segment { + // Content of the segment. + oneof content { + // Raw audio synthesized from the Dialogflow agent's response using + // the output config specified in the request. + bytes audio = 1; + + // Client-specific URI that points to an audio clip accessible to the + // client. Dialogflow does not impose any validation on it. + string uri = 2; + } + + // Output only. Whether the playback of this segment can be interrupted by + // the end user's speech and the client should then start the next + // Dialogflow request. + bool allow_playback_interruption = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Segments this audio response is composed of. + repeated Segment segments = 1; + } + + // Represents the signal that telles the client to transfer the phone call + // connected to the agent to a third-party endpoint. + message TelephonyTransferCall { + // Endpoint to transfer the call to. + oneof endpoint { + // Transfer the call to a phone number + // in [E.164 format](https://en.wikipedia.org/wiki/E.164). + string phone_number = 1; + } + } + + // Represents info card response. If the response contains generative + // knowledge prediction, Dialogflow will return a payload with Infobot + // Messenger compatible info card. + // + // Otherwise, the info card response is skipped. + message KnowledgeInfoCard {} + + // Required. The rich response message. + oneof message { + // Returns a text response. + Text text = 1; + + // Returns a response containing a custom, platform-specific payload. + google.protobuf.Struct payload = 2; + + // Indicates that the conversation succeeded. + ConversationSuccess conversation_success = 9; + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + OutputAudioText output_audio_text = 8; + + // Hands off conversation to a human agent. + LiveAgentHandoff live_agent_handoff = 10; + + // Output only. A signal that indicates the interaction with the Dialogflow + // agent has ended. This message is generated by Dialogflow only when the + // conversation reaches `END_SESSION` page. It is not supposed to be defined + // by the user. + // + // It's guaranteed that there is at most one such message in each response. + EndInteraction end_interaction = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Signal that the client should play an audio clip hosted at a + // client-specific URI. Dialogflow uses this to construct + // [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. + // However, Dialogflow itself does not try to read or process the URI in any + // way. + PlayAudio play_audio = 12; + + // Output only. An audio response message composed of both the synthesized + // Dialogflow agent responses and responses defined via + // [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + MixedAudio mixed_audio = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A signal that the client should transfer the phone call connected to + // this agent to a third-party endpoint. + TelephonyTransferCall telephony_transfer_call = 18; + + // Represents info card for knowledge answers, to be better rendered in + // Dialogflow Messenger. + KnowledgeInfoCard knowledge_info_card = 20; + + // Returns the definition of a tool call that should be executed by the + // client. + google.cloud.dialogflow.cx.v3beta1.ToolCall tool_call = 22; + } + + // The channel which the response is associated with. Clients can specify the + // channel via + // [QueryParameters.channel][google.cloud.dialogflow.cx.v3beta1.QueryParameters.channel], + // and only associated channel response will be returned. + string channel = 19; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto new file mode 100644 index 000000000000..73f246ca8bca --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto @@ -0,0 +1,133 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SafetySettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Settings for Generative Safety. +message SafetySettings { + // Text input which can be used for prompt or banned phrases. + message Phrase { + // Required. Text input which can be used for prompt or banned phrases. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Language code of the phrase. + string language_code = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Strategy for matching phrases. + enum PhraseMatchStrategy { + // Unspecified, defaults to PARTIAL_MATCH. + PHRASE_MATCH_STRATEGY_UNSPECIFIED = 0; + + // Text that contains the phrase as a substring will be matched, e.g. "foo" + // will match "afoobar". + PARTIAL_MATCH = 1; + + // Text that contains the tokenized words of the phrase will be matched, + // e.g. "foo" will match "a foo bar" and "foo bar", but not "foobar". + WORD_MATCH = 2; + } + + // Settings for Responsible AI. + message RaiSettings { + // Sensitivity level for RAI categories. + enum SafetyFilterLevel { + // Unspecified -- uses default sensitivity levels. + SAFETY_FILTER_LEVEL_UNSPECIFIED = 0; + + // Block no text -- effectively disables the category. + BLOCK_NONE = 1; + + // Block a few suspicious texts. + BLOCK_FEW = 2; + + // Block some suspicious texts. + BLOCK_SOME = 3; + + // Block most suspicious texts. + BLOCK_MOST = 4; + } + + // RAI categories to configure. + enum SafetyCategory { + // Unspecified. + SAFETY_CATEGORY_UNSPECIFIED = 0; + + // Dangerous content. + DANGEROUS_CONTENT = 1; + + // Hate speech. + HATE_SPEECH = 2; + + // Harassment. + HARASSMENT = 3; + + // Sexually explicit content. + SEXUALLY_EXPLICIT_CONTENT = 4; + } + + // Configuration of the sensitivity level for blocking an RAI category. + message CategoryFilter { + // RAI category to configure. + SafetyCategory category = 1; + + // Blocking sensitivity level to configure for the RAI category. + SafetyFilterLevel filter_level = 2; + } + + // Optional. RAI blocking configurations. + repeated CategoryFilter category_filters = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for prompt security checks. + message PromptSecuritySettings { + // Optional. Enable prompt security checks. + bool enable_prompt_security = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Default phrase match strategy for banned phrases. + PhraseMatchStrategy default_banned_phrase_match_strategy = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Banned phrases for generated text. + repeated Phrase banned_phrases = 1; + + // Optional. Settings for Responsible AI checks. + RaiSettings rai_settings = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Default RAI settings to be annotated on the agent, so + // that users will be able to restore their RAI configurations to the default + // settings. Read-only field for the API proto only. + RaiSettings default_rai_settings = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Settings for prompt security checks. + PromptSecuritySettings prompt_security_settings = 8 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto new file mode 100644 index 000000000000..534398a5ff8e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto @@ -0,0 +1,409 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SecuritySettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/InspectTemplate" + pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" + pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" +}; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" + pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" +}; + +// Service for managing security settings for Dialogflow. +service SecuritySettingsService { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Create security settings in the specified location. + rpc CreateSecuritySettings(CreateSecuritySettingsRequest) + returns (SecuritySettings) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}/securitySettings" + body: "security_settings" + }; + option (google.api.method_signature) = "parent,security_settings"; + } + + // Retrieves the specified + // [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings]. + // The returned settings may be stale by up to 1 minute. + rpc GetSecuritySettings(GetSecuritySettingsRequest) + returns (SecuritySettings) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified + // [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings]. + rpc UpdateSecuritySettings(UpdateSecuritySettingsRequest) + returns (SecuritySettings) { + option (google.api.http) = { + patch: "/v3beta1/{security_settings.name=projects/*/locations/*/securitySettings/*}" + body: "security_settings" + }; + option (google.api.method_signature) = "security_settings,update_mask"; + } + + // Returns the list of all security settings in the specified location. + rpc ListSecuritySettings(ListSecuritySettingsRequest) + returns (ListSecuritySettingsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*}/securitySettings" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the specified + // [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings]. + rpc DeleteSecuritySettings(DeleteSecuritySettingsRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [SecuritySettingsService.GetSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettings]. +message GetSecuritySettingsRequest { + // Required. Resource name of the settings. + // Format: + // `projects//locations//securitySettings/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; +} + +// The request message for +// [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettings]. +message UpdateSecuritySettingsRequest { + // Required. [SecuritySettings] object that contains values for each of the + // fields to update. + SecuritySettings security_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SecuritySettings.ListSecuritySettings][]. +message ListSecuritySettingsRequest { + // Required. The location to list all security settings for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [SecuritySettings.ListSecuritySettings][]. +message ListSecuritySettingsResponse { + // The list of security settings. + repeated SecuritySettings security_settings = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [SecuritySettings.CreateSecuritySettings][]. +message CreateSecuritySettingsRequest { + // Required. The location to create an + // [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] + // for. Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; + + // Required. The security settings to create. + SecuritySettings security_settings = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SecuritySettings.DeleteSecuritySettings][]. +message DeleteSecuritySettingsRequest { + // Required. The name of the + // [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] to + // delete. Format: + // `projects//locations//securitySettings/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; +} + +// Represents the settings related to security issues, such as data redaction +// and data retention. It may take hours for updates on the settings to +// propagate to all the related components and take effect. +message SecuritySettings { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/SecuritySettings" + pattern: "projects/{project}/locations/{location}/securitySettings/{security_settings}" + }; + + // Defines how we redact data. + enum RedactionStrategy { + // Do not redact. + REDACTION_STRATEGY_UNSPECIFIED = 0; + + // Call redaction service to clean up the data to be persisted. + REDACT_WITH_SERVICE = 1; + } + + // Defines what types of data to redact. + enum RedactionScope { + // Don't redact any kind of data. + REDACTION_SCOPE_UNSPECIFIED = 0; + + // On data to be written to disk or similar devices that are capable of + // holding data even if power is disconnected. This includes data that are + // temporarily saved on disk. + REDACT_DISK_STORAGE = 2; + } + + // Defines how long we retain persisted data that contains sensitive info. + enum RetentionStrategy { + // Retains the persisted data with Dialogflow's internal default 365d TTLs. + RETENTION_STRATEGY_UNSPECIFIED = 0; + + // Removes data when the conversation ends. If there is no + // [Conversation][google.cloud.dialogflow.cx.v3beta1.Conversation] + // explicitly established, a default conversation ends when the + // corresponding Dialogflow session ends. + REMOVE_AFTER_CONVERSATION = 1; + } + + // Type of data we purge after retention settings triggers purge. + enum PurgeDataType { + // Unspecified. Do not use. + PURGE_DATA_TYPE_UNSPECIFIED = 0; + + // Dialogflow history. This does not include Cloud logging, which is + // owned by the user - not Dialogflow. + DIALOGFLOW_HISTORY = 1; + } + + // Settings for exporting audio. + message AudioExportSettings { + // File format for exported audio file. Currently only in telephony + // recordings. + enum AudioFormat { + // Unspecified. Do not use. + AUDIO_FORMAT_UNSPECIFIED = 0; + + // G.711 mu-law PCM with 8kHz sample rate. + MULAW = 1; + + // MP3 file format. + MP3 = 2; + + // OGG Vorbis. + OGG = 3; + } + + // Cloud Storage bucket to export audio record to. + // Setting this field would grant the Storage Object Creator role to + // the Dialogflow Service Agent. + // API caller that tries to modify this field should have the permission of + // storage.buckets.setIamPolicy. + string gcs_bucket = 1; + + // Filename pattern for exported audio. + // {conversation} and {timestamp} are placeholders that will be replaced + // with the conversation ID and epoch micros of the conversation. + // For example, "{conversation}/recording_{timestamp}.mulaw". + string audio_export_pattern = 2; + + // Enable audio redaction if it is true. + // Note that this only redacts end-user audio data; + // Synthesised audio from the virtual agent is not redacted. + bool enable_audio_redaction = 3; + + // File format for exported audio file. Currently only in telephony + // recordings. + AudioFormat audio_format = 4; + + // Whether to store TTS audio. By default, TTS audio from the virtual agent + // is not exported. + bool store_tts_audio = 6; + } + + // Settings for exporting conversations to + // [Insights](https://cloud.google.com/contact-center/insights/docs). + message InsightsExportSettings { + // If enabled, we will automatically exports + // conversations to Insights and Insights runs its analyzers. + bool enable_insights_export = 1; + } + + // Resource name of the settings. + // Required for the + // [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettings] + // method. + // [SecuritySettingsService.CreateSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.CreateSecuritySettings] + // populates the name automatically. Format: + // `projects//locations//securitySettings/`. + string name = 1; + + // Required. The human-readable name of the security settings, unique within + // the location. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Strategy that defines how we do redaction. + RedactionStrategy redaction_strategy = 3; + + // Defines the data for which Dialogflow applies redaction. Dialogflow does + // not redact data that it does not have access to – for example, Cloud + // logging. + RedactionScope redaction_scope = 4; + + // [DLP](https://cloud.google.com/dlp/docs) inspect template name. Use this + // template to define inspect base settings. + // + // The `DLP Inspect Templates Reader` role is needed on the Dialogflow + // service identity service account (has the form + // `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) + // for your agent's project. + // + // If empty, we use the default DLP inspect config. + // + // The template name will have one of the following formats: + // `projects//locations//inspectTemplates/` + // OR + // `organizations//locations//inspectTemplates/` + // + // Note: `inspect_template` must be located in the same region as the + // `SecuritySettings`. + string inspect_template = 9 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/InspectTemplate" + }]; + + // [DLP](https://cloud.google.com/dlp/docs) deidentify template name. Use this + // template to define de-identification configuration for the content. + // + // The `DLP De-identify Templates Reader` role is needed on the Dialogflow + // service identity service account (has the form + // `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) + // for your agent's project. + // + // If empty, Dialogflow replaces sensitive info with `[redacted]` text. + // + // The template name will have one of the following formats: + // `projects//locations//deidentifyTemplates/` + // OR + // `organizations//locations//deidentifyTemplates/` + // + // Note: `deidentify_template` must be located in the same region as the + // `SecuritySettings`. + string deidentify_template = 17 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + }]; + + // Specifies how data is retained. Note that even if the data is + // purged due to retention policy, we may still hold it in backup storage for + // a few days without allowing direct readings. + oneof data_retention { + // Retains data in interaction logging for the specified number of days. + // This does not apply to Cloud logging, which is owned by the user - not + // Dialogflow. + // User must set a value lower than Dialogflow's default 365d TTL (30 days + // for Agent Assist traffic), higher value will be ignored and use default. + // Setting a value higher than that has no effect. A missing value or + // setting to 0 also means we use default TTL. + // When data retention configuration is changed, it only applies to the data + // created after the change; the TTL of existing data created before the + // change stays intact. + int32 retention_window_days = 6; + + // Specifies the retention behavior defined by + // [SecuritySettings.RetentionStrategy][google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy]. + RetentionStrategy retention_strategy = 7; + } + + // List of types of data to remove when retention settings triggers purge. + repeated PurgeDataType purge_data_types = 8; + + // Controls audio export settings for post-conversation analytics when + // ingesting audio to conversations via [Participants.AnalyzeContent][] or + // [Participants.StreamingAnalyzeContent][]. + // + // If + // [retention_strategy][google.cloud.dialogflow.cx.v3beta1.SecuritySettings.retention_strategy] + // is set to REMOVE_AFTER_CONVERSATION or [audio_export_settings.gcs_bucket][] + // is empty, audio export is disabled. + // + // If audio export is enabled, audio is recorded and saved to + // [audio_export_settings.gcs_bucket][], subject to retention policy of + // [audio_export_settings.gcs_bucket][]. + // + // This setting won't effect audio input for implicit sessions via + // [Sessions.DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] + // or + // [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent]. + AudioExportSettings audio_export_settings = 12; + + // Controls conversation exporting settings to Insights after conversation is + // completed. + // + // If + // [retention_strategy][google.cloud.dialogflow.cx.v3beta1.SecuritySettings.retention_strategy] + // is set to REMOVE_AFTER_CONVERSATION, Insights export is disabled no matter + // what you configure here. + InsightsExportSettings insights_export_settings = 13; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto new file mode 100644 index 000000000000..e87990b0f12f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -0,0 +1,1456 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/audio_config.proto"; +import "google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto"; +import "google/cloud/dialogflow/cx/v3beta1/example.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/cloud/dialogflow/cx/v3beta1/generative_settings.proto"; +import "google/cloud/dialogflow/cx/v3beta1/intent.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto"; +import "google/cloud/dialogflow/cx/v3beta1/tool_call.proto"; +import "google/cloud/dialogflow/cx/v3beta1/trace.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/rpc/status.proto"; +import "google/type/latlng.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; +option (google.api.resource_definition) = { + type: "dialogflow.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/DataStore" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}" +}; + +// A session represents an interaction with a user. You retrieve user input +// and pass it to the +// [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] +// method to determine user intent and respond. +service Sessions { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Processes a natural language query and returns structured, actionable data + // as a result. This method is not idempotent, because it may cause session + // entity types to be updated, which in turn might affect results of future + // queries. + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent" + body: "*" + additional_bindings { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent" + body: "*" + } + }; + } + + // Processes a natural language query and returns structured, actionable data + // as a result through server-side streaming. Server-side streaming allows + // Dialogflow to send [partial + // responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) + // earlier in a single request. + rpc ServerStreamingDetectIntent(DetectIntentRequest) + returns (stream DetectIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent" + body: "*" + additional_bindings { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent" + body: "*" + } + }; + } + + // Processes a natural language query in audio format in a streaming fashion + // and returns structured, actionable data as a result. This method is only + // available via the gRPC API (not REST). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) + returns (stream StreamingDetectIntentResponse) {} + + // Returns preliminary intent match results, doesn't change the session + // status. + rpc MatchIntent(MatchIntentRequest) returns (MatchIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent" + body: "*" + additional_bindings { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent" + body: "*" + } + }; + } + + // Fulfills a matched intent returned by + // [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent]. + // Must be called after + // [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], + // with input from + // [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. + // Otherwise, the behavior is undefined. + rpc FulfillIntent(FulfillIntentRequest) returns (FulfillIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent" + body: "*" + additional_bindings { + post: "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent" + body: "*" + } + }; + } + + // Updates the feedback received from the user for a single turn of the bot + // response. + rpc SubmitAnswerFeedback(SubmitAnswerFeedbackRequest) + returns (AnswerFeedback) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback" + body: "*" + }; + } +} + +// Stores information about feedback provided by users about a response. +message AnswerFeedback { + // Represents thumbs up/down rating provided by user about a response. + enum Rating { + // Rating not specified. + RATING_UNSPECIFIED = 0; + + // Thumbs up feedback from user. + THUMBS_UP = 1; + + // Thumbs down feedback from user. + THUMBS_DOWN = 2; + } + + // Stores extra information about why users provided thumbs down rating. + message RatingReason { + // Optional. Custom reason labels for thumbs down rating provided by the + // user. The maximum number of labels allowed is 10 and the maximum length + // of a single label is 128 characters. + repeated string reason_labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional feedback about the rating. + // This field can be populated without choosing a predefined `reason`. + string feedback = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Rating from user for the specific Dialogflow response. + Rating rating = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. In case of thumbs down rating provided, users can optionally + // provide context about the rating. + RatingReason rating_reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom rating from the user about the provided answer, with + // maximum length of 1024 characters. For example, client could use a + // customized JSON object to indicate the rating. + string custom_rating = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request to set the feedback for a bot answer. +message SubmitAnswerFeedbackRequest { + // Required. The name of the session the feedback was sent to. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // Required. ID of the response to update its feedback. This is the same as + // DetectIntentResponse.response_id. + string response_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Feedback provided for a bot answer. + AnswerFeedback answer_feedback = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which fields to update. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The request to detect user's intent. +message DetectIntentRequest { + // Required. The name of the session this query is sent to. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. It's up to the API caller to choose an appropriate `Session + // ID`. It can be a random number or some type of session identifiers + // (preferably hashed). The length of the `Session ID` must not exceed 36 + // characters. + // + // For more information, see the [sessions + // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; + + // Optional. Specifies which fields in the + // [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] to return. If + // not set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + DetectIntentResponseView response_view = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The message returned from the DetectIntent method. +message DetectIntentResponse { + // Represents different DetectIntentResponse types. + enum ResponseType { + // Not specified. This should never happen. + RESPONSE_TYPE_UNSPECIFIED = 0; + + // Partial response. e.g. Aggregated responses in a Fulfillment that enables + // `return_partial_response` can be returned as partial response. + // WARNING: partial response is not eligible for barge-in. + PARTIAL = 1; + + // Final response. + FINAL = 2; + } + + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] + // field. If multiple default text responses exist, they will be concatenated + // when generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 4; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 5; + + // Response type. + ResponseType response_type = 6; + + // Indicates whether the partial response can be cancelled when a later + // response arrives. e.g. if the agent specified some music as partial + // response, it can be cancelled. + bool allow_cancellation = 7; +} + +// The top-level message sent by the client to the +// [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] +// method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain +// [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session], +// [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] +// plus optionally +// [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. +// If the client wants to receive an audio response, it should also contain +// [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config]. +// +// 2. If +// [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] +// was set to +// [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], +// all subsequent messages must contain +// [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] +// to continue with Speech recognition. If you decide to rather detect an +// intent from text input after you already started Speech recognition, +// please send a message with +// [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text]. +// +// However, note that: +// +// * Dialogflow will bill you for the audio duration so far. +// * Dialogflow discards all Speech recognition results in favor of the +// input text. +// * Dialogflow will use the language code from the first message. +// +// After you sent all input, you must half-close or abort the request stream. +message StreamingDetectIntentRequest { + // The name of the session this query is sent to. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + // Note: session must be set in the first request. + // + // For more information, see the [sessions + // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; + + // Enable partial detect intent response. If this flag is not enabled, + // response stream still contains only one final `DetectIntentResponse` even + // if some `Fulfillment`s in the agent have been configured to return partial + // responses. + bool enable_partial_response = 5; + + // If true, `StreamingDetectIntentResponse.debugging_info` will get populated. + bool enable_debugging_info = 8; + + // Optional. Specifies which fields in the + // [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] to return. If + // not set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + DetectIntentResponseView response_view = 16 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Cloud conversation info for easier debugging. +// It will get populated in `StreamingDetectIntentResponse` or +// `StreamingAnalyzeContentResponse` when the flag `enable_debugging_info` is +// set to true in corresponding requests. +message CloudConversationDebuggingInfo { + // Number of input audio data chunks in streaming requests. + int32 audio_data_chunks = 1; + + // Time offset of the end of speech utterance relative to the + // beginning of the first audio chunk. + google.protobuf.Duration result_end_time_offset = 2; + + // Duration of first audio chunk. + google.protobuf.Duration first_audio_duration = 3; + + // Whether client used single utterance mode. + bool single_utterance = 5; + + // Time offsets of the speech partial results relative to the beginning of + // the stream. + repeated google.protobuf.Duration speech_partial_results_end_times = 6; + + // Time offsets of the speech final results (is_final=true) relative to the + // beginning of the stream. + repeated google.protobuf.Duration speech_final_results_end_times = 7; + + // Total number of partial responses. + int32 partial_responses = 8; + + // Time offset of Speaker ID stream close time relative to the Speech stream + // close time in milliseconds. Only meaningful for conversations involving + // passive verification. + int32 speaker_id_passive_latency_ms_offset = 9; + + // Whether a barge-in event is triggered in this request. + bool bargein_event_triggered = 10; + + // Whether speech uses single utterance mode. + bool speech_single_utterance = 11; + + // Time offsets of the DTMF partial results relative to the beginning of + // the stream. + repeated google.protobuf.Duration dtmf_partial_results_times = 12; + + // Time offsets of the DTMF final results relative to the beginning of + // the stream. + repeated google.protobuf.Duration dtmf_final_results_times = 13; + + // Time offset of the end-of-single-utterance signal relative to the + // beginning of the stream. + google.protobuf.Duration single_utterance_end_time_offset = 14; + + // No speech timeout settings for the stream. + google.protobuf.Duration no_speech_timeout = 15; + + // Speech endpointing timeout settings for the stream. + google.protobuf.Duration endpointing_timeout = 19; + + // Whether the streaming terminates with an injected text query. + bool is_input_text = 16; + + // Client half close time in terms of input audio duration. + google.protobuf.Duration client_half_close_time_offset = 17; + + // Client half close time in terms of API streaming duration. + google.protobuf.Duration client_half_close_streaming_time_offset = 18; +} + +// The top-level message returned from the +// [StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] +// method. +// +// Multiple response messages can be returned in order: +// +// * If the `StreamingDetectIntentRequest.query_input.audio` field was +// set, the first M messages contain `recognition_result`. +// Each `recognition_result` represents a more complete transcript of what +// the user said. The last `recognition_result` has `is_final` set to +// `true`. +// +// * If the `StreamingDetectIntentRequest.enable_partial_response` field was +// true, the `detect_intent_response` field is populated for each +// of the following N responses, where 0 <= N <= 5. +// These responses set the +// [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.response_type] +// field to `PARTIAL`. +// +// For the last response message, the `detect_intent_response` is fully +// populated, and +// [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.response_type] +// is set to `FINAL`. +message StreamingDetectIntentResponse { + // The output response. + oneof response { + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 1; + + // The response from detect intent. + DetectIntentResponse detect_intent_response = 2; + } + + // Debugging info that would get populated when + // `StreamingDetectIntentRequest.enable_debugging_info` is set to true. + CloudConversationDebuggingInfo debugging_info = 4; +} + +// Contains a speech recognition result corresponding to a portion of the audio +// that is currently being processed or an indication that this is the end +// of the single requested utterance. +// +// While end-user audio is being processed, Dialogflow sends a series of +// results. Each result may contain a `transcript` value. A transcript +// represents a portion of the utterance. While the recognizer is processing +// audio, transcript values may be interim values or finalized values. +// Once a transcript is finalized, the `is_final` value is set to true and +// processing continues for the next transcript. +// +// If `StreamingDetectIntentRequest.query_input.audio.config.single_utterance` +// was true, and the recognizer has completed processing audio, +// the `message_type` value is set to `END_OF_SINGLE_UTTERANCE and the +// following (last) result contains the last finalized transcript. +// +// The complete end-user utterance is determined by concatenating the +// finalized transcript values received for the series of results. +// +// In the following example, single utterance is enabled. In the case where +// single utterance is not enabled, result 7 would not occur. +// +// ``` +// Num | transcript | message_type | is_final +// --- | ----------------------- | ----------------------- | -------- +// 1 | "tube" | TRANSCRIPT | false +// 2 | "to be a" | TRANSCRIPT | false +// 3 | "to be" | TRANSCRIPT | false +// 4 | "to be or not to be" | TRANSCRIPT | true +// 5 | "that's" | TRANSCRIPT | false +// 6 | "that is | TRANSCRIPT | false +// 7 | unset | END_OF_SINGLE_UTTERANCE | unset +// 8 | " that is the question" | TRANSCRIPT | true +// ``` +// +// Concatenating the finalized transcripts with `is_final` set to true, +// the complete utterance becomes "to be or not to be that is the question". +message StreamingRecognitionResult { + // Type of the response message. + enum MessageType { + // Not specified. Should never be used. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // Message contains a (possibly partial) transcript. + TRANSCRIPT = 1; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This message is only sent if + // [`single_utterance`][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.single_utterance] + // was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 2; + } + + // Type of the result message. + MessageType message_type = 1; + + // Transcript text representing the words that the user spoke. + // Populated if and only if `message_type` = `TRANSCRIPT`. + string transcript = 2; + + // If `false`, the `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, the recognizer will not return + // any further hypotheses about this piece of the audio. May only be populated + // for `message_type` = `TRANSCRIPT`. + bool is_final = 3; + + // The Speech confidence between 0.0 and 1.0 for the current portion of audio. + // A higher number indicates an estimated greater likelihood that the + // recognized words are correct. The default of 0.0 is a sentinel value + // indicating that confidence was not set. + // + // This field is typically only provided if `is_final` is true and you should + // not rely on it being accurate or even set. + float confidence = 4; + + // An estimate of the likelihood that the speech recognizer will + // not change its guess about this interim recognition result: + // * If the value is unspecified or 0.0, Dialogflow didn't compute the + // stability. In particular, Dialogflow will only provide stability for + // `TRANSCRIPT` results with `is_final = false`. + // * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely + // unstable and 1.0 means completely stable. + float stability = 6; + + // Word-specific information for the words recognized by Speech in + // [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. + // Populated if and only if `message_type` = `TRANSCRIPT` and + // [InputAudioConfig.enable_word_info] is set. + repeated SpeechWordInfo speech_word_info = 7; + + // Time offset of the end of this Speech recognition result relative to the + // beginning of the audio. Only populated for `message_type` = + // `TRANSCRIPT`. + google.protobuf.Duration speech_end_offset = 8; + + // Detected language code for the transcript. + string language_code = 10; +} + +// Represents the parameters of a conversational query. +message QueryParameters { + // The time zone of this conversational query from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. If not provided, the time zone specified in the agent is + // used. + string time_zone = 1; + + // The geo location of this conversational query. + google.type.LatLng geo_location = 2; + + // Additional session entity types to replace or extend developer entity types + // with. The entity synonyms apply to all languages and persist for the + // session of this query. + repeated SessionEntityType session_entity_types = 3; + + // This field can be used to pass custom data into the webhook associated with + // the agent. Arbitrary JSON objects are supported. + // Some integrations that query a Dialogflow agent may provide additional + // information in the payload. + // In particular, for the Dialogflow Phone Gateway integration, this field has + // the form: + // ``` + // { + // "telephony": { + // "caller_id": "+18558363987" + // } + // } + // ``` + google.protobuf.Struct payload = 4; + + // Additional parameters to be put into [session + // parameters][SessionInfo.parameters]. To remove a + // parameter from the session, clients should explicitly set the parameter + // value to null. + // + // You can reference the session parameters in the agent with the following + // format: $session.params.parameter-id. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // * MapKey type: string + // * MapKey value: parameter name + // * MapValue type: If parameter's entity type is a composite entity then use + // map, otherwise, depending on the parameter value type, it could be one of + // string, number, boolean, null, list or map. + // * MapValue value: If parameter's entity type is a composite entity then use + // map from composite entity property names to property values, otherwise, + // use parameter value. + google.protobuf.Struct parameters = 5; + + // Scope for the parameters. If not specified, parameters will be treated as + // session parameters. Parameters with custom scope will not be put into + // [session + // parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + // + // You can reference the parameters with custom scope in the agent with the + // following format: $parameter-scope.params.parameter-id. + string parameter_scope = 12; + + // The unique identifier of the + // [page][google.cloud.dialogflow.cx.v3beta1.Page] to override the [current + // page][QueryResult.current_page] in the session. + // Format: + // `projects//locations//agents//flows//pages/`. + // + // If `current_page` is specified, the previous state of the session will be + // ignored by Dialogflow, including the [previous + // page][QueryResult.current_page] and the [previous session + // parameters][QueryResult.parameters]. + // In most cases, + // [current_page][google.cloud.dialogflow.cx.v3beta1.QueryParameters.current_page] + // and + // [parameters][google.cloud.dialogflow.cx.v3beta1.QueryParameters.parameters] + // should be configured together to direct a session to a specific state. + string current_page = 6 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // Whether to disable webhook calls for this request. + bool disable_webhook = 7; + + // Configures whether sentiment analysis should be performed. If not + // provided, sentiment analysis is not performed. + bool analyze_query_text_sentiment = 8; + + // This field can be used to pass HTTP headers for a webhook + // call. These headers will be sent to webhook along with the headers that + // have been configured through Dialogflow web console. The headers defined + // within this field will overwrite the headers configured through Dialogflow + // console if there is a conflict. Header names are case-insensitive. + // Google's specified headers are not allowed. Including: "Host", + // "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding", + // "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc. + map webhook_headers = 10; + + // A list of flow versions to override for the request. + // Format: + // `projects//locations//agents//flows//versions/`. + // + // If version 1 of flow X is included in this list, the traffic of + // flow X will go through version 1 regardless of the version configuration + // in the environment. Each flow can have at most one version specified in + // this list. + repeated string flow_versions = 14 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; + + // Optional. The unique identifier of the + // [playbook][google.cloud.dialogflow.cx.v3beta1.Playbook] to start or + // continue the session with. If `current_playbook` is specified, the previous + // state of the session will be ignored by Dialogflow. + // + // Format: + // `projects//locations//agents//playbooks/`. + string current_playbook = 19 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Optional. Use the specified LLM model settings for processing the request. + LlmModelSettings llm_model_settings = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // The channel which this query is for. + // + // If specified, only the + // [ResponseMessage][google.cloud.dialogflow.cx.v3beta1.ResponseMessage] + // associated with the channel will be returned. If no + // [ResponseMessage][google.cloud.dialogflow.cx.v3beta1.ResponseMessage] is + // associated with the channel, it falls back to the + // [ResponseMessage][google.cloud.dialogflow.cx.v3beta1.ResponseMessage] with + // unspecified channel. + // + // If unspecified, the + // [ResponseMessage][google.cloud.dialogflow.cx.v3beta1.ResponseMessage] with + // unspecified channel will be returned. + string channel = 15; + + // Optional. Configure lifetime of the Dialogflow session. + // By default, a Dialogflow session remains active and its data is stored for + // 30 minutes after the last request is sent for the session. + // This value should be no longer than 1 day. + google.protobuf.Duration session_ttl = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information about the end-user to improve the relevance and + // accuracy of generative answers. + // + // This will be interpreted and used by a language model, so, for good + // results, the data should be self-descriptive, and in a simple structure. + // + // Example: + // + // ```json + // { + // "subscription plan": "Business Premium Plus", + // "devices owned": [ + // {"model": "Google Pixel 7"}, + // {"model": "Google Pixel Tablet"} + // ] + // } + // ``` + google.protobuf.Struct end_user_metadata = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Search configuration for UCS search queries. + SearchConfig search_config = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true and data stores are involved in serving the + // request then + // DetectIntentResponse.query_result.data_store_connection_signals + // will be filled with data that can help evaluations. + bool populate_data_store_connection_signals = 25 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Search configuration for UCS search queries. +message SearchConfig { + // Optional. Boosting configuration for the datastores. + // + // Maps from datastore name to their boost configuration. Do not specify more + // than one BoostSpecs for each datastore name. If multiple BoostSpecs are + // provided for the same datastore name, the behavior is undefined. + repeated BoostSpecs boost_specs = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter configuration for the datastores. + // + // Maps from datastore name to the filter expression for that datastore. Do + // not specify more than one FilterSpecs for each datastore name. If multiple + // FilterSpecs are provided for the same datastore name, the behavior is + // undefined. + repeated FilterSpecs filter_specs = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Boost specification to boost certain documents. +// A copy of google.cloud.discoveryengine.v1main.BoostSpec, field documentation +// is available at +// https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec +message BoostSpec { + // Boost applies to documents which match a condition. + message ConditionBoostSpec { + // Specification for custom ranking based on customer specified attribute + // value. It provides more controls for customized ranking than the simple + // (condition, boost) combination above. + message BoostControlSpec { + // The attribute(or function) for which the custom ranking is to be + // applied. + enum AttributeType { + // Unspecified AttributeType. + ATTRIBUTE_TYPE_UNSPECIFIED = 0; + + // The value of the numerical field will be used to dynamically update + // the boost amount. In this case, the attribute_value (the x value) + // of the control point will be the actual value of the numerical + // field for which the boost_amount is specified. + NUMERICAL = 1; + + // For the freshness use case the attribute value will be the duration + // between the current time and the date in the datetime field + // specified. The value must be formatted as an XSD `dayTimeDuration` + // value (a restricted subset of an ISO 8601 duration value). The + // pattern for this is: `[nD][T[nH][nM][nS]]`. + // E.g. `5D`, `3DT12H30M`, `T24H`. + FRESHNESS = 2; + } + + // The interpolation type to be applied. Default will be linear + // (Piecewise Linear). + enum InterpolationType { + // Interpolation type is unspecified. In this case, it defaults to + // Linear. + INTERPOLATION_TYPE_UNSPECIFIED = 0; + + // Piecewise linear interpolation will be applied. + LINEAR = 1; + } + + // The control points used to define the curve. The curve defined + // through these control points can only be monotonically increasing + // or decreasing(constant values are acceptable). + message ControlPoint { + // Optional. Can be one of: + // 1. The numerical field value. + // 2. The duration spec for freshness: + // The value must be formatted as an XSD `dayTimeDuration` value (a + // restricted subset of an ISO 8601 duration value). The pattern for + // this is: `[nD][T[nH][nM][nS]]`. + string attribute_value = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value between -1 to 1 by which to boost the score if + // the attribute_value evaluates to the value specified above. + float boost_amount = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The name of the field whose value will be used to determine + // the boost amount. + string field_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The attribute type to be used to determine the boost amount. + // The attribute value can be derived from the field value of the + // specified field_name. In the case of numerical it is straightforward + // i.e. attribute_value = numerical_field_value. In the case of freshness + // however, attribute_value = (time.now() - datetime_field_value). + AttributeType attribute_type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The interpolation type to be applied to connect the control + // points listed below. + InterpolationType interpolation_type = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The control points used to define the curve. The monotonic + // function (defined through the interpolation_type above) passes through + // the control points listed here. + repeated ControlPoint control_points = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. An expression which specifies a boost condition. The syntax and + // supported fields are the same as a filter expression. + // Examples: + // + // * To boost documents with document ID "doc_1" or "doc_2", and + // color + // "Red" or "Blue": + // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + string condition = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Strength of the condition boost, which should be in [-1, 1]. + // Negative boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the document a big promotion. However, it does not + // necessarily mean that the boosted document will be the top result at + // all times, nor that other documents will be excluded. Results could + // still be shown even when none of them matches the condition. And + // results that are significantly more relevant to the search query can + // still trump your heavily favored but irrelevant documents. + // + // Setting to -1.0 gives the document a big demotion. However, results + // that are deeply relevant might still be shown. The document will have + // an upstream battle to get a fairly high ranking, but it is not blocked + // out completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Complex specification for custom ranking based on customer + // defined attribute value. + BoostControlSpec boost_control_spec = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Condition boost specifications. If a document matches multiple + // conditions in the specifications, boost scores from these specifications + // are all applied and combined in a non-linear way. Maximum number of + // specifications is 20. + repeated ConditionBoostSpec condition_boost_specs = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Boost specifications for data stores. +message BoostSpecs { + // Optional. Data Stores where the boosting configuration is applied. The full + // names of the referenced data stores. Formats: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + // `projects/{project}/locations/{location}/dataStores/{data_store} + repeated string data_stores = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Optional. A list of boosting specifications. + repeated BoostSpec spec = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Filter specifications for data stores. +message FilterSpecs { + // Optional. Data Stores where the boosting configuration is applied. The full + // names of the referenced data stores. Formats: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + // `projects/{project}/locations/{location}/dataStores/{data_store} + repeated string data_stores = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Optional. The filter expression to be applied. + // Expression syntax is documented at + // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the query input. It can contain one of: +// +// 1. A conversational query in the form of text. +// +// 2. An intent query that specifies which intent to trigger. +// +// 3. Natural language speech audio to be processed. +// +// 4. An event to be triggered. +// +// 5. DTMF digits to invoke an intent and fill in parameter value. +// +// 6. The results of a tool executed by the client. +message QueryInput { + // Required. The input specification. + oneof input { + // The natural language text to be processed. + TextInput text = 2; + + // The intent to be triggered. + IntentInput intent = 3; + + // The natural language speech audio to be processed. + AudioInput audio = 5; + + // The event to be triggered. + EventInput event = 6; + + // The DTMF event to be handled. + DtmfInput dtmf = 7; + + // The results of a tool executed by the client. + google.cloud.dialogflow.cx.v3beta1.ToolCallResult tool_call_result = 11; + } + + // Required. The language of the input. See [Language + // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // for a list of the currently supported language codes. Note that queries in + // the same session do not necessarily need to specify the same language. + string language_code = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the information of a query if handled by generative agent +// resources. +message GenerativeInfo { + // The stack of [playbooks][google.cloud.dialogflow.cx.v3beta1.Playbook] that + // the conversation has currently entered, with the most recent one on the + // top. + repeated string current_playbooks = 1; + + // The actions performed by the generative playbook for the current agent + // response. + Example action_tracing_info = 2; +} + +// Represents the result of a conversational query. +message QueryResult { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] + // was provided as input, this field will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was + // provided as input, this field will contain a copy of the intent + // identifier. Format: + // `projects//locations//agents//intents/`. + string trigger_intent = 11 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // If [natural language speech + // audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as + // input, this field will contain the transcript for the audio. + string transcript = 12; + + // If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided + // as input, this field will contain the name of the event. + string trigger_event = 14; + + // If a [DTMF][google.cloud.dialogflow.cx.v3beta1.DtmfInput] was provided as + // input, this field will contain a copy of the + // [DtmfInput][google.cloud.dialogflow.cx.v3beta1.DtmfInput]. + DtmfInput dtmf = 23; + } + + // The language that was triggered during intent detection. + // See [Language + // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // for a list of the currently supported language codes. + string language_code = 2; + + // The collected [session + // parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // * MapKey type: string + // * MapKey value: parameter name + // * MapValue type: If parameter's entity type is a composite entity then use + // map, otherwise, depending on the parameter value type, it could be one of + // string, number, boolean, null, list or map. + // * MapValue value: If parameter's entity type is a composite entity then use + // map from composite entity property names to property values, otherwise, + // use parameter value. + google.protobuf.Struct parameters = 3; + + // The list of rich messages returned to the client. Responses vary from + // simple text messages to more sophisticated, structured payloads used + // to drive complex logic. + repeated ResponseMessage response_messages = 4; + + // The list of webhook ids in the order of call sequence. + repeated string webhook_ids = 25; + + // The list of webhook display names in the order of call sequence. + repeated string webhook_display_names = 26; + + // The list of webhook latencies in the order of call sequence. + repeated google.protobuf.Duration webhook_latencies = 27; + + // The list of webhook tags in the order of call sequence. + repeated string webhook_tags = 29; + + // The list of webhook call status in the order of call sequence. + repeated google.rpc.Status webhook_statuses = 13; + + // The list of webhook payload in + // [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], + // in the order of call sequence. If some webhook call fails or doesn't return + // any payload, an empty `Struct` would be used instead. + repeated google.protobuf.Struct webhook_payloads = 6; + + // The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all + // fields are filled in this message, including but not limited to `name` and + // `display_name`. + Page current_page = 7; + + // The current [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. Some, not all + // fields are filled in this message, including but not limited to `name` and + // `display_name`. + Flow current_flow = 31; + + // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the + // conversational query. Some, not all fields are filled in this message, + // including but not limited to: `name` and `display_name`. This field is + // deprecated, please use + // [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] + // instead. + Intent intent = 8 [deprecated = true]; + + // The intent detection confidence. Values range from 0.0 (completely + // uncertain) to 1.0 (completely certain). + // This value is for informational purpose only and is only used to + // help match the best intent within the classification threshold. + // This value may change for the same end-user expression at any time due to a + // model retraining or change in implementation. + // This field is deprecated, please use + // [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] + // instead. + float intent_detection_confidence = 9 [deprecated = true]; + + // Intent match result, could be an intent or an event. + Match match = 15; + + // The free-form diagnostic info. For example, this field could contain + // webhook call latency. The fields of this data can change without notice, + // so you should not write code that depends on its structure. + // + // One of the fields is called "Alternative Matched Intents", which may + // aid with debugging. The following describes these intent results: + // + // - The list is empty if no intent was matched to end-user input. + // - Only intents that are referenced in the currently active flow are + // included. + // - The matched intent is included. + // - Other intents that could have matched end-user input, but did not match + // because they are referenced by intent routes that are out of + // [scope](https://cloud.google.com/dialogflow/cx/docs/concept/handler#scope), + // are included. + // - Other intents referenced by intent routes in scope that matched end-user + // input, but had a lower confidence score. + google.protobuf.Struct diagnostic_info = 10; + + // The information of a query if handled by generative agent resources. + GenerativeInfo generative_info = 33; + + // The sentiment analyss result, which depends on + // [`analyze_query_text_sentiment`] + // [google.cloud.dialogflow.cx.v3beta1.QueryParameters.analyze_query_text_sentiment], + // specified in the request. + SentimentAnalysisResult sentiment_analysis_result = 17; + + // Returns the current advanced settings including IVR settings. Even though + // the operations configured by these settings are performed by Dialogflow, + // the client may need to perform special logic at the moment. For example, if + // Dialogflow exports audio to Google Cloud Storage, then the client may need + // to wait for the resulting object to appear in the bucket before proceeding. + AdvancedSettings advanced_settings = 21; + + // Indicates whether the Thumbs up/Thumbs down rating controls are need to be + // shown for the response in the Dialogflow Messenger widget. + bool allow_answer_feedback = 32; + + // Optional. Data store connection feature output signals. + // Filled only when data stores are involved in serving the query. + DataStoreConnectionSignals data_store_connection_signals = 35 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contains the sequence of trace blocks from the current + // conversation turn. Trace blocks are ordered chronologically and contain + // detailed traces of runtime behavior such as tool calls, LLM calls, flow and + // playbook invocations, agent utterances and user utterances. + repeated TraceBlock trace_blocks = 37 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the natural language text to be processed. +message TextInput { + // Required. The UTF-8 encoded natural language text to be processed. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the intent to trigger programmatically rather than as a result of +// natural language processing. +message IntentInput { + // Required. The unique identifier of the intent. + // Format: + // `projects//locations//agents//intents/`. + string intent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the natural speech audio to be processed. +message AudioInput { + // Required. Instructs the speech recognizer how to process the speech audio. + InputAudioConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The natural language speech audio to be processed. + // A single request can contain up to 2 minutes of speech audio data. + // The [transcribed + // text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot + // contain more than 256 bytes. + // + // For non-streaming audio detect intent, both `config` and `audio` must be + // provided. + // For streaming audio detect intent, `config` must be provided in + // the first request and `audio` must be provided in all following requests. + bytes audio = 2; +} + +// Represents the event to trigger. +message EventInput { + // Name of the event. + string event = 1; +} + +// Represents the input for dtmf event. +message DtmfInput { + // The dtmf digits. + string digits = 1; + + // The finish digit (if any). + string finish_digit = 2; +} + +// Represents one match result of [MatchIntent][]. +message Match { + // Type of a Match. + enum MatchType { + // Not specified. Should never be used. + MATCH_TYPE_UNSPECIFIED = 0; + + // The query was matched to an intent. + INTENT = 1; + + // The query directly triggered an intent. + DIRECT_INTENT = 2; + + // The query was used for parameter filling. + PARAMETER_FILLING = 3; + + // No match was found for the query. + NO_MATCH = 4; + + // Indicates an empty query. + NO_INPUT = 5; + + // The query directly triggered an event. + EVENT = 6; + + // The query was matched to a Knowledge Connector answer. + KNOWLEDGE_CONNECTOR = 8; + + // The query was handled by a + // [`Playbook`][google.cloud.dialogflow.cx.v3beta1.Playbook]. + PLAYBOOK = 9; + } + + // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the + // query. Some, not all fields are filled in this message, including but not + // limited to: `name` and `display_name`. Only filled for + // [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type. + Intent intent = 1; + + // The event that matched the query. Filled for + // [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType], + // [`NO_MATCH`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] and + // [`NO_INPUT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match + // types. + string event = 6; + + // The collection of parameters extracted from the query. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // * MapKey type: string + // * MapKey value: parameter name + // * MapValue type: If parameter's entity type is a composite entity then use + // map, otherwise, depending on the parameter value type, it could be one of + // string, number, boolean, null, list or map. + // * MapValue value: If parameter's entity type is a composite entity then use + // map from composite entity property names to property values, otherwise, + // use parameter value. + google.protobuf.Struct parameters = 2; + + // Final text input which was matched during MatchIntent. This value can be + // different from original input sent in request because of spelling + // correction or other processing. + string resolved_input = 3; + + // Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match]. + MatchType match_type = 4; + + // The confidence of this match. Values range from 0.0 (completely uncertain) + // to 1.0 (completely certain). + // This value is for informational purpose only and is only used to help match + // the best intent within the classification threshold. This value may change + // for the same end-user expression at any time due to a model retraining or + // change in implementation. + float confidence = 5; +} + +// Request of [MatchIntent][]. +message MatchIntentRequest { + // Required. The name of the session this query is sent to. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + // + // For more information, see the [sessions + // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Persist session parameter changes from `query_params`. + bool persist_parameter_changes = 5; +} + +// Response of [MatchIntent][]. +message MatchIntentResponse { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] + // was provided as input, this field will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was + // provided as input, this field will contain a copy of the intent + // identifier. Format: + // `projects//locations//agents//intents/`. + string trigger_intent = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // If [natural language speech + // audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as + // input, this field will contain the transcript for the audio. + string transcript = 3; + + // If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided + // as input, this field will contain a copy of the event name. + string trigger_event = 6; + } + + // Match results, if more than one, ordered descendingly by the confidence + // we have that the particular intent matches the query. + repeated Match matches = 4; + + // The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all + // fields are filled in this message, including but not limited to `name` and + // `display_name`. + Page current_page = 5; +} + +// Request of [FulfillIntent][] +message FulfillIntentRequest { + // Must be same as the corresponding MatchIntent request, otherwise the + // behavior is undefined. + MatchIntentRequest match_intent_request = 1; + + // The matched intent/event to fulfill. + Match match = 2; + + // Instructs the speech synthesizer how to generate output audio. + OutputAudioConfig output_audio_config = 3; +} + +// Response of [FulfillIntent][] +message FulfillIntentResponse { + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] + // field. If multiple default text responses exist, they will be concatenated + // when generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 3; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} + +// The result of sentiment analysis. Sentiment analysis inspects user input +// and identifies the prevailing subjective opinion, especially to determine a +// user's attitude as positive, negative, or neutral. +message SentimentAnalysisResult { + // Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + // sentiment). + float score = 1; + + // A non-negative number in the [0, +inf) range, which represents the absolute + // magnitude of sentiment, regardless of score (positive or negative). + float magnitude = 2; +} + +// The response view specifies which fields in the +// [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] to return. +enum DetectIntentResponseView { + // Not specified. `DETECT_INTENT_RESPONSE_VIEW_DEFAULT` will be used. + DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED = 0; + + // Full response view includes all fields. + DETECT_INTENT_RESPONSE_VIEW_FULL = 1; + + // Basic response view omits the following fields: + // - + // [QueryResult.diagnostic_info][google.cloud.dialogflow.cx.v3beta1.QueryResult.diagnostic_info] + // - + // [QueryResult.generative_info][google.cloud.dialogflow.cx.v3beta1.QueryResult.generative_info] + // - + // [QueryResult.trace_blocks][google.cloud.dialogflow.cx.v3beta1.QueryResult.trace_blocks] + // - + // [QueryResult.data_store_connection_signals][google.cloud.dialogflow.cx.v3beta1.QueryResult.data_store_connection_signals] + DETECT_INTENT_RESPONSE_VIEW_BASIC = 2; + + // Default response view omits the following fields: + // - + // [QueryResult.trace_blocks][google.cloud.dialogflow.cx.v3beta1.QueryResult.trace_blocks] + DETECT_INTENT_RESPONSE_VIEW_DEFAULT = 3; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto new file mode 100644 index 000000000000..c6f1d0acf61e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto @@ -0,0 +1,280 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/entity_type.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionEntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. +service SessionEntityTypes { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all session entity types in the specified session. + rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) + returns (ListSessionEntityTypesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + additional_bindings { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified session entity type. + rpc GetSessionEntityType(GetSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + additional_bindings { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a session entity type. + rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + body: "session_entity_type" + additional_bindings { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes" + body: "session_entity_type" + } + }; + option (google.api.method_signature) = "parent,session_entity_type"; + } + + // Updates the specified session entity type. + rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + patch: "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + body: "session_entity_type" + additional_bindings { + patch: "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + body: "session_entity_type" + } + }; + option (google.api.method_signature) = "session_entity_type,update_mask"; + } + + // Deletes the specified session entity type. + rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + additional_bindings { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Session entity types are referred to as **User** entity types and are +// entities that are built for an individual user such as favorites, +// preferences, playlists, and so on. +// +// You can redefine a session entity type at the session level to extend or +// replace a [custom entity type][google.cloud.dialogflow.cx.v3beta1.EntityType] +// at the user session level (we refer to the entity types defined at the agent +// level as "custom entity types"). +// +// Note: session entity types apply to all queries, regardless of the language. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message SessionEntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/SessionEntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}" + }; + + // The types of modifications for the session entity type. + enum EntityOverrideMode { + // Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + + // The collection of session entities overrides the collection of entities + // in the corresponding custom entity type. + ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + + // The collection of session entities extends the collection of entities in + // the corresponding custom entity type. + // + // Note: Even in this override mode calls to `ListSessionEntityTypes`, + // `GetSessionEntityType`, `CreateSessionEntityType` and + // `UpdateSessionEntityType` only return the additional entities added in + // this session entity type. If you want to get the supplemented list, + // please call + // [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType] + // on the custom entity type and merge. + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + } + + // Required. The unique identifier of the session entity type. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates whether the additional data should override or + // supplement the custom entity type definition. + EntityOverrideMode entity_override_mode = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The collection of entities to override or supplement the custom + // entity type. + repeated EntityType.Entity entities = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesRequest { + // Required. The session to list all session entity types from. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesResponse { + // The list of session entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated SessionEntityType session_entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityType]. +message GetSessionEntityTypeRequest { + // Required. The name of the session entity type. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} + +// The request message for +// [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityType]. +message CreateSessionEntityTypeRequest { + // Required. The session to create a session entity type for. + // Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // Required. The session entity type to create. + SessionEntityType session_entity_type = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityType]. +message UpdateSessionEntityTypeRequest { + // Required. The session entity type to update. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + SessionEntityType session_entity_type = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityType]. +message DeleteSessionEntityTypeRequest { + // Required. The name of the session entity type to delete. + // Format: + // `projects//locations//agents//sessions//entityTypes/` + // or + // `projects//locations//agents//environments//sessions//entityTypes/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto new file mode 100644 index 000000000000..2844d8126f59 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto @@ -0,0 +1,1005 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/cloud/dialogflow/cx/v3beta1/intent.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/cloud/dialogflow/cx/v3beta1/session.proto"; +import "google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "TestCaseProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing [Test +// Cases][google.cloud.dialogflow.cx.v3beta1.TestCase] and [Test Case +// Results][google.cloud.dialogflow.cx.v3beta1.TestCaseResult]. +service TestCases { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Fetches a list of test cases for a given agent. + rpc ListTestCases(ListTestCasesRequest) returns (ListTestCasesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases" + }; + option (google.api.method_signature) = "parent"; + } + + // Batch deletes test cases. + rpc BatchDeleteTestCases(BatchDeleteTestCasesRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a test case. + rpc GetTestCase(GetTestCaseRequest) returns (TestCase) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a test case for the given agent. + rpc CreateTestCase(CreateTestCaseRequest) returns (TestCase) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases" + body: "test_case" + }; + option (google.api.method_signature) = "parent,test_case"; + } + + // Updates the specified test case. + rpc UpdateTestCase(UpdateTestCaseRequest) returns (TestCase) { + option (google.api.http) = { + patch: "/v3beta1/{test_case.name=projects/*/locations/*/agents/*/testCases/*}" + body: "test_case" + }; + option (google.api.method_signature) = "test_case,update_mask"; + } + + // Kicks off a test case run. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata] + // - `response`: + // [RunTestCaseResponse][google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse] + rpc RunTestCase(RunTestCaseRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*}:run" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RunTestCaseResponse" + metadata_type: "RunTestCaseMetadata" + }; + } + + // Kicks off a batch run of test cases. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata] + // - `response`: + // [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse] + rpc BatchRunTestCases(BatchRunTestCasesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:batchRun" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchRunTestCasesResponse" + metadata_type: "BatchRunTestCasesMetadata" + }; + } + + // Calculates the test coverage for an agent. + rpc CalculateCoverage(CalculateCoverageRequest) + returns (CalculateCoverageResponse) { + option (google.api.http) = { + get: "/v3beta1/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage" + }; + } + + // Imports the test cases from a Cloud Storage bucket or a local file. It + // always creates new test cases and won't overwrite any existing ones. The + // provided ID in the imported test case is neglected. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata] + // - `response`: + // [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse] + rpc ImportTestCases(ImportTestCasesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportTestCasesResponse" + metadata_type: "ImportTestCasesMetadata" + }; + } + + // Exports the test cases under the agent to a Cloud Storage bucket or a local + // file. Filter can be applied to export a subset of test cases. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata] + // - `response`: + // [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse] + rpc ExportTestCases(ExportTestCasesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportTestCasesResponse" + metadata_type: "ExportTestCasesMetadata" + }; + } + + // Fetches the list of run results for the given test case. A maximum of 100 + // results are kept for each test case. + rpc ListTestCaseResults(ListTestCaseResultsRequest) + returns (ListTestCaseResultsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/testCases/*}/results" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a test case result. + rpc GetTestCaseResult(GetTestCaseResultRequest) returns (TestCaseResult) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*/results/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents a test case. +message TestCase { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TestCase" + pattern: "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}" + }; + + // The unique identifier of the test case. + // [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] + // will populate the name automatically. Otherwise use format: + // `projects//locations//agents//testCases/`. + string name = 1; + + // Tags are short descriptions that users may apply to test cases for + // organizational and filtering purposes. Each tag should start with "#" and + // has a limit of 30 characters. + repeated string tags = 2; + + // Required. The human-readable name of the test case, unique within the + // agent. Limit of 200 characters. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Additional freeform notes about the test case. Limit of 400 characters. + string notes = 4; + + // Config for the test case. + TestConfig test_config = 13; + + // The conversation turns uttered when the test case was created, in + // chronological order. These include the canonical set of agent utterances + // that should occur when the agent is working properly. + repeated ConversationTurn test_case_conversation_turns = 5; + + // Output only. When the test was created. + google.protobuf.Timestamp creation_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest test result. + TestCaseResult last_test_result = 12; +} + +// Represents a result from running a test case in an agent environment. +message TestCaseResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TestCaseResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}" + }; + + // The resource name for the test case result. Format: + // `projects//locations//agents//testCases//results/`. + string name = 1; + + // Environment where the test was run. If not set, it indicates the draft + // environment. + string environment = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + }]; + + // The conversation turns uttered during the test case replay in chronological + // order. + repeated ConversationTurn conversation_turns = 3; + + // Whether the test case passed in the agent environment. + TestResult test_result = 4; + + // The time that the test was run. + google.protobuf.Timestamp test_time = 5; +} + +// Represents configurations for a test case. +message TestConfig { + // Session parameters to be compared when calculating differences. + repeated string tracking_parameters = 1; + + // Flow name to start the test case with. + // Format: + // `projects//locations//agents//flows/`. + // + // Only one of `flow` and `page` should be set to indicate the starting point + // of the test case. If neither is set, the test case will start with start + // page on the default start flow. + string flow = 2 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // The [page][google.cloud.dialogflow.cx.v3beta1.Page] to start the test case + // with. Format: + // `projects//locations//agents//flows//pages/`. + // + // Only one of `flow` and `page` should be set to indicate the starting point + // of the test case. If neither is set, the test case will start with start + // page on the default start flow. + string page = 3 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; +} + +// One interaction between a human and virtual agent. The human provides some +// input and the virtual agent provides a response. +message ConversationTurn { + // The input from the human user. + message UserInput { + // Supports [text + // input][google.cloud.dialogflow.cx.v3beta1.QueryInput.text], [event + // input][google.cloud.dialogflow.cx.v3beta1.QueryInput.event], [dtmf + // input][google.cloud.dialogflow.cx.v3beta1.QueryInput.dtmf] in the test + // case. + QueryInput input = 5; + + // Parameters that need to be injected into the conversation during intent + // detection. + google.protobuf.Struct injected_parameters = 2; + + // If webhooks should be allowed to trigger in response to the user + // utterance. Often if parameters are injected, webhooks should not be + // enabled. + bool is_webhook_enabled = 3; + + // Whether sentiment analysis is enabled. + bool enable_sentiment_analysis = 7; + } + + // The output from the virtual agent. + message VirtualAgentOutput { + // The session parameters available to the bot at this point. + google.protobuf.Struct session_parameters = 4; + + // Output only. If this is part of a [result conversation + // turn][TestCaseResult.conversation_turns], the list of differences + // between the original run and the replay for this output, if any. + repeated TestRunDifference differences = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Input only. The diagnostic + // [info][Session.DetectIntentResponse.QueryResult.diagnostic_info] + // output for the turn. Required to calculate the testing coverage. + google.protobuf.Struct diagnostic_info = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that triggered + // the response. Only name and displayName will be set. + Intent triggered_intent = 7; + + // The [Page][google.cloud.dialogflow.cx.v3beta1.Page] on which the + // utterance was spoken. Only name and displayName will be set. + Page current_page = 8; + + // The [text][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text] + // responses from the agent for the turn. + repeated ResponseMessage.Text text_responses = 9; + + // Response error from the agent in the test result. If set, other output + // is empty. + google.rpc.Status status = 10; + } + + // The user input. + UserInput user_input = 1; + + // The virtual agent output. + VirtualAgentOutput virtual_agent_output = 2; +} + +// The description of differences between original and replayed agent output. +message TestRunDifference { + // What part of the message replay differs from the test case. + enum DiffType { + // Should never be used. + DIFF_TYPE_UNSPECIFIED = 0; + + // The intent. + INTENT = 1; + + // The page. + PAGE = 2; + + // The parameters. + PARAMETERS = 3; + + // The message utterance. + UTTERANCE = 4; + + // The flow. + FLOW = 5; + } + + // The type of diff. + DiffType type = 1; + + // A human readable description of the diff, showing the actual output vs + // expected output. + string description = 2; +} + +// Transition coverage represents the percentage of all possible page +// transitions (page-level transition routes and event handlers, excluding +// transition route groups) present within any of a parent's test cases. +message TransitionCoverage { + // The source or target of a transition. + message TransitionNode { + // A TransitionNode can be either a page or a flow. + oneof kind { + // Indicates a transition to a + // [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Only some fields such + // as name and displayname will be set. + Page page = 1; + + // Indicates a transition to a + // [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. Only some fields such + // as name and displayname will be set. + Flow flow = 2; + } + } + + // A transition in a page. + message Transition { + // The start node of a transition. + TransitionNode source = 1; + + // The index of a transition in the transition list. Starting from 0. + int32 index = 4; + + // The end node of a transition. + TransitionNode target = 2; + + // Whether the transition is covered by at least one of the + // agent's test cases. + bool covered = 3; + + // The detailed transition. + oneof detail { + // Intent route or condition route. + TransitionRoute transition_route = 5; + + // Event handler. + EventHandler event_handler = 6; + } + } + + // The list of Transitions present in the agent. + repeated Transition transitions = 1; + + // The percent of transitions in the agent that are covered. + float coverage_score = 2; +} + +// Transition route group coverage represents the percentage of all possible +// transition routes present within any of a parent's test cases. The results +// are grouped by the transition route group. +message TransitionRouteGroupCoverage { + // Coverage result message for one transition route group. + message Coverage { + // A transition coverage in a transition route group. + message Transition { + // Intent route or condition route. + TransitionRoute transition_route = 1; + + // Whether the transition route is covered by at least one of the + // agent's test cases. + bool covered = 2; + } + + // Transition route group metadata. Only name and displayName will be set. + TransitionRouteGroup route_group = 1; + + // The list of transition routes and coverage in the transition route group. + repeated Transition transitions = 2; + + // The percent of transition routes in the transition route group that are + // covered. + float coverage_score = 3; + } + + // Transition route group coverages. + repeated Coverage coverages = 1; + + // The percent of transition routes in all the transition route groups that + // are covered. + float coverage_score = 2; +} + +// Intent coverage represents the percentage of all possible intents in the +// agent that are triggered in any of a parent's test cases. +message IntentCoverage { + // The agent's intent. + message Intent { + // The intent full resource name + string intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Whether the intent is covered by at least one of the agent's + // test cases. + bool covered = 2; + } + + // The list of Intents present in the agent + repeated Intent intents = 1; + + // The percent of intents in the agent that are covered. + float coverage_score = 2; +} + +// The request message for +// [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3beta1.TestCases.CalculateCoverage]. +message CalculateCoverageRequest { + // The type of coverage score requested. + enum CoverageType { + // Should never be used. + COVERAGE_TYPE_UNSPECIFIED = 0; + + // Intent coverage. + INTENT = 1; + + // Page transition coverage. + PAGE_TRANSITION = 2; + + // Transition route group coverage. + TRANSITION_ROUTE_GROUP = 3; + } + + // Required. The agent to calculate coverage for. + // Format: `projects//locations//agents/`. + string agent = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The type of coverage requested. + CoverageType type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response message for +// [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3beta1.TestCases.CalculateCoverage]. +message CalculateCoverageResponse { + // The agent to calculate coverage for. + // Format: `projects//locations//agents/`. + string agent = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + }]; + + // The type of coverage requested. + oneof coverage_type { + // Intent coverage. + IntentCoverage intent_coverage = 2; + + // Transition (excluding transition route groups) coverage. + TransitionCoverage transition_coverage = 4; + + // Transition route group coverage. + TransitionRouteGroupCoverage route_group_coverage = 6; + } +} + +// The request message for +// [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCases]. +message ListTestCasesRequest { + // Specifies how much test case information to include in the response. + enum TestCaseView { + // The default / unset value. + // The API will default to the BASIC view. + TEST_CASE_VIEW_UNSPECIFIED = 0; + + // Include basic metadata about the test case, but not the conversation + // turns. This is the default value. + BASIC = 1; + + // Include everything. + FULL = 2; + } + + // Required. The agent to list all pages for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // The maximum number of items to return in a single page. By default 20. + // Note that when TestCaseView = FULL, the maximum page size allowed is 20. + // When TestCaseView = BASIC, the maximum page size allowed is 500. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // Specifies whether response should include all fields or just the metadata. + TestCaseView view = 4; +} + +// The response message for +// [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCases]. +message ListTestCasesResponse { + // The list of test cases. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated TestCase test_cases = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [TestCases.BatchDeleteTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchDeleteTestCases]. +message BatchDeleteTestCasesRequest { + // Required. The agent to delete test cases from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Required. Format of test case names: + // `projects//locations//agents//testCases/`. + repeated string names = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; +} + +// The request message for +// [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase]. +message CreateTestCaseRequest { + // Required. The agent to create the test case for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Required. The test case to create. + TestCase test_case = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [TestCases.UpdateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.UpdateTestCase]. +message UpdateTestCaseRequest { + // Required. The test case to update. + TestCase test_case = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to specify which fields should be updated. The + // [`creationTime`][google.cloud.dialogflow.cx.v3beta1.TestCase.creation_time] + // and + // [`lastTestResult`][google.cloud.dialogflow.cx.v3beta1.TestCase.last_test_result] + // cannot be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [TestCases.GetTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCase]. +message GetTestCaseRequest { + // Required. The name of the testcase. + // Format: + // `projects//locations//agents//testCases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; +} + +// The request message for +// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.RunTestCase]. +message RunTestCaseRequest { + // Required. Format of test case name to run: + // `projects//locations//agents//testCases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Optional. Environment name. If not set, draft environment is assumed. + // Format: + // `projects//locations//agents//environments/`. + string environment = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The response message for +// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.RunTestCase]. +message RunTestCaseResponse { + // The result. + TestCaseResult result = 2; +} + +// Metadata returned for the +// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.RunTestCase] +// long running operation. This message currently has no fields. +message RunTestCaseMetadata {} + +// The request message for +// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCases]. +message BatchRunTestCasesRequest { + // Required. Agent name. Format: + // `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Optional. If not set, draft environment is assumed. Format: + // `projects//locations//agents//environments/`. + string environment = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. Format: + // `projects//locations//agents//testCases/`. + repeated string test_cases = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + } + ]; +} + +// The response message for +// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCases]. +message BatchRunTestCasesResponse { + // The test case results. The detailed + // [conversation + // turns][google.cloud.dialogflow.cx.v3beta1.TestCaseResult.conversation_turns] + // are empty in this response. + repeated TestCaseResult results = 1; +} + +// Metadata returned for the +// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCases] +// long running operation. +message BatchRunTestCasesMetadata { + // The test errors. + repeated TestError errors = 1; +} + +// Error info for running a test. +message TestError { + // The test case resource name. + string test_case = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + }]; + + // The status associated with the test. + google.rpc.Status status = 2; + + // The timestamp when the test was completed. + google.protobuf.Timestamp test_time = 3; +} + +// The request message for +// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCases]. +message ImportTestCasesRequest { + // Required. The agent to import test cases to. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // Required. The source to import. + oneof source { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to import test cases from. The format of this URI must be + // `gs:///`. + // + // Dialogflow performs a read operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have read permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string gcs_uri = 2; + + // Uncompressed raw byte content for test cases. + bytes content = 3; + } +} + +// The response message for +// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCases]. +message ImportTestCasesResponse { + // The unique identifiers of the new test cases. + // Format: + // `projects//locations//agents//testCases/`. + repeated string names = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCase" + }]; +} + +// Metadata returned for the +// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCases] +// long running operation. +message ImportTestCasesMetadata { + // Errors for failed test cases. + repeated TestCaseError errors = 1; +} + +// Error info for importing a test. +message TestCaseError { + // The test case. + TestCase test_case = 1; + + // The status associated with the test case. + google.rpc.Status status = 2; +} + +// The request message for +// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ExportTestCases]. +message ExportTestCasesRequest { + // Data format of the exported test cases. + enum DataFormat { + // Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0; + + // Raw bytes. + BLOB = 1; + + // JSON format. + JSON = 2; + } + + // Required. The agent where to export test cases from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCase" + } + ]; + + // The destination to export. + oneof destination { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + // export the test cases to. The format of this URI must be + // `gs:///`. If unspecified, the serialized test + // cases is returned inline. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string gcs_uri = 2; + } + + // The data format of the exported test cases. If not specified, `BLOB` is + // assumed. + DataFormat data_format = 3; + + // The filter expression used to filter exported test cases, see + // [API Filtering](https://aip.dev/160). The expression is case insensitive + // and supports the following syntax: + // + // name = [OR name = ] ... + // + // For example: + // + // * "name = t1 OR name = t2" matches the test case with the exact resource + // name "t1" or "t2". + string filter = 4; +} + +// The response message for +// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ExportTestCases]. +message ExportTestCasesResponse { + // The exported test cases. + oneof destination { + // The URI to a file containing the exported test cases. This field is + // populated only if `gcs_uri` is specified in + // [ExportTestCasesRequest][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest]. + string gcs_uri = 1; + + // Uncompressed raw byte content for test cases. + bytes content = 2; + } +} + +// Metadata returned for the +// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ExportTestCases] +// long running operation. This message currently has no fields. +message ExportTestCasesMetadata {} + +// The request message for +// [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCaseResults]. +message ListTestCaseResultsRequest { + // Required. The test case to list results for. + // Format: + // `projects//locations//agents//testCases/`. + // Specify a `-` as a wildcard for TestCase ID to + // list results across multiple test cases. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TestCaseResult" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The filter expression used to filter test case results. See + // [API Filtering](https://aip.dev/160). + // + // The expression is case insensitive. Only 'AND' is supported for logical + // operators. The supported syntax is listed below in detail: + // + // [AND ] ... + // [AND latest] + // + // The supported fields and operators are: + // field operator + // `environment` `=`, `IN` (Use value `draft` for draft environment) + // `test_time` `>`, `<` + // + // `latest` only returns the latest test result in all results for each test + // case. + // + // Examples: + // * "environment=draft AND latest" matches the latest test result for each + // test case in the draft environment. + // * "environment IN (e1,e2)" matches any test case results with an + // environment resource name of either "e1" or "e2". + // * "test_time > 1602540713" matches any test case results with test time + // later than a unix timestamp in seconds 1602540713. + string filter = 4; +} + +// The response message for +// [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCaseResults]. +message ListTestCaseResultsResponse { + // The list of test case results. + repeated TestCaseResult test_case_results = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [TestCases.GetTestCaseResult][google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCaseResult]. +message GetTestCaseResultRequest { + // Required. The name of the testcase. + // Format: + // `projects//locations//agents//testCases//results/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCaseResult" + } + ]; +} + +// The test result for a test case and an agent environment. +enum TestResult { + // Not specified. Should never be used. + TEST_RESULT_UNSPECIFIED = 0; + + // The test passed. + PASSED = 1; + + // The test did not pass. + FAILED = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool.proto new file mode 100644 index 000000000000..02b5b696ef57 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool.proto @@ -0,0 +1,900 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto"; +import "google/cloud/dialogflow/cx/v3beta1/inline.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ToolProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Tools][google.cloud.dialogflow.cx.v3beta1.Tool]. +service Tools { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a [Tool][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified + // agent. + rpc CreateTool(CreateToolRequest) returns (Tool) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools" + body: "tool" + }; + option (google.api.method_signature) = "parent,tool"; + } + + // Returns a list of [Tools][google.cloud.dialogflow.cx.v3beta1.Tool] in the + // specified agent. + rpc ListTools(ListToolsRequest) returns (ListToolsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools" + }; + option (google.api.method_signature) = "parent"; + } + + // Exports the selected tools. + rpc ExportTools(ExportToolsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportToolsResponse" + metadata_type: "ExportToolsMetadata" + }; + } + + // Retrieves the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + rpc GetTool(GetToolRequest) returns (Tool) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + rpc UpdateTool(UpdateToolRequest) returns (Tool) { + option (google.api.http) = { + patch: "/v3beta1/{tool.name=projects/*/locations/*/agents/*/tools/*}" + body: "tool" + }; + option (google.api.method_signature) = "tool,update_mask"; + } + + // Deletes a specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + rpc DeleteTool(DeleteToolRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List versions of the specified + // [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + rpc ListToolVersions(ListToolVersionsRequest) + returns (ListToolVersionsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/tools/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a version for the specified + // [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + rpc CreateToolVersion(CreateToolVersionRequest) returns (ToolVersion) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/tools/*}/versions" + body: "tool_version" + }; + option (google.api.method_signature) = "parent,tool_version"; + } + + // Retrieves the specified version of the + // [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + rpc GetToolVersion(GetToolVersionRequest) returns (ToolVersion) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified version of the + // [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + rpc DeleteToolVersion(DeleteToolVersionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the specified version of the Tool and stores it as the + // current tool draft, returning the tool with resources updated. + rpc RestoreToolVersion(RestoreToolVersionRequest) + returns (RestoreToolVersionResponse) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for +// [Tools.CreateTool][google.cloud.dialogflow.cx.v3beta1.Tools.CreateTool]. +message CreateToolRequest { + // Required. The agent to create a Tool for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Tool" + } + ]; + + // Required. The Tool to be created. + Tool tool = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Tools.ListTools][google.cloud.dialogflow.cx.v3beta1.Tools.ListTools]. +message ListToolsRequest { + // Required. The agent to list the Tools from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Tool" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Tools.ListTools][google.cloud.dialogflow.cx.v3beta1.Tools.ListTools]. +message ListToolsResponse { + // The list of Tools. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Tool tools = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Tools.GetTool][google.cloud.dialogflow.cx.v3beta1.Tools.GetTool]. +message GetToolRequest { + // Required. The name of the Tool. + // Format: + // `projects//locations//agents//tools/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; +} + +// The request message for +// [Tools.ExportTools][google.cloud.dialogflow.cx.v3beta1.Tools.ExportTools]. +message ExportToolsRequest { + // Data format of the exported tools. + enum DataFormat { + // Unspecified format. Treated as `BLOB`. + DATA_FORMAT_UNSPECIFIED = 0; + + // Tools will be exported as raw bytes. + BLOB = 1; + } + + // Required. The agent to export tools from. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Tool" + } + ]; + + // Required. The name of the tools to export. + // Format: + // `projects//locations//agents//tools/`. + repeated string tools = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // The destination to export. + oneof destination { + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to export the tools + // to. The format of this URI must be `gs:///`. + // + // Dialogflow performs a write operation for the Cloud Storage object + // on the caller's behalf, so your request authentication must + // have write permissions for the object. For more information, see + // [Dialogflow access + // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + string tools_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The option to return the serialized tools inline. + bool tools_content_inline = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The data format of the exported tools. If not specified, `BLOB` + // is assumed. + DataFormat data_format = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Tools.ExportTools][google.cloud.dialogflow.cx.v3beta1.Tools.ExportTools]. +message ExportToolsResponse { + // The exported tools. + oneof tools { + // The URI to a file containing the exported tools. This field is + // populated only if `tools_uri` is specified in + // [ExportToolsRequest][google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest]. + string tools_uri = 1; + + // Uncompressed byte content for tools. This field is populated only if + // `tools_content_inline` is set to true in + // [ExportToolsRequest][google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest]. + InlineDestination tools_content = 2; + } +} + +// The request message for +// [Tools.UpdateTool][google.cloud.dialogflow.cx.v3beta1.Tools.UpdateTool]. +message UpdateToolRequest { + // Required. The Tool to be updated. + Tool tool = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Tools.DeleteTool][google.cloud.dialogflow.cx.v3beta1.Tools.DeleteTool]. +message DeleteToolRequest { + // Required. The name of the Tool to be deleted. + // Format: + // `projects//locations//agents//tools/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // This field has no effect for Tools not being used. + // For Tools that are used: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the tool, as well + // as any references to the tool. + bool force = 2; +} + +// A tool provides a list of actions which are available to the +// [Playbook][google.cloud.dialogflow.cx.v3beta1.Playbook] to attain its goal. A +// Tool consists of a description of the tool's usage and a specification of the +// tool which contains the schema and authentication information. +message Tool { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Tool" + pattern: "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}" + }; + + // An OpenAPI tool is a way to provide the Tool specifications in the Open API + // schema format. + message OpenApiTool { + // Schema representation. + oneof schema { + // Required. The OpenAPI schema specified as a text. + string text_schema = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Authentication information required by the API. + Authentication authentication = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. TLS configuration for the HTTPS verification. + TLSConfig tls_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration. + ServiceDirectoryConfig service_directory_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // A DataStoreTool is a way to provide specifications needed to search a + // list of data stores. + message DataStoreTool { + // A FallbackPrompt is a way to provide specifications for the Data Store + // fallback prompt when generating responses. + message FallbackPrompt {} + + // Required. List of data stores to search. + repeated DataStoreConnection data_store_connections = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Fallback prompt configurations to use. + FallbackPrompt fallback_prompt = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // An ExtensionTool is a way to use Vertex Extensions as a tool. + message ExtensionTool { + // Required. The full name of the referenced vertex extension. + // Formats: + // `projects/{project}/locations/{location}/extensions/{extension}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A Function tool describes the functions to be invoked on the client side. + message FunctionTool { + // Optional. The JSON schema is encapsulated in a + // [google.protobuf.Struct][google.protobuf.Struct] to describe the input of + // the function. This input is a JSON object that contains the function's + // parameters as properties of the object. + google.protobuf.Struct input_schema = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The JSON schema is encapsulated in a + // [google.protobuf.Struct][google.protobuf.Struct] to describe the output + // of the function. This output is a JSON object that contains the + // function's parameters as properties of the object. + google.protobuf.Struct output_schema = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // A ConnectorTool enabling using Integration Connectors Connections as tools. + message ConnectorTool { + // Configuration of a Connection operation for the tool to use. + message Action { + // Entity CRUD operation specification. + message EntityOperation { + // The operation to perform on the entity. + enum OperationType { + // Operation type unspecified. Invalid, ConnectorTool create/update + // will fail. + OPERATION_TYPE_UNSPECIFIED = 0; + + // List operation. + LIST = 1; + + // Get operation. + GET = 2; + + // Create operation. + CREATE = 3; + + // Update operation. + UPDATE = 4; + + // Delete operation. + DELETE = 5; + } + + // Required. ID of the entity. + string entity_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Operation to perform on the entity. + OperationType operation = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specification for an action to configure for the tool to use. + oneof action_spec { + // ID of a Connection action for the tool to use. + string connection_action_id = 4; + + // Entity operation configuration for the tool to use. + EntityOperation entity_operation = 5; + } + + // Optional. Entity fields to use as inputs for the operation. + // If no fields are specified, all fields of the Entity will be used. + repeated string input_fields = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Entity fields to return from the operation. + // If no fields are specified, all fields of the Entity will be returned. + repeated string output_fields = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The full resource name of the referenced Integration Connectors + // Connection. Format: `projects/*/locations/*/connections/*` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Actions for the tool to use. + repeated Action actions = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Integration Connectors end-user authentication configuration. + // If configured, the end-user authentication fields will be passed in the + // Integration Connectors API request and override the admin, default + // authentication configured for the Connection. + // **Note**: The Connection must have authentication override enabled in + // order to specify an EUC configuration here - otherwise, the ConnectorTool + // creation will fail. See: + // https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override + EndUserAuthConfig end_user_auth_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Authentication information required for API calls + message Authentication { + // Config for authentication with API key. + message ApiKeyConfig { + // Required. The parameter name or the header name of the API key. + // E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + string key_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The API key. If the `secret_version_for_api_key` field is + // set, this field will be ignored. + string api_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the API key. If this field is set, the `api_key` field will be ignored. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_api_key = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. Key location in the request. + RequestLocation request_location = 3 + [(google.api.field_behavior) = REQUIRED]; + } + + // The location of the API key in the request. + enum RequestLocation { + // Default value. This value is unused. + REQUEST_LOCATION_UNSPECIFIED = 0; + + // Represents the key in http header. + HEADER = 1; + + // Represents the key in query string. + QUERY_STRING = 2; + } + + // Config for authentication with OAuth. + message OAuthConfig { + // OAuth grant types. Only [client credential + // grant](https://oauth.net/2/grant-types/client-credentials) is + // supported. + enum OauthGrantType { + // Default value. This value is unused. + OAUTH_GRANT_TYPE_UNSPECIFIED = 0; + + // Represents the [client credential + // flow](https://oauth.net/2/grant-types/client-credentials). + CLIENT_CREDENTIAL = 1; + } + + // Required. OAuth grant types. + OauthGrantType oauth_grant_type = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The client ID from the OAuth provider. + string client_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The client secret from the OAuth provider. If the + // `secret_version_for_client_secret` field is set, this field will be + // ignored. + string client_secret = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the client secret. If this field is set, the `client_secret` field will + // be ignored. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_client_secret = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. The token endpoint in the OAuth provider to exchange for an + // access token. + string token_endpoint = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. + repeated string scopes = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for auth using [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + message ServiceAgentAuthConfig { + // Indicate the auth token type generated from the [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + enum ServiceAgentAuth { + // Service agent auth type unspecified. Default to ID_TOKEN. + SERVICE_AGENT_AUTH_UNSPECIFIED = 0; + + // Use [ID + // token](https://cloud.google.com/docs/authentication/token-types#id) + // generated from service agent. This can be used to access Cloud + // Function and Cloud Run after you grant Invoker role to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ID_TOKEN = 1; + + // Use [access + // token](https://cloud.google.com/docs/authentication/token-types#access) + // generated from service agent. This can be used to access other Google + // Cloud APIs after you grant required roles to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ACCESS_TOKEN = 2; + } + + // Optional. Indicate the auth token type generated from the [Diglogflow + // service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + // The generated token is sent in the Authorization header. + ServiceAgentAuth service_agent_auth = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for authentication using bearer token. + message BearerTokenConfig { + // Optional. The text token appended to the text `Bearer` to the request + // Authorization header. + // [Session parameters + // reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + // can be used to pass the token dynamically, e.g. + // `$session.params.parameter-id`. + string token = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the Bearer token. If this field is set, the `token` field will be + // ignored. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_token = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // Configuration for authentication using a service account. + message ServiceAccountAuthConfig { + // Required. The email address of the service account used to authenticate + // the tool call. Dialogflow uses this service account to exchange an + // access token and the access token is then sent in the `Authorization` + // header of the tool request. + // + // The service account must have the + // `roles/iam.serviceAccountTokenCreator` role granted to the + // [Dialogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + string service_account = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The auth configuration. + oneof auth_config { + // Config for API key auth. + ApiKeyConfig api_key_config = 1; + + // Config for OAuth. + OAuthConfig oauth_config = 2; + + // Config for [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) + // auth. + ServiceAgentAuthConfig service_agent_auth_config = 3; + + // Config for bearer token auth. + BearerTokenConfig bearer_token_config = 4; + + // Configuration for service account authentication. + ServiceAccountAuthConfig service_account_auth_config = 5; + } + } + + // The TLS configuration. + message TLSConfig { + // The CA certificate. + message CACert { + // Required. The name of the allowed custom CA certificates. This + // can be used to disambiguate the custom CA certificates. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The allowed custom CA certificates (in DER format) for + // HTTPS verification. This overrides the default SSL trust store. If this + // is empty or unspecified, Dialogflow will use Google's default trust + // store to verify certificates. N.B. Make sure the HTTPS server + // certificates are signed with "subject alt name". For instance a + // certificate can be self-signed using the following command: + // + // ``` + // openssl x509 -req -days 200 -in example.com.csr \ + // -signkey example.com.key \ + // -out example.com.crt \ + // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + // ``` + bytes cert = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specifies a list of allowed custom CA certificates for HTTPS + // verification. + repeated CACert ca_certs = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration for tools using Service Directory. + message ServiceDirectoryConfig { + // Required. The name of [Service + // Directory](https://cloud.google.com/service-directory) service. + // Format: + // `projects//locations//namespaces//services/`. + // `LocationID` of the service directory must be the same as the location + // of the agent. + string service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; + } + + // End-user authentication configuration used for Connection calls. + // The field values can either be hardcoded authentication values or the names + // of [session + // parameters](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + // or [request + // parameters](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#request-scoped). + // + // If parameter names are provided, then those parameters can be used to pass + // the authentication values dynamically, through `$session.params.param-id` + // or `$request.payload.param-id`. + message EndUserAuthConfig { + // Oauth 2.0 Authorization Code authentication configuration. + message Oauth2AuthCodeConfig { + // Required. Oauth token value or parameter name to pass it through. + string oauth_token = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // JWT Profile Oauth 2.0 Authorization Grant authentication configuration. + message Oauth2JwtBearerConfig { + // Required. Issuer value or parameter name to pass it through. + string issuer = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Subject value or parameter name to pass it through. + string subject = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Client key value or parameter name to pass it through. + string client_key = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The end-user authentication configuration. + oneof end_user_auth_config { + // Oauth 2.0 Authorization Code authentication. + Oauth2AuthCodeConfig oauth2_auth_code_config = 2; + + // JWT Profile Oauth 2.0 Authorization Grant authentication. + Oauth2JwtBearerConfig oauth2_jwt_bearer_config = 3; + } + } + + // Represents the type of the tool. + enum ToolType { + // Default value. This value is unused. + TOOL_TYPE_UNSPECIFIED = 0; + + // Customer provided tool. + CUSTOMIZED_TOOL = 1; + + // First party built-in tool created by Dialogflow which cannot be modified. + BUILTIN_TOOL = 2; + } + + // The unique identifier of the Tool. + // Format: + // `projects//locations//agents//tools/`. + string name = 1; + + // Required. The human-readable name of the Tool, unique within an agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. High level description of the Tool and its usage. + string description = 3 [(google.api.field_behavior) = REQUIRED]; + + // Specification of the Tool. + oneof specification { + // OpenAPI specification of the Tool. + OpenApiTool open_api_spec = 4; + + // Data store search tool specification. + DataStoreTool data_store_spec = 8; + + // Vertex extension tool specification. + ExtensionTool extension_spec = 11; + + // Client side executed function specification. + FunctionTool function_spec = 13; + + // Integration connectors tool specification. + ConnectorTool connector_spec = 15; + } + + // Output only. The tool type. + ToolType tool_type = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for +// [Tools.ListToolVersions][google.cloud.dialogflow.cx.v3beta1.Tools.ListToolVersions]. +message ListToolVersionsRequest { + // Required. The parent of the tool versions. + // Format: + // `projects//locations//agents//tools/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ToolVersion" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for +// [Tools.ListToolVersions][google.cloud.dialogflow.cx.v3beta1.Tools.ListToolVersions]. +message ListToolVersionsResponse { + // The list of tool versions. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated ToolVersion tool_versions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Tools.CreateToolVersion][google.cloud.dialogflow.cx.v3beta1.Tools.CreateToolVersion]. +// The request message for +// [Tools.CreateToolVersion][google.cloud.dialogflow.cx.v3beta1.Tools.CreateToolVersion]. +message CreateToolVersionRequest { + // Required. The tool to create a version for. + // Format: + // `projects//locations//agents//tools/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ToolVersion" + } + ]; + + // Required. The tool version to create. + ToolVersion tool_version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Tools.GetToolVersion][google.cloud.dialogflow.cx.v3beta1.Tools.GetToolVersion]. +message GetToolVersionRequest { + // Required. The name of the tool version. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ToolVersion" + } + ]; +} + +// The request message for +// [Tools.DeleteToolVersion][google.cloud.dialogflow.cx.v3beta1.Tools.DeleteToolVersion]. +message DeleteToolVersionRequest { + // Required. The name of the tool version to delete. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ToolVersion" + } + ]; + + // Optional. This field has no effect for Tools not being used. + // For Tools that are used: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the tool, as well + // as any references to the tool. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [Tools.RestoreToolVersion][google.cloud.dialogflow.cx.v3beta1.Tools.RestoreToolVersion]. +message RestoreToolVersionRequest { + // Required. The name of the tool version. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ToolVersion" + } + ]; +} + +// The response message for +// [Tools.RestoreToolVersion][google.cloud.dialogflow.cx.v3beta1.Tools.RestoreToolVersion]. +message RestoreToolVersionResponse { + // The updated tool. + Tool tool = 2; +} + +// Tool version is a snapshot of the tool at certain timestamp. +message ToolVersion { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/ToolVersion" + pattern: "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}" + plural: "toolVersions" + singular: "toolVersion" + }; + + // Identifier. The unique identifier of the tool version. + // Format: + // `projects//locations//agents//tools//versions/`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the tool version. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Snapshot of the tool to be associated with this version. + Tool tool = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Last time the tool version was created or modified. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the tool version was created or modified. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata returned for the +// [Tools.ExportTools][google.cloud.dialogflow.cx.v3beta1.Tools.ExportTools] +// long running operation. +message ExportToolsMetadata {} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto new file mode 100644 index 000000000000..d66838a8f360 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto @@ -0,0 +1,73 @@ +// Copyright 2025 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ToolCallProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Represents a call of a specific tool's action with the specified inputs. +message ToolCall { + // The [tool][Tool] associated with this call. + // Format: `projects//locations//agents//tools/`. + string tool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + // The name of the tool's action associated with this call. + string action = 2 [(google.api.field_behavior) = REQUIRED]; + // The action's input parameters. + google.protobuf.Struct input_parameters = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The result of calling a tool's action that has been executed by the client. +message ToolCallResult { + // The [tool][Tool] associated with this call. + // Format: `projects//locations//agents//tools/`. + string tool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + // The name of the tool's action associated with this call. + string action = 2 [(google.api.field_behavior) = REQUIRED]; + // An error produced by the tool call. + message Error { + // The error message of the function. + string message = 1 [(google.api.field_behavior) = OPTIONAL]; + } + // The tool call's result. + oneof result { + // The tool call's error. + Error error = 3; + // The tool call's output parameters. + google.protobuf.Struct output_parameters = 4; + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/trace.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/trace.proto new file mode 100644 index 000000000000..076b25429ebe --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/trace.proto @@ -0,0 +1,611 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "TraceProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// The trace block tracks a sequence of actions taken by the agent in a flow or +// a playbook. +message TraceBlock { + // Metadata of the trace. + oneof trace_metadata { + // Metadata of the playbook trace. + PlaybookTraceMetadata playbook_trace_metadata = 1; + + // Metadata of the flow trace. + FlowTraceMetadata flow_trace_metadata = 2; + + // Metadata of the speech-to-text and speech-to-text processing. + SpeechProcessingMetadata speech_processing_metadata = 8; + } + + // The actions performed by the agent and the user during this session. + repeated Action actions = 3; + + // Output only. Timestamp of the start of the trace block. + google.protobuf.Timestamp start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the end of the trace block. + google.protobuf.Timestamp complete_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A list of input parameters of the trace block. + google.protobuf.Struct input_parameters = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of output parameters of the trace block. + google.protobuf.Struct output_parameters = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. The end state of the trace block. + OutputState end_state = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Metadata of the speech-to-text and text-to-speech processing. +message SpeechProcessingMetadata { + // Output only. The display name of the speech processing. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata of the playbook trace. +message PlaybookTraceMetadata { + // Required. The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The display name of the playbook. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata of the flow trace. +message FlowTraceMetadata { + // Required. The unique identifier of the flow. + // Format: + // `projects//locations//agents//flows/`. + string flow = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Output only. The display name of the flow. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Action performed by end user or Dialogflow agent in the conversation. +message Action { + // Stores metadata of the intent match action. + message IntentMatch { + // Stores the matched intent, which is the result of the intent match + // action. + message MatchedIntent { + // The ID of the matched intent. + string intent_id = 1; + + // The display name of the matched intent. + string display_name = 2; + + // The score of the matched intent. + float score = 3; + + // The generative fallback response of the matched intent. + google.protobuf.Struct generative_fallback = 4; + } + + // The matched intent. + repeated MatchedIntent matched_intents = 1; + } + + // Stores metadata of the state update action, such as a state machine + // execution in flows. + message FlowStateUpdate { + // Stores the state of a page and its flow. + message PageState { + // The ID of the page. + // Format: + // `projects//locations//agents//flows//pages/`. + string page = 1; + + // The display name of the page. + string display_name = 2; + + // The status of the page. + string status = 3; + } + + // Stores the metadata of a function call to execute. + message FunctionCall { + // The name of the function call. + string name = 1; + } + + // The type of the event that triggered the state update. + string event_type = 1; + + // The updated page and flow state. + PageState page_state = 2; + + // The updated parameters. + google.protobuf.Struct updated_parameters = 3; + + // The destination of the transition. + // Format: + // `projects//locations//agents//flows//pages/` + // or + // `projects//locations//agents//playbooks/`. + string destination = 4; + + // The function call to execute. + FunctionCall function_call = 5; + } + + // Stores metadata of the Text-to-Speech action. + message TTS {} + + // Stores metadata of the Speech-to-Text action. + message STT {} + + // Action details. + oneof action { + // Optional. Agent obtained a message from the customer. + UserUtterance user_utterance = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The agent received an event from the customer or a system event + // is emitted. + Event event = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed by the agent as a message. + AgentUtterance agent_utterance = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by calling a plugin + // tool. + ToolUse tool_use = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. LLM call performed by the agent. + LlmCall llm_call = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Output only. Intent Match in flows. + IntentMatch intent_match = 17 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Output only. The state machine update in flows. + FlowStateUpdate flow_state_update = 18 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Action performed on behalf of the agent by invoking a child + // playbook. + PlaybookInvocation playbook_invocation = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by invoking a CX flow. + FlowInvocation flow_invocation = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by transitioning to a + // target playbook. + PlaybookTransition playbook_transition = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action performed on behalf of the agent by transitioning to a + // target CX flow. + FlowTransition flow_transition = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Text-to-speech action performed by the agent. + TTS tts = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Speech-to-text action performed by the agent. + STT stt = 20 [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. The display name of the action. + string display_name = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the start of the agent action. + google.protobuf.Timestamp start_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the completion of the agent action. + google.protobuf.Timestamp complete_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The detailed tracing information for sub execution steps of the + // action. + repeated Span sub_execution_steps = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. The status of the action. + Status status = 16 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; +} + +// UserUtterance represents one message sent by the customer. +message UserUtterance { + // Required. Message content in text. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Tokens of the audio input. + repeated int32 audio_tokens = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audio input. + bytes audio = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Event represents the event sent by the customer. +message Event { + // Required. Name of the event. + string event = 1 [(google.api.field_behavior) = REQUIRED]; + + // Payload of the event. + oneof payload { + // Optional. Unstructured text payload of the event. + string text = 2 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// AgentUtterance represents one message sent by the agent. +message AgentUtterance { + // Required. Message content in text. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. True if the agent utterance needs to be generated by the LLM. + // Only used in webhook response to differentiate from empty text. Revisit + // whether we need this field or mark `text` as optional when we expose + // webhook interface to customer. + bool require_generation = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Stores metadata of the invocation of an action supported by a tool. +message ToolUse { + // The tracing information for the data store tool. + message DataStoreToolTrace { + // Optional. Data store connection feature output signals. + DataStoreConnectionSignals data_store_connection_signals = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The tracing information for the webhook tool. + message WebhookToolTrace { + // Optional. The tag of the webhook. + string webhook_tag = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The url of the webhook. + string webhook_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The [tool][google.cloud.dialogflow.cx.v3beta1.Tool] that should + // be used. Format: + // `projects//locations//agents//tools/`. + string tool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + + // Output only. The display name of the tool. + string display_name = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Name of the action to be called during the tool use. + string action = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of input parameters for the action. + google.protobuf.Struct input_action_parameters = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of output parameters generated by the action. + google.protobuf.Struct output_action_parameters = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // The tracing information for different tools. + oneof ToolTrace { + // Optional. Data store tool trace. + DataStoreToolTrace data_store_tool_trace = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Webhook tool trace. + WebhookToolTrace webhook_tool_trace = 9 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Stores metadata of the call of an LLM. +message LlmCall { + // Relevant example used for the LLM prompt. + message RetrievedExample { + // The id of the example. + string example_id = 1; + + // The display name of the example. + string example_display_name = 2; + + // Retrieval strategy of the example. + RetrievalStrategy retrieval_strategy = 3; + + // Optional. The matched retrieval label of this LLM call. + string matched_retrieval_label = 14 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Stores token counts of the LLM call. + message TokenCount { + // The total number of tokens used for the input to the LLM call. + int64 total_input_token_count = 1; + + // The number of tokens used for the conversation history in the prompt. + int64 conversation_context_token_count = 3; + + // The number of tokens used for the retrieved examples in the prompt. + int64 example_token_count = 4; + + // The total number of tokens used for the output of the LLM call. + int64 total_output_token_count = 5; + } + + // A list of relevant examples used for the LLM prompt. + repeated RetrievedExample retrieved_examples = 1; + + // The token counts of the LLM call. + TokenCount token_count = 2; + + // The model of the LLM call. + string model = 3; + + // The temperature of the LLM call. + float temperature = 4; +} + +// Stores metadata of the invocation of a child playbook. Playbook invocation +// actions enter the child playbook. +message PlaybookInvocation { + // Required. The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The display name of the playbook. + string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input of the child playbook invocation. + PlaybookInput playbook_input = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output of the child playbook invocation. + PlaybookOutput playbook_output = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Playbook invocation's output state. + OutputState playbook_state = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Stores metadata of the invocation of a child CX flow. Flow invocation actions +// enter the child flow. +message FlowInvocation { + // Required. The unique identifier of the flow. + // Format: + // `projects//locations//agents/`. + string flow = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Output only. The display name of the flow. + string display_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A list of input parameters for the flow. + google.protobuf.Struct input_action_parameters = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of output parameters generated by the flow invocation. + google.protobuf.Struct output_action_parameters = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Flow invocation's output state. + OutputState flow_state = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Stores metadata of the transition to another target playbook. Playbook +// transition actions exit the caller playbook and enter the target playbook. +message PlaybookTransition { + // Required. The unique identifier of the playbook. + // Format: + // `projects//locations//agents//playbooks/`. + string playbook = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Playbook" + } + ]; + + // Output only. The display name of the playbook. + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A list of input parameters for the action. + google.protobuf.Struct input_action_parameters = 2 [deprecated = true]; +} + +// Stores metadata of the transition to a target CX flow. Flow transition +// actions exit the caller playbook and enter the child flow. +message FlowTransition { + // Required. The unique identifier of the flow. + // Format: + // `projects//locations//agents/`. + string flow = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; + + // Output only. The display name of the flow. + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A list of input parameters for the action. + google.protobuf.Struct input_action_parameters = 2 [deprecated = true]; +} + +// Input of the playbook. +message PlaybookInput { + // Optional. Summary string of the preceding conversation for the child + // playbook invocation. + string preceding_conversation_summary = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of input parameters for the action. + google.protobuf.Struct action_parameters = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Output of the playbook. +message PlaybookOutput { + // Playbook output state. + enum State { + option deprecated = true; + + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Playbook succeeded. + OK = 1; + + // Playbook cancelled. + CANCELLED = 2; + + // Playbook failed. + FAILED = 3; + + // Playbook failed due to escalation. + ESCALATED = 4; + } + + // Optional. Summary string of the execution result of the child playbook. + string execution_summary = 1 [(google.api.field_behavior) = OPTIONAL]; + + // End state of the playbook. + State state = 2 [deprecated = true]; + + // Optional. A Struct object of output parameters for the action. + google.protobuf.Struct action_parameters = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A span represents a sub execution step of an action. +message Span { + // The name of the span. + string name = 1; + + // The metadata tags of the span such as span type. + repeated string tags = 2; + + // The unordered collection of metrics in this span. + repeated NamedMetric metrics = 3; + + // Timestamp of the start of the span. + google.protobuf.Timestamp start_time = 4; + + // Timestamp of the completion of the span. + google.protobuf.Timestamp complete_time = 5; +} + +// A named metric is a metric with name, value and unit. +message NamedMetric { + // The name of the metric. + string name = 1; + + // The value of the metric. + google.protobuf.Value value = 2; + + // The unit in which this metric is reported. Follows [The Unified Code for + // Units of Measure](https://unitsofmeasure.org/ucum.html) standard. + string unit = 3; +} + +// The status of the action. +message Status { + // Optional. The exception thrown during the execution of the action. + ExceptionDetail exception = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Exception thrown during the execution of an action. +message ExceptionDetail { + // Optional. The error message. + string error_message = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Output state. +enum OutputState { + // Unspecified output. + OUTPUT_STATE_UNSPECIFIED = 0; + + // Succeeded. + OUTPUT_STATE_OK = 1; + + // Cancelled. + OUTPUT_STATE_CANCELLED = 2; + + // Failed. + OUTPUT_STATE_FAILED = 3; + + // Escalated. + OUTPUT_STATE_ESCALATED = 4; + + // Pending. + OUTPUT_STATE_PENDING = 5; +} + +// Retrieval strategy on how the example is selected to be fed to the prompt. +enum RetrievalStrategy { + // Not specified. `DEFAULT` will be used. + RETRIEVAL_STRATEGY_UNSPECIFIED = 0; + + // Default retrieval strategy. + DEFAULT = 1; + + // Static example will always be inserted to the prompt. + STATIC = 2; + + // Example will never be inserted into the prompt. + NEVER = 3; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto new file mode 100644 index 000000000000..40a00d2c909a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto @@ -0,0 +1,318 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "TransitionRouteGroupProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing +// [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. +service TransitionRouteGroups { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all transition route groups in the specified flow. + rpc ListTransitionRouteGroups(ListTransitionRouteGroupsRequest) + returns (ListTransitionRouteGroupsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + additional_bindings { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + rpc GetTransitionRouteGroup(GetTransitionRouteGroupRequest) + returns (TransitionRouteGroup) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + additional_bindings { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates an + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + // in the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc CreateTransitionRouteGroup(CreateTransitionRouteGroupRequest) + returns (TransitionRouteGroup) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + body: "transition_route_group" + additional_bindings { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups" + body: "transition_route_group" + } + }; + option (google.api.method_signature) = "parent,transition_route_group"; + } + + // Updates the specified + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc UpdateTransitionRouteGroup(UpdateTransitionRouteGroupRequest) + returns (TransitionRouteGroup) { + option (google.api.http) = { + patch: "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + body: "transition_route_group" + additional_bindings { + patch: "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + body: "transition_route_group" + } + }; + option (google.api.method_signature) = "transition_route_group,update_mask"; + } + + // Deletes the specified + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + additional_bindings { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// A TransitionRouteGroup represents a group of +// [`TransitionRoutes`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to +// be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. +message TransitionRouteGroup { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}" + plural: "transitionRouteGroups" + singular: "transitionRouteGroup" + }; + + // The unique identifier of the transition route group. + // [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] + // populates the name automatically. Format: + // `projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/` + // for agent-level groups. + string name = 1; + + // Required. The human-readable name of the transition route group, unique + // within the flow. The display name can be no longer than 30 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Transition routes associated with the + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + repeated TransitionRoute transition_routes = 5; +} + +// The request message for +// [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsRequest { + // Required. The flow to list all transition route groups for. + // Format: + // `projects//locations//agents//flows/` + // or `projects//locations//agents/. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list transition route groups for. The following fields are + // language dependent: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for +// [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsResponse { + // The list of transition route groups. There will be a maximum number of + // items returned based on the page_size field in the request. The list may in + // some cases be empty or contain fewer entries than page_size even if this + // isn't the last page. + repeated TransitionRouteGroup transition_route_groups = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroup]. +message GetTransitionRouteGroupRequest { + // Required. The name of the + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + // Format: + // `projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The language to retrieve the transition route group for. The following + // fields are language dependent: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for +// [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup]. +message CreateTransitionRouteGroupRequest { + // Required. The flow to create an + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + // for. Format: + // `projects//locations//agents//flows/` + // or `projects//locations//agents/` + // for agent-level groups. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // Required. The transition route group to create. + TransitionRouteGroup transition_route_group = 2 + [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `TransitionRouteGroup`: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroup]. +message UpdateTransitionRouteGroupRequest { + // Required. The transition route group to update. + TransitionRouteGroup transition_route_group = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; + + // The language of the following fields in `TransitionRouteGroup`: + // + // * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + // * + // `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for +// [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroup]. +message DeleteTransitionRouteGroupRequest { + // Required. The name of the + // [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + // to delete. Format: + // `projects//locations//agents//flows//transitionRouteGroups/` + // or + // `projects//locations//agents//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // This field has no effect for transition route group that no page is using. + // If the transition route group is referenced by any page: + // + // * If `force` is set to false, an error will be returned with message + // indicating pages that reference the transition route group. + // * If `force` is set to true, Dialogflow will remove the transition route + // group, as well as any reference to it. + bool force = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto new file mode 100644 index 000000000000..e6de7dd37349 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto @@ -0,0 +1,115 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "ValidationMessageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Agent/flow validation message. +message ValidationMessage { + // Resource types. + enum ResourceType { + // Unspecified. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Agent. + AGENT = 1; + + // Intent. + INTENT = 2; + + // Intent training phrase. + INTENT_TRAINING_PHRASE = 8; + + // Intent parameter. + INTENT_PARAMETER = 9; + + // Multiple intents. + INTENTS = 10; + + // Multiple training phrases. + INTENT_TRAINING_PHRASES = 11; + + // Entity type. + ENTITY_TYPE = 3; + + // Multiple entity types. + ENTITY_TYPES = 12; + + // Webhook. + WEBHOOK = 4; + + // Flow. + FLOW = 5; + + // Page. + PAGE = 6; + + // Multiple pages. + PAGES = 13; + + // Transition route group. + TRANSITION_ROUTE_GROUP = 7; + + // Agent transition route group. + AGENT_TRANSITION_ROUTE_GROUP = 14; + } + + // Severity level. + enum Severity { + // Unspecified. + SEVERITY_UNSPECIFIED = 0; + + // The agent doesn't follow Dialogflow best practices. + INFO = 1; + + // The agent may not behave as expected. + WARNING = 2; + + // The agent may experience failures. + ERROR = 3; + } + + // The type of the resources where the message is found. + ResourceType resource_type = 1; + + // The names of the resources where the message is found. + repeated string resources = 2 [deprecated = true]; + + // The resource names of the resources where the message is found. + repeated ResourceName resource_names = 6; + + // Indicates the severity of the message. + Severity severity = 3; + + // The message detail. + string detail = 4; +} + +// Resource name and display name. +message ResourceName { + // Name. + string name = 1; + + // Display name. + string display_name = 2; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/version.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/version.proto new file mode 100644 index 000000000000..510ac6b1f4dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/version.proto @@ -0,0 +1,354 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "VersionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; + +// Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version]. +service Versions { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all versions in the specified + // [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified + // [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the + // specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: + // [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata] + // - `response`: [Version][google.cloud.dialogflow.cx.v3beta1.Version] + rpc CreateVersion(CreateVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + body: "version" + }; + option (google.api.method_signature) = "parent,version"; + option (google.longrunning.operation_info) = { + response_type: "Version" + metadata_type: "CreateVersionOperationMetadata" + }; + } + + // Updates the specified + // [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc UpdateVersion(UpdateVersionRequest) returns (Version) { + option (google.api.http) = { + patch: "/v3beta1/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}" + body: "version" + }; + option (google.api.method_signature) = "version,update_mask"; + } + + // Deletes the specified + // [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Loads resources in the specified version to the draft flow. + // + // This method is a [long-running + // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + // The returned `Operation` type has the following method-specific fields: + // + // - `metadata`: An empty [Struct + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + // - `response`: An [Empty + // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + rpc LoadVersion(LoadVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } + + // Compares the specified base version with target version. + rpc CompareVersions(CompareVersionsRequest) + returns (CompareVersionsResponse) { + option (google.api.http) = { + post: "/v3beta1/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions" + body: "*" + }; + option (google.api.method_signature) = "base_version"; + } +} + +// Metadata associated with the long running operation for +// [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. +message CreateVersionOperationMetadata { + // Name of the created version. + // Format: + // `projects//locations//agents//flows//versions/`. + string version = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; +} + +// Represents a version of a flow. +message Version { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Version" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}" + }; + + // The state of the version. + enum State { + // Not specified. This value is not used. + STATE_UNSPECIFIED = 0; + + // Version is not ready to serve (e.g. training is running). + RUNNING = 1; + + // Training has succeeded and this version is ready to serve. + SUCCEEDED = 2; + + // Version training failed. + FAILED = 3; + } + + // Format: + // projects//locations//agents//flows//versions/. + // Version ID is a self-increasing number generated by Dialogflow upon version + // creation. + string name = 1; + + // Required. The human-readable name of the version. Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the version. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // Output only. The NLU settings of the flow at version creation. + NluSettings nlu_settings = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time of the version. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this version. This field is read-only and cannot + // be set by create and update methods. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for +// [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. +message ListVersionsRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all + // versions for. Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. +message ListVersionsResponse { + // A list of versions. There will be a maximum number of items returned based + // on the page_size field in the request. The list may in some cases be empty + // or contain fewer entries than page_size even if this isn't the last page. + repeated Version versions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion]. +message GetVersionRequest { + // Required. The name of the + // [Version][google.cloud.dialogflow.cx.v3beta1.Version]. Format: + // `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for +// [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. +message CreateVersionRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an + // [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. Format: + // `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // Required. The version to create. + Version version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion]. +message UpdateVersionRequest { + // Required. The version to update. + Version version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. Currently only + // `description` and `display_name` can be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion]. +message DeleteVersionRequest { + // Required. The name of the + // [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete. Format: + // `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for +// [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion]. +message LoadVersionRequest { + // Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be + // loaded to draft flow. Format: + // `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // This field is used to prevent accidental overwrite of other agent + // resources, which can potentially impact other flow's behavior. If + // `allow_override_agent_resources` is false, conflicted agent-level resources + // will not be overridden (i.e. intents, entities, webhooks). + bool allow_override_agent_resources = 2; +} + +// The request message for +// [Versions.CompareVersions][google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersions]. +message CompareVersionsRequest { + // Required. Name of the base flow version to compare with the target version. + // Use version ID `0` to indicate the draft version of the specified flow. + // + // Format: + // `projects//locations//agents//flows//versions/`. + string base_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // Required. Name of the target flow version to compare with the + // base version. Use version ID `0` to indicate the draft version of the + // specified flow. Format: + // `projects//locations//agents//flows//versions/`. + string target_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // The language to compare the flow versions for. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) are + // supported. Note: languages must be enabled in the agent before they can be + // used. + string language_code = 3; +} + +// The response message for +// [Versions.CompareVersions][google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersions]. +message CompareVersionsResponse { + // JSON representation of the base version content. + string base_version_content_json = 1; + + // JSON representation of the target version content. + string target_version_content_json = 2; + + // The timestamp when the two version compares. + google.protobuf.Timestamp compare_time = 3; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto new file mode 100644 index 000000000000..c9d9e7c828e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto @@ -0,0 +1,785 @@ +// Copyright 2026 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; +option java_multiple_files = true; +option java_outer_classname = "WebhookProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; +option (google.api.resource_definition) = { + type: "servicedirectory.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" +}; + +// Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. +service Webhooks { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all webhooks in the specified agent. + rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified webhook. + rpc GetWebhook(GetWebhookRequest) returns (Webhook) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a webhook in the specified agent. + rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" + body: "webhook" + }; + option (google.api.method_signature) = "parent,webhook"; + } + + // Updates the specified webhook. + rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + patch: "/v3beta1/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}" + body: "webhook" + }; + option (google.api.method_signature) = "webhook,update_mask"; + } + + // Deletes the specified webhook. + rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Webhooks host the developer's business logic. During a session, webhooks +// allow the developer to use the data extracted by Dialogflow's natural +// language processing to generate dynamic responses, validate collected data, +// or trigger actions on the backend. +message Webhook { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Webhook" + pattern: "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}" + }; + + // Represents configuration for a generic web service. + message GenericWebService { + // Represents the value of an HTTP header stored in a SecretManager secret + // version. + message SecretVersionHeaderValue { + // Required. The SecretManager secret version resource storing the header + // value. Format: `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // Represents configuration of OAuth client credential flow for 3rd party + // API authentication. + message OAuthConfig { + // Required. The client ID provided by the 3rd party platform. + string client_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The client secret provided by the 3rd party platform. + string client_secret = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the SecretManager secret version resource storing + // the client secret. If this field is set, the `client_secret` field will + // be ignored. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_client_secret = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. The token endpoint provided by the 3rd party platform to + // exchange an access token. + string token_endpoint = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. + repeated string scopes = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Indicate the auth token type generated from the [Diglogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + enum ServiceAgentAuth { + // Service agent auth type unspecified. Default to ID_TOKEN. + SERVICE_AGENT_AUTH_UNSPECIFIED = 0; + + // No token used. + NONE = 1; + + // Use [ID + // token](https://cloud.google.com/docs/authentication/token-types#id) + // generated from service agent. This can be used to access Cloud Function + // and Cloud Run after you grant Invoker role to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ID_TOKEN = 2; + + // Use [access + // token](https://cloud.google.com/docs/authentication/token-types#access) + // generated from service agent. This can be used to access other Google + // Cloud APIs after you grant required roles to + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ACCESS_TOKEN = 3; + } + + // Configuration for authentication using a service account. + message ServiceAccountAuthConfig { + // Required. The email address of the service account used to authenticate + // the webhook call. Dialogflow uses this service account to exchange an + // access token and the access token is then sent in the `Authorization` + // header of the webhook request. + // + // The service account must have the + // `roles/iam.serviceAccountTokenCreator` role granted to the + // [Dialogflow service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + string service_account = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents the type of webhook configuration. + enum WebhookType { + // Default value. This value is unused. + WEBHOOK_TYPE_UNSPECIFIED = 0; + + // Represents a standard webhook. + STANDARD = 1; + + // Represents a flexible webhook. + FLEXIBLE = 2; + } + + // HTTP method to use when calling webhooks. + enum HttpMethod { + // HTTP method not specified. + HTTP_METHOD_UNSPECIFIED = 0; + + // HTTP POST Method. + POST = 1; + + // HTTP GET Method. + GET = 2; + + // HTTP HEAD Method. + HEAD = 3; + + // HTTP PUT Method. + PUT = 4; + + // HTTP DELETE Method. + DELETE = 5; + + // HTTP PATCH Method. + PATCH = 6; + + // HTTP OPTIONS Method. + OPTIONS = 7; + } + + // Required. The webhook URI for receiving POST requests. It must use https + // protocol. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // The user name for HTTP Basic authentication. + string username = 2 [deprecated = true]; + + // The password for HTTP Basic authentication. + string password = 3 [deprecated = true]; + + // Optional. The SecretManager secret version resource storing the + // username:password pair for HTTP Basic authentication. Format: + // `projects/{project}/secrets/{secret}/versions/{version}` + string secret_version_for_username_password = 19 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // The HTTP request headers to send together with webhook requests. + map request_headers = 4; + + // Optional. The HTTP request headers to send together with webhook + // requests. Header values are stored in SecretManager secret versions. + // + // When the same header name is specified in both `request_headers` and + // `secret_versions_for_request_headers`, the value in + // `secret_versions_for_request_headers` will be used. + map secret_versions_for_request_headers = + 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a list of allowed custom CA certificates (in DER + // format) for HTTPS verification. This overrides the default SSL trust + // store. If this is empty or unspecified, Dialogflow will use Google's + // default trust store to verify certificates. N.B. Make sure the HTTPS + // server certificates are signed with "subject alt name". For instance a + // certificate can be self-signed using the following command, + // ``` + // openssl x509 -req -days 200 -in example.com.csr \ + // -signkey example.com.key \ + // -out example.com.crt \ + // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + // ``` + repeated bytes allowed_ca_certs = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The OAuth configuration of the webhook. If specified, + // Dialogflow will initiate the OAuth client credential flow to exchange an + // access token from the 3rd party platform and put it in the auth header. + OAuthConfig oauth_config = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the auth token type generated from the [Diglogflow + // service + // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + // The generated token is sent in the Authorization header. + ServiceAgentAuth service_agent_auth = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for service account authentication. + ServiceAccountAuthConfig service_account_auth_config = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the webhook. + WebhookType webhook_type = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HTTP method for the flexible webhook calls. Standard webhook + // always uses POST. + HttpMethod http_method = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines a custom JSON object as request body to send to + // flexible webhook. + string request_body = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maps the values extracted from specific fields of the flexible + // webhook response into session parameters. + // - Key: session parameter name + // - Value: field path in the webhook response + map parameter_mapping = 9 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Represents configuration for a [Service + // Directory](https://cloud.google.com/service-directory) service. + message ServiceDirectoryConfig { + // Required. The name of [Service + // Directory](https://cloud.google.com/service-directory) service. + // Format: + // `projects//locations//namespaces//services/`. + // `Location ID` of the service directory must be the same as the location + // of the agent. + string service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; + + // Generic Service configuration of this webhook. + GenericWebService generic_web_service = 2; + } + + // The unique identifier of the webhook. + // Required for the + // [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] + // method. + // [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] + // populates the name automatically. Format: + // `projects//locations//agents//webhooks/`. + string name = 1; + + // Required. The human-readable name of the webhook, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The webhook configuration. + oneof webhook { + // Configuration for a generic web service. + GenericWebService generic_web_service = 4; + + // Configuration for a [Service + // Directory](https://cloud.google.com/service-directory) service. + ServiceDirectoryConfig service_directory = 7; + } + + // Webhook execution timeout. Execution is considered failed if Dialogflow + // doesn't receive a response from webhook at the end of the timeout period. + // Defaults to 5 seconds, maximum allowed timeout is 30 seconds. + google.protobuf.Duration timeout = 6; + + // Indicates whether the webhook is disabled. + bool disabled = 5; +} + +// The request message for +// [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. +message ListWebhooksRequest { + // Required. The agent to list all webhooks for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. +message ListWebhooksResponse { + // The list of webhooks. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Webhook webhooks = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for +// [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook]. +message GetWebhookRequest { + // Required. The name of the webhook. + // Format: + // `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; +} + +// The request message for +// [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook]. +message CreateWebhookRequest { + // Required. The agent to create a webhook for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // Required. The webhook to create. + Webhook webhook = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for +// [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook]. +message UpdateWebhookRequest { + // Required. The webhook to update. + Webhook webhook = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook]. +message DeleteWebhookRequest { + // Required. The name of the webhook to delete. + // Format: + // `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // This field has no effect for webhook not being used. + // For webhooks that are used by pages/flows/transition route groups: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the webhook, as well + // as any references to the webhook (i.e. + // [Webhook][google.cloud.dialogflow.cx.v3beta1.Fulfillment.webhook] and + // [tag][google.cloud.dialogflow.cx.v3beta1.Fulfillment.tag]in fulfillments + // that point to this webhook will be removed). + bool force = 2; +} + +// The request message for a webhook call. The request is sent as a JSON object +// and the field names will be presented in camel cases. +// +// You may see undocumented fields in an actual request. These fields are used +// internally by Dialogflow and should be ignored. +message WebhookRequest { + // Represents fulfillment information communicated to the webhook. + message FulfillmentInfo { + // Always present. + // The value of the + // [Fulfillment.tag][google.cloud.dialogflow.cx.v3beta1.Fulfillment.tag] + // field will be populated in this field by Dialogflow when the associated + // webhook is called. The tag is typically used by the webhook service to + // identify which fulfillment is being called, but it could be used for + // other purposes. + string tag = 1; + } + + // Represents intent information communicated to the webhook. + message IntentInfo { + // Represents a value for an intent parameter. + message IntentParameterValue { + // Always present. Original text value extracted from user utterance. + string original_value = 1; + + // Always present. Structured value for the parameter extracted from user + // utterance. + google.protobuf.Value resolved_value = 2; + } + + // Always present. The unique identifier of the last matched + // [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. + // Format: + // `projects//locations//agents//intents/`. + string last_matched_intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Always present. The display name of the last matched + // [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. + string display_name = 3; + + // Parameters identified as a result of intent matching. This is a map of + // the name of the identified parameter to the value of the parameter + // identified from the user's utterance. All parameters defined in the + // matched intent that are identified will be surfaced here. + map parameters = 2; + + // The confidence of the matched intent. Values range from 0.0 (completely + // uncertain) to 1.0 (completely certain). + float confidence = 4; + } + + // Represents the result of sentiment analysis. + message SentimentAnalysisResult { + // Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + // sentiment). + float score = 1; + + // A non-negative number in the [0, +inf) range, which represents the + // absolute magnitude of sentiment, regardless of score (positive or + // negative). + float magnitude = 2; + } + + // Always present. The unique identifier of the + // [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] + // that will be returned to the API caller. + string detect_intent_response_id = 1; + + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] + // was provided as input, this field will contain a copy of the text. + string text = 10; + + // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was + // provided as input, this field will contain a copy of the intent + // identifier. Format: + // `projects//locations//agents//intents/`. + string trigger_intent = 11 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // If [natural language speech + // audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as + // input, this field will contain the transcript for the audio. + string transcript = 12; + + // If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided + // as input, this field will contain the name of the event. + string trigger_event = 14; + + // If [DTMF][google.cloud.dialogflow.cx.v3beta1.DtmfInput] was provided as + // input, this field will contain the DTMF digits. + string dtmf_digits = 17; + } + + // The language code specified in the [original + // request][QueryInput.language_code]. + string language_code = 15; + + // Always present. Information about the fulfillment that triggered this + // webhook call. + FulfillmentInfo fulfillment_info = 6; + + // Information about the last matched intent. + IntentInfo intent_info = 3; + + // Information about page status. + PageInfo page_info = 4; + + // Information about session status. + SessionInfo session_info = 5; + + // The list of rich message responses to present to the user. Webhook can + // choose to append or replace this list in + // [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response]; + repeated ResponseMessage messages = 7; + + // Custom data set in + // [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload]. + google.protobuf.Struct payload = 8; + + // The sentiment analysis result of the current user request. The field is + // filled when sentiment analysis is configured to be enabled for the request. + SentimentAnalysisResult sentiment_analysis_result = 9; + + // Information about the language of the request. + LanguageInfo language_info = 18; +} + +// The response message for a webhook call. +message WebhookResponse { + // Represents a fulfillment response to the user. + message FulfillmentResponse { + // Defines merge behavior for `messages`. + enum MergeBehavior { + // Not specified. `APPEND` will be used. + MERGE_BEHAVIOR_UNSPECIFIED = 0; + + // `messages` will be appended to the list of messages waiting to be sent + // to the user. + APPEND = 1; + + // `messages` will replace the list of messages waiting to be sent to the + // user. + REPLACE = 2; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // Merge behavior for `messages`. + MergeBehavior merge_behavior = 2; + } + + // The fulfillment response to send to the user. This field can be omitted by + // the webhook if it does not intend to send any response to the user. + FulfillmentResponse fulfillment_response = 1; + + // Information about page status. This field can be omitted by the webhook if + // it does not intend to modify page status. + PageInfo page_info = 2; + + // Information about session status. This field can be omitted by the webhook + // if it does not intend to modify session status. + SessionInfo session_info = 3; + + // Value to append directly to + // [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads]. + google.protobuf.Struct payload = 4; + + // The target to transition to. This can be set optionally to indicate an + // immediate transition to a different page in the same host flow, or a + // different flow in the same agent. + oneof transition { + // The target page to transition to. + // Format: + // `projects//locations//agents//flows//pages/`. + string target_page = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: + // `projects//locations//agents//flows/`. + string target_flow = 6 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// Represents page information communicated to and from the webhook. +message PageInfo { + // Represents form information. + message FormInfo { + // Represents parameter information. + message ParameterInfo { + // Represents the state of a parameter. + enum ParameterState { + // Not specified. This value should be never used. + PARAMETER_STATE_UNSPECIFIED = 0; + + // Indicates that the parameter does not have a value. + EMPTY = 1; + + // Indicates that the parameter value is invalid. This field can be used + // by the webhook to invalidate the parameter and ask the server to + // collect it from the user again. + INVALID = 2; + + // Indicates that the parameter has a value. + FILLED = 3; + } + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. + // Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The human-readable name of the parameter, unique within the form. This + // field cannot be modified by the webhook. + string display_name = 1; + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Indicates whether the parameter is required. Optional parameters will + // not trigger prompts; however, they are filled if the user specifies + // them. Required parameters must be filled before form filling concludes. + bool required = 2; + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. + // Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The state of the parameter. This field can be set to + // [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] + // by the webhook to invalidate the parameter; other values set by the + // webhook will be ignored. + ParameterState state = 3; + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The value of the parameter. This field can be set by the webhook to + // change the parameter value. + google.protobuf.Value value = 4; + + // Optional for + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. + // Ignored for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Indicates if the parameter value was just collected on the last + // conversation turn. + bool just_collected = 5; + } + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The parameters contained in the form. Note that the webhook cannot add + // or remove any form parameter. + repeated ParameterInfo parameter_info = 2; + } + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. + // Ignored for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The + // unique identifier of the current page. Format: + // `projects//locations//agents//flows//pages/`. + string current_page = 1 [ + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } + ]; + + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. + // Ignored for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The + // display name of the current page. + string display_name = 4; + + // Optional for both + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Information about the form. + FormInfo form_info = 3; +} + +// Represents session information communicated to and from the webhook. +message SessionInfo { + // Always present for + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. + // Ignored for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The + // unique identifier of the + // [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. + // This field can be used by the webhook to identify a session. Format: + // `projects//locations//agents//sessions/` + // or + // `projects//locations//agents//environments//sessions/` + // if environment is specified. + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // Optional for + // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. + // Optional for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. All + // parameters collected from forms and intents during the session. Parameters + // can be created, updated, or removed by the webhook. To remove a parameter + // from the session, the webhook should explicitly set the parameter value to + // null in + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The + // map is keyed by parameters' display names. + map parameters = 2; +} + +// Represents the language information of the request. +message LanguageInfo { + // The language code specified in the original + // [request][google.cloud.dialogflow.cx.v3beta1.QueryInput.language_code]. + string input_language_code = 1; + + // The language code detected for this request based on the user + // conversation. + string resolved_language_code = 2; + + // The confidence score of the detected language between 0 and 1. + float confidence_score = 3; +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.d.ts b/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.d.ts new file mode 100644 index 000000000000..099cfba3548d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.d.ts @@ -0,0 +1,112193 @@ +// Copyright 2026 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace dialogflow. */ + namespace dialogflow { + + /** Namespace cx. */ + namespace cx { + + /** Namespace v3. */ + namespace v3 { + + /** Properties of an AdvancedSettings. */ + interface IAdvancedSettings { + + /** AdvancedSettings audioExportGcsDestination */ + audioExportGcsDestination?: (google.cloud.dialogflow.cx.v3.IGcsDestination|null); + + /** AdvancedSettings speechSettings */ + speechSettings?: (google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings|null); + + /** AdvancedSettings dtmfSettings */ + dtmfSettings?: (google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings|null); + + /** AdvancedSettings loggingSettings */ + loggingSettings?: (google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings|null); + } + + /** Represents an AdvancedSettings. */ + class AdvancedSettings implements IAdvancedSettings { + + /** + * Constructs a new AdvancedSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IAdvancedSettings); + + /** AdvancedSettings audioExportGcsDestination. */ + public audioExportGcsDestination?: (google.cloud.dialogflow.cx.v3.IGcsDestination|null); + + /** AdvancedSettings speechSettings. */ + public speechSettings?: (google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings|null); + + /** AdvancedSettings dtmfSettings. */ + public dtmfSettings?: (google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings|null); + + /** AdvancedSettings loggingSettings. */ + public loggingSettings?: (google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings|null); + + /** + * Creates a new AdvancedSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IAdvancedSettings): google.cloud.dialogflow.cx.v3.AdvancedSettings; + + /** + * Encodes the specified AdvancedSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.verify|verify} messages. + * @param message AdvancedSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IAdvancedSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.verify|verify} messages. + * @param message AdvancedSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IAdvancedSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedSettings + * @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.dialogflow.cx.v3.AdvancedSettings; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedSettings + * @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.dialogflow.cx.v3.AdvancedSettings; + + /** + * Verifies an AdvancedSettings 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 AdvancedSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AdvancedSettings; + + /** + * Creates a plain object from an AdvancedSettings message. Also converts values to other types if specified. + * @param message AdvancedSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AdvancedSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AdvancedSettings { + + /** Properties of a SpeechSettings. */ + interface ISpeechSettings { + + /** SpeechSettings endpointerSensitivity */ + endpointerSensitivity?: (number|null); + + /** SpeechSettings noSpeechTimeout */ + noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** SpeechSettings useTimeoutBasedEndpointing */ + useTimeoutBasedEndpointing?: (boolean|null); + + /** SpeechSettings models */ + models?: ({ [k: string]: string }|null); + } + + /** Represents a SpeechSettings. */ + class SpeechSettings implements ISpeechSettings { + + /** + * Constructs a new SpeechSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings); + + /** SpeechSettings endpointerSensitivity. */ + public endpointerSensitivity: number; + + /** SpeechSettings noSpeechTimeout. */ + public noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** SpeechSettings useTimeoutBasedEndpointing. */ + public useTimeoutBasedEndpointing: boolean; + + /** SpeechSettings models. */ + public models: { [k: string]: string }; + + /** + * Creates a new SpeechSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings): google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings; + + /** + * Encodes the specified SpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @param message SpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @param message SpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechSettings + * @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.dialogflow.cx.v3.AdvancedSettings.SpeechSettings; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechSettings + * @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.dialogflow.cx.v3.AdvancedSettings.SpeechSettings; + + /** + * Verifies a SpeechSettings 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 SpeechSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings; + + /** + * Creates a plain object from a SpeechSettings message. Also converts values to other types if specified. + * @param message SpeechSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DtmfSettings. */ + interface IDtmfSettings { + + /** DtmfSettings enabled */ + enabled?: (boolean|null); + + /** DtmfSettings maxDigits */ + maxDigits?: (number|null); + + /** DtmfSettings finishDigit */ + finishDigit?: (string|null); + + /** DtmfSettings interdigitTimeoutDuration */ + interdigitTimeoutDuration?: (google.protobuf.IDuration|null); + + /** DtmfSettings endpointingTimeoutDuration */ + endpointingTimeoutDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a DtmfSettings. */ + class DtmfSettings implements IDtmfSettings { + + /** + * Constructs a new DtmfSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings); + + /** DtmfSettings enabled. */ + public enabled: boolean; + + /** DtmfSettings maxDigits. */ + public maxDigits: number; + + /** DtmfSettings finishDigit. */ + public finishDigit: string; + + /** DtmfSettings interdigitTimeoutDuration. */ + public interdigitTimeoutDuration?: (google.protobuf.IDuration|null); + + /** DtmfSettings endpointingTimeoutDuration. */ + public endpointingTimeoutDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new DtmfSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DtmfSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings): google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings; + + /** + * Encodes the specified DtmfSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @param message DtmfSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DtmfSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @param message DtmfSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DtmfSettings + * @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.dialogflow.cx.v3.AdvancedSettings.DtmfSettings; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DtmfSettings + * @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.dialogflow.cx.v3.AdvancedSettings.DtmfSettings; + + /** + * Verifies a DtmfSettings 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 DtmfSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DtmfSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings; + + /** + * Creates a plain object from a DtmfSettings message. Also converts values to other types if specified. + * @param message DtmfSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DtmfSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DtmfSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoggingSettings. */ + interface ILoggingSettings { + + /** LoggingSettings enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); + + /** LoggingSettings enableInteractionLogging */ + enableInteractionLogging?: (boolean|null); + + /** LoggingSettings enableConsentBasedRedaction */ + enableConsentBasedRedaction?: (boolean|null); + } + + /** Represents a LoggingSettings. */ + class LoggingSettings implements ILoggingSettings { + + /** + * Constructs a new LoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings); + + /** LoggingSettings enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; + + /** LoggingSettings enableInteractionLogging. */ + public enableInteractionLogging: boolean; + + /** LoggingSettings enableConsentBasedRedaction. */ + public enableConsentBasedRedaction: boolean; + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings): google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingSettings + * @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.dialogflow.cx.v3.AdvancedSettings.LoggingSettings; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingSettings + * @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.dialogflow.cx.v3.AdvancedSettings.LoggingSettings; + + /** + * Verifies a LoggingSettings 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 LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @param message LoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGcsDestination): google.cloud.dialogflow.cx.v3.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.dialogflow.cx.v3.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.dialogflow.cx.v3.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Agents */ + class Agents extends $protobuf.rpc.Service { + + /** + * Constructs a new Agents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Agents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Agents; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAgentsResponse + */ + public listAgents(request: google.cloud.dialogflow.cx.v3.IListAgentsRequest, callback: google.cloud.dialogflow.cx.v3.Agents.ListAgentsCallback): void; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @returns Promise + */ + public listAgents(request: google.cloud.dialogflow.cx.v3.IListAgentsRequest): Promise; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public getAgent(request: google.cloud.dialogflow.cx.v3.IGetAgentRequest, callback: google.cloud.dialogflow.cx.v3.Agents.GetAgentCallback): void; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @returns Promise + */ + public getAgent(request: google.cloud.dialogflow.cx.v3.IGetAgentRequest): Promise; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public createAgent(request: google.cloud.dialogflow.cx.v3.ICreateAgentRequest, callback: google.cloud.dialogflow.cx.v3.Agents.CreateAgentCallback): void; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @returns Promise + */ + public createAgent(request: google.cloud.dialogflow.cx.v3.ICreateAgentRequest): Promise; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public updateAgent(request: google.cloud.dialogflow.cx.v3.IUpdateAgentRequest, callback: google.cloud.dialogflow.cx.v3.Agents.UpdateAgentCallback): void; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @returns Promise + */ + public updateAgent(request: google.cloud.dialogflow.cx.v3.IUpdateAgentRequest): Promise; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgent(request: google.cloud.dialogflow.cx.v3.IDeleteAgentRequest, callback: google.cloud.dialogflow.cx.v3.Agents.DeleteAgentCallback): void; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @returns Promise + */ + public deleteAgent(request: google.cloud.dialogflow.cx.v3.IDeleteAgentRequest): Promise; + + /** + * Calls ExportAgent. + * @param request ExportAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAgent(request: google.cloud.dialogflow.cx.v3.IExportAgentRequest, callback: google.cloud.dialogflow.cx.v3.Agents.ExportAgentCallback): void; + + /** + * Calls ExportAgent. + * @param request ExportAgentRequest message or plain object + * @returns Promise + */ + public exportAgent(request: google.cloud.dialogflow.cx.v3.IExportAgentRequest): Promise; + + /** + * Calls RestoreAgent. + * @param request RestoreAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreAgent(request: google.cloud.dialogflow.cx.v3.IRestoreAgentRequest, callback: google.cloud.dialogflow.cx.v3.Agents.RestoreAgentCallback): void; + + /** + * Calls RestoreAgent. + * @param request RestoreAgentRequest message or plain object + * @returns Promise + */ + public restoreAgent(request: google.cloud.dialogflow.cx.v3.IRestoreAgentRequest): Promise; + + /** + * Calls ValidateAgent. + * @param request ValidateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentValidationResult + */ + public validateAgent(request: google.cloud.dialogflow.cx.v3.IValidateAgentRequest, callback: google.cloud.dialogflow.cx.v3.Agents.ValidateAgentCallback): void; + + /** + * Calls ValidateAgent. + * @param request ValidateAgentRequest message or plain object + * @returns Promise + */ + public validateAgent(request: google.cloud.dialogflow.cx.v3.IValidateAgentRequest): Promise; + + /** + * Calls GetAgentValidationResult. + * @param request GetAgentValidationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentValidationResult + */ + public getAgentValidationResult(request: google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest, callback: google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResultCallback): void; + + /** + * Calls GetAgentValidationResult. + * @param request GetAgentValidationResultRequest message or plain object + * @returns Promise + */ + public getAgentValidationResult(request: google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest): Promise; + + /** + * Calls GetGenerativeSettings. + * @param request GetGenerativeSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerativeSettings + */ + public getGenerativeSettings(request: google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest, callback: google.cloud.dialogflow.cx.v3.Agents.GetGenerativeSettingsCallback): void; + + /** + * Calls GetGenerativeSettings. + * @param request GetGenerativeSettingsRequest message or plain object + * @returns Promise + */ + public getGenerativeSettings(request: google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest): Promise; + + /** + * Calls UpdateGenerativeSettings. + * @param request UpdateGenerativeSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerativeSettings + */ + public updateGenerativeSettings(request: google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest, callback: google.cloud.dialogflow.cx.v3.Agents.UpdateGenerativeSettingsCallback): void; + + /** + * Calls UpdateGenerativeSettings. + * @param request UpdateGenerativeSettingsRequest message or plain object + * @returns Promise + */ + public updateGenerativeSettings(request: google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest): Promise; + } + + namespace Agents { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|listAgents}. + * @param error Error, if any + * @param [response] ListAgentsResponse + */ + type ListAgentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListAgentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|getAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type GetAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|createAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type CreateAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|updateAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type UpdateAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|deleteAgent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|exportAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|restoreAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|validateAgent}. + * @param error Error, if any + * @param [response] AgentValidationResult + */ + type ValidateAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.AgentValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|getAgentValidationResult}. + * @param error Error, if any + * @param [response] AgentValidationResult + */ + type GetAgentValidationResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.AgentValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|getGenerativeSettings}. + * @param error Error, if any + * @param [response] GenerativeSettings + */ + type GetGenerativeSettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.GenerativeSettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|updateGenerativeSettings}. + * @param error Error, if any + * @param [response] GenerativeSettings + */ + type UpdateGenerativeSettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.GenerativeSettings) => void; + } + + /** Properties of a SpeechToTextSettings. */ + interface ISpeechToTextSettings { + + /** SpeechToTextSettings enableSpeechAdaptation */ + enableSpeechAdaptation?: (boolean|null); + } + + /** Represents a SpeechToTextSettings. */ + class SpeechToTextSettings implements ISpeechToTextSettings { + + /** + * Constructs a new SpeechToTextSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISpeechToTextSettings); + + /** SpeechToTextSettings enableSpeechAdaptation. */ + public enableSpeechAdaptation: boolean; + + /** + * Creates a new SpeechToTextSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechToTextSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISpeechToTextSettings): google.cloud.dialogflow.cx.v3.SpeechToTextSettings; + + /** + * Encodes the specified SpeechToTextSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechToTextSettings.verify|verify} messages. + * @param message SpeechToTextSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISpeechToTextSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechToTextSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechToTextSettings.verify|verify} messages. + * @param message SpeechToTextSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISpeechToTextSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechToTextSettings + * @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.dialogflow.cx.v3.SpeechToTextSettings; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechToTextSettings + * @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.dialogflow.cx.v3.SpeechToTextSettings; + + /** + * Verifies a SpeechToTextSettings 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 SpeechToTextSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechToTextSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SpeechToTextSettings; + + /** + * Creates a plain object from a SpeechToTextSettings message. Also converts values to other types if specified. + * @param message SpeechToTextSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SpeechToTextSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechToTextSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechToTextSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Agent. */ + interface IAgent { + + /** Agent name */ + name?: (string|null); + + /** Agent displayName */ + displayName?: (string|null); + + /** Agent defaultLanguageCode */ + defaultLanguageCode?: (string|null); + + /** Agent supportedLanguageCodes */ + supportedLanguageCodes?: (string[]|null); + + /** Agent timeZone */ + timeZone?: (string|null); + + /** Agent description */ + description?: (string|null); + + /** Agent avatarUri */ + avatarUri?: (string|null); + + /** Agent speechToTextSettings */ + speechToTextSettings?: (google.cloud.dialogflow.cx.v3.ISpeechToTextSettings|null); + + /** Agent startFlow */ + startFlow?: (string|null); + + /** Agent startPlaybook */ + startPlaybook?: (string|null); + + /** Agent securitySettings */ + securitySettings?: (string|null); + + /** Agent enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); + + /** Agent enableSpellCorrection */ + enableSpellCorrection?: (boolean|null); + + /** Agent enableMultiLanguageTraining */ + enableMultiLanguageTraining?: (boolean|null); + + /** Agent locked */ + locked?: (boolean|null); + + /** Agent advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Agent gitIntegrationSettings */ + gitIntegrationSettings?: (google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings|null); + + /** Agent textToSpeechSettings */ + textToSpeechSettings?: (google.cloud.dialogflow.cx.v3.ITextToSpeechSettings|null); + + /** Agent genAppBuilderSettings */ + genAppBuilderSettings?: (google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings|null); + + /** Agent answerFeedbackSettings */ + answerFeedbackSettings?: (google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings|null); + + /** Agent personalizationSettings */ + personalizationSettings?: (google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings|null); + + /** Agent clientCertificateSettings */ + clientCertificateSettings?: (google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings|null); + + /** Agent satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Agent satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents an Agent. */ + class Agent implements IAgent { + + /** + * Constructs a new Agent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IAgent); + + /** Agent name. */ + public name: string; + + /** Agent displayName. */ + public displayName: string; + + /** Agent defaultLanguageCode. */ + public defaultLanguageCode: string; + + /** Agent supportedLanguageCodes. */ + public supportedLanguageCodes: string[]; + + /** Agent timeZone. */ + public timeZone: string; + + /** Agent description. */ + public description: string; + + /** Agent avatarUri. */ + public avatarUri: string; + + /** Agent speechToTextSettings. */ + public speechToTextSettings?: (google.cloud.dialogflow.cx.v3.ISpeechToTextSettings|null); + + /** Agent startFlow. */ + public startFlow?: (string|null); + + /** Agent startPlaybook. */ + public startPlaybook?: (string|null); + + /** Agent securitySettings. */ + public securitySettings: string; + + /** Agent enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; + + /** Agent enableSpellCorrection. */ + public enableSpellCorrection: boolean; + + /** Agent enableMultiLanguageTraining. */ + public enableMultiLanguageTraining: boolean; + + /** Agent locked. */ + public locked: boolean; + + /** Agent advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Agent gitIntegrationSettings. */ + public gitIntegrationSettings?: (google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings|null); + + /** Agent textToSpeechSettings. */ + public textToSpeechSettings?: (google.cloud.dialogflow.cx.v3.ITextToSpeechSettings|null); + + /** Agent genAppBuilderSettings. */ + public genAppBuilderSettings?: (google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings|null); + + /** Agent answerFeedbackSettings. */ + public answerFeedbackSettings?: (google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings|null); + + /** Agent personalizationSettings. */ + public personalizationSettings?: (google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings|null); + + /** Agent clientCertificateSettings. */ + public clientCertificateSettings?: (google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings|null); + + /** Agent satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Agent satisfiesPzi. */ + public satisfiesPzi?: (boolean|null); + + /** Agent sessionEntryResource. */ + public sessionEntryResource?: ("startFlow"|"startPlaybook"); + + /** + * Creates a new Agent instance using the specified properties. + * @param [properties] Properties to set + * @returns Agent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IAgent): google.cloud.dialogflow.cx.v3.Agent; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Agent + * @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.dialogflow.cx.v3.Agent; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Agent + * @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.dialogflow.cx.v3.Agent; + + /** + * Verifies an Agent 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 Agent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Agent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Agent; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @param message Agent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Agent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Agent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Agent { + + /** Properties of a GitIntegrationSettings. */ + interface IGitIntegrationSettings { + + /** GitIntegrationSettings githubSettings */ + githubSettings?: (google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings|null); + } + + /** Represents a GitIntegrationSettings. */ + class GitIntegrationSettings implements IGitIntegrationSettings { + + /** + * Constructs a new GitIntegrationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings); + + /** GitIntegrationSettings githubSettings. */ + public githubSettings?: (google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings|null); + + /** GitIntegrationSettings gitSettings. */ + public gitSettings?: "githubSettings"; + + /** + * Creates a new GitIntegrationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GitIntegrationSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings): google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings; + + /** + * Encodes the specified GitIntegrationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.verify|verify} messages. + * @param message GitIntegrationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitIntegrationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.verify|verify} messages. + * @param message GitIntegrationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitIntegrationSettings + * @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.dialogflow.cx.v3.Agent.GitIntegrationSettings; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitIntegrationSettings + * @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.dialogflow.cx.v3.Agent.GitIntegrationSettings; + + /** + * Verifies a GitIntegrationSettings 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 GitIntegrationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitIntegrationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings; + + /** + * Creates a plain object from a GitIntegrationSettings message. Also converts values to other types if specified. + * @param message GitIntegrationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitIntegrationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitIntegrationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GitIntegrationSettings { + + /** Properties of a GithubSettings. */ + interface IGithubSettings { + + /** GithubSettings displayName */ + displayName?: (string|null); + + /** GithubSettings repositoryUri */ + repositoryUri?: (string|null); + + /** GithubSettings trackingBranch */ + trackingBranch?: (string|null); + + /** GithubSettings accessToken */ + accessToken?: (string|null); + + /** GithubSettings branches */ + branches?: (string[]|null); + } + + /** Represents a GithubSettings. */ + class GithubSettings implements IGithubSettings { + + /** + * Constructs a new GithubSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings); + + /** GithubSettings displayName. */ + public displayName: string; + + /** GithubSettings repositoryUri. */ + public repositoryUri: string; + + /** GithubSettings trackingBranch. */ + public trackingBranch: string; + + /** GithubSettings accessToken. */ + public accessToken: string; + + /** GithubSettings branches. */ + public branches: string[]; + + /** + * Creates a new GithubSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GithubSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings): google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Encodes the specified GithubSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @param message GithubSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GithubSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @param message GithubSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GithubSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GithubSettings + * @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.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Decodes a GithubSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GithubSettings + * @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.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Verifies a GithubSettings 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 GithubSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GithubSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Creates a plain object from a GithubSettings message. Also converts values to other types if specified. + * @param message GithubSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GithubSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GithubSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GenAppBuilderSettings. */ + interface IGenAppBuilderSettings { + + /** GenAppBuilderSettings engine */ + engine?: (string|null); + } + + /** Represents a GenAppBuilderSettings. */ + class GenAppBuilderSettings implements IGenAppBuilderSettings { + + /** + * Constructs a new GenAppBuilderSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings); + + /** GenAppBuilderSettings engine. */ + public engine: string; + + /** + * Creates a new GenAppBuilderSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAppBuilderSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings): google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings; + + /** + * Encodes the specified GenAppBuilderSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.verify|verify} messages. + * @param message GenAppBuilderSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAppBuilderSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.verify|verify} messages. + * @param message GenAppBuilderSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAppBuilderSettings + * @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.dialogflow.cx.v3.Agent.GenAppBuilderSettings; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAppBuilderSettings + * @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.dialogflow.cx.v3.Agent.GenAppBuilderSettings; + + /** + * Verifies a GenAppBuilderSettings 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 GenAppBuilderSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAppBuilderSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings; + + /** + * Creates a plain object from a GenAppBuilderSettings message. Also converts values to other types if specified. + * @param message GenAppBuilderSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAppBuilderSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAppBuilderSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnswerFeedbackSettings. */ + interface IAnswerFeedbackSettings { + + /** AnswerFeedbackSettings enableAnswerFeedback */ + enableAnswerFeedback?: (boolean|null); + } + + /** Represents an AnswerFeedbackSettings. */ + class AnswerFeedbackSettings implements IAnswerFeedbackSettings { + + /** + * Constructs a new AnswerFeedbackSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings); + + /** AnswerFeedbackSettings enableAnswerFeedback. */ + public enableAnswerFeedback: boolean; + + /** + * Creates a new AnswerFeedbackSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerFeedbackSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings): google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings; + + /** + * Encodes the specified AnswerFeedbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @param message AnswerFeedbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerFeedbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @param message AnswerFeedbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerFeedbackSettings + * @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.dialogflow.cx.v3.Agent.AnswerFeedbackSettings; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerFeedbackSettings + * @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.dialogflow.cx.v3.Agent.AnswerFeedbackSettings; + + /** + * Verifies an AnswerFeedbackSettings 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 AnswerFeedbackSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerFeedbackSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings; + + /** + * Creates a plain object from an AnswerFeedbackSettings message. Also converts values to other types if specified. + * @param message AnswerFeedbackSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerFeedbackSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerFeedbackSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonalizationSettings. */ + interface IPersonalizationSettings { + + /** PersonalizationSettings defaultEndUserMetadata */ + defaultEndUserMetadata?: (google.protobuf.IStruct|null); + } + + /** Represents a PersonalizationSettings. */ + class PersonalizationSettings implements IPersonalizationSettings { + + /** + * Constructs a new PersonalizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings); + + /** PersonalizationSettings defaultEndUserMetadata. */ + public defaultEndUserMetadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new PersonalizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonalizationSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings): google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings; + + /** + * Encodes the specified PersonalizationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.verify|verify} messages. + * @param message PersonalizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonalizationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.verify|verify} messages. + * @param message PersonalizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonalizationSettings + * @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.dialogflow.cx.v3.Agent.PersonalizationSettings; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonalizationSettings + * @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.dialogflow.cx.v3.Agent.PersonalizationSettings; + + /** + * Verifies a PersonalizationSettings 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 PersonalizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonalizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings; + + /** + * Creates a plain object from a PersonalizationSettings message. Also converts values to other types if specified. + * @param message PersonalizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonalizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonalizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientCertificateSettings. */ + interface IClientCertificateSettings { + + /** ClientCertificateSettings sslCertificate */ + sslCertificate?: (string|null); + + /** ClientCertificateSettings privateKey */ + privateKey?: (string|null); + + /** ClientCertificateSettings passphrase */ + passphrase?: (string|null); + } + + /** Represents a ClientCertificateSettings. */ + class ClientCertificateSettings implements IClientCertificateSettings { + + /** + * Constructs a new ClientCertificateSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings); + + /** ClientCertificateSettings sslCertificate. */ + public sslCertificate: string; + + /** ClientCertificateSettings privateKey. */ + public privateKey: string; + + /** ClientCertificateSettings passphrase. */ + public passphrase: string; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientCertificateSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings): google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientCertificateSettings + * @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.dialogflow.cx.v3.Agent.ClientCertificateSettings; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientCertificateSettings + * @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.dialogflow.cx.v3.Agent.ClientCertificateSettings; + + /** + * Verifies a ClientCertificateSettings 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 ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientCertificateSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @param message ClientCertificateSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientCertificateSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListAgentsRequest. */ + interface IListAgentsRequest { + + /** ListAgentsRequest parent */ + parent?: (string|null); + + /** ListAgentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAgentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAgentsRequest. */ + class ListAgentsRequest implements IListAgentsRequest { + + /** + * Constructs a new ListAgentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListAgentsRequest); + + /** ListAgentsRequest parent. */ + public parent: string; + + /** ListAgentsRequest pageSize. */ + public pageSize: number; + + /** ListAgentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListAgentsRequest): google.cloud.dialogflow.cx.v3.ListAgentsRequest; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsRequest + * @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.dialogflow.cx.v3.ListAgentsRequest; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsRequest + * @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.dialogflow.cx.v3.ListAgentsRequest; + + /** + * Verifies a ListAgentsRequest 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 ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListAgentsRequest; + + /** + * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. + * @param message ListAgentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsResponse. */ + interface IListAgentsResponse { + + /** ListAgentsResponse agents */ + agents?: (google.cloud.dialogflow.cx.v3.IAgent[]|null); + + /** ListAgentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAgentsResponse. */ + class ListAgentsResponse implements IListAgentsResponse { + + /** + * Constructs a new ListAgentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListAgentsResponse); + + /** ListAgentsResponse agents. */ + public agents: google.cloud.dialogflow.cx.v3.IAgent[]; + + /** ListAgentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListAgentsResponse): google.cloud.dialogflow.cx.v3.ListAgentsResponse; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsResponse + * @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.dialogflow.cx.v3.ListAgentsResponse; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsResponse + * @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.dialogflow.cx.v3.ListAgentsResponse; + + /** + * Verifies a ListAgentsResponse 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 ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListAgentsResponse; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @param message ListAgentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentRequest. */ + interface IGetAgentRequest { + + /** GetAgentRequest name */ + name?: (string|null); + } + + /** Represents a GetAgentRequest. */ + class GetAgentRequest implements IGetAgentRequest { + + /** + * Constructs a new GetAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetAgentRequest); + + /** GetAgentRequest name. */ + public name: string; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetAgentRequest): google.cloud.dialogflow.cx.v3.GetAgentRequest; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentRequest + * @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.dialogflow.cx.v3.GetAgentRequest; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentRequest + * @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.dialogflow.cx.v3.GetAgentRequest; + + /** + * Verifies a GetAgentRequest 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 GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetAgentRequest; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @param message GetAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAgentRequest. */ + interface ICreateAgentRequest { + + /** CreateAgentRequest parent */ + parent?: (string|null); + + /** CreateAgentRequest agent */ + agent?: (google.cloud.dialogflow.cx.v3.IAgent|null); + } + + /** Represents a CreateAgentRequest. */ + class CreateAgentRequest implements ICreateAgentRequest { + + /** + * Constructs a new CreateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateAgentRequest); + + /** CreateAgentRequest parent. */ + public parent: string; + + /** CreateAgentRequest agent. */ + public agent?: (google.cloud.dialogflow.cx.v3.IAgent|null); + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateAgentRequest): google.cloud.dialogflow.cx.v3.CreateAgentRequest; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAgentRequest + * @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.dialogflow.cx.v3.CreateAgentRequest; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAgentRequest + * @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.dialogflow.cx.v3.CreateAgentRequest; + + /** + * Verifies a CreateAgentRequest 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 CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateAgentRequest; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @param message CreateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAgentRequest. */ + interface IUpdateAgentRequest { + + /** UpdateAgentRequest agent */ + agent?: (google.cloud.dialogflow.cx.v3.IAgent|null); + + /** UpdateAgentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAgentRequest. */ + class UpdateAgentRequest implements IUpdateAgentRequest { + + /** + * Constructs a new UpdateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateAgentRequest); + + /** UpdateAgentRequest agent. */ + public agent?: (google.cloud.dialogflow.cx.v3.IAgent|null); + + /** UpdateAgentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateAgentRequest): google.cloud.dialogflow.cx.v3.UpdateAgentRequest; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAgentRequest + * @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.dialogflow.cx.v3.UpdateAgentRequest; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAgentRequest + * @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.dialogflow.cx.v3.UpdateAgentRequest; + + /** + * Verifies an UpdateAgentRequest 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 UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateAgentRequest; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @param message UpdateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAgentRequest. */ + interface IDeleteAgentRequest { + + /** DeleteAgentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAgentRequest. */ + class DeleteAgentRequest implements IDeleteAgentRequest { + + /** + * Constructs a new DeleteAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteAgentRequest); + + /** DeleteAgentRequest name. */ + public name: string; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteAgentRequest): google.cloud.dialogflow.cx.v3.DeleteAgentRequest; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAgentRequest + * @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.dialogflow.cx.v3.DeleteAgentRequest; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAgentRequest + * @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.dialogflow.cx.v3.DeleteAgentRequest; + + /** + * Verifies a DeleteAgentRequest 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 DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteAgentRequest; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @param message DeleteAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAgentRequest. */ + interface IExportAgentRequest { + + /** ExportAgentRequest name */ + name?: (string|null); + + /** ExportAgentRequest agentUri */ + agentUri?: (string|null); + + /** ExportAgentRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat|null); + + /** ExportAgentRequest environment */ + environment?: (string|null); + + /** ExportAgentRequest gitDestination */ + gitDestination?: (google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination|null); + + /** ExportAgentRequest includeBigqueryExportSettings */ + includeBigqueryExportSettings?: (boolean|null); + } + + /** Represents an ExportAgentRequest. */ + class ExportAgentRequest implements IExportAgentRequest { + + /** + * Constructs a new ExportAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportAgentRequest); + + /** ExportAgentRequest name. */ + public name: string; + + /** ExportAgentRequest agentUri. */ + public agentUri: string; + + /** ExportAgentRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat); + + /** ExportAgentRequest environment. */ + public environment: string; + + /** ExportAgentRequest gitDestination. */ + public gitDestination?: (google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination|null); + + /** ExportAgentRequest includeBigqueryExportSettings. */ + public includeBigqueryExportSettings: boolean; + + /** + * Creates a new ExportAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportAgentRequest): google.cloud.dialogflow.cx.v3.ExportAgentRequest; + + /** + * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.verify|verify} messages. + * @param message ExportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.verify|verify} messages. + * @param message ExportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAgentRequest + * @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.dialogflow.cx.v3.ExportAgentRequest; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAgentRequest + * @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.dialogflow.cx.v3.ExportAgentRequest; + + /** + * Verifies an ExportAgentRequest 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 ExportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportAgentRequest; + + /** + * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. + * @param message ExportAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportAgentRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON_PACKAGE = 4 + } + + /** Properties of a GitDestination. */ + interface IGitDestination { + + /** GitDestination trackingBranch */ + trackingBranch?: (string|null); + + /** GitDestination commitMessage */ + commitMessage?: (string|null); + } + + /** Represents a GitDestination. */ + class GitDestination implements IGitDestination { + + /** + * Constructs a new GitDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination); + + /** GitDestination trackingBranch. */ + public trackingBranch: string; + + /** GitDestination commitMessage. */ + public commitMessage: string; + + /** + * Creates a new GitDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GitDestination instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination): google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination; + + /** + * Encodes the specified GitDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.verify|verify} messages. + * @param message GitDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.verify|verify} messages. + * @param message GitDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitDestination + * @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.dialogflow.cx.v3.ExportAgentRequest.GitDestination; + + /** + * Decodes a GitDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitDestination + * @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.dialogflow.cx.v3.ExportAgentRequest.GitDestination; + + /** + * Verifies a GitDestination 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 GitDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination; + + /** + * Creates a plain object from a GitDestination message. Also converts values to other types if specified. + * @param message GitDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportAgentResponse. */ + interface IExportAgentResponse { + + /** ExportAgentResponse agentUri */ + agentUri?: (string|null); + + /** ExportAgentResponse agentContent */ + agentContent?: (Uint8Array|Buffer|string|null); + + /** ExportAgentResponse commitSha */ + commitSha?: (string|null); + } + + /** Represents an ExportAgentResponse. */ + class ExportAgentResponse implements IExportAgentResponse { + + /** + * Constructs a new ExportAgentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportAgentResponse); + + /** ExportAgentResponse agentUri. */ + public agentUri?: (string|null); + + /** ExportAgentResponse agentContent. */ + public agentContent?: (Uint8Array|Buffer|string|null); + + /** ExportAgentResponse commitSha. */ + public commitSha?: (string|null); + + /** ExportAgentResponse agent. */ + public agent?: ("agentUri"|"agentContent"|"commitSha"); + + /** + * Creates a new ExportAgentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAgentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportAgentResponse): google.cloud.dialogflow.cx.v3.ExportAgentResponse; + + /** + * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentResponse.verify|verify} messages. + * @param message ExportAgentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentResponse.verify|verify} messages. + * @param message ExportAgentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAgentResponse + * @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.dialogflow.cx.v3.ExportAgentResponse; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAgentResponse + * @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.dialogflow.cx.v3.ExportAgentResponse; + + /** + * Verifies an ExportAgentResponse 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 ExportAgentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAgentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportAgentResponse; + + /** + * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. + * @param message ExportAgentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportAgentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAgentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAgentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAgentRequest. */ + interface IRestoreAgentRequest { + + /** RestoreAgentRequest name */ + name?: (string|null); + + /** RestoreAgentRequest agentUri */ + agentUri?: (string|null); + + /** RestoreAgentRequest agentContent */ + agentContent?: (Uint8Array|Buffer|string|null); + + /** RestoreAgentRequest gitSource */ + gitSource?: (google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource|null); + + /** RestoreAgentRequest restoreOption */ + restoreOption?: (google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption|keyof typeof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption|null); + } + + /** Represents a RestoreAgentRequest. */ + class RestoreAgentRequest implements IRestoreAgentRequest { + + /** + * Constructs a new RestoreAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRestoreAgentRequest); + + /** RestoreAgentRequest name. */ + public name: string; + + /** RestoreAgentRequest agentUri. */ + public agentUri?: (string|null); + + /** RestoreAgentRequest agentContent. */ + public agentContent?: (Uint8Array|Buffer|string|null); + + /** RestoreAgentRequest gitSource. */ + public gitSource?: (google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource|null); + + /** RestoreAgentRequest restoreOption. */ + public restoreOption: (google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption|keyof typeof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption); + + /** RestoreAgentRequest agent. */ + public agent?: ("agentUri"|"agentContent"|"gitSource"); + + /** + * Creates a new RestoreAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRestoreAgentRequest): google.cloud.dialogflow.cx.v3.RestoreAgentRequest; + + /** + * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.verify|verify} messages. + * @param message RestoreAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.verify|verify} messages. + * @param message RestoreAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAgentRequest + * @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.dialogflow.cx.v3.RestoreAgentRequest; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAgentRequest + * @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.dialogflow.cx.v3.RestoreAgentRequest; + + /** + * Verifies a RestoreAgentRequest 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 RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RestoreAgentRequest; + + /** + * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. + * @param message RestoreAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RestoreAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RestoreAgentRequest { + + /** Properties of a GitSource. */ + interface IGitSource { + + /** GitSource trackingBranch */ + trackingBranch?: (string|null); + } + + /** Represents a GitSource. */ + class GitSource implements IGitSource { + + /** + * Constructs a new GitSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource); + + /** GitSource trackingBranch. */ + public trackingBranch: string; + + /** + * Creates a new GitSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GitSource instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource): google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource; + + /** + * Encodes the specified GitSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.verify|verify} messages. + * @param message GitSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.verify|verify} messages. + * @param message GitSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitSource + * @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.dialogflow.cx.v3.RestoreAgentRequest.GitSource; + + /** + * Decodes a GitSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitSource + * @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.dialogflow.cx.v3.RestoreAgentRequest.GitSource; + + /** + * Verifies a GitSource 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 GitSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource; + + /** + * Creates a plain object from a GitSource message. Also converts values to other types if specified. + * @param message GitSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RestoreOption enum. */ + enum RestoreOption { + RESTORE_OPTION_UNSPECIFIED = 0, + KEEP = 1, + FALLBACK = 2 + } + } + + /** Properties of a ValidateAgentRequest. */ + interface IValidateAgentRequest { + + /** ValidateAgentRequest name */ + name?: (string|null); + + /** ValidateAgentRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ValidateAgentRequest. */ + class ValidateAgentRequest implements IValidateAgentRequest { + + /** + * Constructs a new ValidateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IValidateAgentRequest); + + /** ValidateAgentRequest name. */ + public name: string; + + /** ValidateAgentRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ValidateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IValidateAgentRequest): google.cloud.dialogflow.cx.v3.ValidateAgentRequest; + + /** + * Encodes the specified ValidateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateAgentRequest.verify|verify} messages. + * @param message ValidateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IValidateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateAgentRequest.verify|verify} messages. + * @param message ValidateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IValidateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateAgentRequest + * @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.dialogflow.cx.v3.ValidateAgentRequest; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateAgentRequest + * @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.dialogflow.cx.v3.ValidateAgentRequest; + + /** + * Verifies a ValidateAgentRequest 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 ValidateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ValidateAgentRequest; + + /** + * Creates a plain object from a ValidateAgentRequest message. Also converts values to other types if specified. + * @param message ValidateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ValidateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentValidationResultRequest. */ + interface IGetAgentValidationResultRequest { + + /** GetAgentValidationResultRequest name */ + name?: (string|null); + + /** GetAgentValidationResultRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetAgentValidationResultRequest. */ + class GetAgentValidationResultRequest implements IGetAgentValidationResultRequest { + + /** + * Constructs a new GetAgentValidationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest); + + /** GetAgentValidationResultRequest name. */ + public name: string; + + /** GetAgentValidationResultRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetAgentValidationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentValidationResultRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest): google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest; + + /** + * Encodes the specified GetAgentValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest.verify|verify} messages. + * @param message GetAgentValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest.verify|verify} messages. + * @param message GetAgentValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentValidationResultRequest + * @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.dialogflow.cx.v3.GetAgentValidationResultRequest; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentValidationResultRequest + * @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.dialogflow.cx.v3.GetAgentValidationResultRequest; + + /** + * Verifies a GetAgentValidationResultRequest 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 GetAgentValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentValidationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest; + + /** + * Creates a plain object from a GetAgentValidationResultRequest message. Also converts values to other types if specified. + * @param message GetAgentValidationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentValidationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentValidationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentValidationResult. */ + interface IAgentValidationResult { + + /** AgentValidationResult name */ + name?: (string|null); + + /** AgentValidationResult flowValidationResults */ + flowValidationResults?: (google.cloud.dialogflow.cx.v3.IFlowValidationResult[]|null); + } + + /** Represents an AgentValidationResult. */ + class AgentValidationResult implements IAgentValidationResult { + + /** + * Constructs a new AgentValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IAgentValidationResult); + + /** AgentValidationResult name. */ + public name: string; + + /** AgentValidationResult flowValidationResults. */ + public flowValidationResults: google.cloud.dialogflow.cx.v3.IFlowValidationResult[]; + + /** + * Creates a new AgentValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentValidationResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IAgentValidationResult): google.cloud.dialogflow.cx.v3.AgentValidationResult; + + /** + * Encodes the specified AgentValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentValidationResult.verify|verify} messages. + * @param message AgentValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IAgentValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentValidationResult.verify|verify} messages. + * @param message AgentValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IAgentValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentValidationResult + * @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.dialogflow.cx.v3.AgentValidationResult; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentValidationResult + * @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.dialogflow.cx.v3.AgentValidationResult; + + /** + * Verifies an AgentValidationResult 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 AgentValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AgentValidationResult; + + /** + * Creates a plain object from an AgentValidationResult message. Also converts values to other types if specified. + * @param message AgentValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AgentValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentValidationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGenerativeSettingsRequest. */ + interface IGetGenerativeSettingsRequest { + + /** GetGenerativeSettingsRequest name */ + name?: (string|null); + + /** GetGenerativeSettingsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetGenerativeSettingsRequest. */ + class GetGenerativeSettingsRequest implements IGetGenerativeSettingsRequest { + + /** + * Constructs a new GetGenerativeSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest); + + /** GetGenerativeSettingsRequest name. */ + public name: string; + + /** GetGenerativeSettingsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetGenerativeSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGenerativeSettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest): google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest; + + /** + * Encodes the specified GetGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest.verify|verify} messages. + * @param message GetGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest.verify|verify} messages. + * @param message GetGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGenerativeSettingsRequest + * @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.dialogflow.cx.v3.GetGenerativeSettingsRequest; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGenerativeSettingsRequest + * @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.dialogflow.cx.v3.GetGenerativeSettingsRequest; + + /** + * Verifies a GetGenerativeSettingsRequest 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 GetGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGenerativeSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest; + + /** + * Creates a plain object from a GetGenerativeSettingsRequest message. Also converts values to other types if specified. + * @param message GetGenerativeSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGenerativeSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGenerativeSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGenerativeSettingsRequest. */ + interface IUpdateGenerativeSettingsRequest { + + /** UpdateGenerativeSettingsRequest generativeSettings */ + generativeSettings?: (google.cloud.dialogflow.cx.v3.IGenerativeSettings|null); + + /** UpdateGenerativeSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGenerativeSettingsRequest. */ + class UpdateGenerativeSettingsRequest implements IUpdateGenerativeSettingsRequest { + + /** + * Constructs a new UpdateGenerativeSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest); + + /** UpdateGenerativeSettingsRequest generativeSettings. */ + public generativeSettings?: (google.cloud.dialogflow.cx.v3.IGenerativeSettings|null); + + /** UpdateGenerativeSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGenerativeSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGenerativeSettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest): google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest; + + /** + * Encodes the specified UpdateGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @param message UpdateGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @param message UpdateGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGenerativeSettingsRequest + * @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.dialogflow.cx.v3.UpdateGenerativeSettingsRequest; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGenerativeSettingsRequest + * @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.dialogflow.cx.v3.UpdateGenerativeSettingsRequest; + + /** + * Verifies an UpdateGenerativeSettingsRequest 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 UpdateGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGenerativeSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest; + + /** + * Creates a plain object from an UpdateGenerativeSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateGenerativeSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGenerativeSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGenerativeSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + AUDIO_ENCODING_LINEAR_16 = 1, + AUDIO_ENCODING_FLAC = 2, + AUDIO_ENCODING_MULAW = 3, + AUDIO_ENCODING_AMR = 4, + AUDIO_ENCODING_AMR_WB = 5, + AUDIO_ENCODING_OGG_OPUS = 6, + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7, + AUDIO_ENCODING_ALAW = 8 + } + + /** SpeechModelVariant enum. */ + enum SpeechModelVariant { + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0, + USE_BEST_AVAILABLE = 1, + USE_STANDARD = 2, + USE_ENHANCED = 3 + } + + /** Properties of a SpeechWordInfo. */ + interface ISpeechWordInfo { + + /** SpeechWordInfo word */ + word?: (string|null); + + /** SpeechWordInfo startOffset */ + startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset */ + endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence */ + confidence?: (number|null); + } + + /** Represents a SpeechWordInfo. */ + class SpeechWordInfo implements ISpeechWordInfo { + + /** + * Constructs a new SpeechWordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISpeechWordInfo); + + /** SpeechWordInfo word. */ + public word: string; + + /** SpeechWordInfo startOffset. */ + public startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset. */ + public endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence. */ + public confidence: number; + + /** + * Creates a new SpeechWordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechWordInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISpeechWordInfo): google.cloud.dialogflow.cx.v3.SpeechWordInfo; + + /** + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechWordInfo + * @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.dialogflow.cx.v3.SpeechWordInfo; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechWordInfo + * @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.dialogflow.cx.v3.SpeechWordInfo; + + /** + * Verifies a SpeechWordInfo 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 SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechWordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SpeechWordInfo; + + /** + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * @param message SpeechWordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SpeechWordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechWordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechWordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BargeInConfig. */ + interface IBargeInConfig { + + /** BargeInConfig noBargeInDuration */ + noBargeInDuration?: (google.protobuf.IDuration|null); + + /** BargeInConfig totalDuration */ + totalDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a BargeInConfig. */ + class BargeInConfig implements IBargeInConfig { + + /** + * Constructs a new BargeInConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IBargeInConfig); + + /** BargeInConfig noBargeInDuration. */ + public noBargeInDuration?: (google.protobuf.IDuration|null); + + /** BargeInConfig totalDuration. */ + public totalDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BargeInConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IBargeInConfig): google.cloud.dialogflow.cx.v3.BargeInConfig; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BargeInConfig + * @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.dialogflow.cx.v3.BargeInConfig; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BargeInConfig + * @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.dialogflow.cx.v3.BargeInConfig; + + /** + * Verifies a BargeInConfig 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 BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BargeInConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BargeInConfig; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @param message BargeInConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BargeInConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BargeInConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BargeInConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InputAudioConfig. */ + interface IInputAudioConfig { + + /** InputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.cx.v3.AudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3.AudioEncoding|null); + + /** InputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** InputAudioConfig enableWordInfo */ + enableWordInfo?: (boolean|null); + + /** InputAudioConfig phraseHints */ + phraseHints?: (string[]|null); + + /** InputAudioConfig model */ + model?: (string|null); + + /** InputAudioConfig modelVariant */ + modelVariant?: (google.cloud.dialogflow.cx.v3.SpeechModelVariant|keyof typeof google.cloud.dialogflow.cx.v3.SpeechModelVariant|null); + + /** InputAudioConfig singleUtterance */ + singleUtterance?: (boolean|null); + + /** InputAudioConfig bargeInConfig */ + bargeInConfig?: (google.cloud.dialogflow.cx.v3.IBargeInConfig|null); + + /** InputAudioConfig optOutConformerModelMigration */ + optOutConformerModelMigration?: (boolean|null); + } + + /** Represents an InputAudioConfig. */ + class InputAudioConfig implements IInputAudioConfig { + + /** + * Constructs a new InputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IInputAudioConfig); + + /** InputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.cx.v3.AudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3.AudioEncoding); + + /** InputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** InputAudioConfig enableWordInfo. */ + public enableWordInfo: boolean; + + /** InputAudioConfig phraseHints. */ + public phraseHints: string[]; + + /** InputAudioConfig model. */ + public model: string; + + /** InputAudioConfig modelVariant. */ + public modelVariant: (google.cloud.dialogflow.cx.v3.SpeechModelVariant|keyof typeof google.cloud.dialogflow.cx.v3.SpeechModelVariant); + + /** InputAudioConfig singleUtterance. */ + public singleUtterance: boolean; + + /** InputAudioConfig bargeInConfig. */ + public bargeInConfig?: (google.cloud.dialogflow.cx.v3.IBargeInConfig|null); + + /** InputAudioConfig optOutConformerModelMigration. */ + public optOutConformerModelMigration: boolean; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudioConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IInputAudioConfig): google.cloud.dialogflow.cx.v3.InputAudioConfig; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudioConfig + * @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.dialogflow.cx.v3.InputAudioConfig; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudioConfig + * @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.dialogflow.cx.v3.InputAudioConfig; + + /** + * Verifies an InputAudioConfig 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 InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.InputAudioConfig; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @param message InputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SsmlVoiceGender enum. */ + enum SsmlVoiceGender { + SSML_VOICE_GENDER_UNSPECIFIED = 0, + SSML_VOICE_GENDER_MALE = 1, + SSML_VOICE_GENDER_FEMALE = 2, + SSML_VOICE_GENDER_NEUTRAL = 3 + } + + /** Properties of a VoiceSelectionParams. */ + interface IVoiceSelectionParams { + + /** VoiceSelectionParams name */ + name?: (string|null); + + /** VoiceSelectionParams ssmlGender */ + ssmlGender?: (google.cloud.dialogflow.cx.v3.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.cx.v3.SsmlVoiceGender|null); + } + + /** Represents a VoiceSelectionParams. */ + class VoiceSelectionParams implements IVoiceSelectionParams { + + /** + * Constructs a new VoiceSelectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IVoiceSelectionParams); + + /** VoiceSelectionParams name. */ + public name: string; + + /** VoiceSelectionParams ssmlGender. */ + public ssmlGender: (google.cloud.dialogflow.cx.v3.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.cx.v3.SsmlVoiceGender); + + /** + * Creates a new VoiceSelectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceSelectionParams instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IVoiceSelectionParams): google.cloud.dialogflow.cx.v3.VoiceSelectionParams; + + /** + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceSelectionParams + * @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.dialogflow.cx.v3.VoiceSelectionParams; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceSelectionParams + * @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.dialogflow.cx.v3.VoiceSelectionParams; + + /** + * Verifies a VoiceSelectionParams 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 VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceSelectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.VoiceSelectionParams; + + /** + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @param message VoiceSelectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.VoiceSelectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceSelectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceSelectionParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SynthesizeSpeechConfig. */ + interface ISynthesizeSpeechConfig { + + /** SynthesizeSpeechConfig speakingRate */ + speakingRate?: (number|null); + + /** SynthesizeSpeechConfig pitch */ + pitch?: (number|null); + + /** SynthesizeSpeechConfig volumeGainDb */ + volumeGainDb?: (number|null); + + /** SynthesizeSpeechConfig effectsProfileId */ + effectsProfileId?: (string[]|null); + + /** SynthesizeSpeechConfig voice */ + voice?: (google.cloud.dialogflow.cx.v3.IVoiceSelectionParams|null); + } + + /** Represents a SynthesizeSpeechConfig. */ + class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + + /** + * Constructs a new SynthesizeSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig); + + /** SynthesizeSpeechConfig speakingRate. */ + public speakingRate: number; + + /** SynthesizeSpeechConfig pitch. */ + public pitch: number; + + /** SynthesizeSpeechConfig volumeGainDb. */ + public volumeGainDb: number; + + /** SynthesizeSpeechConfig effectsProfileId. */ + public effectsProfileId: string[]; + + /** SynthesizeSpeechConfig voice. */ + public voice?: (google.cloud.dialogflow.cx.v3.IVoiceSelectionParams|null); + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SynthesizeSpeechConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig): google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SynthesizeSpeechConfig + * @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.dialogflow.cx.v3.SynthesizeSpeechConfig; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SynthesizeSpeechConfig + * @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.dialogflow.cx.v3.SynthesizeSpeechConfig; + + /** + * Verifies a SynthesizeSpeechConfig 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 SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SynthesizeSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @param message SynthesizeSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** OutputAudioEncoding enum. */ + enum OutputAudioEncoding { + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0, + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1, + OUTPUT_AUDIO_ENCODING_MP3 = 2, + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4, + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3, + OUTPUT_AUDIO_ENCODING_MULAW = 5, + OUTPUT_AUDIO_ENCODING_ALAW = 6 + } + + /** Properties of an OutputAudioConfig. */ + interface IOutputAudioConfig { + + /** OutputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.cx.v3.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3.OutputAudioEncoding|null); + + /** OutputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** OutputAudioConfig synthesizeSpeechConfig */ + synthesizeSpeechConfig?: (google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig|null); + } + + /** Represents an OutputAudioConfig. */ + class OutputAudioConfig implements IOutputAudioConfig { + + /** + * Constructs a new OutputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IOutputAudioConfig); + + /** OutputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.cx.v3.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3.OutputAudioEncoding); + + /** OutputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** OutputAudioConfig synthesizeSpeechConfig. */ + public synthesizeSpeechConfig?: (google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig|null); + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IOutputAudioConfig): google.cloud.dialogflow.cx.v3.OutputAudioConfig; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioConfig + * @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.dialogflow.cx.v3.OutputAudioConfig; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioConfig + * @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.dialogflow.cx.v3.OutputAudioConfig; + + /** + * Verifies an OutputAudioConfig 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 OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.OutputAudioConfig; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @param message OutputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextToSpeechSettings. */ + interface ITextToSpeechSettings { + + /** TextToSpeechSettings synthesizeSpeechConfigs */ + synthesizeSpeechConfigs?: ({ [k: string]: google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig }|null); + } + + /** Represents a TextToSpeechSettings. */ + class TextToSpeechSettings implements ITextToSpeechSettings { + + /** + * Constructs a new TextToSpeechSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITextToSpeechSettings); + + /** TextToSpeechSettings synthesizeSpeechConfigs. */ + public synthesizeSpeechConfigs: { [k: string]: google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig }; + + /** + * Creates a new TextToSpeechSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns TextToSpeechSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITextToSpeechSettings): google.cloud.dialogflow.cx.v3.TextToSpeechSettings; + + /** + * Encodes the specified TextToSpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextToSpeechSettings.verify|verify} messages. + * @param message TextToSpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITextToSpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextToSpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextToSpeechSettings.verify|verify} messages. + * @param message TextToSpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITextToSpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextToSpeechSettings + * @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.dialogflow.cx.v3.TextToSpeechSettings; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextToSpeechSettings + * @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.dialogflow.cx.v3.TextToSpeechSettings; + + /** + * Verifies a TextToSpeechSettings 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 TextToSpeechSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextToSpeechSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TextToSpeechSettings; + + /** + * Creates a plain object from a TextToSpeechSettings message. Also converts values to other types if specified. + * @param message TextToSpeechSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TextToSpeechSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextToSpeechSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextToSpeechSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Flows */ + class Flows extends $protobuf.rpc.Service { + + /** + * Constructs a new Flows service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Flows service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Flows; + + /** + * Calls CreateFlow. + * @param request CreateFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Flow + */ + public createFlow(request: google.cloud.dialogflow.cx.v3.ICreateFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.CreateFlowCallback): void; + + /** + * Calls CreateFlow. + * @param request CreateFlowRequest message or plain object + * @returns Promise + */ + public createFlow(request: google.cloud.dialogflow.cx.v3.ICreateFlowRequest): Promise; + + /** + * Calls DeleteFlow. + * @param request DeleteFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFlow(request: google.cloud.dialogflow.cx.v3.IDeleteFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.DeleteFlowCallback): void; + + /** + * Calls DeleteFlow. + * @param request DeleteFlowRequest message or plain object + * @returns Promise + */ + public deleteFlow(request: google.cloud.dialogflow.cx.v3.IDeleteFlowRequest): Promise; + + /** + * Calls ListFlows. + * @param request ListFlowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFlowsResponse + */ + public listFlows(request: google.cloud.dialogflow.cx.v3.IListFlowsRequest, callback: google.cloud.dialogflow.cx.v3.Flows.ListFlowsCallback): void; + + /** + * Calls ListFlows. + * @param request ListFlowsRequest message or plain object + * @returns Promise + */ + public listFlows(request: google.cloud.dialogflow.cx.v3.IListFlowsRequest): Promise; + + /** + * Calls GetFlow. + * @param request GetFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Flow + */ + public getFlow(request: google.cloud.dialogflow.cx.v3.IGetFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.GetFlowCallback): void; + + /** + * Calls GetFlow. + * @param request GetFlowRequest message or plain object + * @returns Promise + */ + public getFlow(request: google.cloud.dialogflow.cx.v3.IGetFlowRequest): Promise; + + /** + * Calls UpdateFlow. + * @param request UpdateFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Flow + */ + public updateFlow(request: google.cloud.dialogflow.cx.v3.IUpdateFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.UpdateFlowCallback): void; + + /** + * Calls UpdateFlow. + * @param request UpdateFlowRequest message or plain object + * @returns Promise + */ + public updateFlow(request: google.cloud.dialogflow.cx.v3.IUpdateFlowRequest): Promise; + + /** + * Calls TrainFlow. + * @param request TrainFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public trainFlow(request: google.cloud.dialogflow.cx.v3.ITrainFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.TrainFlowCallback): void; + + /** + * Calls TrainFlow. + * @param request TrainFlowRequest message or plain object + * @returns Promise + */ + public trainFlow(request: google.cloud.dialogflow.cx.v3.ITrainFlowRequest): Promise; + + /** + * Calls ValidateFlow. + * @param request ValidateFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FlowValidationResult + */ + public validateFlow(request: google.cloud.dialogflow.cx.v3.IValidateFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.ValidateFlowCallback): void; + + /** + * Calls ValidateFlow. + * @param request ValidateFlowRequest message or plain object + * @returns Promise + */ + public validateFlow(request: google.cloud.dialogflow.cx.v3.IValidateFlowRequest): Promise; + + /** + * Calls GetFlowValidationResult. + * @param request GetFlowValidationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FlowValidationResult + */ + public getFlowValidationResult(request: google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest, callback: google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResultCallback): void; + + /** + * Calls GetFlowValidationResult. + * @param request GetFlowValidationResultRequest message or plain object + * @returns Promise + */ + public getFlowValidationResult(request: google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest): Promise; + + /** + * Calls ImportFlow. + * @param request ImportFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importFlow(request: google.cloud.dialogflow.cx.v3.IImportFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.ImportFlowCallback): void; + + /** + * Calls ImportFlow. + * @param request ImportFlowRequest message or plain object + * @returns Promise + */ + public importFlow(request: google.cloud.dialogflow.cx.v3.IImportFlowRequest): Promise; + + /** + * Calls ExportFlow. + * @param request ExportFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportFlow(request: google.cloud.dialogflow.cx.v3.IExportFlowRequest, callback: google.cloud.dialogflow.cx.v3.Flows.ExportFlowCallback): void; + + /** + * Calls ExportFlow. + * @param request ExportFlowRequest message or plain object + * @returns Promise + */ + public exportFlow(request: google.cloud.dialogflow.cx.v3.IExportFlowRequest): Promise; + } + + namespace Flows { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|createFlow}. + * @param error Error, if any + * @param [response] Flow + */ + type CreateFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Flow) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|deleteFlow}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFlowCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|listFlows}. + * @param error Error, if any + * @param [response] ListFlowsResponse + */ + type ListFlowsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListFlowsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|getFlow}. + * @param error Error, if any + * @param [response] Flow + */ + type GetFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Flow) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|updateFlow}. + * @param error Error, if any + * @param [response] Flow + */ + type UpdateFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Flow) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|trainFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type TrainFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|validateFlow}. + * @param error Error, if any + * @param [response] FlowValidationResult + */ + type ValidateFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.FlowValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|getFlowValidationResult}. + * @param error Error, if any + * @param [response] FlowValidationResult + */ + type GetFlowValidationResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.FlowValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|importFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|exportFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NluSettings. */ + interface INluSettings { + + /** NluSettings modelType */ + modelType?: (google.cloud.dialogflow.cx.v3.NluSettings.ModelType|keyof typeof google.cloud.dialogflow.cx.v3.NluSettings.ModelType|null); + + /** NluSettings classificationThreshold */ + classificationThreshold?: (number|null); + + /** NluSettings modelTrainingMode */ + modelTrainingMode?: (google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode|keyof typeof google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode|null); + } + + /** Represents a NluSettings. */ + class NluSettings implements INluSettings { + + /** + * Constructs a new NluSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.INluSettings); + + /** NluSettings modelType. */ + public modelType: (google.cloud.dialogflow.cx.v3.NluSettings.ModelType|keyof typeof google.cloud.dialogflow.cx.v3.NluSettings.ModelType); + + /** NluSettings classificationThreshold. */ + public classificationThreshold: number; + + /** NluSettings modelTrainingMode. */ + public modelTrainingMode: (google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode|keyof typeof google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode); + + /** + * Creates a new NluSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NluSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.INluSettings): google.cloud.dialogflow.cx.v3.NluSettings; + + /** + * Encodes the specified NluSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.NluSettings.verify|verify} messages. + * @param message NluSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.INluSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NluSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.NluSettings.verify|verify} messages. + * @param message NluSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.INluSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NluSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NluSettings + * @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.dialogflow.cx.v3.NluSettings; + + /** + * Decodes a NluSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NluSettings + * @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.dialogflow.cx.v3.NluSettings; + + /** + * Verifies a NluSettings 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 NluSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NluSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.NluSettings; + + /** + * Creates a plain object from a NluSettings message. Also converts values to other types if specified. + * @param message NluSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.NluSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NluSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NluSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NluSettings { + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + MODEL_TYPE_STANDARD = 1, + MODEL_TYPE_ADVANCED = 3 + } + + /** ModelTrainingMode enum. */ + enum ModelTrainingMode { + MODEL_TRAINING_MODE_UNSPECIFIED = 0, + MODEL_TRAINING_MODE_AUTOMATIC = 1, + MODEL_TRAINING_MODE_MANUAL = 2 + } + } + + /** Properties of a Flow. */ + interface IFlow { + + /** Flow name */ + name?: (string|null); + + /** Flow displayName */ + displayName?: (string|null); + + /** Flow description */ + description?: (string|null); + + /** Flow transitionRoutes */ + transitionRoutes?: (google.cloud.dialogflow.cx.v3.ITransitionRoute[]|null); + + /** Flow eventHandlers */ + eventHandlers?: (google.cloud.dialogflow.cx.v3.IEventHandler[]|null); + + /** Flow transitionRouteGroups */ + transitionRouteGroups?: (string[]|null); + + /** Flow nluSettings */ + nluSettings?: (google.cloud.dialogflow.cx.v3.INluSettings|null); + + /** Flow advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Flow knowledgeConnectorSettings */ + knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null); + + /** Flow inputParameterDefinitions */ + inputParameterDefinitions?: (google.cloud.dialogflow.cx.v3.IParameterDefinition[]|null); + + /** Flow outputParameterDefinitions */ + outputParameterDefinitions?: (google.cloud.dialogflow.cx.v3.IParameterDefinition[]|null); + + /** Flow multiLanguageSettings */ + multiLanguageSettings?: (google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings|null); + + /** Flow locked */ + locked?: (boolean|null); + } + + /** Represents a Flow. */ + class Flow implements IFlow { + + /** + * Constructs a new Flow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFlow); + + /** Flow name. */ + public name: string; + + /** Flow displayName. */ + public displayName: string; + + /** Flow description. */ + public description: string; + + /** Flow transitionRoutes. */ + public transitionRoutes: google.cloud.dialogflow.cx.v3.ITransitionRoute[]; + + /** Flow eventHandlers. */ + public eventHandlers: google.cloud.dialogflow.cx.v3.IEventHandler[]; + + /** Flow transitionRouteGroups. */ + public transitionRouteGroups: string[]; + + /** Flow nluSettings. */ + public nluSettings?: (google.cloud.dialogflow.cx.v3.INluSettings|null); + + /** Flow advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Flow knowledgeConnectorSettings. */ + public knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null); + + /** Flow inputParameterDefinitions. */ + public inputParameterDefinitions: google.cloud.dialogflow.cx.v3.IParameterDefinition[]; + + /** Flow outputParameterDefinitions. */ + public outputParameterDefinitions: google.cloud.dialogflow.cx.v3.IParameterDefinition[]; + + /** Flow multiLanguageSettings. */ + public multiLanguageSettings?: (google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings|null); + + /** Flow locked. */ + public locked: boolean; + + /** + * Creates a new Flow instance using the specified properties. + * @param [properties] Properties to set + * @returns Flow instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFlow): google.cloud.dialogflow.cx.v3.Flow; + + /** + * Encodes the specified Flow message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.verify|verify} messages. + * @param message Flow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFlow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Flow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.verify|verify} messages. + * @param message Flow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFlow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Flow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Flow + * @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.dialogflow.cx.v3.Flow; + + /** + * Decodes a Flow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Flow + * @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.dialogflow.cx.v3.Flow; + + /** + * Verifies a Flow 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 Flow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Flow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Flow; + + /** + * Creates a plain object from a Flow message. Also converts values to other types if specified. + * @param message Flow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Flow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Flow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Flow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Flow { + + /** Properties of a MultiLanguageSettings. */ + interface IMultiLanguageSettings { + + /** MultiLanguageSettings enableMultiLanguageDetection */ + enableMultiLanguageDetection?: (boolean|null); + + /** MultiLanguageSettings supportedResponseLanguageCodes */ + supportedResponseLanguageCodes?: (string[]|null); + } + + /** Represents a MultiLanguageSettings. */ + class MultiLanguageSettings implements IMultiLanguageSettings { + + /** + * Constructs a new MultiLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings); + + /** MultiLanguageSettings enableMultiLanguageDetection. */ + public enableMultiLanguageDetection: boolean; + + /** MultiLanguageSettings supportedResponseLanguageCodes. */ + public supportedResponseLanguageCodes: string[]; + + /** + * Creates a new MultiLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiLanguageSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings): google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings; + + /** + * Encodes the specified MultiLanguageSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.verify|verify} messages. + * @param message MultiLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiLanguageSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.verify|verify} messages. + * @param message MultiLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiLanguageSettings + * @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.dialogflow.cx.v3.Flow.MultiLanguageSettings; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiLanguageSettings + * @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.dialogflow.cx.v3.Flow.MultiLanguageSettings; + + /** + * Verifies a MultiLanguageSettings 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 MultiLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings; + + /** + * Creates a plain object from a MultiLanguageSettings message. Also converts values to other types if specified. + * @param message MultiLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateFlowRequest. */ + interface ICreateFlowRequest { + + /** CreateFlowRequest parent */ + parent?: (string|null); + + /** CreateFlowRequest flow */ + flow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + + /** CreateFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateFlowRequest. */ + class CreateFlowRequest implements ICreateFlowRequest { + + /** + * Constructs a new CreateFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateFlowRequest); + + /** CreateFlowRequest parent. */ + public parent: string; + + /** CreateFlowRequest flow. */ + public flow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + + /** CreateFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateFlowRequest): google.cloud.dialogflow.cx.v3.CreateFlowRequest; + + /** + * Encodes the specified CreateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateFlowRequest.verify|verify} messages. + * @param message CreateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateFlowRequest.verify|verify} messages. + * @param message CreateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFlowRequest + * @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.dialogflow.cx.v3.CreateFlowRequest; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFlowRequest + * @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.dialogflow.cx.v3.CreateFlowRequest; + + /** + * Verifies a CreateFlowRequest 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 CreateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateFlowRequest; + + /** + * Creates a plain object from a CreateFlowRequest message. Also converts values to other types if specified. + * @param message CreateFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFlowRequest. */ + interface IDeleteFlowRequest { + + /** DeleteFlowRequest name */ + name?: (string|null); + + /** DeleteFlowRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteFlowRequest. */ + class DeleteFlowRequest implements IDeleteFlowRequest { + + /** + * Constructs a new DeleteFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteFlowRequest); + + /** DeleteFlowRequest name. */ + public name: string; + + /** DeleteFlowRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteFlowRequest): google.cloud.dialogflow.cx.v3.DeleteFlowRequest; + + /** + * Encodes the specified DeleteFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteFlowRequest.verify|verify} messages. + * @param message DeleteFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteFlowRequest.verify|verify} messages. + * @param message DeleteFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFlowRequest + * @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.dialogflow.cx.v3.DeleteFlowRequest; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFlowRequest + * @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.dialogflow.cx.v3.DeleteFlowRequest; + + /** + * Verifies a DeleteFlowRequest 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 DeleteFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteFlowRequest; + + /** + * Creates a plain object from a DeleteFlowRequest message. Also converts values to other types if specified. + * @param message DeleteFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFlowsRequest. */ + interface IListFlowsRequest { + + /** ListFlowsRequest parent */ + parent?: (string|null); + + /** ListFlowsRequest pageSize */ + pageSize?: (number|null); + + /** ListFlowsRequest pageToken */ + pageToken?: (string|null); + + /** ListFlowsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListFlowsRequest. */ + class ListFlowsRequest implements IListFlowsRequest { + + /** + * Constructs a new ListFlowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListFlowsRequest); + + /** ListFlowsRequest parent. */ + public parent: string; + + /** ListFlowsRequest pageSize. */ + public pageSize: number; + + /** ListFlowsRequest pageToken. */ + public pageToken: string; + + /** ListFlowsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListFlowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFlowsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListFlowsRequest): google.cloud.dialogflow.cx.v3.ListFlowsRequest; + + /** + * Encodes the specified ListFlowsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsRequest.verify|verify} messages. + * @param message ListFlowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListFlowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFlowsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsRequest.verify|verify} messages. + * @param message ListFlowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListFlowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFlowsRequest + * @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.dialogflow.cx.v3.ListFlowsRequest; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFlowsRequest + * @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.dialogflow.cx.v3.ListFlowsRequest; + + /** + * Verifies a ListFlowsRequest 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 ListFlowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFlowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListFlowsRequest; + + /** + * Creates a plain object from a ListFlowsRequest message. Also converts values to other types if specified. + * @param message ListFlowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListFlowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFlowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFlowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFlowsResponse. */ + interface IListFlowsResponse { + + /** ListFlowsResponse flows */ + flows?: (google.cloud.dialogflow.cx.v3.IFlow[]|null); + + /** ListFlowsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFlowsResponse. */ + class ListFlowsResponse implements IListFlowsResponse { + + /** + * Constructs a new ListFlowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListFlowsResponse); + + /** ListFlowsResponse flows. */ + public flows: google.cloud.dialogflow.cx.v3.IFlow[]; + + /** ListFlowsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFlowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFlowsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListFlowsResponse): google.cloud.dialogflow.cx.v3.ListFlowsResponse; + + /** + * Encodes the specified ListFlowsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsResponse.verify|verify} messages. + * @param message ListFlowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListFlowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFlowsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsResponse.verify|verify} messages. + * @param message ListFlowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListFlowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFlowsResponse + * @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.dialogflow.cx.v3.ListFlowsResponse; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFlowsResponse + * @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.dialogflow.cx.v3.ListFlowsResponse; + + /** + * Verifies a ListFlowsResponse 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 ListFlowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFlowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListFlowsResponse; + + /** + * Creates a plain object from a ListFlowsResponse message. Also converts values to other types if specified. + * @param message ListFlowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListFlowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFlowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFlowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFlowRequest. */ + interface IGetFlowRequest { + + /** GetFlowRequest name */ + name?: (string|null); + + /** GetFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetFlowRequest. */ + class GetFlowRequest implements IGetFlowRequest { + + /** + * Constructs a new GetFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetFlowRequest); + + /** GetFlowRequest name. */ + public name: string; + + /** GetFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetFlowRequest): google.cloud.dialogflow.cx.v3.GetFlowRequest; + + /** + * Encodes the specified GetFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowRequest.verify|verify} messages. + * @param message GetFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowRequest.verify|verify} messages. + * @param message GetFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFlowRequest + * @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.dialogflow.cx.v3.GetFlowRequest; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFlowRequest + * @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.dialogflow.cx.v3.GetFlowRequest; + + /** + * Verifies a GetFlowRequest 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 GetFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetFlowRequest; + + /** + * Creates a plain object from a GetFlowRequest message. Also converts values to other types if specified. + * @param message GetFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFlowRequest. */ + interface IUpdateFlowRequest { + + /** UpdateFlowRequest flow */ + flow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + + /** UpdateFlowRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents an UpdateFlowRequest. */ + class UpdateFlowRequest implements IUpdateFlowRequest { + + /** + * Constructs a new UpdateFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateFlowRequest); + + /** UpdateFlowRequest flow. */ + public flow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + + /** UpdateFlowRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new UpdateFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateFlowRequest): google.cloud.dialogflow.cx.v3.UpdateFlowRequest; + + /** + * Encodes the specified UpdateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateFlowRequest.verify|verify} messages. + * @param message UpdateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateFlowRequest.verify|verify} messages. + * @param message UpdateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFlowRequest + * @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.dialogflow.cx.v3.UpdateFlowRequest; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFlowRequest + * @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.dialogflow.cx.v3.UpdateFlowRequest; + + /** + * Verifies an UpdateFlowRequest 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 UpdateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateFlowRequest; + + /** + * Creates a plain object from an UpdateFlowRequest message. Also converts values to other types if specified. + * @param message UpdateFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrainFlowRequest. */ + interface ITrainFlowRequest { + + /** TrainFlowRequest name */ + name?: (string|null); + } + + /** Represents a TrainFlowRequest. */ + class TrainFlowRequest implements ITrainFlowRequest { + + /** + * Constructs a new TrainFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITrainFlowRequest); + + /** TrainFlowRequest name. */ + public name: string; + + /** + * Creates a new TrainFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITrainFlowRequest): google.cloud.dialogflow.cx.v3.TrainFlowRequest; + + /** + * Encodes the specified TrainFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TrainFlowRequest.verify|verify} messages. + * @param message TrainFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITrainFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TrainFlowRequest.verify|verify} messages. + * @param message TrainFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITrainFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainFlowRequest + * @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.dialogflow.cx.v3.TrainFlowRequest; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainFlowRequest + * @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.dialogflow.cx.v3.TrainFlowRequest; + + /** + * Verifies a TrainFlowRequest 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 TrainFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TrainFlowRequest; + + /** + * Creates a plain object from a TrainFlowRequest message. Also converts values to other types if specified. + * @param message TrainFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TrainFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateFlowRequest. */ + interface IValidateFlowRequest { + + /** ValidateFlowRequest name */ + name?: (string|null); + + /** ValidateFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ValidateFlowRequest. */ + class ValidateFlowRequest implements IValidateFlowRequest { + + /** + * Constructs a new ValidateFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IValidateFlowRequest); + + /** ValidateFlowRequest name. */ + public name: string; + + /** ValidateFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ValidateFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IValidateFlowRequest): google.cloud.dialogflow.cx.v3.ValidateFlowRequest; + + /** + * Encodes the specified ValidateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateFlowRequest.verify|verify} messages. + * @param message ValidateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IValidateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateFlowRequest.verify|verify} messages. + * @param message ValidateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IValidateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateFlowRequest + * @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.dialogflow.cx.v3.ValidateFlowRequest; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateFlowRequest + * @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.dialogflow.cx.v3.ValidateFlowRequest; + + /** + * Verifies a ValidateFlowRequest 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 ValidateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ValidateFlowRequest; + + /** + * Creates a plain object from a ValidateFlowRequest message. Also converts values to other types if specified. + * @param message ValidateFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ValidateFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFlowValidationResultRequest. */ + interface IGetFlowValidationResultRequest { + + /** GetFlowValidationResultRequest name */ + name?: (string|null); + + /** GetFlowValidationResultRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetFlowValidationResultRequest. */ + class GetFlowValidationResultRequest implements IGetFlowValidationResultRequest { + + /** + * Constructs a new GetFlowValidationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest); + + /** GetFlowValidationResultRequest name. */ + public name: string; + + /** GetFlowValidationResultRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetFlowValidationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFlowValidationResultRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest): google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest; + + /** + * Encodes the specified GetFlowValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest.verify|verify} messages. + * @param message GetFlowValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFlowValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest.verify|verify} messages. + * @param message GetFlowValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFlowValidationResultRequest + * @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.dialogflow.cx.v3.GetFlowValidationResultRequest; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFlowValidationResultRequest + * @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.dialogflow.cx.v3.GetFlowValidationResultRequest; + + /** + * Verifies a GetFlowValidationResultRequest 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 GetFlowValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFlowValidationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest; + + /** + * Creates a plain object from a GetFlowValidationResultRequest message. Also converts values to other types if specified. + * @param message GetFlowValidationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFlowValidationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFlowValidationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowValidationResult. */ + interface IFlowValidationResult { + + /** FlowValidationResult name */ + name?: (string|null); + + /** FlowValidationResult validationMessages */ + validationMessages?: (google.cloud.dialogflow.cx.v3.IValidationMessage[]|null); + + /** FlowValidationResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a FlowValidationResult. */ + class FlowValidationResult implements IFlowValidationResult { + + /** + * Constructs a new FlowValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFlowValidationResult); + + /** FlowValidationResult name. */ + public name: string; + + /** FlowValidationResult validationMessages. */ + public validationMessages: google.cloud.dialogflow.cx.v3.IValidationMessage[]; + + /** FlowValidationResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new FlowValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowValidationResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFlowValidationResult): google.cloud.dialogflow.cx.v3.FlowValidationResult; + + /** + * Encodes the specified FlowValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowValidationResult.verify|verify} messages. + * @param message FlowValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFlowValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowValidationResult.verify|verify} messages. + * @param message FlowValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFlowValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowValidationResult + * @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.dialogflow.cx.v3.FlowValidationResult; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowValidationResult + * @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.dialogflow.cx.v3.FlowValidationResult; + + /** + * Verifies a FlowValidationResult 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 FlowValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FlowValidationResult; + + /** + * Creates a plain object from a FlowValidationResult message. Also converts values to other types if specified. + * @param message FlowValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FlowValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowValidationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportFlowRequest. */ + interface IImportFlowRequest { + + /** ImportFlowRequest parent */ + parent?: (string|null); + + /** ImportFlowRequest flowUri */ + flowUri?: (string|null); + + /** ImportFlowRequest flowContent */ + flowContent?: (Uint8Array|Buffer|string|null); + + /** ImportFlowRequest importOption */ + importOption?: (google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption|keyof typeof google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption|null); + + /** ImportFlowRequest flowImportStrategy */ + flowImportStrategy?: (google.cloud.dialogflow.cx.v3.IFlowImportStrategy|null); + } + + /** Represents an ImportFlowRequest. */ + class ImportFlowRequest implements IImportFlowRequest { + + /** + * Constructs a new ImportFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportFlowRequest); + + /** ImportFlowRequest parent. */ + public parent: string; + + /** ImportFlowRequest flowUri. */ + public flowUri?: (string|null); + + /** ImportFlowRequest flowContent. */ + public flowContent?: (Uint8Array|Buffer|string|null); + + /** ImportFlowRequest importOption. */ + public importOption: (google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption|keyof typeof google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption); + + /** ImportFlowRequest flowImportStrategy. */ + public flowImportStrategy?: (google.cloud.dialogflow.cx.v3.IFlowImportStrategy|null); + + /** ImportFlowRequest flow. */ + public flow?: ("flowUri"|"flowContent"); + + /** + * Creates a new ImportFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportFlowRequest): google.cloud.dialogflow.cx.v3.ImportFlowRequest; + + /** + * Encodes the specified ImportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowRequest.verify|verify} messages. + * @param message ImportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowRequest.verify|verify} messages. + * @param message ImportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportFlowRequest + * @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.dialogflow.cx.v3.ImportFlowRequest; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportFlowRequest + * @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.dialogflow.cx.v3.ImportFlowRequest; + + /** + * Verifies an ImportFlowRequest 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 ImportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportFlowRequest; + + /** + * Creates a plain object from an ImportFlowRequest message. Also converts values to other types if specified. + * @param message ImportFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportFlowRequest { + + /** ImportOption enum. */ + enum ImportOption { + IMPORT_OPTION_UNSPECIFIED = 0, + KEEP = 1, + FALLBACK = 2 + } + } + + /** Properties of a FlowImportStrategy. */ + interface IFlowImportStrategy { + + /** FlowImportStrategy globalImportStrategy */ + globalImportStrategy?: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy|null); + } + + /** Represents a FlowImportStrategy. */ + class FlowImportStrategy implements IFlowImportStrategy { + + /** + * Constructs a new FlowImportStrategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFlowImportStrategy); + + /** FlowImportStrategy globalImportStrategy. */ + public globalImportStrategy: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy); + + /** + * Creates a new FlowImportStrategy instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowImportStrategy instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFlowImportStrategy): google.cloud.dialogflow.cx.v3.FlowImportStrategy; + + /** + * Encodes the specified FlowImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowImportStrategy.verify|verify} messages. + * @param message FlowImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFlowImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowImportStrategy.verify|verify} messages. + * @param message FlowImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFlowImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowImportStrategy + * @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.dialogflow.cx.v3.FlowImportStrategy; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowImportStrategy + * @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.dialogflow.cx.v3.FlowImportStrategy; + + /** + * Verifies a FlowImportStrategy 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 FlowImportStrategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowImportStrategy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FlowImportStrategy; + + /** + * Creates a plain object from a FlowImportStrategy message. Also converts values to other types if specified. + * @param message FlowImportStrategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FlowImportStrategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowImportStrategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowImportStrategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportFlowResponse. */ + interface IImportFlowResponse { + + /** ImportFlowResponse flow */ + flow?: (string|null); + } + + /** Represents an ImportFlowResponse. */ + class ImportFlowResponse implements IImportFlowResponse { + + /** + * Constructs a new ImportFlowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportFlowResponse); + + /** ImportFlowResponse flow. */ + public flow: string; + + /** + * Creates a new ImportFlowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportFlowResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportFlowResponse): google.cloud.dialogflow.cx.v3.ImportFlowResponse; + + /** + * Encodes the specified ImportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowResponse.verify|verify} messages. + * @param message ImportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowResponse.verify|verify} messages. + * @param message ImportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportFlowResponse + * @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.dialogflow.cx.v3.ImportFlowResponse; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportFlowResponse + * @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.dialogflow.cx.v3.ImportFlowResponse; + + /** + * Verifies an ImportFlowResponse 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 ImportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportFlowResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportFlowResponse; + + /** + * Creates a plain object from an ImportFlowResponse message. Also converts values to other types if specified. + * @param message ImportFlowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportFlowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportFlowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportFlowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportFlowRequest. */ + interface IExportFlowRequest { + + /** ExportFlowRequest name */ + name?: (string|null); + + /** ExportFlowRequest flowUri */ + flowUri?: (string|null); + + /** ExportFlowRequest includeReferencedFlows */ + includeReferencedFlows?: (boolean|null); + } + + /** Represents an ExportFlowRequest. */ + class ExportFlowRequest implements IExportFlowRequest { + + /** + * Constructs a new ExportFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportFlowRequest); + + /** ExportFlowRequest name. */ + public name: string; + + /** ExportFlowRequest flowUri. */ + public flowUri: string; + + /** ExportFlowRequest includeReferencedFlows. */ + public includeReferencedFlows: boolean; + + /** + * Creates a new ExportFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportFlowRequest): google.cloud.dialogflow.cx.v3.ExportFlowRequest; + + /** + * Encodes the specified ExportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowRequest.verify|verify} messages. + * @param message ExportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowRequest.verify|verify} messages. + * @param message ExportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportFlowRequest + * @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.dialogflow.cx.v3.ExportFlowRequest; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportFlowRequest + * @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.dialogflow.cx.v3.ExportFlowRequest; + + /** + * Verifies an ExportFlowRequest 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 ExportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportFlowRequest; + + /** + * Creates a plain object from an ExportFlowRequest message. Also converts values to other types if specified. + * @param message ExportFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportFlowResponse. */ + interface IExportFlowResponse { + + /** ExportFlowResponse flowUri */ + flowUri?: (string|null); + + /** ExportFlowResponse flowContent */ + flowContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ExportFlowResponse. */ + class ExportFlowResponse implements IExportFlowResponse { + + /** + * Constructs a new ExportFlowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportFlowResponse); + + /** ExportFlowResponse flowUri. */ + public flowUri?: (string|null); + + /** ExportFlowResponse flowContent. */ + public flowContent?: (Uint8Array|Buffer|string|null); + + /** ExportFlowResponse flow. */ + public flow?: ("flowUri"|"flowContent"); + + /** + * Creates a new ExportFlowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportFlowResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportFlowResponse): google.cloud.dialogflow.cx.v3.ExportFlowResponse; + + /** + * Encodes the specified ExportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowResponse.verify|verify} messages. + * @param message ExportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowResponse.verify|verify} messages. + * @param message ExportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportFlowResponse + * @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.dialogflow.cx.v3.ExportFlowResponse; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportFlowResponse + * @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.dialogflow.cx.v3.ExportFlowResponse; + + /** + * Verifies an ExportFlowResponse 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 ExportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportFlowResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportFlowResponse; + + /** + * Creates a plain object from an ExportFlowResponse message. Also converts values to other types if specified. + * @param message ExportFlowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportFlowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportFlowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportFlowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ImportStrategy enum. */ + enum ImportStrategy { + IMPORT_STRATEGY_UNSPECIFIED = 0, + IMPORT_STRATEGY_CREATE_NEW = 1, + IMPORT_STRATEGY_REPLACE = 2, + IMPORT_STRATEGY_KEEP = 3, + IMPORT_STRATEGY_MERGE = 4, + IMPORT_STRATEGY_THROW_ERROR = 5 + } + + /** Represents a Pages */ + class Pages extends $protobuf.rpc.Service { + + /** + * Constructs a new Pages service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Pages service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Pages; + + /** + * Calls ListPages. + * @param request ListPagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPagesResponse + */ + public listPages(request: google.cloud.dialogflow.cx.v3.IListPagesRequest, callback: google.cloud.dialogflow.cx.v3.Pages.ListPagesCallback): void; + + /** + * Calls ListPages. + * @param request ListPagesRequest message or plain object + * @returns Promise + */ + public listPages(request: google.cloud.dialogflow.cx.v3.IListPagesRequest): Promise; + + /** + * Calls GetPage. + * @param request GetPageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Page + */ + public getPage(request: google.cloud.dialogflow.cx.v3.IGetPageRequest, callback: google.cloud.dialogflow.cx.v3.Pages.GetPageCallback): void; + + /** + * Calls GetPage. + * @param request GetPageRequest message or plain object + * @returns Promise + */ + public getPage(request: google.cloud.dialogflow.cx.v3.IGetPageRequest): Promise; + + /** + * Calls CreatePage. + * @param request CreatePageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Page + */ + public createPage(request: google.cloud.dialogflow.cx.v3.ICreatePageRequest, callback: google.cloud.dialogflow.cx.v3.Pages.CreatePageCallback): void; + + /** + * Calls CreatePage. + * @param request CreatePageRequest message or plain object + * @returns Promise + */ + public createPage(request: google.cloud.dialogflow.cx.v3.ICreatePageRequest): Promise; + + /** + * Calls UpdatePage. + * @param request UpdatePageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Page + */ + public updatePage(request: google.cloud.dialogflow.cx.v3.IUpdatePageRequest, callback: google.cloud.dialogflow.cx.v3.Pages.UpdatePageCallback): void; + + /** + * Calls UpdatePage. + * @param request UpdatePageRequest message or plain object + * @returns Promise + */ + public updatePage(request: google.cloud.dialogflow.cx.v3.IUpdatePageRequest): Promise; + + /** + * Calls DeletePage. + * @param request DeletePageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePage(request: google.cloud.dialogflow.cx.v3.IDeletePageRequest, callback: google.cloud.dialogflow.cx.v3.Pages.DeletePageCallback): void; + + /** + * Calls DeletePage. + * @param request DeletePageRequest message or plain object + * @returns Promise + */ + public deletePage(request: google.cloud.dialogflow.cx.v3.IDeletePageRequest): Promise; + } + + namespace Pages { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|listPages}. + * @param error Error, if any + * @param [response] ListPagesResponse + */ + type ListPagesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListPagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|getPage}. + * @param error Error, if any + * @param [response] Page + */ + type GetPageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Page) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|createPage}. + * @param error Error, if any + * @param [response] Page + */ + type CreatePageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Page) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|updatePage}. + * @param error Error, if any + * @param [response] Page + */ + type UpdatePageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Page) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|deletePage}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Page. */ + interface IPage { + + /** Page name */ + name?: (string|null); + + /** Page displayName */ + displayName?: (string|null); + + /** Page description */ + description?: (string|null); + + /** Page entryFulfillment */ + entryFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** Page form */ + form?: (google.cloud.dialogflow.cx.v3.IForm|null); + + /** Page transitionRouteGroups */ + transitionRouteGroups?: (string[]|null); + + /** Page transitionRoutes */ + transitionRoutes?: (google.cloud.dialogflow.cx.v3.ITransitionRoute[]|null); + + /** Page eventHandlers */ + eventHandlers?: (google.cloud.dialogflow.cx.v3.IEventHandler[]|null); + + /** Page advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Page knowledgeConnectorSettings */ + knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPage); + + /** Page name. */ + public name: string; + + /** Page displayName. */ + public displayName: string; + + /** Page description. */ + public description: string; + + /** Page entryFulfillment. */ + public entryFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** Page form. */ + public form?: (google.cloud.dialogflow.cx.v3.IForm|null); + + /** Page transitionRouteGroups. */ + public transitionRouteGroups: string[]; + + /** Page transitionRoutes. */ + public transitionRoutes: google.cloud.dialogflow.cx.v3.ITransitionRoute[]; + + /** Page eventHandlers. */ + public eventHandlers: google.cloud.dialogflow.cx.v3.IEventHandler[]; + + /** Page advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Page knowledgeConnectorSettings. */ + public knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null); + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPage): google.cloud.dialogflow.cx.v3.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @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.dialogflow.cx.v3.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @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.dialogflow.cx.v3.Page; + + /** + * Verifies a Page 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 Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Page + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Form. */ + interface IForm { + + /** Form parameters */ + parameters?: (google.cloud.dialogflow.cx.v3.Form.IParameter[]|null); + } + + /** Represents a Form. */ + class Form implements IForm { + + /** + * Constructs a new Form. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IForm); + + /** Form parameters. */ + public parameters: google.cloud.dialogflow.cx.v3.Form.IParameter[]; + + /** + * Creates a new Form instance using the specified properties. + * @param [properties] Properties to set + * @returns Form instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IForm): google.cloud.dialogflow.cx.v3.Form; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Form message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Form + * @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.dialogflow.cx.v3.Form; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Form + * @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.dialogflow.cx.v3.Form; + + /** + * Verifies a Form 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 Form message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Form + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Form; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @param message Form + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Form, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Form to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Form + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Form { + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter displayName */ + displayName?: (string|null); + + /** Parameter required */ + required?: (boolean|null); + + /** Parameter entityType */ + entityType?: (string|null); + + /** Parameter isList */ + isList?: (boolean|null); + + /** Parameter fillBehavior */ + fillBehavior?: (google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior|null); + + /** Parameter defaultValue */ + defaultValue?: (google.protobuf.IValue|null); + + /** Parameter redact */ + redact?: (boolean|null); + + /** Parameter advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Form.IParameter); + + /** Parameter displayName. */ + public displayName: string; + + /** Parameter required. */ + public required: boolean; + + /** Parameter entityType. */ + public entityType: string; + + /** Parameter isList. */ + public isList: boolean; + + /** Parameter fillBehavior. */ + public fillBehavior?: (google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior|null); + + /** Parameter defaultValue. */ + public defaultValue?: (google.protobuf.IValue|null); + + /** Parameter redact. */ + public redact: boolean; + + /** Parameter advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Form.IParameter): google.cloud.dialogflow.cx.v3.Form.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Form.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Form.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @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.dialogflow.cx.v3.Form.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @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.dialogflow.cx.v3.Form.Parameter; + + /** + * Verifies a Parameter 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 Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Form.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Form.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Parameter { + + /** Properties of a FillBehavior. */ + interface IFillBehavior { + + /** FillBehavior initialPromptFulfillment */ + initialPromptFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** FillBehavior repromptEventHandlers */ + repromptEventHandlers?: (google.cloud.dialogflow.cx.v3.IEventHandler[]|null); + } + + /** Represents a FillBehavior. */ + class FillBehavior implements IFillBehavior { + + /** + * Constructs a new FillBehavior. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior); + + /** FillBehavior initialPromptFulfillment. */ + public initialPromptFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** FillBehavior repromptEventHandlers. */ + public repromptEventHandlers: google.cloud.dialogflow.cx.v3.IEventHandler[]; + + /** + * Creates a new FillBehavior instance using the specified properties. + * @param [properties] Properties to set + * @returns FillBehavior instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior): google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior; + + /** + * Encodes the specified FillBehavior message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.verify|verify} messages. + * @param message FillBehavior message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FillBehavior message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.verify|verify} messages. + * @param message FillBehavior message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FillBehavior message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FillBehavior + * @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.dialogflow.cx.v3.Form.Parameter.FillBehavior; + + /** + * Decodes a FillBehavior message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FillBehavior + * @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.dialogflow.cx.v3.Form.Parameter.FillBehavior; + + /** + * Verifies a FillBehavior 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 FillBehavior message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FillBehavior + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior; + + /** + * Creates a plain object from a FillBehavior message. Also converts values to other types if specified. + * @param message FillBehavior + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FillBehavior to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FillBehavior + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an EventHandler. */ + interface IEventHandler { + + /** EventHandler name */ + name?: (string|null); + + /** EventHandler event */ + event?: (string|null); + + /** EventHandler triggerFulfillment */ + triggerFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** EventHandler targetPage */ + targetPage?: (string|null); + + /** EventHandler targetFlow */ + targetFlow?: (string|null); + + /** EventHandler targetPlaybook */ + targetPlaybook?: (string|null); + } + + /** Represents an EventHandler. */ + class EventHandler implements IEventHandler { + + /** + * Constructs a new EventHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IEventHandler); + + /** EventHandler name. */ + public name: string; + + /** EventHandler event. */ + public event: string; + + /** EventHandler triggerFulfillment. */ + public triggerFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** EventHandler targetPage. */ + public targetPage?: (string|null); + + /** EventHandler targetFlow. */ + public targetFlow?: (string|null); + + /** EventHandler targetPlaybook. */ + public targetPlaybook?: (string|null); + + /** EventHandler target. */ + public target?: ("targetPage"|"targetFlow"|"targetPlaybook"); + + /** + * Creates a new EventHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns EventHandler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IEventHandler): google.cloud.dialogflow.cx.v3.EventHandler; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventHandler + * @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.dialogflow.cx.v3.EventHandler; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventHandler + * @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.dialogflow.cx.v3.EventHandler; + + /** + * Verifies an EventHandler 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 EventHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventHandler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.EventHandler; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @param message EventHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.EventHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitionRoute. */ + interface ITransitionRoute { + + /** TransitionRoute name */ + name?: (string|null); + + /** TransitionRoute description */ + description?: (string|null); + + /** TransitionRoute intent */ + intent?: (string|null); + + /** TransitionRoute condition */ + condition?: (string|null); + + /** TransitionRoute triggerFulfillment */ + triggerFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** TransitionRoute targetPage */ + targetPage?: (string|null); + + /** TransitionRoute targetFlow */ + targetFlow?: (string|null); + } + + /** Represents a TransitionRoute. */ + class TransitionRoute implements ITransitionRoute { + + /** + * Constructs a new TransitionRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITransitionRoute); + + /** TransitionRoute name. */ + public name: string; + + /** TransitionRoute description. */ + public description: string; + + /** TransitionRoute intent. */ + public intent: string; + + /** TransitionRoute condition. */ + public condition: string; + + /** TransitionRoute triggerFulfillment. */ + public triggerFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** TransitionRoute targetPage. */ + public targetPage?: (string|null); + + /** TransitionRoute targetFlow. */ + public targetFlow?: (string|null); + + /** TransitionRoute target. */ + public target?: ("targetPage"|"targetFlow"); + + /** + * Creates a new TransitionRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionRoute instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITransitionRoute): google.cloud.dialogflow.cx.v3.TransitionRoute; + + /** + * Encodes the specified TransitionRoute message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRoute.verify|verify} messages. + * @param message TransitionRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITransitionRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionRoute message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRoute.verify|verify} messages. + * @param message TransitionRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITransitionRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionRoute + * @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.dialogflow.cx.v3.TransitionRoute; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionRoute + * @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.dialogflow.cx.v3.TransitionRoute; + + /** + * Verifies a TransitionRoute 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 TransitionRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionRoute; + + /** + * Creates a plain object from a TransitionRoute message. Also converts values to other types if specified. + * @param message TransitionRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPagesRequest. */ + interface IListPagesRequest { + + /** ListPagesRequest parent */ + parent?: (string|null); + + /** ListPagesRequest languageCode */ + languageCode?: (string|null); + + /** ListPagesRequest pageSize */ + pageSize?: (number|null); + + /** ListPagesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPagesRequest. */ + class ListPagesRequest implements IListPagesRequest { + + /** + * Constructs a new ListPagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListPagesRequest); + + /** ListPagesRequest parent. */ + public parent: string; + + /** ListPagesRequest languageCode. */ + public languageCode: string; + + /** ListPagesRequest pageSize. */ + public pageSize: number; + + /** ListPagesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPagesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListPagesRequest): google.cloud.dialogflow.cx.v3.ListPagesRequest; + + /** + * Encodes the specified ListPagesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesRequest.verify|verify} messages. + * @param message ListPagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListPagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesRequest.verify|verify} messages. + * @param message ListPagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListPagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPagesRequest + * @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.dialogflow.cx.v3.ListPagesRequest; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPagesRequest + * @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.dialogflow.cx.v3.ListPagesRequest; + + /** + * Verifies a ListPagesRequest 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 ListPagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListPagesRequest; + + /** + * Creates a plain object from a ListPagesRequest message. Also converts values to other types if specified. + * @param message ListPagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListPagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPagesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPagesResponse. */ + interface IListPagesResponse { + + /** ListPagesResponse pages */ + pages?: (google.cloud.dialogflow.cx.v3.IPage[]|null); + + /** ListPagesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPagesResponse. */ + class ListPagesResponse implements IListPagesResponse { + + /** + * Constructs a new ListPagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListPagesResponse); + + /** ListPagesResponse pages. */ + public pages: google.cloud.dialogflow.cx.v3.IPage[]; + + /** ListPagesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPagesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListPagesResponse): google.cloud.dialogflow.cx.v3.ListPagesResponse; + + /** + * Encodes the specified ListPagesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesResponse.verify|verify} messages. + * @param message ListPagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListPagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesResponse.verify|verify} messages. + * @param message ListPagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListPagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPagesResponse + * @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.dialogflow.cx.v3.ListPagesResponse; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPagesResponse + * @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.dialogflow.cx.v3.ListPagesResponse; + + /** + * Verifies a ListPagesResponse 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 ListPagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListPagesResponse; + + /** + * Creates a plain object from a ListPagesResponse message. Also converts values to other types if specified. + * @param message ListPagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListPagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPagesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPageRequest. */ + interface IGetPageRequest { + + /** GetPageRequest name */ + name?: (string|null); + + /** GetPageRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetPageRequest. */ + class GetPageRequest implements IGetPageRequest { + + /** + * Constructs a new GetPageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetPageRequest); + + /** GetPageRequest name. */ + public name: string; + + /** GetPageRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetPageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetPageRequest): google.cloud.dialogflow.cx.v3.GetPageRequest; + + /** + * Encodes the specified GetPageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPageRequest.verify|verify} messages. + * @param message GetPageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPageRequest.verify|verify} messages. + * @param message GetPageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPageRequest + * @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.dialogflow.cx.v3.GetPageRequest; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPageRequest + * @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.dialogflow.cx.v3.GetPageRequest; + + /** + * Verifies a GetPageRequest 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 GetPageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetPageRequest; + + /** + * Creates a plain object from a GetPageRequest message. Also converts values to other types if specified. + * @param message GetPageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetPageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreatePageRequest. */ + interface ICreatePageRequest { + + /** CreatePageRequest parent */ + parent?: (string|null); + + /** CreatePageRequest page */ + page?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** CreatePageRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreatePageRequest. */ + class CreatePageRequest implements ICreatePageRequest { + + /** + * Constructs a new CreatePageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreatePageRequest); + + /** CreatePageRequest parent. */ + public parent: string; + + /** CreatePageRequest page. */ + public page?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** CreatePageRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreatePageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreatePageRequest): google.cloud.dialogflow.cx.v3.CreatePageRequest; + + /** + * Encodes the specified CreatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePageRequest.verify|verify} messages. + * @param message CreatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePageRequest.verify|verify} messages. + * @param message CreatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePageRequest + * @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.dialogflow.cx.v3.CreatePageRequest; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePageRequest + * @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.dialogflow.cx.v3.CreatePageRequest; + + /** + * Verifies a CreatePageRequest 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 CreatePageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreatePageRequest; + + /** + * Creates a plain object from a CreatePageRequest message. Also converts values to other types if specified. + * @param message CreatePageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreatePageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePageRequest. */ + interface IUpdatePageRequest { + + /** UpdatePageRequest page */ + page?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** UpdatePageRequest languageCode */ + languageCode?: (string|null); + + /** UpdatePageRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePageRequest. */ + class UpdatePageRequest implements IUpdatePageRequest { + + /** + * Constructs a new UpdatePageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdatePageRequest); + + /** UpdatePageRequest page. */ + public page?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** UpdatePageRequest languageCode. */ + public languageCode: string; + + /** UpdatePageRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdatePageRequest): google.cloud.dialogflow.cx.v3.UpdatePageRequest; + + /** + * Encodes the specified UpdatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePageRequest.verify|verify} messages. + * @param message UpdatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePageRequest.verify|verify} messages. + * @param message UpdatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePageRequest + * @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.dialogflow.cx.v3.UpdatePageRequest; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePageRequest + * @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.dialogflow.cx.v3.UpdatePageRequest; + + /** + * Verifies an UpdatePageRequest 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 UpdatePageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdatePageRequest; + + /** + * Creates a plain object from an UpdatePageRequest message. Also converts values to other types if specified. + * @param message UpdatePageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdatePageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePageRequest. */ + interface IDeletePageRequest { + + /** DeletePageRequest name */ + name?: (string|null); + + /** DeletePageRequest force */ + force?: (boolean|null); + } + + /** Represents a DeletePageRequest. */ + class DeletePageRequest implements IDeletePageRequest { + + /** + * Constructs a new DeletePageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeletePageRequest); + + /** DeletePageRequest name. */ + public name: string; + + /** DeletePageRequest force. */ + public force: boolean; + + /** + * Creates a new DeletePageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeletePageRequest): google.cloud.dialogflow.cx.v3.DeletePageRequest; + + /** + * Encodes the specified DeletePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePageRequest.verify|verify} messages. + * @param message DeletePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeletePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePageRequest.verify|verify} messages. + * @param message DeletePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeletePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePageRequest + * @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.dialogflow.cx.v3.DeletePageRequest; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePageRequest + * @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.dialogflow.cx.v3.DeletePageRequest; + + /** + * Verifies a DeletePageRequest 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 DeletePageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeletePageRequest; + + /** + * Creates a plain object from a DeletePageRequest message. Also converts values to other types if specified. + * @param message DeletePageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeletePageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KnowledgeConnectorSettings. */ + interface IKnowledgeConnectorSettings { + + /** KnowledgeConnectorSettings enabled */ + enabled?: (boolean|null); + + /** KnowledgeConnectorSettings triggerFulfillment */ + triggerFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** KnowledgeConnectorSettings targetPage */ + targetPage?: (string|null); + + /** KnowledgeConnectorSettings targetFlow */ + targetFlow?: (string|null); + + /** KnowledgeConnectorSettings dataStoreConnections */ + dataStoreConnections?: (google.cloud.dialogflow.cx.v3.IDataStoreConnection[]|null); + } + + /** Represents a KnowledgeConnectorSettings. */ + class KnowledgeConnectorSettings implements IKnowledgeConnectorSettings { + + /** + * Constructs a new KnowledgeConnectorSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings); + + /** KnowledgeConnectorSettings enabled. */ + public enabled: boolean; + + /** KnowledgeConnectorSettings triggerFulfillment. */ + public triggerFulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** KnowledgeConnectorSettings targetPage. */ + public targetPage?: (string|null); + + /** KnowledgeConnectorSettings targetFlow. */ + public targetFlow?: (string|null); + + /** KnowledgeConnectorSettings dataStoreConnections. */ + public dataStoreConnections: google.cloud.dialogflow.cx.v3.IDataStoreConnection[]; + + /** KnowledgeConnectorSettings target. */ + public target?: ("targetPage"|"targetFlow"); + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeConnectorSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings): google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3.KnowledgeConnectorSettings; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3.KnowledgeConnectorSettings; + + /** + * Verifies a KnowledgeConnectorSettings 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 KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeConnectorSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @param message KnowledgeConnectorSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreConnection. */ + interface IDataStoreConnection { + + /** DataStoreConnection dataStoreType */ + dataStoreType?: (google.cloud.dialogflow.cx.v3.DataStoreType|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreType|null); + + /** DataStoreConnection dataStore */ + dataStore?: (string|null); + + /** DataStoreConnection documentProcessingMode */ + documentProcessingMode?: (google.cloud.dialogflow.cx.v3.DocumentProcessingMode|keyof typeof google.cloud.dialogflow.cx.v3.DocumentProcessingMode|null); + } + + /** Represents a DataStoreConnection. */ + class DataStoreConnection implements IDataStoreConnection { + + /** + * Constructs a new DataStoreConnection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDataStoreConnection); + + /** DataStoreConnection dataStoreType. */ + public dataStoreType: (google.cloud.dialogflow.cx.v3.DataStoreType|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreType); + + /** DataStoreConnection dataStore. */ + public dataStore: string; + + /** DataStoreConnection documentProcessingMode. */ + public documentProcessingMode: (google.cloud.dialogflow.cx.v3.DocumentProcessingMode|keyof typeof google.cloud.dialogflow.cx.v3.DocumentProcessingMode); + + /** + * Creates a new DataStoreConnection instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreConnection instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDataStoreConnection): google.cloud.dialogflow.cx.v3.DataStoreConnection; + + /** + * Encodes the specified DataStoreConnection message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnection.verify|verify} messages. + * @param message DataStoreConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDataStoreConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreConnection message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnection.verify|verify} messages. + * @param message DataStoreConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDataStoreConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreConnection + * @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.dialogflow.cx.v3.DataStoreConnection; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreConnection + * @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.dialogflow.cx.v3.DataStoreConnection; + + /** + * Verifies a DataStoreConnection 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 DataStoreConnection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreConnection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnection; + + /** + * Creates a plain object from a DataStoreConnection message. Also converts values to other types if specified. + * @param message DataStoreConnection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreConnection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreConnection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataStoreType enum. */ + enum DataStoreType { + DATA_STORE_TYPE_UNSPECIFIED = 0, + PUBLIC_WEB = 1, + UNSTRUCTURED = 2, + STRUCTURED = 3 + } + + /** Properties of a DataStoreConnectionSignals. */ + interface IDataStoreConnectionSignals { + + /** DataStoreConnectionSignals rewriterModelCallSignals */ + rewriterModelCallSignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals|null); + + /** DataStoreConnectionSignals rewrittenQuery */ + rewrittenQuery?: (string|null); + + /** DataStoreConnectionSignals searchSnippets */ + searchSnippets?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet[]|null); + + /** DataStoreConnectionSignals answerGenerationModelCallSignals */ + answerGenerationModelCallSignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null); + + /** DataStoreConnectionSignals answer */ + answer?: (string|null); + + /** DataStoreConnectionSignals answerParts */ + answerParts?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart[]|null); + + /** DataStoreConnectionSignals citedSnippets */ + citedSnippets?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet[]|null); + + /** DataStoreConnectionSignals groundingSignals */ + groundingSignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals|null); + + /** DataStoreConnectionSignals safetySignals */ + safetySignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals|null); + } + + /** Represents a DataStoreConnectionSignals. */ + class DataStoreConnectionSignals implements IDataStoreConnectionSignals { + + /** + * Constructs a new DataStoreConnectionSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals); + + /** DataStoreConnectionSignals rewriterModelCallSignals. */ + public rewriterModelCallSignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals|null); + + /** DataStoreConnectionSignals rewrittenQuery. */ + public rewrittenQuery: string; + + /** DataStoreConnectionSignals searchSnippets. */ + public searchSnippets: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet[]; + + /** DataStoreConnectionSignals answerGenerationModelCallSignals. */ + public answerGenerationModelCallSignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null); + + /** DataStoreConnectionSignals answer. */ + public answer: string; + + /** DataStoreConnectionSignals answerParts. */ + public answerParts: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart[]; + + /** DataStoreConnectionSignals citedSnippets. */ + public citedSnippets: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet[]; + + /** DataStoreConnectionSignals groundingSignals. */ + public groundingSignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals|null); + + /** DataStoreConnectionSignals safetySignals. */ + public safetySignals?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals|null); + + /** + * Creates a new DataStoreConnectionSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreConnectionSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals; + + /** + * Encodes the specified DataStoreConnectionSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.verify|verify} messages. + * @param message DataStoreConnectionSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreConnectionSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.verify|verify} messages. + * @param message DataStoreConnectionSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreConnectionSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreConnectionSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals; + + /** + * Verifies a DataStoreConnectionSignals 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 DataStoreConnectionSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreConnectionSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals; + + /** + * Creates a plain object from a DataStoreConnectionSignals message. Also converts values to other types if specified. + * @param message DataStoreConnectionSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreConnectionSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreConnectionSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreConnectionSignals { + + /** Properties of a RewriterModelCallSignals. */ + interface IRewriterModelCallSignals { + + /** RewriterModelCallSignals renderedPrompt */ + renderedPrompt?: (string|null); + + /** RewriterModelCallSignals modelOutput */ + modelOutput?: (string|null); + + /** RewriterModelCallSignals model */ + model?: (string|null); + } + + /** Represents a RewriterModelCallSignals. */ + class RewriterModelCallSignals implements IRewriterModelCallSignals { + + /** + * Constructs a new RewriterModelCallSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals); + + /** RewriterModelCallSignals renderedPrompt. */ + public renderedPrompt: string; + + /** RewriterModelCallSignals modelOutput. */ + public modelOutput: string; + + /** RewriterModelCallSignals model. */ + public model: string; + + /** + * Creates a new RewriterModelCallSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns RewriterModelCallSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Encodes the specified RewriterModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @param message RewriterModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RewriterModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @param message RewriterModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RewriterModelCallSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RewriterModelCallSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Verifies a RewriterModelCallSignals 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 RewriterModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RewriterModelCallSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Creates a plain object from a RewriterModelCallSignals message. Also converts values to other types if specified. + * @param message RewriterModelCallSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RewriterModelCallSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RewriterModelCallSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchSnippet. */ + interface ISearchSnippet { + + /** SearchSnippet documentTitle */ + documentTitle?: (string|null); + + /** SearchSnippet documentUri */ + documentUri?: (string|null); + + /** SearchSnippet text */ + text?: (string|null); + + /** SearchSnippet metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents a SearchSnippet. */ + class SearchSnippet implements ISearchSnippet { + + /** + * Constructs a new SearchSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet); + + /** SearchSnippet documentTitle. */ + public documentTitle: string; + + /** SearchSnippet documentUri. */ + public documentUri: string; + + /** SearchSnippet text. */ + public text: string; + + /** SearchSnippet metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new SearchSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchSnippet instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet; + + /** + * Encodes the specified SearchSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @param message SearchSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @param message SearchSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchSnippet + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchSnippet + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet; + + /** + * Verifies a SearchSnippet 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 SearchSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet; + + /** + * Creates a plain object from a SearchSnippet message. Also converts values to other types if specified. + * @param message SearchSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnswerGenerationModelCallSignals. */ + interface IAnswerGenerationModelCallSignals { + + /** AnswerGenerationModelCallSignals renderedPrompt */ + renderedPrompt?: (string|null); + + /** AnswerGenerationModelCallSignals modelOutput */ + modelOutput?: (string|null); + + /** AnswerGenerationModelCallSignals model */ + model?: (string|null); + } + + /** Represents an AnswerGenerationModelCallSignals. */ + class AnswerGenerationModelCallSignals implements IAnswerGenerationModelCallSignals { + + /** + * Constructs a new AnswerGenerationModelCallSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals); + + /** AnswerGenerationModelCallSignals renderedPrompt. */ + public renderedPrompt: string; + + /** AnswerGenerationModelCallSignals modelOutput. */ + public modelOutput: string; + + /** AnswerGenerationModelCallSignals model. */ + public model: string; + + /** + * Creates a new AnswerGenerationModelCallSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerGenerationModelCallSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @param message AnswerGenerationModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @param message AnswerGenerationModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerGenerationModelCallSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerGenerationModelCallSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Verifies an AnswerGenerationModelCallSignals 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 AnswerGenerationModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerGenerationModelCallSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Creates a plain object from an AnswerGenerationModelCallSignals message. Also converts values to other types if specified. + * @param message AnswerGenerationModelCallSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerGenerationModelCallSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerGenerationModelCallSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnswerPart. */ + interface IAnswerPart { + + /** AnswerPart text */ + text?: (string|null); + + /** AnswerPart supportingIndices */ + supportingIndices?: (number[]|null); + } + + /** Represents an AnswerPart. */ + class AnswerPart implements IAnswerPart { + + /** + * Constructs a new AnswerPart. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart); + + /** AnswerPart text. */ + public text: string; + + /** AnswerPart supportingIndices. */ + public supportingIndices: number[]; + + /** + * Creates a new AnswerPart instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerPart instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart; + + /** + * Encodes the specified AnswerPart message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @param message AnswerPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerPart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @param message AnswerPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerPart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerPart + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart; + + /** + * Decodes an AnswerPart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerPart + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart; + + /** + * Verifies an AnswerPart 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 AnswerPart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerPart + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart; + + /** + * Creates a plain object from an AnswerPart message. Also converts values to other types if specified. + * @param message AnswerPart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerPart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerPart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CitedSnippet. */ + interface ICitedSnippet { + + /** CitedSnippet searchSnippet */ + searchSnippet?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet|null); + + /** CitedSnippet snippetIndex */ + snippetIndex?: (number|null); + } + + /** Represents a CitedSnippet. */ + class CitedSnippet implements ICitedSnippet { + + /** + * Constructs a new CitedSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet); + + /** CitedSnippet searchSnippet. */ + public searchSnippet?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet|null); + + /** CitedSnippet snippetIndex. */ + public snippetIndex: number; + + /** + * Creates a new CitedSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns CitedSnippet instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet; + + /** + * Encodes the specified CitedSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @param message CitedSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitedSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @param message CitedSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitedSnippet + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitedSnippet + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet; + + /** + * Verifies a CitedSnippet 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 CitedSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitedSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet; + + /** + * Creates a plain object from a CitedSnippet message. Also converts values to other types if specified. + * @param message CitedSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitedSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CitedSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingSignals. */ + interface IGroundingSignals { + + /** GroundingSignals decision */ + decision?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|null); + + /** GroundingSignals score */ + score?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|null); + } + + /** Represents a GroundingSignals. */ + class GroundingSignals implements IGroundingSignals { + + /** + * Constructs a new GroundingSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals); + + /** GroundingSignals decision. */ + public decision: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision); + + /** GroundingSignals score. */ + public score: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket); + + /** + * Creates a new GroundingSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals; + + /** + * Encodes the specified GroundingSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @param message GroundingSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @param message GroundingSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingSignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals; + + /** + * Verifies a GroundingSignals 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 GroundingSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals; + + /** + * Creates a plain object from a GroundingSignals message. Also converts values to other types if specified. + * @param message GroundingSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GroundingSignals { + + /** GroundingDecision enum. */ + enum GroundingDecision { + GROUNDING_DECISION_UNSPECIFIED = 0, + ACCEPTED_BY_GROUNDING = 1, + REJECTED_BY_GROUNDING = 2 + } + + /** GroundingScoreBucket enum. */ + enum GroundingScoreBucket { + GROUNDING_SCORE_BUCKET_UNSPECIFIED = 0, + VERY_LOW = 1, + LOW = 3, + MEDIUM = 4, + HIGH = 5, + VERY_HIGH = 6 + } + } + + /** Properties of a SafetySignals. */ + interface ISafetySignals { + + /** SafetySignals decision */ + decision?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision|null); + + /** SafetySignals bannedPhraseMatch */ + bannedPhraseMatch?: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|null); + + /** SafetySignals matchedBannedPhrase */ + matchedBannedPhrase?: (string|null); + } + + /** Represents a SafetySignals. */ + class SafetySignals implements ISafetySignals { + + /** + * Constructs a new SafetySignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals); + + /** SafetySignals decision. */ + public decision: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision); + + /** SafetySignals bannedPhraseMatch. */ + public bannedPhraseMatch: (google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|keyof typeof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch); + + /** SafetySignals matchedBannedPhrase. */ + public matchedBannedPhrase: string; + + /** + * Creates a new SafetySignals instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals; + + /** + * Encodes the specified SafetySignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @param message SafetySignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @param message SafetySignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals; + + /** + * Decodes a SafetySignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySignals + * @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.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals; + + /** + * Verifies a SafetySignals 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 SafetySignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals; + + /** + * Creates a plain object from a SafetySignals message. Also converts values to other types if specified. + * @param message SafetySignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetySignals { + + /** SafetyDecision enum. */ + enum SafetyDecision { + SAFETY_DECISION_UNSPECIFIED = 0, + ACCEPTED_BY_SAFETY_CHECK = 1, + REJECTED_BY_SAFETY_CHECK = 2 + } + + /** BannedPhraseMatch enum. */ + enum BannedPhraseMatch { + BANNED_PHRASE_MATCH_UNSPECIFIED = 0, + BANNED_PHRASE_MATCH_NONE = 1, + BANNED_PHRASE_MATCH_QUERY = 2, + BANNED_PHRASE_MATCH_RESPONSE = 3 + } + } + } + + /** DocumentProcessingMode enum. */ + enum DocumentProcessingMode { + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0, + DOCUMENTS = 1, + CHUNKS = 2 + } + + /** Properties of a Fulfillment. */ + interface IFulfillment { + + /** Fulfillment messages */ + messages?: (google.cloud.dialogflow.cx.v3.IResponseMessage[]|null); + + /** Fulfillment webhook */ + webhook?: (string|null); + + /** Fulfillment returnPartialResponses */ + returnPartialResponses?: (boolean|null); + + /** Fulfillment tag */ + tag?: (string|null); + + /** Fulfillment setParameterActions */ + setParameterActions?: (google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction[]|null); + + /** Fulfillment conditionalCases */ + conditionalCases?: (google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases[]|null); + + /** Fulfillment advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Fulfillment enableGenerativeFallback */ + enableGenerativeFallback?: (boolean|null); + + /** Fulfillment generators */ + generators?: (google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings[]|null); + } + + /** Represents a Fulfillment. */ + class Fulfillment implements IFulfillment { + + /** + * Constructs a new Fulfillment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFulfillment); + + /** Fulfillment messages. */ + public messages: google.cloud.dialogflow.cx.v3.IResponseMessage[]; + + /** Fulfillment webhook. */ + public webhook: string; + + /** Fulfillment returnPartialResponses. */ + public returnPartialResponses: boolean; + + /** Fulfillment tag. */ + public tag: string; + + /** Fulfillment setParameterActions. */ + public setParameterActions: google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction[]; + + /** Fulfillment conditionalCases. */ + public conditionalCases: google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases[]; + + /** Fulfillment advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** Fulfillment enableGenerativeFallback. */ + public enableGenerativeFallback: boolean; + + /** Fulfillment generators. */ + public generators: google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings[]; + + /** + * Creates a new Fulfillment instance using the specified properties. + * @param [properties] Properties to set + * @returns Fulfillment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFulfillment): google.cloud.dialogflow.cx.v3.Fulfillment; + + /** + * Encodes the specified Fulfillment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.verify|verify} messages. + * @param message Fulfillment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFulfillment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Fulfillment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.verify|verify} messages. + * @param message Fulfillment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFulfillment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fulfillment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fulfillment + * @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.dialogflow.cx.v3.Fulfillment; + + /** + * Decodes a Fulfillment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fulfillment + * @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.dialogflow.cx.v3.Fulfillment; + + /** + * Verifies a Fulfillment 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 Fulfillment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fulfillment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Fulfillment; + + /** + * Creates a plain object from a Fulfillment message. Also converts values to other types if specified. + * @param message Fulfillment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Fulfillment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Fulfillment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Fulfillment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Fulfillment { + + /** Properties of a SetParameterAction. */ + interface ISetParameterAction { + + /** SetParameterAction parameter */ + parameter?: (string|null); + + /** SetParameterAction value */ + value?: (google.protobuf.IValue|null); + } + + /** Represents a SetParameterAction. */ + class SetParameterAction implements ISetParameterAction { + + /** + * Constructs a new SetParameterAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction); + + /** SetParameterAction parameter. */ + public parameter: string; + + /** SetParameterAction value. */ + public value?: (google.protobuf.IValue|null); + + /** + * Creates a new SetParameterAction instance using the specified properties. + * @param [properties] Properties to set + * @returns SetParameterAction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction): google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction; + + /** + * Encodes the specified SetParameterAction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.verify|verify} messages. + * @param message SetParameterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetParameterAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.verify|verify} messages. + * @param message SetParameterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetParameterAction + * @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.dialogflow.cx.v3.Fulfillment.SetParameterAction; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetParameterAction + * @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.dialogflow.cx.v3.Fulfillment.SetParameterAction; + + /** + * Verifies a SetParameterAction 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 SetParameterAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetParameterAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction; + + /** + * Creates a plain object from a SetParameterAction message. Also converts values to other types if specified. + * @param message SetParameterAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetParameterAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetParameterAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConditionalCases. */ + interface IConditionalCases { + + /** ConditionalCases cases */ + cases?: (google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase[]|null); + } + + /** Represents a ConditionalCases. */ + class ConditionalCases implements IConditionalCases { + + /** + * Constructs a new ConditionalCases. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases); + + /** ConditionalCases cases. */ + public cases: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase[]; + + /** + * Creates a new ConditionalCases instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionalCases instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases): google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases; + + /** + * Encodes the specified ConditionalCases message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.verify|verify} messages. + * @param message ConditionalCases message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionalCases message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.verify|verify} messages. + * @param message ConditionalCases message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionalCases + * @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.dialogflow.cx.v3.Fulfillment.ConditionalCases; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionalCases + * @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.dialogflow.cx.v3.Fulfillment.ConditionalCases; + + /** + * Verifies a ConditionalCases 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 ConditionalCases message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionalCases + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases; + + /** + * Creates a plain object from a ConditionalCases message. Also converts values to other types if specified. + * @param message ConditionalCases + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionalCases to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionalCases + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionalCases { + + /** Properties of a Case. */ + interface ICase { + + /** Case condition */ + condition?: (string|null); + + /** Case caseContent */ + caseContent?: (google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent[]|null); + } + + /** Represents a Case. */ + class Case implements ICase { + + /** + * Constructs a new Case. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase); + + /** Case condition. */ + public condition: string; + + /** Case caseContent. */ + public caseContent: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent[]; + + /** + * Creates a new Case instance using the specified properties. + * @param [properties] Properties to set + * @returns Case instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase): google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Case message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Case + * @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.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Case + * @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.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case; + + /** + * Verifies a Case 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 Case message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Case + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @param message Case + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Case to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Case + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Case { + + /** Properties of a CaseContent. */ + interface ICaseContent { + + /** CaseContent message */ + message?: (google.cloud.dialogflow.cx.v3.IResponseMessage|null); + + /** CaseContent additionalCases */ + additionalCases?: (google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases|null); + } + + /** Represents a CaseContent. */ + class CaseContent implements ICaseContent { + + /** + * Constructs a new CaseContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent); + + /** CaseContent message. */ + public message?: (google.cloud.dialogflow.cx.v3.IResponseMessage|null); + + /** CaseContent additionalCases. */ + public additionalCases?: (google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases|null); + + /** CaseContent casesOrMessage. */ + public casesOrMessage?: ("message"|"additionalCases"); + + /** + * Creates a new CaseContent instance using the specified properties. + * @param [properties] Properties to set + * @returns CaseContent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent): google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Encodes the specified CaseContent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @param message CaseContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaseContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @param message CaseContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaseContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaseContent + * @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.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Decodes a CaseContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaseContent + * @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.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Verifies a CaseContent 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 CaseContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaseContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Creates a plain object from a CaseContent message. Also converts values to other types if specified. + * @param message CaseContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaseContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaseContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a GeneratorSettings. */ + interface IGeneratorSettings { + + /** GeneratorSettings generator */ + generator?: (string|null); + + /** GeneratorSettings inputParameters */ + inputParameters?: ({ [k: string]: string }|null); + + /** GeneratorSettings outputParameter */ + outputParameter?: (string|null); + } + + /** Represents a GeneratorSettings. */ + class GeneratorSettings implements IGeneratorSettings { + + /** + * Constructs a new GeneratorSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings); + + /** GeneratorSettings generator. */ + public generator: string; + + /** GeneratorSettings inputParameters. */ + public inputParameters: { [k: string]: string }; + + /** GeneratorSettings outputParameter. */ + public outputParameter: string; + + /** + * Creates a new GeneratorSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratorSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings): google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings; + + /** + * Encodes the specified GeneratorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.verify|verify} messages. + * @param message GeneratorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.verify|verify} messages. + * @param message GeneratorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratorSettings + * @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.dialogflow.cx.v3.Fulfillment.GeneratorSettings; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratorSettings + * @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.dialogflow.cx.v3.Fulfillment.GeneratorSettings; + + /** + * Verifies a GeneratorSettings 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 GeneratorSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratorSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings; + + /** + * Creates a plain object from a GeneratorSettings message. Also converts values to other types if specified. + * @param message GeneratorSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratorSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratorSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResponseMessage. */ + interface IResponseMessage { + + /** ResponseMessage text */ + text?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IText|null); + + /** ResponseMessage payload */ + payload?: (google.protobuf.IStruct|null); + + /** ResponseMessage conversationSuccess */ + conversationSuccess?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess|null); + + /** ResponseMessage outputAudioText */ + outputAudioText?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText|null); + + /** ResponseMessage liveAgentHandoff */ + liveAgentHandoff?: (google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff|null); + + /** ResponseMessage endInteraction */ + endInteraction?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction|null); + + /** ResponseMessage playAudio */ + playAudio?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio|null); + + /** ResponseMessage mixedAudio */ + mixedAudio?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio|null); + + /** ResponseMessage telephonyTransferCall */ + telephonyTransferCall?: (google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall|null); + + /** ResponseMessage knowledgeInfoCard */ + knowledgeInfoCard?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard|null); + + /** ResponseMessage toolCall */ + toolCall?: (google.cloud.dialogflow.cx.v3.IToolCall|null); + + /** ResponseMessage responseType */ + responseType?: (google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType|null); + + /** ResponseMessage channel */ + channel?: (string|null); + } + + /** Represents a ResponseMessage. */ + class ResponseMessage implements IResponseMessage { + + /** + * Constructs a new ResponseMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IResponseMessage); + + /** ResponseMessage text. */ + public text?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IText|null); + + /** ResponseMessage payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** ResponseMessage conversationSuccess. */ + public conversationSuccess?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess|null); + + /** ResponseMessage outputAudioText. */ + public outputAudioText?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText|null); + + /** ResponseMessage liveAgentHandoff. */ + public liveAgentHandoff?: (google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff|null); + + /** ResponseMessage endInteraction. */ + public endInteraction?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction|null); + + /** ResponseMessage playAudio. */ + public playAudio?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio|null); + + /** ResponseMessage mixedAudio. */ + public mixedAudio?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio|null); + + /** ResponseMessage telephonyTransferCall. */ + public telephonyTransferCall?: (google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall|null); + + /** ResponseMessage knowledgeInfoCard. */ + public knowledgeInfoCard?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard|null); + + /** ResponseMessage toolCall. */ + public toolCall?: (google.cloud.dialogflow.cx.v3.IToolCall|null); + + /** ResponseMessage responseType. */ + public responseType: (google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType); + + /** ResponseMessage channel. */ + public channel: string; + + /** ResponseMessage message. */ + public message?: ("text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"|"toolCall"); + + /** + * Creates a new ResponseMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMessage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IResponseMessage): google.cloud.dialogflow.cx.v3.ResponseMessage; + + /** + * Encodes the specified ResponseMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.verify|verify} messages. + * @param message ResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.verify|verify} messages. + * @param message ResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMessage + * @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.dialogflow.cx.v3.ResponseMessage; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMessage + * @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.dialogflow.cx.v3.ResponseMessage; + + /** + * Verifies a ResponseMessage 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 ResponseMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage; + + /** + * Creates a plain object from a ResponseMessage message. Also converts values to other types if specified. + * @param message ResponseMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResponseMessage { + + /** Properties of a Text. */ + interface IText { + + /** Text text */ + text?: (string[]|null); + + /** Text allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents a Text. */ + class Text implements IText { + + /** + * Constructs a new Text. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IText); + + /** Text text. */ + public text: string[]; + + /** Text allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** + * Creates a new Text instance using the specified properties. + * @param [properties] Properties to set + * @returns Text instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IText): google.cloud.dialogflow.cx.v3.ResponseMessage.Text; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Text message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Text + * @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.dialogflow.cx.v3.ResponseMessage.Text; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Text + * @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.dialogflow.cx.v3.ResponseMessage.Text; + + /** + * Verifies a Text 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 Text message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Text + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.Text; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @param message Text + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Text to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Text + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LiveAgentHandoff. */ + interface ILiveAgentHandoff { + + /** LiveAgentHandoff metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents a LiveAgentHandoff. */ + class LiveAgentHandoff implements ILiveAgentHandoff { + + /** + * Constructs a new LiveAgentHandoff. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff); + + /** LiveAgentHandoff metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new LiveAgentHandoff instance using the specified properties. + * @param [properties] Properties to set + * @returns LiveAgentHandoff instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff): google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff; + + /** + * Encodes the specified LiveAgentHandoff message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @param message LiveAgentHandoff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LiveAgentHandoff message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @param message LiveAgentHandoff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LiveAgentHandoff + * @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.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LiveAgentHandoff + * @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.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff; + + /** + * Verifies a LiveAgentHandoff 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 LiveAgentHandoff message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LiveAgentHandoff + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff; + + /** + * Creates a plain object from a LiveAgentHandoff message. Also converts values to other types if specified. + * @param message LiveAgentHandoff + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LiveAgentHandoff to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LiveAgentHandoff + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationSuccess. */ + interface IConversationSuccess { + + /** ConversationSuccess metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents a ConversationSuccess. */ + class ConversationSuccess implements IConversationSuccess { + + /** + * Constructs a new ConversationSuccess. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess); + + /** ConversationSuccess metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new ConversationSuccess instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationSuccess instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess): google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess; + + /** + * Encodes the specified ConversationSuccess message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @param message ConversationSuccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationSuccess message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @param message ConversationSuccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationSuccess + * @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.dialogflow.cx.v3.ResponseMessage.ConversationSuccess; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationSuccess + * @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.dialogflow.cx.v3.ResponseMessage.ConversationSuccess; + + /** + * Verifies a ConversationSuccess 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 ConversationSuccess message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationSuccess + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess; + + /** + * Creates a plain object from a ConversationSuccess message. Also converts values to other types if specified. + * @param message ConversationSuccess + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationSuccess to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationSuccess + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputAudioText. */ + interface IOutputAudioText { + + /** OutputAudioText text */ + text?: (string|null); + + /** OutputAudioText ssml */ + ssml?: (string|null); + + /** OutputAudioText allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents an OutputAudioText. */ + class OutputAudioText implements IOutputAudioText { + + /** + * Constructs a new OutputAudioText. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText); + + /** OutputAudioText text. */ + public text?: (string|null); + + /** OutputAudioText ssml. */ + public ssml?: (string|null); + + /** OutputAudioText allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** OutputAudioText source. */ + public source?: ("text"|"ssml"); + + /** + * Creates a new OutputAudioText instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioText instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText): google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText; + + /** + * Encodes the specified OutputAudioText message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.verify|verify} messages. + * @param message OutputAudioText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.verify|verify} messages. + * @param message OutputAudioText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioText + * @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.dialogflow.cx.v3.ResponseMessage.OutputAudioText; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioText + * @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.dialogflow.cx.v3.ResponseMessage.OutputAudioText; + + /** + * Verifies an OutputAudioText 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 OutputAudioText message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioText + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText; + + /** + * Creates a plain object from an OutputAudioText message. Also converts values to other types if specified. + * @param message OutputAudioText + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioText to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputAudioText + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndInteraction. */ + interface IEndInteraction { + } + + /** Represents an EndInteraction. */ + class EndInteraction implements IEndInteraction { + + /** + * Constructs a new EndInteraction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction); + + /** + * Creates a new EndInteraction instance using the specified properties. + * @param [properties] Properties to set + * @returns EndInteraction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction): google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndInteraction + * @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.dialogflow.cx.v3.ResponseMessage.EndInteraction; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndInteraction + * @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.dialogflow.cx.v3.ResponseMessage.EndInteraction; + + /** + * Verifies an EndInteraction 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 EndInteraction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndInteraction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @param message EndInteraction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndInteraction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndInteraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlayAudio. */ + interface IPlayAudio { + + /** PlayAudio audioUri */ + audioUri?: (string|null); + + /** PlayAudio allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents a PlayAudio. */ + class PlayAudio implements IPlayAudio { + + /** + * Constructs a new PlayAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio); + + /** PlayAudio audioUri. */ + public audioUri: string; + + /** PlayAudio allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** + * Creates a new PlayAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns PlayAudio instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio): google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio; + + /** + * Encodes the specified PlayAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.verify|verify} messages. + * @param message PlayAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.verify|verify} messages. + * @param message PlayAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlayAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlayAudio + * @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.dialogflow.cx.v3.ResponseMessage.PlayAudio; + + /** + * Decodes a PlayAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlayAudio + * @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.dialogflow.cx.v3.ResponseMessage.PlayAudio; + + /** + * Verifies a PlayAudio 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 PlayAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlayAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio; + + /** + * Creates a plain object from a PlayAudio message. Also converts values to other types if specified. + * @param message PlayAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlayAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlayAudio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MixedAudio. */ + interface IMixedAudio { + + /** MixedAudio segments */ + segments?: (google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment[]|null); + } + + /** Represents a MixedAudio. */ + class MixedAudio implements IMixedAudio { + + /** + * Constructs a new MixedAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio); + + /** MixedAudio segments. */ + public segments: google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment[]; + + /** + * Creates a new MixedAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns MixedAudio instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio): google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio; + + /** + * Encodes the specified MixedAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.verify|verify} messages. + * @param message MixedAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MixedAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.verify|verify} messages. + * @param message MixedAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MixedAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MixedAudio + * @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.dialogflow.cx.v3.ResponseMessage.MixedAudio; + + /** + * Decodes a MixedAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MixedAudio + * @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.dialogflow.cx.v3.ResponseMessage.MixedAudio; + + /** + * Verifies a MixedAudio 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 MixedAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MixedAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio; + + /** + * Creates a plain object from a MixedAudio message. Also converts values to other types if specified. + * @param message MixedAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MixedAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MixedAudio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MixedAudio { + + /** Properties of a Segment. */ + interface ISegment { + + /** Segment audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** Segment uri */ + uri?: (string|null); + + /** Segment allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents a Segment. */ + class Segment implements ISegment { + + /** + * Constructs a new Segment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment); + + /** Segment audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** Segment uri. */ + public uri?: (string|null); + + /** Segment allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** Segment content. */ + public content?: ("audio"|"uri"); + + /** + * Creates a new Segment instance using the specified properties. + * @param [properties] Properties to set + * @returns Segment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment): google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Segment + * @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.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Segment + * @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.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment; + + /** + * Verifies a Segment 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 Segment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Segment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @param message Segment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Segment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Segment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TelephonyTransferCall. */ + interface ITelephonyTransferCall { + + /** TelephonyTransferCall phoneNumber */ + phoneNumber?: (string|null); + } + + /** Represents a TelephonyTransferCall. */ + class TelephonyTransferCall implements ITelephonyTransferCall { + + /** + * Constructs a new TelephonyTransferCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall); + + /** TelephonyTransferCall phoneNumber. */ + public phoneNumber?: (string|null); + + /** TelephonyTransferCall endpoint. */ + public endpoint?: "phoneNumber"; + + /** + * Creates a new TelephonyTransferCall instance using the specified properties. + * @param [properties] Properties to set + * @returns TelephonyTransferCall instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall): google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall; + + /** + * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @param message TelephonyTransferCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @param message TelephonyTransferCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TelephonyTransferCall + * @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.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TelephonyTransferCall + * @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.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall; + + /** + * Verifies a TelephonyTransferCall 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 TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TelephonyTransferCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall; + + /** + * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. + * @param message TelephonyTransferCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TelephonyTransferCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TelephonyTransferCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KnowledgeInfoCard. */ + interface IKnowledgeInfoCard { + } + + /** Represents a KnowledgeInfoCard. */ + class KnowledgeInfoCard implements IKnowledgeInfoCard { + + /** + * Constructs a new KnowledgeInfoCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard); + + /** + * Creates a new KnowledgeInfoCard instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeInfoCard instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard): google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard; + + /** + * Encodes the specified KnowledgeInfoCard message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @param message KnowledgeInfoCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeInfoCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @param message KnowledgeInfoCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeInfoCard + * @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.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeInfoCard + * @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.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard; + + /** + * Verifies a KnowledgeInfoCard 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 KnowledgeInfoCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeInfoCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard; + + /** + * Creates a plain object from a KnowledgeInfoCard message. Also converts values to other types if specified. + * @param message KnowledgeInfoCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeInfoCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KnowledgeInfoCard + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ResponseType enum. */ + enum ResponseType { + RESPONSE_TYPE_UNSPECIFIED = 0, + ENTRY_PROMPT = 1, + PARAMETER_PROMPT = 2, + HANDLER_PROMPT = 3 + } + } + + /** Properties of a ToolCall. */ + interface IToolCall { + + /** ToolCall tool */ + tool?: (string|null); + + /** ToolCall action */ + action?: (string|null); + + /** ToolCall inputParameters */ + inputParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCall. */ + class ToolCall implements IToolCall { + + /** + * Constructs a new ToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IToolCall); + + /** ToolCall tool. */ + public tool: string; + + /** ToolCall action. */ + public action: string; + + /** ToolCall inputParameters. */ + public inputParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new ToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCall instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IToolCall): google.cloud.dialogflow.cx.v3.ToolCall; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCall + * @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.dialogflow.cx.v3.ToolCall; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCall + * @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.dialogflow.cx.v3.ToolCall; + + /** + * Verifies a ToolCall 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 ToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ToolCall; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @param message ToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCallResult. */ + interface IToolCallResult { + + /** ToolCallResult tool */ + tool?: (string|null); + + /** ToolCallResult action */ + action?: (string|null); + + /** ToolCallResult error */ + error?: (google.cloud.dialogflow.cx.v3.ToolCallResult.IError|null); + + /** ToolCallResult outputParameters */ + outputParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCallResult. */ + class ToolCallResult implements IToolCallResult { + + /** + * Constructs a new ToolCallResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IToolCallResult); + + /** ToolCallResult tool. */ + public tool: string; + + /** ToolCallResult action. */ + public action: string; + + /** ToolCallResult error. */ + public error?: (google.cloud.dialogflow.cx.v3.ToolCallResult.IError|null); + + /** ToolCallResult outputParameters. */ + public outputParameters?: (google.protobuf.IStruct|null); + + /** ToolCallResult result. */ + public result?: ("error"|"outputParameters"); + + /** + * Creates a new ToolCallResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCallResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IToolCallResult): google.cloud.dialogflow.cx.v3.ToolCallResult; + + /** + * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.verify|verify} messages. + * @param message ToolCallResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.verify|verify} messages. + * @param message ToolCallResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCallResult + * @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.dialogflow.cx.v3.ToolCallResult; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCallResult + * @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.dialogflow.cx.v3.ToolCallResult; + + /** + * Verifies a ToolCallResult 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 ToolCallResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCallResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ToolCallResult; + + /** + * Creates a plain object from a ToolCallResult message. Also converts values to other types if specified. + * @param message ToolCallResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ToolCallResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCallResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCallResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolCallResult { + + /** Properties of an Error. */ + interface IError { + + /** Error message */ + message?: (string|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ToolCallResult.IError); + + /** Error message. */ + public message: string; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ToolCallResult.IError): google.cloud.dialogflow.cx.v3.ToolCallResult.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @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.dialogflow.cx.v3.ToolCallResult.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @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.dialogflow.cx.v3.ToolCallResult.Error; + + /** + * Verifies an Error 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 Error message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Error + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ToolCallResult.Error; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ToolCallResult.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Error + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ParameterDefinition. */ + interface IParameterDefinition { + + /** ParameterDefinition name */ + name?: (string|null); + + /** ParameterDefinition type */ + type?: (google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType|keyof typeof google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType|null); + + /** ParameterDefinition typeSchema */ + typeSchema?: (google.cloud.dialogflow.cx.v3.ITypeSchema|null); + + /** ParameterDefinition description */ + description?: (string|null); + } + + /** Represents a ParameterDefinition. */ + class ParameterDefinition implements IParameterDefinition { + + /** + * Constructs a new ParameterDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IParameterDefinition); + + /** ParameterDefinition name. */ + public name: string; + + /** ParameterDefinition type. */ + public type: (google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType|keyof typeof google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType); + + /** ParameterDefinition typeSchema. */ + public typeSchema?: (google.cloud.dialogflow.cx.v3.ITypeSchema|null); + + /** ParameterDefinition description. */ + public description: string; + + /** + * Creates a new ParameterDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterDefinition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IParameterDefinition): google.cloud.dialogflow.cx.v3.ParameterDefinition; + + /** + * Encodes the specified ParameterDefinition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ParameterDefinition.verify|verify} messages. + * @param message ParameterDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IParameterDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterDefinition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ParameterDefinition.verify|verify} messages. + * @param message ParameterDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IParameterDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterDefinition + * @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.dialogflow.cx.v3.ParameterDefinition; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterDefinition + * @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.dialogflow.cx.v3.ParameterDefinition; + + /** + * Verifies a ParameterDefinition 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 ParameterDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ParameterDefinition; + + /** + * Creates a plain object from a ParameterDefinition message. Also converts values to other types if specified. + * @param message ParameterDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ParameterDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ParameterDefinition { + + /** ParameterType enum. */ + enum ParameterType { + PARAMETER_TYPE_UNSPECIFIED = 0, + STRING = 1, + NUMBER = 2, + BOOLEAN = 3, + NULL = 4, + OBJECT = 5, + LIST = 6 + } + } + + /** Properties of a TypeSchema. */ + interface ITypeSchema { + + /** TypeSchema inlineSchema */ + inlineSchema?: (google.cloud.dialogflow.cx.v3.IInlineSchema|null); + + /** TypeSchema schemaReference */ + schemaReference?: (google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference|null); + } + + /** Represents a TypeSchema. */ + class TypeSchema implements ITypeSchema { + + /** + * Constructs a new TypeSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITypeSchema); + + /** TypeSchema inlineSchema. */ + public inlineSchema?: (google.cloud.dialogflow.cx.v3.IInlineSchema|null); + + /** TypeSchema schemaReference. */ + public schemaReference?: (google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference|null); + + /** TypeSchema schema. */ + public schema?: ("inlineSchema"|"schemaReference"); + + /** + * Creates a new TypeSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeSchema instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITypeSchema): google.cloud.dialogflow.cx.v3.TypeSchema; + + /** + * Encodes the specified TypeSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.verify|verify} messages. + * @param message TypeSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITypeSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.verify|verify} messages. + * @param message TypeSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITypeSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeSchema + * @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.dialogflow.cx.v3.TypeSchema; + + /** + * Decodes a TypeSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeSchema + * @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.dialogflow.cx.v3.TypeSchema; + + /** + * Verifies a TypeSchema 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 TypeSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TypeSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TypeSchema; + + /** + * Creates a plain object from a TypeSchema message. Also converts values to other types if specified. + * @param message TypeSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TypeSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TypeSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TypeSchema { + + /** Properties of a SchemaReference. */ + interface ISchemaReference { + + /** SchemaReference tool */ + tool?: (string|null); + + /** SchemaReference schema */ + schema?: (string|null); + } + + /** Represents a SchemaReference. */ + class SchemaReference implements ISchemaReference { + + /** + * Constructs a new SchemaReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference); + + /** SchemaReference tool. */ + public tool: string; + + /** SchemaReference schema. */ + public schema: string; + + /** + * Creates a new SchemaReference instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaReference instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference): google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference; + + /** + * Encodes the specified SchemaReference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.verify|verify} messages. + * @param message SchemaReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaReference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.verify|verify} messages. + * @param message SchemaReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaReference + * @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.dialogflow.cx.v3.TypeSchema.SchemaReference; + + /** + * Decodes a SchemaReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaReference + * @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.dialogflow.cx.v3.TypeSchema.SchemaReference; + + /** + * Verifies a SchemaReference 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 SchemaReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference; + + /** + * Creates a plain object from a SchemaReference message. Also converts values to other types if specified. + * @param message SchemaReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an InlineSchema. */ + interface IInlineSchema { + + /** InlineSchema type */ + type?: (google.cloud.dialogflow.cx.v3.DataType|keyof typeof google.cloud.dialogflow.cx.v3.DataType|null); + + /** InlineSchema items */ + items?: (google.cloud.dialogflow.cx.v3.ITypeSchema|null); + } + + /** Represents an InlineSchema. */ + class InlineSchema implements IInlineSchema { + + /** + * Constructs a new InlineSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IInlineSchema); + + /** InlineSchema type. */ + public type: (google.cloud.dialogflow.cx.v3.DataType|keyof typeof google.cloud.dialogflow.cx.v3.DataType); + + /** InlineSchema items. */ + public items?: (google.cloud.dialogflow.cx.v3.ITypeSchema|null); + + /** + * Creates a new InlineSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSchema instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IInlineSchema): google.cloud.dialogflow.cx.v3.InlineSchema; + + /** + * Encodes the specified InlineSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSchema.verify|verify} messages. + * @param message InlineSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IInlineSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSchema.verify|verify} messages. + * @param message InlineSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IInlineSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSchema + * @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.dialogflow.cx.v3.InlineSchema; + + /** + * Decodes an InlineSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSchema + * @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.dialogflow.cx.v3.InlineSchema; + + /** + * Verifies an InlineSchema 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 InlineSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.InlineSchema; + + /** + * Creates a plain object from an InlineSchema message. Also converts values to other types if specified. + * @param message InlineSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.InlineSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + STRING = 1, + NUMBER = 2, + BOOLEAN = 3, + ARRAY = 6 + } + + /** Properties of a ValidationMessage. */ + interface IValidationMessage { + + /** ValidationMessage resourceType */ + resourceType?: (google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType|keyof typeof google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType|null); + + /** ValidationMessage resources */ + resources?: (string[]|null); + + /** ValidationMessage resourceNames */ + resourceNames?: (google.cloud.dialogflow.cx.v3.IResourceName[]|null); + + /** ValidationMessage severity */ + severity?: (google.cloud.dialogflow.cx.v3.ValidationMessage.Severity|keyof typeof google.cloud.dialogflow.cx.v3.ValidationMessage.Severity|null); + + /** ValidationMessage detail */ + detail?: (string|null); + } + + /** Represents a ValidationMessage. */ + class ValidationMessage implements IValidationMessage { + + /** + * Constructs a new ValidationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IValidationMessage); + + /** ValidationMessage resourceType. */ + public resourceType: (google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType|keyof typeof google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType); + + /** ValidationMessage resources. */ + public resources: string[]; + + /** ValidationMessage resourceNames. */ + public resourceNames: google.cloud.dialogflow.cx.v3.IResourceName[]; + + /** ValidationMessage severity. */ + public severity: (google.cloud.dialogflow.cx.v3.ValidationMessage.Severity|keyof typeof google.cloud.dialogflow.cx.v3.ValidationMessage.Severity); + + /** ValidationMessage detail. */ + public detail: string; + + /** + * Creates a new ValidationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidationMessage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IValidationMessage): google.cloud.dialogflow.cx.v3.ValidationMessage; + + /** + * Encodes the specified ValidationMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidationMessage.verify|verify} messages. + * @param message ValidationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IValidationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidationMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidationMessage.verify|verify} messages. + * @param message ValidationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IValidationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidationMessage + * @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.dialogflow.cx.v3.ValidationMessage; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidationMessage + * @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.dialogflow.cx.v3.ValidationMessage; + + /** + * Verifies a ValidationMessage 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 ValidationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidationMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ValidationMessage; + + /** + * Creates a plain object from a ValidationMessage message. Also converts values to other types if specified. + * @param message ValidationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ValidationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidationMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ValidationMessage { + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + AGENT = 1, + INTENT = 2, + INTENT_TRAINING_PHRASE = 8, + INTENT_PARAMETER = 9, + INTENTS = 10, + INTENT_TRAINING_PHRASES = 11, + ENTITY_TYPE = 3, + ENTITY_TYPES = 12, + WEBHOOK = 4, + FLOW = 5, + PAGE = 6, + PAGES = 13, + TRANSITION_ROUTE_GROUP = 7, + AGENT_TRANSITION_ROUTE_GROUP = 14 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + INFO = 1, + WARNING = 2, + ERROR = 3 + } + } + + /** Properties of a ResourceName. */ + interface IResourceName { + + /** ResourceName name */ + name?: (string|null); + + /** ResourceName displayName */ + displayName?: (string|null); + } + + /** Represents a ResourceName. */ + class ResourceName implements IResourceName { + + /** + * Constructs a new ResourceName. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IResourceName); + + /** ResourceName name. */ + public name: string; + + /** ResourceName displayName. */ + public displayName: string; + + /** + * Creates a new ResourceName instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceName instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IResourceName): google.cloud.dialogflow.cx.v3.ResourceName; + + /** + * Encodes the specified ResourceName message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResourceName.verify|verify} messages. + * @param message ResourceName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IResourceName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceName message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResourceName.verify|verify} messages. + * @param message ResourceName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IResourceName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceName message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceName + * @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.dialogflow.cx.v3.ResourceName; + + /** + * Decodes a ResourceName message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceName + * @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.dialogflow.cx.v3.ResourceName; + + /** + * Verifies a ResourceName 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 ResourceName message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceName + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ResourceName; + + /** + * Creates a plain object from a ResourceName message. Also converts values to other types if specified. + * @param message ResourceName + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ResourceName, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceName to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceName + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerativeSettings. */ + interface IGenerativeSettings { + + /** GenerativeSettings name */ + name?: (string|null); + + /** GenerativeSettings fallbackSettings */ + fallbackSettings?: (google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings|null); + + /** GenerativeSettings generativeSafetySettings */ + generativeSafetySettings?: (google.cloud.dialogflow.cx.v3.ISafetySettings|null); + + /** GenerativeSettings knowledgeConnectorSettings */ + knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings|null); + + /** GenerativeSettings languageCode */ + languageCode?: (string|null); + + /** GenerativeSettings llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + } + + /** Represents a GenerativeSettings. */ + class GenerativeSettings implements IGenerativeSettings { + + /** + * Constructs a new GenerativeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGenerativeSettings); + + /** GenerativeSettings name. */ + public name: string; + + /** GenerativeSettings fallbackSettings. */ + public fallbackSettings?: (google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings|null); + + /** GenerativeSettings generativeSafetySettings. */ + public generativeSafetySettings?: (google.cloud.dialogflow.cx.v3.ISafetySettings|null); + + /** GenerativeSettings knowledgeConnectorSettings. */ + public knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings|null); + + /** GenerativeSettings languageCode. */ + public languageCode: string; + + /** GenerativeSettings llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + + /** + * Creates a new GenerativeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerativeSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGenerativeSettings): google.cloud.dialogflow.cx.v3.GenerativeSettings; + + /** + * Encodes the specified GenerativeSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.verify|verify} messages. + * @param message GenerativeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGenerativeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerativeSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.verify|verify} messages. + * @param message GenerativeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGenerativeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerativeSettings + * @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.dialogflow.cx.v3.GenerativeSettings; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerativeSettings + * @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.dialogflow.cx.v3.GenerativeSettings; + + /** + * Verifies a GenerativeSettings 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 GenerativeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerativeSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GenerativeSettings; + + /** + * Creates a plain object from a GenerativeSettings message. Also converts values to other types if specified. + * @param message GenerativeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GenerativeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerativeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerativeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerativeSettings { + + /** Properties of a FallbackSettings. */ + interface IFallbackSettings { + + /** FallbackSettings selectedPrompt */ + selectedPrompt?: (string|null); + + /** FallbackSettings promptTemplates */ + promptTemplates?: (google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate[]|null); + } + + /** Represents a FallbackSettings. */ + class FallbackSettings implements IFallbackSettings { + + /** + * Constructs a new FallbackSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings); + + /** FallbackSettings selectedPrompt. */ + public selectedPrompt: string; + + /** FallbackSettings promptTemplates. */ + public promptTemplates: google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate[]; + + /** + * Creates a new FallbackSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns FallbackSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings): google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings; + + /** + * Encodes the specified FallbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @param message FallbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FallbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @param message FallbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FallbackSettings + * @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.dialogflow.cx.v3.GenerativeSettings.FallbackSettings; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FallbackSettings + * @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.dialogflow.cx.v3.GenerativeSettings.FallbackSettings; + + /** + * Verifies a FallbackSettings 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 FallbackSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FallbackSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings; + + /** + * Creates a plain object from a FallbackSettings message. Also converts values to other types if specified. + * @param message FallbackSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FallbackSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FallbackSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FallbackSettings { + + /** Properties of a PromptTemplate. */ + interface IPromptTemplate { + + /** PromptTemplate displayName */ + displayName?: (string|null); + + /** PromptTemplate promptText */ + promptText?: (string|null); + + /** PromptTemplate frozen */ + frozen?: (boolean|null); + } + + /** Represents a PromptTemplate. */ + class PromptTemplate implements IPromptTemplate { + + /** + * Constructs a new PromptTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate); + + /** PromptTemplate displayName. */ + public displayName: string; + + /** PromptTemplate promptText. */ + public promptText: string; + + /** PromptTemplate frozen. */ + public frozen: boolean; + + /** + * Creates a new PromptTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptTemplate instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate): google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Encodes the specified PromptTemplate message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @param message PromptTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptTemplate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @param message PromptTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptTemplate + * @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.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptTemplate + * @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.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Verifies a PromptTemplate 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 PromptTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Creates a plain object from a PromptTemplate message. Also converts values to other types if specified. + * @param message PromptTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a KnowledgeConnectorSettings. */ + interface IKnowledgeConnectorSettings { + + /** KnowledgeConnectorSettings business */ + business?: (string|null); + + /** KnowledgeConnectorSettings agent */ + agent?: (string|null); + + /** KnowledgeConnectorSettings agentIdentity */ + agentIdentity?: (string|null); + + /** KnowledgeConnectorSettings businessDescription */ + businessDescription?: (string|null); + + /** KnowledgeConnectorSettings agentScope */ + agentScope?: (string|null); + + /** KnowledgeConnectorSettings disableDataStoreFallback */ + disableDataStoreFallback?: (boolean|null); + } + + /** Represents a KnowledgeConnectorSettings. */ + class KnowledgeConnectorSettings implements IKnowledgeConnectorSettings { + + /** + * Constructs a new KnowledgeConnectorSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings); + + /** KnowledgeConnectorSettings business. */ + public business: string; + + /** KnowledgeConnectorSettings agent. */ + public agent: string; + + /** KnowledgeConnectorSettings agentIdentity. */ + public agentIdentity: string; + + /** KnowledgeConnectorSettings businessDescription. */ + public businessDescription: string; + + /** KnowledgeConnectorSettings agentScope. */ + public agentScope: string; + + /** KnowledgeConnectorSettings disableDataStoreFallback. */ + public disableDataStoreFallback: boolean; + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeConnectorSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings): google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Verifies a KnowledgeConnectorSettings 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 KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeConnectorSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @param message KnowledgeConnectorSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LlmModelSettings. */ + interface ILlmModelSettings { + + /** LlmModelSettings model */ + model?: (string|null); + + /** LlmModelSettings promptText */ + promptText?: (string|null); + } + + /** Represents a LlmModelSettings. */ + class LlmModelSettings implements ILlmModelSettings { + + /** + * Constructs a new LlmModelSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ILlmModelSettings); + + /** LlmModelSettings model. */ + public model: string; + + /** LlmModelSettings promptText. */ + public promptText: string; + + /** + * Creates a new LlmModelSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmModelSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ILlmModelSettings): google.cloud.dialogflow.cx.v3.LlmModelSettings; + + /** + * Encodes the specified LlmModelSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LlmModelSettings.verify|verify} messages. + * @param message LlmModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ILlmModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmModelSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LlmModelSettings.verify|verify} messages. + * @param message LlmModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ILlmModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmModelSettings + * @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.dialogflow.cx.v3.LlmModelSettings; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmModelSettings + * @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.dialogflow.cx.v3.LlmModelSettings; + + /** + * Verifies a LlmModelSettings 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 LlmModelSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmModelSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.LlmModelSettings; + + /** + * Creates a plain object from a LlmModelSettings message. Also converts values to other types if specified. + * @param message LlmModelSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.LlmModelSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmModelSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmModelSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SafetySettings. */ + interface ISafetySettings { + + /** SafetySettings defaultBannedPhraseMatchStrategy */ + defaultBannedPhraseMatchStrategy?: (google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy|keyof typeof google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy|null); + + /** SafetySettings bannedPhrases */ + bannedPhrases?: (google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase[]|null); + + /** SafetySettings raiSettings */ + raiSettings?: (google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null); + + /** SafetySettings defaultRaiSettings */ + defaultRaiSettings?: (google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null); + + /** SafetySettings promptSecuritySettings */ + promptSecuritySettings?: (google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings|null); + } + + /** Represents a SafetySettings. */ + class SafetySettings implements ISafetySettings { + + /** + * Constructs a new SafetySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISafetySettings); + + /** SafetySettings defaultBannedPhraseMatchStrategy. */ + public defaultBannedPhraseMatchStrategy: (google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy|keyof typeof google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy); + + /** SafetySettings bannedPhrases. */ + public bannedPhrases: google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase[]; + + /** SafetySettings raiSettings. */ + public raiSettings?: (google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null); + + /** SafetySettings defaultRaiSettings. */ + public defaultRaiSettings?: (google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null); + + /** SafetySettings promptSecuritySettings. */ + public promptSecuritySettings?: (google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings|null); + + /** + * Creates a new SafetySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISafetySettings): google.cloud.dialogflow.cx.v3.SafetySettings; + + /** + * Encodes the specified SafetySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.verify|verify} messages. + * @param message SafetySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISafetySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.verify|verify} messages. + * @param message SafetySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISafetySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySettings + * @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.dialogflow.cx.v3.SafetySettings; + + /** + * Decodes a SafetySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySettings + * @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.dialogflow.cx.v3.SafetySettings; + + /** + * Verifies a SafetySettings 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 SafetySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SafetySettings; + + /** + * Creates a plain object from a SafetySettings message. Also converts values to other types if specified. + * @param message SafetySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SafetySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetySettings { + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase text */ + text?: (string|null); + + /** Phrase languageCode */ + languageCode?: (string|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase); + + /** Phrase text. */ + public text: string; + + /** Phrase languageCode. */ + public languageCode: string; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase): google.cloud.dialogflow.cx.v3.SafetySettings.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @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.dialogflow.cx.v3.SafetySettings.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @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.dialogflow.cx.v3.SafetySettings.Phrase; + + /** + * Verifies a Phrase 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 Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SafetySettings.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SafetySettings.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PhraseMatchStrategy enum. */ + enum PhraseMatchStrategy { + PHRASE_MATCH_STRATEGY_UNSPECIFIED = 0, + PARTIAL_MATCH = 1, + WORD_MATCH = 2 + } + + /** Properties of a RaiSettings. */ + interface IRaiSettings { + + /** RaiSettings categoryFilters */ + categoryFilters?: (google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter[]|null); + } + + /** Represents a RaiSettings. */ + class RaiSettings implements IRaiSettings { + + /** + * Constructs a new RaiSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings); + + /** RaiSettings categoryFilters. */ + public categoryFilters: google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter[]; + + /** + * Creates a new RaiSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RaiSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings): google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings; + + /** + * Encodes the specified RaiSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.verify|verify} messages. + * @param message RaiSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RaiSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.verify|verify} messages. + * @param message RaiSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RaiSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RaiSettings + * @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.dialogflow.cx.v3.SafetySettings.RaiSettings; + + /** + * Decodes a RaiSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RaiSettings + * @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.dialogflow.cx.v3.SafetySettings.RaiSettings; + + /** + * Verifies a RaiSettings 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 RaiSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RaiSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings; + + /** + * Creates a plain object from a RaiSettings message. Also converts values to other types if specified. + * @param message RaiSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RaiSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RaiSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RaiSettings { + + /** SafetyFilterLevel enum. */ + enum SafetyFilterLevel { + SAFETY_FILTER_LEVEL_UNSPECIFIED = 0, + BLOCK_NONE = 1, + BLOCK_FEW = 2, + BLOCK_SOME = 3, + BLOCK_MOST = 4 + } + + /** SafetyCategory enum. */ + enum SafetyCategory { + SAFETY_CATEGORY_UNSPECIFIED = 0, + DANGEROUS_CONTENT = 1, + HATE_SPEECH = 2, + HARASSMENT = 3, + SEXUALLY_EXPLICIT_CONTENT = 4 + } + + /** Properties of a CategoryFilter. */ + interface ICategoryFilter { + + /** CategoryFilter category */ + category?: (google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory|keyof typeof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory|null); + + /** CategoryFilter filterLevel */ + filterLevel?: (google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel|keyof typeof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel|null); + } + + /** Represents a CategoryFilter. */ + class CategoryFilter implements ICategoryFilter { + + /** + * Constructs a new CategoryFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter); + + /** CategoryFilter category. */ + public category: (google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory|keyof typeof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory); + + /** CategoryFilter filterLevel. */ + public filterLevel: (google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel|keyof typeof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel); + + /** + * Creates a new CategoryFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoryFilter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter): google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Encodes the specified CategoryFilter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @param message CategoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoryFilter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @param message CategoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoryFilter + * @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.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoryFilter + * @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.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Verifies a CategoryFilter 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 CategoryFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoryFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Creates a plain object from a CategoryFilter message. Also converts values to other types if specified. + * @param message CategoryFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoryFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoryFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PromptSecuritySettings. */ + interface IPromptSecuritySettings { + + /** PromptSecuritySettings enablePromptSecurity */ + enablePromptSecurity?: (boolean|null); + } + + /** Represents a PromptSecuritySettings. */ + class PromptSecuritySettings implements IPromptSecuritySettings { + + /** + * Constructs a new PromptSecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings); + + /** PromptSecuritySettings enablePromptSecurity. */ + public enablePromptSecurity: boolean; + + /** + * Creates a new PromptSecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptSecuritySettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings): google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings; + + /** + * Encodes the specified PromptSecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @param message PromptSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @param message PromptSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptSecuritySettings + * @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.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptSecuritySettings + * @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.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings; + + /** + * Verifies a PromptSecuritySettings 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 PromptSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptSecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings; + + /** + * Creates a plain object from a PromptSecuritySettings message. Also converts values to other types if specified. + * @param message PromptSecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptSecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptSecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a Changelogs */ + class Changelogs extends $protobuf.rpc.Service { + + /** + * Constructs a new Changelogs service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Changelogs service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Changelogs; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChangelogsResponse + */ + public listChangelogs(request: google.cloud.dialogflow.cx.v3.IListChangelogsRequest, callback: google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogsCallback): void; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @returns Promise + */ + public listChangelogs(request: google.cloud.dialogflow.cx.v3.IListChangelogsRequest): Promise; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Changelog + */ + public getChangelog(request: google.cloud.dialogflow.cx.v3.IGetChangelogRequest, callback: google.cloud.dialogflow.cx.v3.Changelogs.GetChangelogCallback): void; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @returns Promise + */ + public getChangelog(request: google.cloud.dialogflow.cx.v3.IGetChangelogRequest): Promise; + } + + namespace Changelogs { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Changelogs|listChangelogs}. + * @param error Error, if any + * @param [response] ListChangelogsResponse + */ + type ListChangelogsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListChangelogsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Changelogs|getChangelog}. + * @param error Error, if any + * @param [response] Changelog + */ + type GetChangelogCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Changelog) => void; + } + + /** Properties of a ListChangelogsRequest. */ + interface IListChangelogsRequest { + + /** ListChangelogsRequest parent */ + parent?: (string|null); + + /** ListChangelogsRequest filter */ + filter?: (string|null); + + /** ListChangelogsRequest pageSize */ + pageSize?: (number|null); + + /** ListChangelogsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListChangelogsRequest. */ + class ListChangelogsRequest implements IListChangelogsRequest { + + /** + * Constructs a new ListChangelogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListChangelogsRequest); + + /** ListChangelogsRequest parent. */ + public parent: string; + + /** ListChangelogsRequest filter. */ + public filter: string; + + /** ListChangelogsRequest pageSize. */ + public pageSize: number; + + /** ListChangelogsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListChangelogsRequest): google.cloud.dialogflow.cx.v3.ListChangelogsRequest; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsRequest + * @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.dialogflow.cx.v3.ListChangelogsRequest; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsRequest + * @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.dialogflow.cx.v3.ListChangelogsRequest; + + /** + * Verifies a ListChangelogsRequest 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 ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListChangelogsRequest; + + /** + * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. + * @param message ListChangelogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListChangelogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChangelogsResponse. */ + interface IListChangelogsResponse { + + /** ListChangelogsResponse changelogs */ + changelogs?: (google.cloud.dialogflow.cx.v3.IChangelog[]|null); + + /** ListChangelogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChangelogsResponse. */ + class ListChangelogsResponse implements IListChangelogsResponse { + + /** + * Constructs a new ListChangelogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListChangelogsResponse); + + /** ListChangelogsResponse changelogs. */ + public changelogs: google.cloud.dialogflow.cx.v3.IChangelog[]; + + /** ListChangelogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListChangelogsResponse): google.cloud.dialogflow.cx.v3.ListChangelogsResponse; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsResponse + * @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.dialogflow.cx.v3.ListChangelogsResponse; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsResponse + * @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.dialogflow.cx.v3.ListChangelogsResponse; + + /** + * Verifies a ListChangelogsResponse 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 ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListChangelogsResponse; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @param message ListChangelogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListChangelogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChangelogRequest. */ + interface IGetChangelogRequest { + + /** GetChangelogRequest name */ + name?: (string|null); + } + + /** Represents a GetChangelogRequest. */ + class GetChangelogRequest implements IGetChangelogRequest { + + /** + * Constructs a new GetChangelogRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetChangelogRequest); + + /** GetChangelogRequest name. */ + public name: string; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChangelogRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetChangelogRequest): google.cloud.dialogflow.cx.v3.GetChangelogRequest; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChangelogRequest + * @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.dialogflow.cx.v3.GetChangelogRequest; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChangelogRequest + * @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.dialogflow.cx.v3.GetChangelogRequest; + + /** + * Verifies a GetChangelogRequest 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 GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChangelogRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetChangelogRequest; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @param message GetChangelogRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetChangelogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChangelogRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChangelogRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Changelog. */ + interface IChangelog { + + /** Changelog name */ + name?: (string|null); + + /** Changelog userEmail */ + userEmail?: (string|null); + + /** Changelog displayName */ + displayName?: (string|null); + + /** Changelog action */ + action?: (string|null); + + /** Changelog type */ + type?: (string|null); + + /** Changelog resource */ + resource?: (string|null); + + /** Changelog createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog languageCode */ + languageCode?: (string|null); + } + + /** Represents a Changelog. */ + class Changelog implements IChangelog { + + /** + * Constructs a new Changelog. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IChangelog); + + /** Changelog name. */ + public name: string; + + /** Changelog userEmail. */ + public userEmail: string; + + /** Changelog displayName. */ + public displayName: string; + + /** Changelog action. */ + public action: string; + + /** Changelog type. */ + public type: string; + + /** Changelog resource. */ + public resource: string; + + /** Changelog createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog languageCode. */ + public languageCode: string; + + /** + * Creates a new Changelog instance using the specified properties. + * @param [properties] Properties to set + * @returns Changelog instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IChangelog): google.cloud.dialogflow.cx.v3.Changelog; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Changelog + * @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.dialogflow.cx.v3.Changelog; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Changelog + * @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.dialogflow.cx.v3.Changelog; + + /** + * Verifies a Changelog 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 Changelog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Changelog + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Changelog; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @param message Changelog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Changelog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Changelog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Changelog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CodeBlock. */ + interface ICodeBlock { + + /** CodeBlock code */ + code?: (string|null); + } + + /** Represents a CodeBlock. */ + class CodeBlock implements ICodeBlock { + + /** + * Constructs a new CodeBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICodeBlock); + + /** CodeBlock code. */ + public code: string; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeBlock instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICodeBlock): google.cloud.dialogflow.cx.v3.CodeBlock; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeBlock + * @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.dialogflow.cx.v3.CodeBlock; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeBlock + * @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.dialogflow.cx.v3.CodeBlock; + + /** + * Verifies a CodeBlock 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 CodeBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CodeBlock; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @param message CodeBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CodeBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Deployments */ + class Deployments extends $protobuf.rpc.Service { + + /** + * Constructs a new Deployments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Deployments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Deployments; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse + */ + public listDeployments(request: google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, callback: google.cloud.dialogflow.cx.v3.Deployments.ListDeploymentsCallback): void; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @returns Promise + */ + public listDeployments(request: google.cloud.dialogflow.cx.v3.IListDeploymentsRequest): Promise; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public getDeployment(request: google.cloud.dialogflow.cx.v3.IGetDeploymentRequest, callback: google.cloud.dialogflow.cx.v3.Deployments.GetDeploymentCallback): void; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @returns Promise + */ + public getDeployment(request: google.cloud.dialogflow.cx.v3.IGetDeploymentRequest): Promise; + } + + namespace Deployments { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Deployments|listDeployments}. + * @param error Error, if any + * @param [response] ListDeploymentsResponse + */ + type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Deployments|getDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Deployment) => void; + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment flowVersion */ + flowVersion?: (string|null); + + /** Deployment state */ + state?: (google.cloud.dialogflow.cx.v3.Deployment.State|keyof typeof google.cloud.dialogflow.cx.v3.Deployment.State|null); + + /** Deployment result */ + result?: (google.cloud.dialogflow.cx.v3.Deployment.IResult|null); + + /** Deployment startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Deployment endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment flowVersion. */ + public flowVersion: string; + + /** Deployment state. */ + public state: (google.cloud.dialogflow.cx.v3.Deployment.State|keyof typeof google.cloud.dialogflow.cx.v3.Deployment.State); + + /** Deployment result. */ + public result?: (google.cloud.dialogflow.cx.v3.Deployment.IResult|null); + + /** Deployment startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Deployment endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeployment): google.cloud.dialogflow.cx.v3.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @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.dialogflow.cx.v3.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @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.dialogflow.cx.v3.Deployment; + + /** + * Verifies a Deployment 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 Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Deployment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3 + } + + /** Properties of a Result. */ + interface IResult { + + /** Result deploymentTestResults */ + deploymentTestResults?: (string[]|null); + + /** Result experiment */ + experiment?: (string|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Deployment.IResult); + + /** Result deploymentTestResults. */ + public deploymentTestResults: string[]; + + /** Result experiment. */ + public experiment: string; + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Deployment.IResult): google.cloud.dialogflow.cx.v3.Deployment.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Deployment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Deployment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @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.dialogflow.cx.v3.Deployment.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @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.dialogflow.cx.v3.Deployment.Result; + + /** + * Verifies a Result 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 Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Deployment.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Deployment.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Result + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListDeploymentsRequest. */ + interface IListDeploymentsRequest { + + /** ListDeploymentsRequest parent */ + parent?: (string|null); + + /** ListDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDeploymentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDeploymentsRequest. */ + class ListDeploymentsRequest implements IListDeploymentsRequest { + + /** + * Constructs a new ListDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListDeploymentsRequest); + + /** ListDeploymentsRequest parent. */ + public parent: string; + + /** ListDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListDeploymentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListDeploymentsRequest): google.cloud.dialogflow.cx.v3.ListDeploymentsRequest; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsRequest + * @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.dialogflow.cx.v3.ListDeploymentsRequest; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsRequest + * @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.dialogflow.cx.v3.ListDeploymentsRequest; + + /** + * Verifies a ListDeploymentsRequest 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 ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListDeploymentsRequest; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsResponse. */ + interface IListDeploymentsResponse { + + /** ListDeploymentsResponse deployments */ + deployments?: (google.cloud.dialogflow.cx.v3.IDeployment[]|null); + + /** ListDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeploymentsResponse. */ + class ListDeploymentsResponse implements IListDeploymentsResponse { + + /** + * Constructs a new ListDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListDeploymentsResponse); + + /** ListDeploymentsResponse deployments. */ + public deployments: google.cloud.dialogflow.cx.v3.IDeployment[]; + + /** ListDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListDeploymentsResponse): google.cloud.dialogflow.cx.v3.ListDeploymentsResponse; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsResponse + * @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.dialogflow.cx.v3.ListDeploymentsResponse; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsResponse + * @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.dialogflow.cx.v3.ListDeploymentsResponse; + + /** + * Verifies a ListDeploymentsResponse 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 ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListDeploymentsResponse; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeploymentRequest. */ + interface IGetDeploymentRequest { + + /** GetDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetDeploymentRequest. */ + class GetDeploymentRequest implements IGetDeploymentRequest { + + /** + * Constructs a new GetDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetDeploymentRequest); + + /** GetDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeploymentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetDeploymentRequest): google.cloud.dialogflow.cx.v3.GetDeploymentRequest; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeploymentRequest + * @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.dialogflow.cx.v3.GetDeploymentRequest; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeploymentRequest + * @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.dialogflow.cx.v3.GetDeploymentRequest; + + /** + * Verifies a GetDeploymentRequest 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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetDeploymentRequest; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @param message GetDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an EntityTypes */ + class EntityTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new EntityTypes service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new EntityTypes service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EntityTypes; + + /** + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public getEntityType(request: google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityTypeCallback): void; + + /** + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @returns Promise + */ + public getEntityType(request: google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest): Promise; + + /** + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public createEntityType(request: google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityTypeCallback): void; + + /** + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @returns Promise + */ + public createEntityType(request: google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest): Promise; + + /** + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public updateEntityType(request: google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityTypeCallback): void; + + /** + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @returns Promise + */ + public updateEntityType(request: google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest): Promise; + + /** + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEntityType(request: google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityTypeCallback): void; + + /** + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @returns Promise + */ + public deleteEntityType(request: google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest): Promise; + + /** + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEntityTypesResponse + */ + public listEntityTypes(request: google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypesCallback): void; + + /** + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @returns Promise + */ + public listEntityTypes(request: google.cloud.dialogflow.cx.v3.IListEntityTypesRequest): Promise; + + /** + * Calls ExportEntityTypes. + * @param request ExportEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportEntityTypes(request: google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypesCallback): void; + + /** + * Calls ExportEntityTypes. + * @param request ExportEntityTypesRequest message or plain object + * @returns Promise + */ + public exportEntityTypes(request: google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest): Promise; + + /** + * Calls ImportEntityTypes. + * @param request ImportEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importEntityTypes(request: google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypesCallback): void; + + /** + * Calls ImportEntityTypes. + * @param request ImportEntityTypesRequest message or plain object + * @returns Promise + */ + public importEntityTypes(request: google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest): Promise; + } + + namespace EntityTypes { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|getEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type GetEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.EntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|createEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type CreateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.EntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|updateEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type UpdateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.EntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|deleteEntityType}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|listEntityTypes}. + * @param error Error, if any + * @param [response] ListEntityTypesResponse + */ + type ListEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListEntityTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|exportEntityTypes}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|importEntityTypes}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an EntityType. */ + interface IEntityType { + + /** EntityType name */ + name?: (string|null); + + /** EntityType displayName */ + displayName?: (string|null); + + /** EntityType kind */ + kind?: (google.cloud.dialogflow.cx.v3.EntityType.Kind|keyof typeof google.cloud.dialogflow.cx.v3.EntityType.Kind|null); + + /** EntityType autoExpansionMode */ + autoExpansionMode?: (google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode|null); + + /** EntityType entities */ + entities?: (google.cloud.dialogflow.cx.v3.EntityType.IEntity[]|null); + + /** EntityType excludedPhrases */ + excludedPhrases?: (google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase[]|null); + + /** EntityType enableFuzzyExtraction */ + enableFuzzyExtraction?: (boolean|null); + + /** EntityType redact */ + redact?: (boolean|null); + } + + /** Represents an EntityType. */ + class EntityType implements IEntityType { + + /** + * Constructs a new EntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IEntityType); + + /** EntityType name. */ + public name: string; + + /** EntityType displayName. */ + public displayName: string; + + /** EntityType kind. */ + public kind: (google.cloud.dialogflow.cx.v3.EntityType.Kind|keyof typeof google.cloud.dialogflow.cx.v3.EntityType.Kind); + + /** EntityType autoExpansionMode. */ + public autoExpansionMode: (google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode); + + /** EntityType entities. */ + public entities: google.cloud.dialogflow.cx.v3.EntityType.IEntity[]; + + /** EntityType excludedPhrases. */ + public excludedPhrases: google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase[]; + + /** EntityType enableFuzzyExtraction. */ + public enableFuzzyExtraction: boolean; + + /** EntityType redact. */ + public redact: boolean; + + /** + * Creates a new EntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityType instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IEntityType): google.cloud.dialogflow.cx.v3.EntityType; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityType + * @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.dialogflow.cx.v3.EntityType; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityType + * @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.dialogflow.cx.v3.EntityType; + + /** + * Verifies an EntityType 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 EntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.EntityType; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @param message EntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityType { + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + KIND_MAP = 1, + KIND_LIST = 2, + KIND_REGEXP = 3 + } + + /** AutoExpansionMode enum. */ + enum AutoExpansionMode { + AUTO_EXPANSION_MODE_UNSPECIFIED = 0, + AUTO_EXPANSION_MODE_DEFAULT = 1 + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity value */ + value?: (string|null); + + /** Entity synonyms */ + synonyms?: (string[]|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.EntityType.IEntity); + + /** Entity value. */ + public value: string; + + /** Entity synonyms. */ + public synonyms: string[]; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.EntityType.IEntity): google.cloud.dialogflow.cx.v3.EntityType.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @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.dialogflow.cx.v3.EntityType.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @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.dialogflow.cx.v3.EntityType.Entity; + + /** + * Verifies an Entity 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.EntityType.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.EntityType.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExcludedPhrase. */ + interface IExcludedPhrase { + + /** ExcludedPhrase value */ + value?: (string|null); + } + + /** Represents an ExcludedPhrase. */ + class ExcludedPhrase implements IExcludedPhrase { + + /** + * Constructs a new ExcludedPhrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase); + + /** ExcludedPhrase value. */ + public value: string; + + /** + * Creates a new ExcludedPhrase instance using the specified properties. + * @param [properties] Properties to set + * @returns ExcludedPhrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase): google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase; + + /** + * Encodes the specified ExcludedPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.verify|verify} messages. + * @param message ExcludedPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExcludedPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.verify|verify} messages. + * @param message ExcludedPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExcludedPhrase + * @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.dialogflow.cx.v3.EntityType.ExcludedPhrase; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExcludedPhrase + * @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.dialogflow.cx.v3.EntityType.ExcludedPhrase; + + /** + * Verifies an ExcludedPhrase 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 ExcludedPhrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExcludedPhrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase; + + /** + * Creates a plain object from an ExcludedPhrase message. Also converts values to other types if specified. + * @param message ExcludedPhrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExcludedPhrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExcludedPhrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportEntityTypesRequest. */ + interface IExportEntityTypesRequest { + + /** ExportEntityTypesRequest parent */ + parent?: (string|null); + + /** ExportEntityTypesRequest entityTypes */ + entityTypes?: (string[]|null); + + /** ExportEntityTypesRequest entityTypesUri */ + entityTypesUri?: (string|null); + + /** ExportEntityTypesRequest entityTypesContentInline */ + entityTypesContentInline?: (boolean|null); + + /** ExportEntityTypesRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat|null); + + /** ExportEntityTypesRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents an ExportEntityTypesRequest. */ + class ExportEntityTypesRequest implements IExportEntityTypesRequest { + + /** + * Constructs a new ExportEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest); + + /** ExportEntityTypesRequest parent. */ + public parent: string; + + /** ExportEntityTypesRequest entityTypes. */ + public entityTypes: string[]; + + /** ExportEntityTypesRequest entityTypesUri. */ + public entityTypesUri?: (string|null); + + /** ExportEntityTypesRequest entityTypesContentInline. */ + public entityTypesContentInline?: (boolean|null); + + /** ExportEntityTypesRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat); + + /** ExportEntityTypesRequest languageCode. */ + public languageCode: string; + + /** ExportEntityTypesRequest destination. */ + public destination?: ("entityTypesUri"|"entityTypesContentInline"); + + /** + * Creates a new ExportEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest): google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest; + + /** + * Encodes the specified ExportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.verify|verify} messages. + * @param message ExportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.verify|verify} messages. + * @param message ExportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntityTypesRequest + * @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.dialogflow.cx.v3.ExportEntityTypesRequest; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntityTypesRequest + * @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.dialogflow.cx.v3.ExportEntityTypesRequest; + + /** + * Verifies an ExportEntityTypesRequest 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 ExportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest; + + /** + * Creates a plain object from an ExportEntityTypesRequest message. Also converts values to other types if specified. + * @param message ExportEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportEntityTypesRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON_PACKAGE = 5 + } + } + + /** Properties of an ExportEntityTypesResponse. */ + interface IExportEntityTypesResponse { + + /** ExportEntityTypesResponse entityTypesUri */ + entityTypesUri?: (string|null); + + /** ExportEntityTypesResponse entityTypesContent */ + entityTypesContent?: (google.cloud.dialogflow.cx.v3.IInlineDestination|null); + } + + /** Represents an ExportEntityTypesResponse. */ + class ExportEntityTypesResponse implements IExportEntityTypesResponse { + + /** + * Constructs a new ExportEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse); + + /** ExportEntityTypesResponse entityTypesUri. */ + public entityTypesUri?: (string|null); + + /** ExportEntityTypesResponse entityTypesContent. */ + public entityTypesContent?: (google.cloud.dialogflow.cx.v3.IInlineDestination|null); + + /** ExportEntityTypesResponse exportedEntityTypes. */ + public exportedEntityTypes?: ("entityTypesUri"|"entityTypesContent"); + + /** + * Creates a new ExportEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse): google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse; + + /** + * Encodes the specified ExportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse.verify|verify} messages. + * @param message ExportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse.verify|verify} messages. + * @param message ExportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntityTypesResponse + * @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.dialogflow.cx.v3.ExportEntityTypesResponse; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntityTypesResponse + * @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.dialogflow.cx.v3.ExportEntityTypesResponse; + + /** + * Verifies an ExportEntityTypesResponse 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 ExportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse; + + /** + * Creates a plain object from an ExportEntityTypesResponse message. Also converts values to other types if specified. + * @param message ExportEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportEntityTypesMetadata. */ + interface IExportEntityTypesMetadata { + } + + /** Represents an ExportEntityTypesMetadata. */ + class ExportEntityTypesMetadata implements IExportEntityTypesMetadata { + + /** + * Constructs a new ExportEntityTypesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata); + + /** + * Creates a new ExportEntityTypesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntityTypesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata): google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata; + + /** + * Encodes the specified ExportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata.verify|verify} messages. + * @param message ExportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata.verify|verify} messages. + * @param message ExportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntityTypesMetadata + * @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.dialogflow.cx.v3.ExportEntityTypesMetadata; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntityTypesMetadata + * @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.dialogflow.cx.v3.ExportEntityTypesMetadata; + + /** + * Verifies an ExportEntityTypesMetadata 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 ExportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntityTypesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata; + + /** + * Creates a plain object from an ExportEntityTypesMetadata message. Also converts values to other types if specified. + * @param message ExportEntityTypesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEntityTypesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEntityTypesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportEntityTypesRequest. */ + interface IImportEntityTypesRequest { + + /** ImportEntityTypesRequest parent */ + parent?: (string|null); + + /** ImportEntityTypesRequest entityTypesUri */ + entityTypesUri?: (string|null); + + /** ImportEntityTypesRequest entityTypesContent */ + entityTypesContent?: (google.cloud.dialogflow.cx.v3.IInlineSource|null); + + /** ImportEntityTypesRequest mergeOption */ + mergeOption?: (google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption|null); + + /** ImportEntityTypesRequest targetEntityType */ + targetEntityType?: (string|null); + } + + /** Represents an ImportEntityTypesRequest. */ + class ImportEntityTypesRequest implements IImportEntityTypesRequest { + + /** + * Constructs a new ImportEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest); + + /** ImportEntityTypesRequest parent. */ + public parent: string; + + /** ImportEntityTypesRequest entityTypesUri. */ + public entityTypesUri?: (string|null); + + /** ImportEntityTypesRequest entityTypesContent. */ + public entityTypesContent?: (google.cloud.dialogflow.cx.v3.IInlineSource|null); + + /** ImportEntityTypesRequest mergeOption. */ + public mergeOption: (google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption); + + /** ImportEntityTypesRequest targetEntityType. */ + public targetEntityType: string; + + /** ImportEntityTypesRequest entityTypes. */ + public entityTypes?: ("entityTypesUri"|"entityTypesContent"); + + /** + * Creates a new ImportEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest): google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest; + + /** + * Encodes the specified ImportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.verify|verify} messages. + * @param message ImportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.verify|verify} messages. + * @param message ImportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntityTypesRequest + * @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.dialogflow.cx.v3.ImportEntityTypesRequest; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntityTypesRequest + * @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.dialogflow.cx.v3.ImportEntityTypesRequest; + + /** + * Verifies an ImportEntityTypesRequest 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 ImportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest; + + /** + * Creates a plain object from an ImportEntityTypesRequest message. Also converts values to other types if specified. + * @param message ImportEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportEntityTypesRequest { + + /** MergeOption enum. */ + enum MergeOption { + MERGE_OPTION_UNSPECIFIED = 0, + REPLACE = 1, + MERGE = 2, + RENAME = 3, + REPORT_CONFLICT = 4, + KEEP = 5 + } + } + + /** Properties of an ImportEntityTypesResponse. */ + interface IImportEntityTypesResponse { + + /** ImportEntityTypesResponse entityTypes */ + entityTypes?: (string[]|null); + + /** ImportEntityTypesResponse conflictingResources */ + conflictingResources?: (google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources|null); + } + + /** Represents an ImportEntityTypesResponse. */ + class ImportEntityTypesResponse implements IImportEntityTypesResponse { + + /** + * Constructs a new ImportEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse); + + /** ImportEntityTypesResponse entityTypes. */ + public entityTypes: string[]; + + /** ImportEntityTypesResponse conflictingResources. */ + public conflictingResources?: (google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources|null); + + /** + * Creates a new ImportEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse): google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse; + + /** + * Encodes the specified ImportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.verify|verify} messages. + * @param message ImportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.verify|verify} messages. + * @param message ImportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntityTypesResponse + * @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.dialogflow.cx.v3.ImportEntityTypesResponse; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntityTypesResponse + * @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.dialogflow.cx.v3.ImportEntityTypesResponse; + + /** + * Verifies an ImportEntityTypesResponse 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 ImportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse; + + /** + * Creates a plain object from an ImportEntityTypesResponse message. Also converts values to other types if specified. + * @param message ImportEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportEntityTypesResponse { + + /** Properties of a ConflictingResources. */ + interface IConflictingResources { + + /** ConflictingResources entityTypeDisplayNames */ + entityTypeDisplayNames?: (string[]|null); + + /** ConflictingResources entityDisplayNames */ + entityDisplayNames?: (string[]|null); + } + + /** Represents a ConflictingResources. */ + class ConflictingResources implements IConflictingResources { + + /** + * Constructs a new ConflictingResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources); + + /** ConflictingResources entityTypeDisplayNames. */ + public entityTypeDisplayNames: string[]; + + /** ConflictingResources entityDisplayNames. */ + public entityDisplayNames: string[]; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ConflictingResources instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources): google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConflictingResources + * @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.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConflictingResources + * @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.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources; + + /** + * Verifies a ConflictingResources 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 ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConflictingResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @param message ConflictingResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConflictingResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConflictingResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportEntityTypesMetadata. */ + interface IImportEntityTypesMetadata { + } + + /** Represents an ImportEntityTypesMetadata. */ + class ImportEntityTypesMetadata implements IImportEntityTypesMetadata { + + /** + * Constructs a new ImportEntityTypesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata); + + /** + * Creates a new ImportEntityTypesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntityTypesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata): google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata; + + /** + * Encodes the specified ImportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata.verify|verify} messages. + * @param message ImportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata.verify|verify} messages. + * @param message ImportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntityTypesMetadata + * @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.dialogflow.cx.v3.ImportEntityTypesMetadata; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntityTypesMetadata + * @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.dialogflow.cx.v3.ImportEntityTypesMetadata; + + /** + * Verifies an ImportEntityTypesMetadata 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 ImportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntityTypesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata; + + /** + * Creates a plain object from an ImportEntityTypesMetadata message. Also converts values to other types if specified. + * @param message ImportEntityTypesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEntityTypesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEntityTypesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEntityTypesRequest. */ + interface IListEntityTypesRequest { + + /** ListEntityTypesRequest parent */ + parent?: (string|null); + + /** ListEntityTypesRequest languageCode */ + languageCode?: (string|null); + + /** ListEntityTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListEntityTypesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEntityTypesRequest. */ + class ListEntityTypesRequest implements IListEntityTypesRequest { + + /** + * Constructs a new ListEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListEntityTypesRequest); + + /** ListEntityTypesRequest parent. */ + public parent: string; + + /** ListEntityTypesRequest languageCode. */ + public languageCode: string; + + /** ListEntityTypesRequest pageSize. */ + public pageSize: number; + + /** ListEntityTypesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListEntityTypesRequest): google.cloud.dialogflow.cx.v3.ListEntityTypesRequest; + + /** + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntityTypesRequest + * @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.dialogflow.cx.v3.ListEntityTypesRequest; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntityTypesRequest + * @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.dialogflow.cx.v3.ListEntityTypesRequest; + + /** + * Verifies a ListEntityTypesRequest 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 ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListEntityTypesRequest; + + /** + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEntityTypesResponse. */ + interface IListEntityTypesResponse { + + /** ListEntityTypesResponse entityTypes */ + entityTypes?: (google.cloud.dialogflow.cx.v3.IEntityType[]|null); + + /** ListEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEntityTypesResponse. */ + class ListEntityTypesResponse implements IListEntityTypesResponse { + + /** + * Constructs a new ListEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListEntityTypesResponse); + + /** ListEntityTypesResponse entityTypes. */ + public entityTypes: google.cloud.dialogflow.cx.v3.IEntityType[]; + + /** ListEntityTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListEntityTypesResponse): google.cloud.dialogflow.cx.v3.ListEntityTypesResponse; + + /** + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntityTypesResponse + * @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.dialogflow.cx.v3.ListEntityTypesResponse; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntityTypesResponse + * @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.dialogflow.cx.v3.ListEntityTypesResponse; + + /** + * Verifies a ListEntityTypesResponse 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 ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListEntityTypesResponse; + + /** + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEntityTypeRequest. */ + interface IGetEntityTypeRequest { + + /** GetEntityTypeRequest name */ + name?: (string|null); + + /** GetEntityTypeRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetEntityTypeRequest. */ + class GetEntityTypeRequest implements IGetEntityTypeRequest { + + /** + * Constructs a new GetEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest); + + /** GetEntityTypeRequest name. */ + public name: string; + + /** GetEntityTypeRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest): google.cloud.dialogflow.cx.v3.GetEntityTypeRequest; + + /** + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEntityTypeRequest + * @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.dialogflow.cx.v3.GetEntityTypeRequest; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEntityTypeRequest + * @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.dialogflow.cx.v3.GetEntityTypeRequest; + + /** + * Verifies a GetEntityTypeRequest 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 GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetEntityTypeRequest; + + /** + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEntityTypeRequest. */ + interface ICreateEntityTypeRequest { + + /** CreateEntityTypeRequest parent */ + parent?: (string|null); + + /** CreateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.cx.v3.IEntityType|null); + + /** CreateEntityTypeRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateEntityTypeRequest. */ + class CreateEntityTypeRequest implements ICreateEntityTypeRequest { + + /** + * Constructs a new CreateEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest); + + /** CreateEntityTypeRequest parent. */ + public parent: string; + + /** CreateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.cx.v3.IEntityType|null); + + /** CreateEntityTypeRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest): google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest; + + /** + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEntityTypeRequest + * @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.dialogflow.cx.v3.CreateEntityTypeRequest; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEntityTypeRequest + * @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.dialogflow.cx.v3.CreateEntityTypeRequest; + + /** + * Verifies a CreateEntityTypeRequest 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 CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest; + + /** + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEntityTypeRequest. */ + interface IUpdateEntityTypeRequest { + + /** UpdateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.cx.v3.IEntityType|null); + + /** UpdateEntityTypeRequest languageCode */ + languageCode?: (string|null); + + /** UpdateEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEntityTypeRequest. */ + class UpdateEntityTypeRequest implements IUpdateEntityTypeRequest { + + /** + * Constructs a new UpdateEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest); + + /** UpdateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.cx.v3.IEntityType|null); + + /** UpdateEntityTypeRequest languageCode. */ + public languageCode: string; + + /** UpdateEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest): google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest; + + /** + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEntityTypeRequest + * @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.dialogflow.cx.v3.UpdateEntityTypeRequest; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEntityTypeRequest + * @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.dialogflow.cx.v3.UpdateEntityTypeRequest; + + /** + * Verifies an UpdateEntityTypeRequest 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 UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest; + + /** + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEntityTypeRequest. */ + interface IDeleteEntityTypeRequest { + + /** DeleteEntityTypeRequest name */ + name?: (string|null); + + /** DeleteEntityTypeRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteEntityTypeRequest. */ + class DeleteEntityTypeRequest implements IDeleteEntityTypeRequest { + + /** + * Constructs a new DeleteEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest); + + /** DeleteEntityTypeRequest name. */ + public name: string; + + /** DeleteEntityTypeRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest): google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest; + + /** + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEntityTypeRequest + * @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.dialogflow.cx.v3.DeleteEntityTypeRequest; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEntityTypeRequest + * @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.dialogflow.cx.v3.DeleteEntityTypeRequest; + + /** + * Verifies a DeleteEntityTypeRequest 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 DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest; + + /** + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InlineDestination. */ + interface IInlineDestination { + + /** InlineDestination content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an InlineDestination. */ + class InlineDestination implements IInlineDestination { + + /** + * Constructs a new InlineDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IInlineDestination); + + /** InlineDestination content. */ + public content: (Uint8Array|Buffer|string); + + /** + * Creates a new InlineDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineDestination instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IInlineDestination): google.cloud.dialogflow.cx.v3.InlineDestination; + + /** + * Encodes the specified InlineDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineDestination.verify|verify} messages. + * @param message InlineDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IInlineDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineDestination.verify|verify} messages. + * @param message InlineDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IInlineDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineDestination + * @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.dialogflow.cx.v3.InlineDestination; + + /** + * Decodes an InlineDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineDestination + * @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.dialogflow.cx.v3.InlineDestination; + + /** + * Verifies an InlineDestination 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 InlineDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.InlineDestination; + + /** + * Creates a plain object from an InlineDestination message. Also converts values to other types if specified. + * @param message InlineDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.InlineDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InlineSource. */ + interface IInlineSource { + + /** InlineSource content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an InlineSource. */ + class InlineSource implements IInlineSource { + + /** + * Constructs a new InlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IInlineSource); + + /** InlineSource content. */ + public content: (Uint8Array|Buffer|string); + + /** + * Creates a new InlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSource instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IInlineSource): google.cloud.dialogflow.cx.v3.InlineSource; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSource + * @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.dialogflow.cx.v3.InlineSource; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSource + * @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.dialogflow.cx.v3.InlineSource; + + /** + * Verifies an InlineSource 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 InlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.InlineSource; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @param message InlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.InlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Environments */ + class Environments extends $protobuf.rpc.Service { + + /** + * Constructs a new Environments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Environments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + */ + public listEnvironments(request: google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, callback: google.cloud.dialogflow.cx.v3.Environments.ListEnvironmentsCallback): void; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @returns Promise + */ + public listEnvironments(request: google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest): Promise; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Environment + */ + public getEnvironment(request: google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3.Environments.GetEnvironmentCallback): void; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @returns Promise + */ + public getEnvironment(request: google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest): Promise; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEnvironment(request: google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3.Environments.CreateEnvironmentCallback): void; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @returns Promise + */ + public createEnvironment(request: google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest): Promise; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateEnvironment(request: google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironmentCallback): void; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @returns Promise + */ + public updateEnvironment(request: google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest): Promise; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEnvironment(request: google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironmentCallback): void; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @returns Promise + */ + public deleteEnvironment(request: google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest): Promise; + + /** + * Calls LookupEnvironmentHistory. + * @param request LookupEnvironmentHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupEnvironmentHistoryResponse + */ + public lookupEnvironmentHistory(request: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, callback: google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistoryCallback): void; + + /** + * Calls LookupEnvironmentHistory. + * @param request LookupEnvironmentHistoryRequest message or plain object + * @returns Promise + */ + public lookupEnvironmentHistory(request: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest): Promise; + + /** + * Calls RunContinuousTest. + * @param request RunContinuousTestRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runContinuousTest(request: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, callback: google.cloud.dialogflow.cx.v3.Environments.RunContinuousTestCallback): void; + + /** + * Calls RunContinuousTest. + * @param request RunContinuousTestRequest message or plain object + * @returns Promise + */ + public runContinuousTest(request: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest): Promise; + + /** + * Calls ListContinuousTestResults. + * @param request ListContinuousTestResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListContinuousTestResultsResponse + */ + public listContinuousTestResults(request: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, callback: google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResultsCallback): void; + + /** + * Calls ListContinuousTestResults. + * @param request ListContinuousTestResultsRequest message or plain object + * @returns Promise + */ + public listContinuousTestResults(request: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest): Promise; + + /** + * Calls DeployFlow. + * @param request DeployFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployFlow(request: google.cloud.dialogflow.cx.v3.IDeployFlowRequest, callback: google.cloud.dialogflow.cx.v3.Environments.DeployFlowCallback): void; + + /** + * Calls DeployFlow. + * @param request DeployFlowRequest message or plain object + * @returns Promise + */ + public deployFlow(request: google.cloud.dialogflow.cx.v3.IDeployFlowRequest): Promise; + } + + namespace Environments { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|listEnvironments}. + * @param error Error, if any + * @param [response] ListEnvironmentsResponse + */ + type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|getEnvironment}. + * @param error Error, if any + * @param [response] Environment + */ + type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Environment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|createEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|updateEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|deleteEnvironment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEnvironmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|lookupEnvironmentHistory}. + * @param error Error, if any + * @param [response] LookupEnvironmentHistoryResponse + */ + type LookupEnvironmentHistoryCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|runContinuousTest}. + * @param error Error, if any + * @param [response] Operation + */ + type RunContinuousTestCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|listContinuousTestResults}. + * @param error Error, if any + * @param [response] ListContinuousTestResultsResponse + */ + type ListContinuousTestResultsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|deployFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ + name?: (string|null); + + /** Environment displayName */ + displayName?: (string|null); + + /** Environment description */ + description?: (string|null); + + /** Environment versionConfigs */ + versionConfigs?: (google.cloud.dialogflow.cx.v3.Environment.IVersionConfig[]|null); + + /** Environment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment testCasesConfig */ + testCasesConfig?: (google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig|null); + + /** Environment webhookConfig */ + webhookConfig?: (google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IEnvironment); + + /** Environment name. */ + public name: string; + + /** Environment displayName. */ + public displayName: string; + + /** Environment description. */ + public description: string; + + /** Environment versionConfigs. */ + public versionConfigs: google.cloud.dialogflow.cx.v3.Environment.IVersionConfig[]; + + /** Environment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment testCasesConfig. */ + public testCasesConfig?: (google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig|null); + + /** Environment webhookConfig. */ + public webhookConfig?: (google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IEnvironment): google.cloud.dialogflow.cx.v3.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @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.dialogflow.cx.v3.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @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.dialogflow.cx.v3.Environment; + + /** + * Verifies an Environment 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 Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** Properties of a VersionConfig. */ + interface IVersionConfig { + + /** VersionConfig version */ + version?: (string|null); + } + + /** Represents a VersionConfig. */ + class VersionConfig implements IVersionConfig { + + /** + * Constructs a new VersionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Environment.IVersionConfig); + + /** VersionConfig version. */ + public version: string; + + /** + * Creates a new VersionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Environment.IVersionConfig): google.cloud.dialogflow.cx.v3.Environment.VersionConfig; + + /** + * Encodes the specified VersionConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.VersionConfig.verify|verify} messages. + * @param message VersionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Environment.IVersionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.VersionConfig.verify|verify} messages. + * @param message VersionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Environment.IVersionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionConfig + * @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.dialogflow.cx.v3.Environment.VersionConfig; + + /** + * Decodes a VersionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionConfig + * @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.dialogflow.cx.v3.Environment.VersionConfig; + + /** + * Verifies a VersionConfig 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 VersionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Environment.VersionConfig; + + /** + * Creates a plain object from a VersionConfig message. Also converts values to other types if specified. + * @param message VersionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Environment.VersionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestCasesConfig. */ + interface ITestCasesConfig { + + /** TestCasesConfig testCases */ + testCases?: (string[]|null); + + /** TestCasesConfig enableContinuousRun */ + enableContinuousRun?: (boolean|null); + + /** TestCasesConfig enablePredeploymentRun */ + enablePredeploymentRun?: (boolean|null); + } + + /** Represents a TestCasesConfig. */ + class TestCasesConfig implements ITestCasesConfig { + + /** + * Constructs a new TestCasesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig); + + /** TestCasesConfig testCases. */ + public testCases: string[]; + + /** TestCasesConfig enableContinuousRun. */ + public enableContinuousRun: boolean; + + /** TestCasesConfig enablePredeploymentRun. */ + public enablePredeploymentRun: boolean; + + /** + * Creates a new TestCasesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCasesConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig): google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig; + + /** + * Encodes the specified TestCasesConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.verify|verify} messages. + * @param message TestCasesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCasesConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.verify|verify} messages. + * @param message TestCasesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCasesConfig + * @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.dialogflow.cx.v3.Environment.TestCasesConfig; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCasesConfig + * @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.dialogflow.cx.v3.Environment.TestCasesConfig; + + /** + * Verifies a TestCasesConfig 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 TestCasesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCasesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig; + + /** + * Creates a plain object from a TestCasesConfig message. Also converts values to other types if specified. + * @param message TestCasesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCasesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCasesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebhookConfig. */ + interface IWebhookConfig { + + /** WebhookConfig webhookOverrides */ + webhookOverrides?: (google.cloud.dialogflow.cx.v3.IWebhook[]|null); + } + + /** Represents a WebhookConfig. */ + class WebhookConfig implements IWebhookConfig { + + /** + * Constructs a new WebhookConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig); + + /** WebhookConfig webhookOverrides. */ + public webhookOverrides: google.cloud.dialogflow.cx.v3.IWebhook[]; + + /** + * Creates a new WebhookConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig): google.cloud.dialogflow.cx.v3.Environment.WebhookConfig; + + /** + * Encodes the specified WebhookConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.verify|verify} messages. + * @param message WebhookConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.verify|verify} messages. + * @param message WebhookConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookConfig + * @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.dialogflow.cx.v3.Environment.WebhookConfig; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookConfig + * @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.dialogflow.cx.v3.Environment.WebhookConfig; + + /** + * Verifies a WebhookConfig 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 WebhookConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Environment.WebhookConfig; + + /** + * Creates a plain object from a WebhookConfig message. Also converts values to other types if specified. + * @param message WebhookConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Environment.WebhookConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListEnvironmentsRequest. */ + interface IListEnvironmentsRequest { + + /** ListEnvironmentsRequest parent */ + parent?: (string|null); + + /** ListEnvironmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListEnvironmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEnvironmentsRequest. */ + class ListEnvironmentsRequest implements IListEnvironmentsRequest { + + /** + * Constructs a new ListEnvironmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest); + + /** ListEnvironmentsRequest parent. */ + public parent: string; + + /** ListEnvironmentsRequest pageSize. */ + public pageSize: number; + + /** ListEnvironmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest): google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsRequest + * @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.dialogflow.cx.v3.ListEnvironmentsRequest; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsRequest + * @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.dialogflow.cx.v3.ListEnvironmentsRequest; + + /** + * Verifies a ListEnvironmentsRequest 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 ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @param message ListEnvironmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEnvironmentsResponse. */ + interface IListEnvironmentsResponse { + + /** ListEnvironmentsResponse environments */ + environments?: (google.cloud.dialogflow.cx.v3.IEnvironment[]|null); + + /** ListEnvironmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEnvironmentsResponse. */ + class ListEnvironmentsResponse implements IListEnvironmentsResponse { + + /** + * Constructs a new ListEnvironmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse); + + /** ListEnvironmentsResponse environments. */ + public environments: google.cloud.dialogflow.cx.v3.IEnvironment[]; + + /** ListEnvironmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse): google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsResponse + * @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.dialogflow.cx.v3.ListEnvironmentsResponse; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsResponse + * @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.dialogflow.cx.v3.ListEnvironmentsResponse; + + /** + * Verifies a ListEnvironmentsResponse 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 ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @param message ListEnvironmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEnvironmentRequest. */ + interface IGetEnvironmentRequest { + + /** GetEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a GetEnvironmentRequest. */ + class GetEnvironmentRequest implements IGetEnvironmentRequest { + + /** + * Constructs a new GetEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest); + + /** GetEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest): google.cloud.dialogflow.cx.v3.GetEnvironmentRequest; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEnvironmentRequest + * @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.dialogflow.cx.v3.GetEnvironmentRequest; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEnvironmentRequest + * @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.dialogflow.cx.v3.GetEnvironmentRequest; + + /** + * Verifies a GetEnvironmentRequest 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 GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetEnvironmentRequest; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @param message GetEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEnvironmentRequest. */ + interface ICreateEnvironmentRequest { + + /** CreateEnvironmentRequest parent */ + parent?: (string|null); + + /** CreateEnvironmentRequest environment */ + environment?: (google.cloud.dialogflow.cx.v3.IEnvironment|null); + } + + /** Represents a CreateEnvironmentRequest. */ + class CreateEnvironmentRequest implements ICreateEnvironmentRequest { + + /** + * Constructs a new CreateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest); + + /** CreateEnvironmentRequest parent. */ + public parent: string; + + /** CreateEnvironmentRequest environment. */ + public environment?: (google.cloud.dialogflow.cx.v3.IEnvironment|null); + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest): google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest; + + /** + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEnvironmentRequest + * @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.dialogflow.cx.v3.CreateEnvironmentRequest; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEnvironmentRequest + * @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.dialogflow.cx.v3.CreateEnvironmentRequest; + + /** + * Verifies a CreateEnvironmentRequest 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 CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest; + + /** + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @param message CreateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEnvironmentRequest. */ + interface IUpdateEnvironmentRequest { + + /** UpdateEnvironmentRequest environment */ + environment?: (google.cloud.dialogflow.cx.v3.IEnvironment|null); + + /** UpdateEnvironmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEnvironmentRequest. */ + class UpdateEnvironmentRequest implements IUpdateEnvironmentRequest { + + /** + * Constructs a new UpdateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest); + + /** UpdateEnvironmentRequest environment. */ + public environment?: (google.cloud.dialogflow.cx.v3.IEnvironment|null); + + /** UpdateEnvironmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest): google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEnvironmentRequest + * @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.dialogflow.cx.v3.UpdateEnvironmentRequest; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEnvironmentRequest + * @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.dialogflow.cx.v3.UpdateEnvironmentRequest; + + /** + * Verifies an UpdateEnvironmentRequest 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 UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest; + + /** + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @param message UpdateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEnvironmentRequest. */ + interface IDeleteEnvironmentRequest { + + /** DeleteEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEnvironmentRequest. */ + class DeleteEnvironmentRequest implements IDeleteEnvironmentRequest { + + /** + * Constructs a new DeleteEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest); + + /** DeleteEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest): google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEnvironmentRequest + * @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.dialogflow.cx.v3.DeleteEnvironmentRequest; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEnvironmentRequest + * @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.dialogflow.cx.v3.DeleteEnvironmentRequest; + + /** + * Verifies a DeleteEnvironmentRequest 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 DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @param message DeleteEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupEnvironmentHistoryRequest. */ + interface ILookupEnvironmentHistoryRequest { + + /** LookupEnvironmentHistoryRequest name */ + name?: (string|null); + + /** LookupEnvironmentHistoryRequest pageSize */ + pageSize?: (number|null); + + /** LookupEnvironmentHistoryRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a LookupEnvironmentHistoryRequest. */ + class LookupEnvironmentHistoryRequest implements ILookupEnvironmentHistoryRequest { + + /** + * Constructs a new LookupEnvironmentHistoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest); + + /** LookupEnvironmentHistoryRequest name. */ + public name: string; + + /** LookupEnvironmentHistoryRequest pageSize. */ + public pageSize: number; + + /** LookupEnvironmentHistoryRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new LookupEnvironmentHistoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupEnvironmentHistoryRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest): google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @param message LookupEnvironmentHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @param message LookupEnvironmentHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupEnvironmentHistoryRequest + * @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.dialogflow.cx.v3.LookupEnvironmentHistoryRequest; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupEnvironmentHistoryRequest + * @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.dialogflow.cx.v3.LookupEnvironmentHistoryRequest; + + /** + * Verifies a LookupEnvironmentHistoryRequest 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 LookupEnvironmentHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupEnvironmentHistoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest; + + /** + * Creates a plain object from a LookupEnvironmentHistoryRequest message. Also converts values to other types if specified. + * @param message LookupEnvironmentHistoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupEnvironmentHistoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupEnvironmentHistoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupEnvironmentHistoryResponse. */ + interface ILookupEnvironmentHistoryResponse { + + /** LookupEnvironmentHistoryResponse environments */ + environments?: (google.cloud.dialogflow.cx.v3.IEnvironment[]|null); + + /** LookupEnvironmentHistoryResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a LookupEnvironmentHistoryResponse. */ + class LookupEnvironmentHistoryResponse implements ILookupEnvironmentHistoryResponse { + + /** + * Constructs a new LookupEnvironmentHistoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse); + + /** LookupEnvironmentHistoryResponse environments. */ + public environments: google.cloud.dialogflow.cx.v3.IEnvironment[]; + + /** LookupEnvironmentHistoryResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new LookupEnvironmentHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupEnvironmentHistoryResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse): google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse; + + /** + * Encodes the specified LookupEnvironmentHistoryResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @param message LookupEnvironmentHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupEnvironmentHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @param message LookupEnvironmentHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupEnvironmentHistoryResponse + * @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.dialogflow.cx.v3.LookupEnvironmentHistoryResponse; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupEnvironmentHistoryResponse + * @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.dialogflow.cx.v3.LookupEnvironmentHistoryResponse; + + /** + * Verifies a LookupEnvironmentHistoryResponse 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 LookupEnvironmentHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupEnvironmentHistoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse; + + /** + * Creates a plain object from a LookupEnvironmentHistoryResponse message. Also converts values to other types if specified. + * @param message LookupEnvironmentHistoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupEnvironmentHistoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupEnvironmentHistoryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousTestResult. */ + interface IContinuousTestResult { + + /** ContinuousTestResult name */ + name?: (string|null); + + /** ContinuousTestResult result */ + result?: (google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|keyof typeof google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|null); + + /** ContinuousTestResult testCaseResults */ + testCaseResults?: (string[]|null); + + /** ContinuousTestResult runTime */ + runTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousTestResult. */ + class ContinuousTestResult implements IContinuousTestResult { + + /** + * Constructs a new ContinuousTestResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IContinuousTestResult); + + /** ContinuousTestResult name. */ + public name: string; + + /** ContinuousTestResult result. */ + public result: (google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|keyof typeof google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult); + + /** ContinuousTestResult testCaseResults. */ + public testCaseResults: string[]; + + /** ContinuousTestResult runTime. */ + public runTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousTestResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousTestResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IContinuousTestResult): google.cloud.dialogflow.cx.v3.ContinuousTestResult; + + /** + * Encodes the specified ContinuousTestResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @param message ContinuousTestResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IContinuousTestResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousTestResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @param message ContinuousTestResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IContinuousTestResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousTestResult + * @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.dialogflow.cx.v3.ContinuousTestResult; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousTestResult + * @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.dialogflow.cx.v3.ContinuousTestResult; + + /** + * Verifies a ContinuousTestResult 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 ContinuousTestResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousTestResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ContinuousTestResult; + + /** + * Creates a plain object from a ContinuousTestResult message. Also converts values to other types if specified. + * @param message ContinuousTestResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ContinuousTestResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousTestResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousTestResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContinuousTestResult { + + /** AggregatedTestResult enum. */ + enum AggregatedTestResult { + AGGREGATED_TEST_RESULT_UNSPECIFIED = 0, + PASSED = 1, + FAILED = 2 + } + } + + /** Properties of a RunContinuousTestRequest. */ + interface IRunContinuousTestRequest { + + /** RunContinuousTestRequest environment */ + environment?: (string|null); + } + + /** Represents a RunContinuousTestRequest. */ + class RunContinuousTestRequest implements IRunContinuousTestRequest { + + /** + * Constructs a new RunContinuousTestRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest); + + /** RunContinuousTestRequest environment. */ + public environment: string; + + /** + * Creates a new RunContinuousTestRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest): google.cloud.dialogflow.cx.v3.RunContinuousTestRequest; + + /** + * Encodes the specified RunContinuousTestRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @param message RunContinuousTestRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @param message RunContinuousTestRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestRequest + * @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.dialogflow.cx.v3.RunContinuousTestRequest; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestRequest + * @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.dialogflow.cx.v3.RunContinuousTestRequest; + + /** + * Verifies a RunContinuousTestRequest 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 RunContinuousTestRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunContinuousTestRequest; + + /** + * Creates a plain object from a RunContinuousTestRequest message. Also converts values to other types if specified. + * @param message RunContinuousTestRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunContinuousTestRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunContinuousTestRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunContinuousTestResponse. */ + interface IRunContinuousTestResponse { + + /** RunContinuousTestResponse continuousTestResult */ + continuousTestResult?: (google.cloud.dialogflow.cx.v3.IContinuousTestResult|null); + } + + /** Represents a RunContinuousTestResponse. */ + class RunContinuousTestResponse implements IRunContinuousTestResponse { + + /** + * Constructs a new RunContinuousTestResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse); + + /** RunContinuousTestResponse continuousTestResult. */ + public continuousTestResult?: (google.cloud.dialogflow.cx.v3.IContinuousTestResult|null); + + /** + * Creates a new RunContinuousTestResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse): google.cloud.dialogflow.cx.v3.RunContinuousTestResponse; + + /** + * Encodes the specified RunContinuousTestResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @param message RunContinuousTestResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @param message RunContinuousTestResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestResponse + * @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.dialogflow.cx.v3.RunContinuousTestResponse; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestResponse + * @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.dialogflow.cx.v3.RunContinuousTestResponse; + + /** + * Verifies a RunContinuousTestResponse 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 RunContinuousTestResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunContinuousTestResponse; + + /** + * Creates a plain object from a RunContinuousTestResponse message. Also converts values to other types if specified. + * @param message RunContinuousTestResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunContinuousTestResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunContinuousTestResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunContinuousTestMetadata. */ + interface IRunContinuousTestMetadata { + + /** RunContinuousTestMetadata errors */ + errors?: (google.cloud.dialogflow.cx.v3.ITestError[]|null); + } + + /** Represents a RunContinuousTestMetadata. */ + class RunContinuousTestMetadata implements IRunContinuousTestMetadata { + + /** + * Constructs a new RunContinuousTestMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata); + + /** RunContinuousTestMetadata errors. */ + public errors: google.cloud.dialogflow.cx.v3.ITestError[]; + + /** + * Creates a new RunContinuousTestMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata): google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata; + + /** + * Encodes the specified RunContinuousTestMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @param message RunContinuousTestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @param message RunContinuousTestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestMetadata + * @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.dialogflow.cx.v3.RunContinuousTestMetadata; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestMetadata + * @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.dialogflow.cx.v3.RunContinuousTestMetadata; + + /** + * Verifies a RunContinuousTestMetadata 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 RunContinuousTestMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata; + + /** + * Creates a plain object from a RunContinuousTestMetadata message. Also converts values to other types if specified. + * @param message RunContinuousTestMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunContinuousTestMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListContinuousTestResultsRequest. */ + interface IListContinuousTestResultsRequest { + + /** ListContinuousTestResultsRequest parent */ + parent?: (string|null); + + /** ListContinuousTestResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListContinuousTestResultsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListContinuousTestResultsRequest. */ + class ListContinuousTestResultsRequest implements IListContinuousTestResultsRequest { + + /** + * Constructs a new ListContinuousTestResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest); + + /** ListContinuousTestResultsRequest parent. */ + public parent: string; + + /** ListContinuousTestResultsRequest pageSize. */ + public pageSize: number; + + /** ListContinuousTestResultsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListContinuousTestResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContinuousTestResultsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest; + + /** + * Encodes the specified ListContinuousTestResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @param message ListContinuousTestResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContinuousTestResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @param message ListContinuousTestResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContinuousTestResultsRequest + * @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.dialogflow.cx.v3.ListContinuousTestResultsRequest; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContinuousTestResultsRequest + * @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.dialogflow.cx.v3.ListContinuousTestResultsRequest; + + /** + * Verifies a ListContinuousTestResultsRequest 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 ListContinuousTestResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContinuousTestResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest; + + /** + * Creates a plain object from a ListContinuousTestResultsRequest message. Also converts values to other types if specified. + * @param message ListContinuousTestResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContinuousTestResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContinuousTestResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListContinuousTestResultsResponse. */ + interface IListContinuousTestResultsResponse { + + /** ListContinuousTestResultsResponse continuousTestResults */ + continuousTestResults?: (google.cloud.dialogflow.cx.v3.IContinuousTestResult[]|null); + + /** ListContinuousTestResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListContinuousTestResultsResponse. */ + class ListContinuousTestResultsResponse implements IListContinuousTestResultsResponse { + + /** + * Constructs a new ListContinuousTestResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse); + + /** ListContinuousTestResultsResponse continuousTestResults. */ + public continuousTestResults: google.cloud.dialogflow.cx.v3.IContinuousTestResult[]; + + /** ListContinuousTestResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListContinuousTestResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContinuousTestResultsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse; + + /** + * Encodes the specified ListContinuousTestResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @param message ListContinuousTestResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContinuousTestResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @param message ListContinuousTestResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContinuousTestResultsResponse + * @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.dialogflow.cx.v3.ListContinuousTestResultsResponse; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContinuousTestResultsResponse + * @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.dialogflow.cx.v3.ListContinuousTestResultsResponse; + + /** + * Verifies a ListContinuousTestResultsResponse 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 ListContinuousTestResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContinuousTestResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse; + + /** + * Creates a plain object from a ListContinuousTestResultsResponse message. Also converts values to other types if specified. + * @param message ListContinuousTestResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContinuousTestResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContinuousTestResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployFlowRequest. */ + interface IDeployFlowRequest { + + /** DeployFlowRequest environment */ + environment?: (string|null); + + /** DeployFlowRequest flowVersion */ + flowVersion?: (string|null); + } + + /** Represents a DeployFlowRequest. */ + class DeployFlowRequest implements IDeployFlowRequest { + + /** + * Constructs a new DeployFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeployFlowRequest); + + /** DeployFlowRequest environment. */ + public environment: string; + + /** DeployFlowRequest flowVersion. */ + public flowVersion: string; + + /** + * Creates a new DeployFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeployFlowRequest): google.cloud.dialogflow.cx.v3.DeployFlowRequest; + + /** + * Encodes the specified DeployFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowRequest.verify|verify} messages. + * @param message DeployFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeployFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowRequest.verify|verify} messages. + * @param message DeployFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeployFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployFlowRequest + * @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.dialogflow.cx.v3.DeployFlowRequest; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployFlowRequest + * @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.dialogflow.cx.v3.DeployFlowRequest; + + /** + * Verifies a DeployFlowRequest 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 DeployFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeployFlowRequest; + + /** + * Creates a plain object from a DeployFlowRequest message. Also converts values to other types if specified. + * @param message DeployFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeployFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployFlowResponse. */ + interface IDeployFlowResponse { + + /** DeployFlowResponse environment */ + environment?: (google.cloud.dialogflow.cx.v3.IEnvironment|null); + + /** DeployFlowResponse deployment */ + deployment?: (string|null); + } + + /** Represents a DeployFlowResponse. */ + class DeployFlowResponse implements IDeployFlowResponse { + + /** + * Constructs a new DeployFlowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeployFlowResponse); + + /** DeployFlowResponse environment. */ + public environment?: (google.cloud.dialogflow.cx.v3.IEnvironment|null); + + /** DeployFlowResponse deployment. */ + public deployment: string; + + /** + * Creates a new DeployFlowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployFlowResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeployFlowResponse): google.cloud.dialogflow.cx.v3.DeployFlowResponse; + + /** + * Encodes the specified DeployFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowResponse.verify|verify} messages. + * @param message DeployFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeployFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowResponse.verify|verify} messages. + * @param message DeployFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeployFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployFlowResponse + * @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.dialogflow.cx.v3.DeployFlowResponse; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployFlowResponse + * @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.dialogflow.cx.v3.DeployFlowResponse; + + /** + * Verifies a DeployFlowResponse 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 DeployFlowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployFlowResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeployFlowResponse; + + /** + * Creates a plain object from a DeployFlowResponse message. Also converts values to other types if specified. + * @param message DeployFlowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeployFlowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployFlowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployFlowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployFlowMetadata. */ + interface IDeployFlowMetadata { + + /** DeployFlowMetadata testErrors */ + testErrors?: (google.cloud.dialogflow.cx.v3.ITestError[]|null); + } + + /** Represents a DeployFlowMetadata. */ + class DeployFlowMetadata implements IDeployFlowMetadata { + + /** + * Constructs a new DeployFlowMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeployFlowMetadata); + + /** DeployFlowMetadata testErrors. */ + public testErrors: google.cloud.dialogflow.cx.v3.ITestError[]; + + /** + * Creates a new DeployFlowMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployFlowMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeployFlowMetadata): google.cloud.dialogflow.cx.v3.DeployFlowMetadata; + + /** + * Encodes the specified DeployFlowMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowMetadata.verify|verify} messages. + * @param message DeployFlowMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeployFlowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployFlowMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowMetadata.verify|verify} messages. + * @param message DeployFlowMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeployFlowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployFlowMetadata + * @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.dialogflow.cx.v3.DeployFlowMetadata; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployFlowMetadata + * @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.dialogflow.cx.v3.DeployFlowMetadata; + + /** + * Verifies a DeployFlowMetadata 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 DeployFlowMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployFlowMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeployFlowMetadata; + + /** + * Creates a plain object from a DeployFlowMetadata message. Also converts values to other types if specified. + * @param message DeployFlowMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeployFlowMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployFlowMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployFlowMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TestCases */ + class TestCases extends $protobuf.rpc.Service { + + /** + * Constructs a new TestCases service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TestCases service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TestCases; + + /** + * Calls ListTestCases. + * @param request ListTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTestCasesResponse + */ + public listTestCases(request: google.cloud.dialogflow.cx.v3.IListTestCasesRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.ListTestCasesCallback): void; + + /** + * Calls ListTestCases. + * @param request ListTestCasesRequest message or plain object + * @returns Promise + */ + public listTestCases(request: google.cloud.dialogflow.cx.v3.IListTestCasesRequest): Promise; + + /** + * Calls BatchDeleteTestCases. + * @param request BatchDeleteTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public batchDeleteTestCases(request: google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCasesCallback): void; + + /** + * Calls BatchDeleteTestCases. + * @param request BatchDeleteTestCasesRequest message or plain object + * @returns Promise + */ + public batchDeleteTestCases(request: google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest): Promise; + + /** + * Calls GetTestCase. + * @param request GetTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCase + */ + public getTestCase(request: google.cloud.dialogflow.cx.v3.IGetTestCaseRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseCallback): void; + + /** + * Calls GetTestCase. + * @param request GetTestCaseRequest message or plain object + * @returns Promise + */ + public getTestCase(request: google.cloud.dialogflow.cx.v3.IGetTestCaseRequest): Promise; + + /** + * Calls CreateTestCase. + * @param request CreateTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCase + */ + public createTestCase(request: google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.CreateTestCaseCallback): void; + + /** + * Calls CreateTestCase. + * @param request CreateTestCaseRequest message or plain object + * @returns Promise + */ + public createTestCase(request: google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest): Promise; + + /** + * Calls UpdateTestCase. + * @param request UpdateTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCase + */ + public updateTestCase(request: google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCaseCallback): void; + + /** + * Calls UpdateTestCase. + * @param request UpdateTestCaseRequest message or plain object + * @returns Promise + */ + public updateTestCase(request: google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest): Promise; + + /** + * Calls RunTestCase. + * @param request RunTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runTestCase(request: google.cloud.dialogflow.cx.v3.IRunTestCaseRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.RunTestCaseCallback): void; + + /** + * Calls RunTestCase. + * @param request RunTestCaseRequest message or plain object + * @returns Promise + */ + public runTestCase(request: google.cloud.dialogflow.cx.v3.IRunTestCaseRequest): Promise; + + /** + * Calls BatchRunTestCases. + * @param request BatchRunTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchRunTestCases(request: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCasesCallback): void; + + /** + * Calls BatchRunTestCases. + * @param request BatchRunTestCasesRequest message or plain object + * @returns Promise + */ + public batchRunTestCases(request: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest): Promise; + + /** + * Calls CalculateCoverage. + * @param request CalculateCoverageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CalculateCoverageResponse + */ + public calculateCoverage(request: google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverageCallback): void; + + /** + * Calls CalculateCoverage. + * @param request CalculateCoverageRequest message or plain object + * @returns Promise + */ + public calculateCoverage(request: google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest): Promise; + + /** + * Calls ImportTestCases. + * @param request ImportTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importTestCases(request: google.cloud.dialogflow.cx.v3.IImportTestCasesRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.ImportTestCasesCallback): void; + + /** + * Calls ImportTestCases. + * @param request ImportTestCasesRequest message or plain object + * @returns Promise + */ + public importTestCases(request: google.cloud.dialogflow.cx.v3.IImportTestCasesRequest): Promise; + + /** + * Calls ExportTestCases. + * @param request ExportTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportTestCases(request: google.cloud.dialogflow.cx.v3.IExportTestCasesRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.ExportTestCasesCallback): void; + + /** + * Calls ExportTestCases. + * @param request ExportTestCasesRequest message or plain object + * @returns Promise + */ + public exportTestCases(request: google.cloud.dialogflow.cx.v3.IExportTestCasesRequest): Promise; + + /** + * Calls ListTestCaseResults. + * @param request ListTestCaseResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTestCaseResultsResponse + */ + public listTestCaseResults(request: google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResultsCallback): void; + + /** + * Calls ListTestCaseResults. + * @param request ListTestCaseResultsRequest message or plain object + * @returns Promise + */ + public listTestCaseResults(request: google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest): Promise; + + /** + * Calls GetTestCaseResult. + * @param request GetTestCaseResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCaseResult + */ + public getTestCaseResult(request: google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest, callback: google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResultCallback): void; + + /** + * Calls GetTestCaseResult. + * @param request GetTestCaseResultRequest message or plain object + * @returns Promise + */ + public getTestCaseResult(request: google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest): Promise; + } + + namespace TestCases { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|listTestCases}. + * @param error Error, if any + * @param [response] ListTestCasesResponse + */ + type ListTestCasesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListTestCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|batchDeleteTestCases}. + * @param error Error, if any + * @param [response] Empty + */ + type BatchDeleteTestCasesCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|getTestCase}. + * @param error Error, if any + * @param [response] TestCase + */ + type GetTestCaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.TestCase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|createTestCase}. + * @param error Error, if any + * @param [response] TestCase + */ + type CreateTestCaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.TestCase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|updateTestCase}. + * @param error Error, if any + * @param [response] TestCase + */ + type UpdateTestCaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.TestCase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|runTestCase}. + * @param error Error, if any + * @param [response] Operation + */ + type RunTestCaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|batchRunTestCases}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchRunTestCasesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|calculateCoverage}. + * @param error Error, if any + * @param [response] CalculateCoverageResponse + */ + type CalculateCoverageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.CalculateCoverageResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|importTestCases}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportTestCasesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|exportTestCases}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportTestCasesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|listTestCaseResults}. + * @param error Error, if any + * @param [response] ListTestCaseResultsResponse + */ + type ListTestCaseResultsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|getTestCaseResult}. + * @param error Error, if any + * @param [response] TestCaseResult + */ + type GetTestCaseResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.TestCaseResult) => void; + } + + /** Properties of a TestCase. */ + interface ITestCase { + + /** TestCase name */ + name?: (string|null); + + /** TestCase tags */ + tags?: (string[]|null); + + /** TestCase displayName */ + displayName?: (string|null); + + /** TestCase notes */ + notes?: (string|null); + + /** TestCase testConfig */ + testConfig?: (google.cloud.dialogflow.cx.v3.ITestConfig|null); + + /** TestCase testCaseConversationTurns */ + testCaseConversationTurns?: (google.cloud.dialogflow.cx.v3.IConversationTurn[]|null); + + /** TestCase creationTime */ + creationTime?: (google.protobuf.ITimestamp|null); + + /** TestCase lastTestResult */ + lastTestResult?: (google.cloud.dialogflow.cx.v3.ITestCaseResult|null); + } + + /** Represents a TestCase. */ + class TestCase implements ITestCase { + + /** + * Constructs a new TestCase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITestCase); + + /** TestCase name. */ + public name: string; + + /** TestCase tags. */ + public tags: string[]; + + /** TestCase displayName. */ + public displayName: string; + + /** TestCase notes. */ + public notes: string; + + /** TestCase testConfig. */ + public testConfig?: (google.cloud.dialogflow.cx.v3.ITestConfig|null); + + /** TestCase testCaseConversationTurns. */ + public testCaseConversationTurns: google.cloud.dialogflow.cx.v3.IConversationTurn[]; + + /** TestCase creationTime. */ + public creationTime?: (google.protobuf.ITimestamp|null); + + /** TestCase lastTestResult. */ + public lastTestResult?: (google.cloud.dialogflow.cx.v3.ITestCaseResult|null); + + /** + * Creates a new TestCase instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITestCase): google.cloud.dialogflow.cx.v3.TestCase; + + /** + * Encodes the specified TestCase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCase.verify|verify} messages. + * @param message TestCase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITestCase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCase.verify|verify} messages. + * @param message TestCase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITestCase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCase + * @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.dialogflow.cx.v3.TestCase; + + /** + * Decodes a TestCase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCase + * @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.dialogflow.cx.v3.TestCase; + + /** + * Verifies a TestCase 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 TestCase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TestCase; + + /** + * Creates a plain object from a TestCase message. Also converts values to other types if specified. + * @param message TestCase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TestCase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestCaseResult. */ + interface ITestCaseResult { + + /** TestCaseResult name */ + name?: (string|null); + + /** TestCaseResult environment */ + environment?: (string|null); + + /** TestCaseResult conversationTurns */ + conversationTurns?: (google.cloud.dialogflow.cx.v3.IConversationTurn[]|null); + + /** TestCaseResult testResult */ + testResult?: (google.cloud.dialogflow.cx.v3.TestResult|keyof typeof google.cloud.dialogflow.cx.v3.TestResult|null); + + /** TestCaseResult testTime */ + testTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TestCaseResult. */ + class TestCaseResult implements ITestCaseResult { + + /** + * Constructs a new TestCaseResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITestCaseResult); + + /** TestCaseResult name. */ + public name: string; + + /** TestCaseResult environment. */ + public environment: string; + + /** TestCaseResult conversationTurns. */ + public conversationTurns: google.cloud.dialogflow.cx.v3.IConversationTurn[]; + + /** TestCaseResult testResult. */ + public testResult: (google.cloud.dialogflow.cx.v3.TestResult|keyof typeof google.cloud.dialogflow.cx.v3.TestResult); + + /** TestCaseResult testTime. */ + public testTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TestCaseResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCaseResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITestCaseResult): google.cloud.dialogflow.cx.v3.TestCaseResult; + + /** + * Encodes the specified TestCaseResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseResult.verify|verify} messages. + * @param message TestCaseResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITestCaseResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCaseResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseResult.verify|verify} messages. + * @param message TestCaseResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITestCaseResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCaseResult + * @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.dialogflow.cx.v3.TestCaseResult; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCaseResult + * @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.dialogflow.cx.v3.TestCaseResult; + + /** + * Verifies a TestCaseResult 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 TestCaseResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCaseResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TestCaseResult; + + /** + * Creates a plain object from a TestCaseResult message. Also converts values to other types if specified. + * @param message TestCaseResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TestCaseResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCaseResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCaseResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestConfig. */ + interface ITestConfig { + + /** TestConfig trackingParameters */ + trackingParameters?: (string[]|null); + + /** TestConfig flow */ + flow?: (string|null); + + /** TestConfig page */ + page?: (string|null); + } + + /** Represents a TestConfig. */ + class TestConfig implements ITestConfig { + + /** + * Constructs a new TestConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITestConfig); + + /** TestConfig trackingParameters. */ + public trackingParameters: string[]; + + /** TestConfig flow. */ + public flow: string; + + /** TestConfig page. */ + public page: string; + + /** + * Creates a new TestConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TestConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITestConfig): google.cloud.dialogflow.cx.v3.TestConfig; + + /** + * Encodes the specified TestConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestConfig.verify|verify} messages. + * @param message TestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestConfig.verify|verify} messages. + * @param message TestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestConfig + * @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.dialogflow.cx.v3.TestConfig; + + /** + * Decodes a TestConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestConfig + * @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.dialogflow.cx.v3.TestConfig; + + /** + * Verifies a TestConfig 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 TestConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TestConfig; + + /** + * Creates a plain object from a TestConfig message. Also converts values to other types if specified. + * @param message TestConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TestConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationTurn. */ + interface IConversationTurn { + + /** ConversationTurn userInput */ + userInput?: (google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput|null); + + /** ConversationTurn virtualAgentOutput */ + virtualAgentOutput?: (google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput|null); + } + + /** Represents a ConversationTurn. */ + class ConversationTurn implements IConversationTurn { + + /** + * Constructs a new ConversationTurn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IConversationTurn); + + /** ConversationTurn userInput. */ + public userInput?: (google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput|null); + + /** ConversationTurn virtualAgentOutput. */ + public virtualAgentOutput?: (google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput|null); + + /** + * Creates a new ConversationTurn instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationTurn instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IConversationTurn): google.cloud.dialogflow.cx.v3.ConversationTurn; + + /** + * Encodes the specified ConversationTurn message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.verify|verify} messages. + * @param message ConversationTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IConversationTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationTurn message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.verify|verify} messages. + * @param message ConversationTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IConversationTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationTurn + * @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.dialogflow.cx.v3.ConversationTurn; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationTurn + * @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.dialogflow.cx.v3.ConversationTurn; + + /** + * Verifies a ConversationTurn 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 ConversationTurn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationTurn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ConversationTurn; + + /** + * Creates a plain object from a ConversationTurn message. Also converts values to other types if specified. + * @param message ConversationTurn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ConversationTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationTurn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationTurn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConversationTurn { + + /** Properties of a UserInput. */ + interface IUserInput { + + /** UserInput input */ + input?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** UserInput injectedParameters */ + injectedParameters?: (google.protobuf.IStruct|null); + + /** UserInput isWebhookEnabled */ + isWebhookEnabled?: (boolean|null); + + /** UserInput enableSentimentAnalysis */ + enableSentimentAnalysis?: (boolean|null); + } + + /** Represents a UserInput. */ + class UserInput implements IUserInput { + + /** + * Constructs a new UserInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput); + + /** UserInput input. */ + public input?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** UserInput injectedParameters. */ + public injectedParameters?: (google.protobuf.IStruct|null); + + /** UserInput isWebhookEnabled. */ + public isWebhookEnabled: boolean; + + /** UserInput enableSentimentAnalysis. */ + public enableSentimentAnalysis: boolean; + + /** + * Creates a new UserInput instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput): google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput; + + /** + * Encodes the specified UserInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.verify|verify} messages. + * @param message UserInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.verify|verify} messages. + * @param message UserInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInput + * @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.dialogflow.cx.v3.ConversationTurn.UserInput; + + /** + * Decodes a UserInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInput + * @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.dialogflow.cx.v3.ConversationTurn.UserInput; + + /** + * Verifies a UserInput 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 UserInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput; + + /** + * Creates a plain object from a UserInput message. Also converts values to other types if specified. + * @param message UserInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VirtualAgentOutput. */ + interface IVirtualAgentOutput { + + /** VirtualAgentOutput sessionParameters */ + sessionParameters?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput differences */ + differences?: (google.cloud.dialogflow.cx.v3.ITestRunDifference[]|null); + + /** VirtualAgentOutput diagnosticInfo */ + diagnosticInfo?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput triggeredIntent */ + triggeredIntent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** VirtualAgentOutput currentPage */ + currentPage?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** VirtualAgentOutput textResponses */ + textResponses?: (google.cloud.dialogflow.cx.v3.ResponseMessage.IText[]|null); + + /** VirtualAgentOutput status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a VirtualAgentOutput. */ + class VirtualAgentOutput implements IVirtualAgentOutput { + + /** + * Constructs a new VirtualAgentOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput); + + /** VirtualAgentOutput sessionParameters. */ + public sessionParameters?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput differences. */ + public differences: google.cloud.dialogflow.cx.v3.ITestRunDifference[]; + + /** VirtualAgentOutput diagnosticInfo. */ + public diagnosticInfo?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput triggeredIntent. */ + public triggeredIntent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** VirtualAgentOutput currentPage. */ + public currentPage?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** VirtualAgentOutput textResponses. */ + public textResponses: google.cloud.dialogflow.cx.v3.ResponseMessage.IText[]; + + /** VirtualAgentOutput status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new VirtualAgentOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns VirtualAgentOutput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput): google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput; + + /** + * Encodes the specified VirtualAgentOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @param message VirtualAgentOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VirtualAgentOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @param message VirtualAgentOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VirtualAgentOutput + * @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.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VirtualAgentOutput + * @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.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput; + + /** + * Verifies a VirtualAgentOutput 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 VirtualAgentOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VirtualAgentOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput; + + /** + * Creates a plain object from a VirtualAgentOutput message. Also converts values to other types if specified. + * @param message VirtualAgentOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VirtualAgentOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VirtualAgentOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TestRunDifference. */ + interface ITestRunDifference { + + /** TestRunDifference type */ + type?: (google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType|keyof typeof google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType|null); + + /** TestRunDifference description */ + description?: (string|null); + } + + /** Represents a TestRunDifference. */ + class TestRunDifference implements ITestRunDifference { + + /** + * Constructs a new TestRunDifference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITestRunDifference); + + /** TestRunDifference type. */ + public type: (google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType|keyof typeof google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType); + + /** TestRunDifference description. */ + public description: string; + + /** + * Creates a new TestRunDifference instance using the specified properties. + * @param [properties] Properties to set + * @returns TestRunDifference instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITestRunDifference): google.cloud.dialogflow.cx.v3.TestRunDifference; + + /** + * Encodes the specified TestRunDifference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestRunDifference.verify|verify} messages. + * @param message TestRunDifference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITestRunDifference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestRunDifference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestRunDifference.verify|verify} messages. + * @param message TestRunDifference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITestRunDifference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestRunDifference + * @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.dialogflow.cx.v3.TestRunDifference; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestRunDifference + * @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.dialogflow.cx.v3.TestRunDifference; + + /** + * Verifies a TestRunDifference 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 TestRunDifference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestRunDifference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TestRunDifference; + + /** + * Creates a plain object from a TestRunDifference message. Also converts values to other types if specified. + * @param message TestRunDifference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TestRunDifference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestRunDifference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestRunDifference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TestRunDifference { + + /** DiffType enum. */ + enum DiffType { + DIFF_TYPE_UNSPECIFIED = 0, + INTENT = 1, + PAGE = 2, + PARAMETERS = 3, + UTTERANCE = 4, + FLOW = 5 + } + } + + /** Properties of a TransitionCoverage. */ + interface ITransitionCoverage { + + /** TransitionCoverage transitions */ + transitions?: (google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition[]|null); + + /** TransitionCoverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents a TransitionCoverage. */ + class TransitionCoverage implements ITransitionCoverage { + + /** + * Constructs a new TransitionCoverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITransitionCoverage); + + /** TransitionCoverage transitions. */ + public transitions: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition[]; + + /** TransitionCoverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new TransitionCoverage instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionCoverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITransitionCoverage): google.cloud.dialogflow.cx.v3.TransitionCoverage; + + /** + * Encodes the specified TransitionCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.verify|verify} messages. + * @param message TransitionCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITransitionCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.verify|verify} messages. + * @param message TransitionCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITransitionCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionCoverage + * @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.dialogflow.cx.v3.TransitionCoverage; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionCoverage + * @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.dialogflow.cx.v3.TransitionCoverage; + + /** + * Verifies a TransitionCoverage 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 TransitionCoverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionCoverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionCoverage; + + /** + * Creates a plain object from a TransitionCoverage message. Also converts values to other types if specified. + * @param message TransitionCoverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionCoverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionCoverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionCoverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitionCoverage { + + /** Properties of a TransitionNode. */ + interface ITransitionNode { + + /** TransitionNode page */ + page?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** TransitionNode flow */ + flow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + } + + /** Represents a TransitionNode. */ + class TransitionNode implements ITransitionNode { + + /** + * Constructs a new TransitionNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode); + + /** TransitionNode page. */ + public page?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** TransitionNode flow. */ + public flow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + + /** TransitionNode kind. */ + public kind?: ("page"|"flow"); + + /** + * Creates a new TransitionNode instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionNode instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode): google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode; + + /** + * Encodes the specified TransitionNode message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.verify|verify} messages. + * @param message TransitionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionNode message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.verify|verify} messages. + * @param message TransitionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionNode + * @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.dialogflow.cx.v3.TransitionCoverage.TransitionNode; + + /** + * Decodes a TransitionNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionNode + * @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.dialogflow.cx.v3.TransitionCoverage.TransitionNode; + + /** + * Verifies a TransitionNode 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 TransitionNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode; + + /** + * Creates a plain object from a TransitionNode message. Also converts values to other types if specified. + * @param message TransitionNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Transition. */ + interface ITransition { + + /** Transition source */ + source?: (google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null); + + /** Transition index */ + index?: (number|null); + + /** Transition target */ + target?: (google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null); + + /** Transition covered */ + covered?: (boolean|null); + + /** Transition transitionRoute */ + transitionRoute?: (google.cloud.dialogflow.cx.v3.ITransitionRoute|null); + + /** Transition eventHandler */ + eventHandler?: (google.cloud.dialogflow.cx.v3.IEventHandler|null); + } + + /** Represents a Transition. */ + class Transition implements ITransition { + + /** + * Constructs a new Transition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition); + + /** Transition source. */ + public source?: (google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null); + + /** Transition index. */ + public index: number; + + /** Transition target. */ + public target?: (google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null); + + /** Transition covered. */ + public covered: boolean; + + /** Transition transitionRoute. */ + public transitionRoute?: (google.cloud.dialogflow.cx.v3.ITransitionRoute|null); + + /** Transition eventHandler. */ + public eventHandler?: (google.cloud.dialogflow.cx.v3.IEventHandler|null); + + /** Transition detail. */ + public detail?: ("transitionRoute"|"eventHandler"); + + /** + * Creates a new Transition instance using the specified properties. + * @param [properties] Properties to set + * @returns Transition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition): google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transition + * @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.dialogflow.cx.v3.TransitionCoverage.Transition; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transition + * @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.dialogflow.cx.v3.TransitionCoverage.Transition; + + /** + * Verifies a Transition 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 Transition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @param message Transition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Transition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Transition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TransitionRouteGroupCoverage. */ + interface ITransitionRouteGroupCoverage { + + /** TransitionRouteGroupCoverage coverages */ + coverages?: (google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage[]|null); + + /** TransitionRouteGroupCoverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents a TransitionRouteGroupCoverage. */ + class TransitionRouteGroupCoverage implements ITransitionRouteGroupCoverage { + + /** + * Constructs a new TransitionRouteGroupCoverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage); + + /** TransitionRouteGroupCoverage coverages. */ + public coverages: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage[]; + + /** TransitionRouteGroupCoverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new TransitionRouteGroupCoverage instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionRouteGroupCoverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage): google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage; + + /** + * Encodes the specified TransitionRouteGroupCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.verify|verify} messages. + * @param message TransitionRouteGroupCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionRouteGroupCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.verify|verify} messages. + * @param message TransitionRouteGroupCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionRouteGroupCoverage + * @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.dialogflow.cx.v3.TransitionRouteGroupCoverage; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionRouteGroupCoverage + * @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.dialogflow.cx.v3.TransitionRouteGroupCoverage; + + /** + * Verifies a TransitionRouteGroupCoverage 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 TransitionRouteGroupCoverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionRouteGroupCoverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage; + + /** + * Creates a plain object from a TransitionRouteGroupCoverage message. Also converts values to other types if specified. + * @param message TransitionRouteGroupCoverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionRouteGroupCoverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionRouteGroupCoverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitionRouteGroupCoverage { + + /** Properties of a Coverage. */ + interface ICoverage { + + /** Coverage routeGroup */ + routeGroup?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null); + + /** Coverage transitions */ + transitions?: (google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition[]|null); + + /** Coverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents a Coverage. */ + class Coverage implements ICoverage { + + /** + * Constructs a new Coverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage); + + /** Coverage routeGroup. */ + public routeGroup?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null); + + /** Coverage transitions. */ + public transitions: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition[]; + + /** Coverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new Coverage instance using the specified properties. + * @param [properties] Properties to set + * @returns Coverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage): google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage; + + /** + * Encodes the specified Coverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @param message Coverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Coverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @param message Coverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Coverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coverage + * @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.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage; + + /** + * Decodes a Coverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coverage + * @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.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage; + + /** + * Verifies a Coverage 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 Coverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage; + + /** + * Creates a plain object from a Coverage message. Also converts values to other types if specified. + * @param message Coverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Coverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Coverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Coverage { + + /** Properties of a Transition. */ + interface ITransition { + + /** Transition transitionRoute */ + transitionRoute?: (google.cloud.dialogflow.cx.v3.ITransitionRoute|null); + + /** Transition covered */ + covered?: (boolean|null); + } + + /** Represents a Transition. */ + class Transition implements ITransition { + + /** + * Constructs a new Transition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition); + + /** Transition transitionRoute. */ + public transitionRoute?: (google.cloud.dialogflow.cx.v3.ITransitionRoute|null); + + /** Transition covered. */ + public covered: boolean; + + /** + * Creates a new Transition instance using the specified properties. + * @param [properties] Properties to set + * @returns Transition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition): google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transition + * @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.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transition + * @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.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Verifies a Transition 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 Transition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @param message Transition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Transition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Transition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an IntentCoverage. */ + interface IIntentCoverage { + + /** IntentCoverage intents */ + intents?: (google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent[]|null); + + /** IntentCoverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents an IntentCoverage. */ + class IntentCoverage implements IIntentCoverage { + + /** + * Constructs a new IntentCoverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IIntentCoverage); + + /** IntentCoverage intents. */ + public intents: google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent[]; + + /** IntentCoverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new IntentCoverage instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentCoverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IIntentCoverage): google.cloud.dialogflow.cx.v3.IntentCoverage; + + /** + * Encodes the specified IntentCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.verify|verify} messages. + * @param message IntentCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IIntentCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.verify|verify} messages. + * @param message IntentCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IIntentCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentCoverage + * @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.dialogflow.cx.v3.IntentCoverage; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentCoverage + * @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.dialogflow.cx.v3.IntentCoverage; + + /** + * Verifies an IntentCoverage 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 IntentCoverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentCoverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.IntentCoverage; + + /** + * Creates a plain object from an IntentCoverage message. Also converts values to other types if specified. + * @param message IntentCoverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.IntentCoverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentCoverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentCoverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntentCoverage { + + /** Properties of an Intent. */ + interface IIntent { + + /** Intent intent */ + intent?: (string|null); + + /** Intent covered */ + covered?: (boolean|null); + } + + /** Represents an Intent. */ + class Intent implements IIntent { + + /** + * Constructs a new Intent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent); + + /** Intent intent. */ + public intent: string; + + /** Intent covered. */ + public covered: boolean; + + /** + * Creates a new Intent instance using the specified properties. + * @param [properties] Properties to set + * @returns Intent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent): google.cloud.dialogflow.cx.v3.IntentCoverage.Intent; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intent + * @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.dialogflow.cx.v3.IntentCoverage.Intent; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intent + * @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.dialogflow.cx.v3.IntentCoverage.Intent; + + /** + * Verifies an Intent 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 Intent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.IntentCoverage.Intent; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @param message Intent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.IntentCoverage.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Intent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Intent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CalculateCoverageRequest. */ + interface ICalculateCoverageRequest { + + /** CalculateCoverageRequest agent */ + agent?: (string|null); + + /** CalculateCoverageRequest type */ + type?: (google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType|keyof typeof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType|null); + } + + /** Represents a CalculateCoverageRequest. */ + class CalculateCoverageRequest implements ICalculateCoverageRequest { + + /** + * Constructs a new CalculateCoverageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest); + + /** CalculateCoverageRequest agent. */ + public agent: string; + + /** CalculateCoverageRequest type. */ + public type: (google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType|keyof typeof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType); + + /** + * Creates a new CalculateCoverageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CalculateCoverageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest): google.cloud.dialogflow.cx.v3.CalculateCoverageRequest; + + /** + * Encodes the specified CalculateCoverageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.verify|verify} messages. + * @param message CalculateCoverageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CalculateCoverageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.verify|verify} messages. + * @param message CalculateCoverageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CalculateCoverageRequest + * @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.dialogflow.cx.v3.CalculateCoverageRequest; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CalculateCoverageRequest + * @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.dialogflow.cx.v3.CalculateCoverageRequest; + + /** + * Verifies a CalculateCoverageRequest 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 CalculateCoverageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CalculateCoverageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CalculateCoverageRequest; + + /** + * Creates a plain object from a CalculateCoverageRequest message. Also converts values to other types if specified. + * @param message CalculateCoverageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CalculateCoverageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CalculateCoverageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CalculateCoverageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CalculateCoverageRequest { + + /** CoverageType enum. */ + enum CoverageType { + COVERAGE_TYPE_UNSPECIFIED = 0, + INTENT = 1, + PAGE_TRANSITION = 2, + TRANSITION_ROUTE_GROUP = 3 + } + } + + /** Properties of a CalculateCoverageResponse. */ + interface ICalculateCoverageResponse { + + /** CalculateCoverageResponse agent */ + agent?: (string|null); + + /** CalculateCoverageResponse intentCoverage */ + intentCoverage?: (google.cloud.dialogflow.cx.v3.IIntentCoverage|null); + + /** CalculateCoverageResponse transitionCoverage */ + transitionCoverage?: (google.cloud.dialogflow.cx.v3.ITransitionCoverage|null); + + /** CalculateCoverageResponse routeGroupCoverage */ + routeGroupCoverage?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage|null); + } + + /** Represents a CalculateCoverageResponse. */ + class CalculateCoverageResponse implements ICalculateCoverageResponse { + + /** + * Constructs a new CalculateCoverageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse); + + /** CalculateCoverageResponse agent. */ + public agent: string; + + /** CalculateCoverageResponse intentCoverage. */ + public intentCoverage?: (google.cloud.dialogflow.cx.v3.IIntentCoverage|null); + + /** CalculateCoverageResponse transitionCoverage. */ + public transitionCoverage?: (google.cloud.dialogflow.cx.v3.ITransitionCoverage|null); + + /** CalculateCoverageResponse routeGroupCoverage. */ + public routeGroupCoverage?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage|null); + + /** CalculateCoverageResponse coverageType. */ + public coverageType?: ("intentCoverage"|"transitionCoverage"|"routeGroupCoverage"); + + /** + * Creates a new CalculateCoverageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CalculateCoverageResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse): google.cloud.dialogflow.cx.v3.CalculateCoverageResponse; + + /** + * Encodes the specified CalculateCoverageResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageResponse.verify|verify} messages. + * @param message CalculateCoverageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CalculateCoverageResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageResponse.verify|verify} messages. + * @param message CalculateCoverageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CalculateCoverageResponse + * @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.dialogflow.cx.v3.CalculateCoverageResponse; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CalculateCoverageResponse + * @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.dialogflow.cx.v3.CalculateCoverageResponse; + + /** + * Verifies a CalculateCoverageResponse 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 CalculateCoverageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CalculateCoverageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CalculateCoverageResponse; + + /** + * Creates a plain object from a CalculateCoverageResponse message. Also converts values to other types if specified. + * @param message CalculateCoverageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CalculateCoverageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CalculateCoverageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CalculateCoverageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTestCasesRequest. */ + interface IListTestCasesRequest { + + /** ListTestCasesRequest parent */ + parent?: (string|null); + + /** ListTestCasesRequest pageSize */ + pageSize?: (number|null); + + /** ListTestCasesRequest pageToken */ + pageToken?: (string|null); + + /** ListTestCasesRequest view */ + view?: (google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView|keyof typeof google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView|null); + } + + /** Represents a ListTestCasesRequest. */ + class ListTestCasesRequest implements IListTestCasesRequest { + + /** + * Constructs a new ListTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListTestCasesRequest); + + /** ListTestCasesRequest parent. */ + public parent: string; + + /** ListTestCasesRequest pageSize. */ + public pageSize: number; + + /** ListTestCasesRequest pageToken. */ + public pageToken: string; + + /** ListTestCasesRequest view. */ + public view: (google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView|keyof typeof google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView); + + /** + * Creates a new ListTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListTestCasesRequest): google.cloud.dialogflow.cx.v3.ListTestCasesRequest; + + /** + * Encodes the specified ListTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesRequest.verify|verify} messages. + * @param message ListTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesRequest.verify|verify} messages. + * @param message ListTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCasesRequest + * @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.dialogflow.cx.v3.ListTestCasesRequest; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCasesRequest + * @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.dialogflow.cx.v3.ListTestCasesRequest; + + /** + * Verifies a ListTestCasesRequest 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 ListTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListTestCasesRequest; + + /** + * Creates a plain object from a ListTestCasesRequest message. Also converts values to other types if specified. + * @param message ListTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListTestCasesRequest { + + /** TestCaseView enum. */ + enum TestCaseView { + TEST_CASE_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + } + + /** Properties of a ListTestCasesResponse. */ + interface IListTestCasesResponse { + + /** ListTestCasesResponse testCases */ + testCases?: (google.cloud.dialogflow.cx.v3.ITestCase[]|null); + + /** ListTestCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTestCasesResponse. */ + class ListTestCasesResponse implements IListTestCasesResponse { + + /** + * Constructs a new ListTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListTestCasesResponse); + + /** ListTestCasesResponse testCases. */ + public testCases: google.cloud.dialogflow.cx.v3.ITestCase[]; + + /** ListTestCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListTestCasesResponse): google.cloud.dialogflow.cx.v3.ListTestCasesResponse; + + /** + * Encodes the specified ListTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesResponse.verify|verify} messages. + * @param message ListTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesResponse.verify|verify} messages. + * @param message ListTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCasesResponse + * @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.dialogflow.cx.v3.ListTestCasesResponse; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCasesResponse + * @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.dialogflow.cx.v3.ListTestCasesResponse; + + /** + * Verifies a ListTestCasesResponse 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 ListTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListTestCasesResponse; + + /** + * Creates a plain object from a ListTestCasesResponse message. Also converts values to other types if specified. + * @param message ListTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteTestCasesRequest. */ + interface IBatchDeleteTestCasesRequest { + + /** BatchDeleteTestCasesRequest parent */ + parent?: (string|null); + + /** BatchDeleteTestCasesRequest names */ + names?: (string[]|null); + } + + /** Represents a BatchDeleteTestCasesRequest. */ + class BatchDeleteTestCasesRequest implements IBatchDeleteTestCasesRequest { + + /** + * Constructs a new BatchDeleteTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest); + + /** BatchDeleteTestCasesRequest parent. */ + public parent: string; + + /** BatchDeleteTestCasesRequest names. */ + public names: string[]; + + /** + * Creates a new BatchDeleteTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest): google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest.verify|verify} messages. + * @param message BatchDeleteTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest.verify|verify} messages. + * @param message BatchDeleteTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteTestCasesRequest + * @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.dialogflow.cx.v3.BatchDeleteTestCasesRequest; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteTestCasesRequest + * @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.dialogflow.cx.v3.BatchDeleteTestCasesRequest; + + /** + * Verifies a BatchDeleteTestCasesRequest 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 BatchDeleteTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest; + + /** + * Creates a plain object from a BatchDeleteTestCasesRequest message. Also converts values to other types if specified. + * @param message BatchDeleteTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTestCaseRequest. */ + interface ICreateTestCaseRequest { + + /** CreateTestCaseRequest parent */ + parent?: (string|null); + + /** CreateTestCaseRequest testCase */ + testCase?: (google.cloud.dialogflow.cx.v3.ITestCase|null); + } + + /** Represents a CreateTestCaseRequest. */ + class CreateTestCaseRequest implements ICreateTestCaseRequest { + + /** + * Constructs a new CreateTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest); + + /** CreateTestCaseRequest parent. */ + public parent: string; + + /** CreateTestCaseRequest testCase. */ + public testCase?: (google.cloud.dialogflow.cx.v3.ITestCase|null); + + /** + * Creates a new CreateTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest): google.cloud.dialogflow.cx.v3.CreateTestCaseRequest; + + /** + * Encodes the specified CreateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTestCaseRequest.verify|verify} messages. + * @param message CreateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTestCaseRequest.verify|verify} messages. + * @param message CreateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTestCaseRequest + * @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.dialogflow.cx.v3.CreateTestCaseRequest; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTestCaseRequest + * @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.dialogflow.cx.v3.CreateTestCaseRequest; + + /** + * Verifies a CreateTestCaseRequest 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 CreateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateTestCaseRequest; + + /** + * Creates a plain object from a CreateTestCaseRequest message. Also converts values to other types if specified. + * @param message CreateTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTestCaseRequest. */ + interface IUpdateTestCaseRequest { + + /** UpdateTestCaseRequest testCase */ + testCase?: (google.cloud.dialogflow.cx.v3.ITestCase|null); + + /** UpdateTestCaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTestCaseRequest. */ + class UpdateTestCaseRequest implements IUpdateTestCaseRequest { + + /** + * Constructs a new UpdateTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest); + + /** UpdateTestCaseRequest testCase. */ + public testCase?: (google.cloud.dialogflow.cx.v3.ITestCase|null); + + /** UpdateTestCaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest): google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest; + + /** + * Encodes the specified UpdateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest.verify|verify} messages. + * @param message UpdateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest.verify|verify} messages. + * @param message UpdateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTestCaseRequest + * @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.dialogflow.cx.v3.UpdateTestCaseRequest; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTestCaseRequest + * @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.dialogflow.cx.v3.UpdateTestCaseRequest; + + /** + * Verifies an UpdateTestCaseRequest 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 UpdateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest; + + /** + * Creates a plain object from an UpdateTestCaseRequest message. Also converts values to other types if specified. + * @param message UpdateTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTestCaseRequest. */ + interface IGetTestCaseRequest { + + /** GetTestCaseRequest name */ + name?: (string|null); + } + + /** Represents a GetTestCaseRequest. */ + class GetTestCaseRequest implements IGetTestCaseRequest { + + /** + * Constructs a new GetTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetTestCaseRequest); + + /** GetTestCaseRequest name. */ + public name: string; + + /** + * Creates a new GetTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetTestCaseRequest): google.cloud.dialogflow.cx.v3.GetTestCaseRequest; + + /** + * Encodes the specified GetTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseRequest.verify|verify} messages. + * @param message GetTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseRequest.verify|verify} messages. + * @param message GetTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTestCaseRequest + * @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.dialogflow.cx.v3.GetTestCaseRequest; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTestCaseRequest + * @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.dialogflow.cx.v3.GetTestCaseRequest; + + /** + * Verifies a GetTestCaseRequest 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 GetTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetTestCaseRequest; + + /** + * Creates a plain object from a GetTestCaseRequest message. Also converts values to other types if specified. + * @param message GetTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunTestCaseRequest. */ + interface IRunTestCaseRequest { + + /** RunTestCaseRequest name */ + name?: (string|null); + + /** RunTestCaseRequest environment */ + environment?: (string|null); + } + + /** Represents a RunTestCaseRequest. */ + class RunTestCaseRequest implements IRunTestCaseRequest { + + /** + * Constructs a new RunTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunTestCaseRequest); + + /** RunTestCaseRequest name. */ + public name: string; + + /** RunTestCaseRequest environment. */ + public environment: string; + + /** + * Creates a new RunTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunTestCaseRequest): google.cloud.dialogflow.cx.v3.RunTestCaseRequest; + + /** + * Encodes the specified RunTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseRequest.verify|verify} messages. + * @param message RunTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseRequest.verify|verify} messages. + * @param message RunTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunTestCaseRequest + * @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.dialogflow.cx.v3.RunTestCaseRequest; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunTestCaseRequest + * @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.dialogflow.cx.v3.RunTestCaseRequest; + + /** + * Verifies a RunTestCaseRequest 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 RunTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunTestCaseRequest; + + /** + * Creates a plain object from a RunTestCaseRequest message. Also converts values to other types if specified. + * @param message RunTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunTestCaseResponse. */ + interface IRunTestCaseResponse { + + /** RunTestCaseResponse result */ + result?: (google.cloud.dialogflow.cx.v3.ITestCaseResult|null); + } + + /** Represents a RunTestCaseResponse. */ + class RunTestCaseResponse implements IRunTestCaseResponse { + + /** + * Constructs a new RunTestCaseResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunTestCaseResponse); + + /** RunTestCaseResponse result. */ + public result?: (google.cloud.dialogflow.cx.v3.ITestCaseResult|null); + + /** + * Creates a new RunTestCaseResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunTestCaseResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunTestCaseResponse): google.cloud.dialogflow.cx.v3.RunTestCaseResponse; + + /** + * Encodes the specified RunTestCaseResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseResponse.verify|verify} messages. + * @param message RunTestCaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunTestCaseResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseResponse.verify|verify} messages. + * @param message RunTestCaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunTestCaseResponse + * @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.dialogflow.cx.v3.RunTestCaseResponse; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunTestCaseResponse + * @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.dialogflow.cx.v3.RunTestCaseResponse; + + /** + * Verifies a RunTestCaseResponse 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 RunTestCaseResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunTestCaseResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunTestCaseResponse; + + /** + * Creates a plain object from a RunTestCaseResponse message. Also converts values to other types if specified. + * @param message RunTestCaseResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunTestCaseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunTestCaseResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunTestCaseResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunTestCaseMetadata. */ + interface IRunTestCaseMetadata { + } + + /** Represents a RunTestCaseMetadata. */ + class RunTestCaseMetadata implements IRunTestCaseMetadata { + + /** + * Constructs a new RunTestCaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata); + + /** + * Creates a new RunTestCaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunTestCaseMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata): google.cloud.dialogflow.cx.v3.RunTestCaseMetadata; + + /** + * Encodes the specified RunTestCaseMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseMetadata.verify|verify} messages. + * @param message RunTestCaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunTestCaseMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseMetadata.verify|verify} messages. + * @param message RunTestCaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunTestCaseMetadata + * @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.dialogflow.cx.v3.RunTestCaseMetadata; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunTestCaseMetadata + * @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.dialogflow.cx.v3.RunTestCaseMetadata; + + /** + * Verifies a RunTestCaseMetadata 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 RunTestCaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunTestCaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunTestCaseMetadata; + + /** + * Creates a plain object from a RunTestCaseMetadata message. Also converts values to other types if specified. + * @param message RunTestCaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunTestCaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunTestCaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunTestCaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunTestCasesRequest. */ + interface IBatchRunTestCasesRequest { + + /** BatchRunTestCasesRequest parent */ + parent?: (string|null); + + /** BatchRunTestCasesRequest environment */ + environment?: (string|null); + + /** BatchRunTestCasesRequest testCases */ + testCases?: (string[]|null); + } + + /** Represents a BatchRunTestCasesRequest. */ + class BatchRunTestCasesRequest implements IBatchRunTestCasesRequest { + + /** + * Constructs a new BatchRunTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest); + + /** BatchRunTestCasesRequest parent. */ + public parent: string; + + /** BatchRunTestCasesRequest environment. */ + public environment: string; + + /** BatchRunTestCasesRequest testCases. */ + public testCases: string[]; + + /** + * Creates a new BatchRunTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest): google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest; + + /** + * Encodes the specified BatchRunTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest.verify|verify} messages. + * @param message BatchRunTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest.verify|verify} messages. + * @param message BatchRunTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunTestCasesRequest + * @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.dialogflow.cx.v3.BatchRunTestCasesRequest; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunTestCasesRequest + * @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.dialogflow.cx.v3.BatchRunTestCasesRequest; + + /** + * Verifies a BatchRunTestCasesRequest 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 BatchRunTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest; + + /** + * Creates a plain object from a BatchRunTestCasesRequest message. Also converts values to other types if specified. + * @param message BatchRunTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunTestCasesResponse. */ + interface IBatchRunTestCasesResponse { + + /** BatchRunTestCasesResponse results */ + results?: (google.cloud.dialogflow.cx.v3.ITestCaseResult[]|null); + } + + /** Represents a BatchRunTestCasesResponse. */ + class BatchRunTestCasesResponse implements IBatchRunTestCasesResponse { + + /** + * Constructs a new BatchRunTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse); + + /** BatchRunTestCasesResponse results. */ + public results: google.cloud.dialogflow.cx.v3.ITestCaseResult[]; + + /** + * Creates a new BatchRunTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse): google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse; + + /** + * Encodes the specified BatchRunTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse.verify|verify} messages. + * @param message BatchRunTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse.verify|verify} messages. + * @param message BatchRunTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunTestCasesResponse + * @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.dialogflow.cx.v3.BatchRunTestCasesResponse; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunTestCasesResponse + * @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.dialogflow.cx.v3.BatchRunTestCasesResponse; + + /** + * Verifies a BatchRunTestCasesResponse 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 BatchRunTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse; + + /** + * Creates a plain object from a BatchRunTestCasesResponse message. Also converts values to other types if specified. + * @param message BatchRunTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunTestCasesMetadata. */ + interface IBatchRunTestCasesMetadata { + + /** BatchRunTestCasesMetadata errors */ + errors?: (google.cloud.dialogflow.cx.v3.ITestError[]|null); + } + + /** Represents a BatchRunTestCasesMetadata. */ + class BatchRunTestCasesMetadata implements IBatchRunTestCasesMetadata { + + /** + * Constructs a new BatchRunTestCasesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata); + + /** BatchRunTestCasesMetadata errors. */ + public errors: google.cloud.dialogflow.cx.v3.ITestError[]; + + /** + * Creates a new BatchRunTestCasesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunTestCasesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata): google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata; + + /** + * Encodes the specified BatchRunTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata.verify|verify} messages. + * @param message BatchRunTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata.verify|verify} messages. + * @param message BatchRunTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunTestCasesMetadata + * @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.dialogflow.cx.v3.BatchRunTestCasesMetadata; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunTestCasesMetadata + * @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.dialogflow.cx.v3.BatchRunTestCasesMetadata; + + /** + * Verifies a BatchRunTestCasesMetadata 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 BatchRunTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunTestCasesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata; + + /** + * Creates a plain object from a BatchRunTestCasesMetadata message. Also converts values to other types if specified. + * @param message BatchRunTestCasesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunTestCasesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunTestCasesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestError. */ + interface ITestError { + + /** TestError testCase */ + testCase?: (string|null); + + /** TestError status */ + status?: (google.rpc.IStatus|null); + + /** TestError testTime */ + testTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TestError. */ + class TestError implements ITestError { + + /** + * Constructs a new TestError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITestError); + + /** TestError testCase. */ + public testCase: string; + + /** TestError status. */ + public status?: (google.rpc.IStatus|null); + + /** TestError testTime. */ + public testTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TestError instance using the specified properties. + * @param [properties] Properties to set + * @returns TestError instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITestError): google.cloud.dialogflow.cx.v3.TestError; + + /** + * Encodes the specified TestError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestError.verify|verify} messages. + * @param message TestError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITestError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestError.verify|verify} messages. + * @param message TestError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITestError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestError + * @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.dialogflow.cx.v3.TestError; + + /** + * Decodes a TestError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestError + * @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.dialogflow.cx.v3.TestError; + + /** + * Verifies a TestError 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 TestError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TestError; + + /** + * Creates a plain object from a TestError message. Also converts values to other types if specified. + * @param message TestError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TestError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportTestCasesRequest. */ + interface IImportTestCasesRequest { + + /** ImportTestCasesRequest parent */ + parent?: (string|null); + + /** ImportTestCasesRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportTestCasesRequest content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ImportTestCasesRequest. */ + class ImportTestCasesRequest implements IImportTestCasesRequest { + + /** + * Constructs a new ImportTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportTestCasesRequest); + + /** ImportTestCasesRequest parent. */ + public parent: string; + + /** ImportTestCasesRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ImportTestCasesRequest content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** ImportTestCasesRequest source. */ + public source?: ("gcsUri"|"content"); + + /** + * Creates a new ImportTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportTestCasesRequest): google.cloud.dialogflow.cx.v3.ImportTestCasesRequest; + + /** + * Encodes the specified ImportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesRequest.verify|verify} messages. + * @param message ImportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesRequest.verify|verify} messages. + * @param message ImportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTestCasesRequest + * @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.dialogflow.cx.v3.ImportTestCasesRequest; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTestCasesRequest + * @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.dialogflow.cx.v3.ImportTestCasesRequest; + + /** + * Verifies an ImportTestCasesRequest 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 ImportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportTestCasesRequest; + + /** + * Creates a plain object from an ImportTestCasesRequest message. Also converts values to other types if specified. + * @param message ImportTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportTestCasesResponse. */ + interface IImportTestCasesResponse { + + /** ImportTestCasesResponse names */ + names?: (string[]|null); + } + + /** Represents an ImportTestCasesResponse. */ + class ImportTestCasesResponse implements IImportTestCasesResponse { + + /** + * Constructs a new ImportTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportTestCasesResponse); + + /** ImportTestCasesResponse names. */ + public names: string[]; + + /** + * Creates a new ImportTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportTestCasesResponse): google.cloud.dialogflow.cx.v3.ImportTestCasesResponse; + + /** + * Encodes the specified ImportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesResponse.verify|verify} messages. + * @param message ImportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesResponse.verify|verify} messages. + * @param message ImportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTestCasesResponse + * @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.dialogflow.cx.v3.ImportTestCasesResponse; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTestCasesResponse + * @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.dialogflow.cx.v3.ImportTestCasesResponse; + + /** + * Verifies an ImportTestCasesResponse 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 ImportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportTestCasesResponse; + + /** + * Creates a plain object from an ImportTestCasesResponse message. Also converts values to other types if specified. + * @param message ImportTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportTestCasesMetadata. */ + interface IImportTestCasesMetadata { + + /** ImportTestCasesMetadata errors */ + errors?: (google.cloud.dialogflow.cx.v3.ITestCaseError[]|null); + } + + /** Represents an ImportTestCasesMetadata. */ + class ImportTestCasesMetadata implements IImportTestCasesMetadata { + + /** + * Constructs a new ImportTestCasesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata); + + /** ImportTestCasesMetadata errors. */ + public errors: google.cloud.dialogflow.cx.v3.ITestCaseError[]; + + /** + * Creates a new ImportTestCasesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTestCasesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata): google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata; + + /** + * Encodes the specified ImportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata.verify|verify} messages. + * @param message ImportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata.verify|verify} messages. + * @param message ImportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTestCasesMetadata + * @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.dialogflow.cx.v3.ImportTestCasesMetadata; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTestCasesMetadata + * @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.dialogflow.cx.v3.ImportTestCasesMetadata; + + /** + * Verifies an ImportTestCasesMetadata 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 ImportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTestCasesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata; + + /** + * Creates a plain object from an ImportTestCasesMetadata message. Also converts values to other types if specified. + * @param message ImportTestCasesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTestCasesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportTestCasesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestCaseError. */ + interface ITestCaseError { + + /** TestCaseError testCase */ + testCase?: (google.cloud.dialogflow.cx.v3.ITestCase|null); + + /** TestCaseError status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a TestCaseError. */ + class TestCaseError implements ITestCaseError { + + /** + * Constructs a new TestCaseError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITestCaseError); + + /** TestCaseError testCase. */ + public testCase?: (google.cloud.dialogflow.cx.v3.ITestCase|null); + + /** TestCaseError status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new TestCaseError instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCaseError instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITestCaseError): google.cloud.dialogflow.cx.v3.TestCaseError; + + /** + * Encodes the specified TestCaseError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseError.verify|verify} messages. + * @param message TestCaseError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITestCaseError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCaseError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseError.verify|verify} messages. + * @param message TestCaseError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITestCaseError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCaseError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCaseError + * @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.dialogflow.cx.v3.TestCaseError; + + /** + * Decodes a TestCaseError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCaseError + * @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.dialogflow.cx.v3.TestCaseError; + + /** + * Verifies a TestCaseError 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 TestCaseError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCaseError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TestCaseError; + + /** + * Creates a plain object from a TestCaseError message. Also converts values to other types if specified. + * @param message TestCaseError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TestCaseError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCaseError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCaseError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportTestCasesRequest. */ + interface IExportTestCasesRequest { + + /** ExportTestCasesRequest parent */ + parent?: (string|null); + + /** ExportTestCasesRequest gcsUri */ + gcsUri?: (string|null); + + /** ExportTestCasesRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat|null); + + /** ExportTestCasesRequest filter */ + filter?: (string|null); + } + + /** Represents an ExportTestCasesRequest. */ + class ExportTestCasesRequest implements IExportTestCasesRequest { + + /** + * Constructs a new ExportTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportTestCasesRequest); + + /** ExportTestCasesRequest parent. */ + public parent: string; + + /** ExportTestCasesRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ExportTestCasesRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat); + + /** ExportTestCasesRequest filter. */ + public filter: string; + + /** ExportTestCasesRequest destination. */ + public destination?: "gcsUri"; + + /** + * Creates a new ExportTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportTestCasesRequest): google.cloud.dialogflow.cx.v3.ExportTestCasesRequest; + + /** + * Encodes the specified ExportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.verify|verify} messages. + * @param message ExportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.verify|verify} messages. + * @param message ExportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportTestCasesRequest + * @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.dialogflow.cx.v3.ExportTestCasesRequest; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportTestCasesRequest + * @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.dialogflow.cx.v3.ExportTestCasesRequest; + + /** + * Verifies an ExportTestCasesRequest 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 ExportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportTestCasesRequest; + + /** + * Creates a plain object from an ExportTestCasesRequest message. Also converts values to other types if specified. + * @param message ExportTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportTestCasesRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON = 2 + } + } + + /** Properties of an ExportTestCasesResponse. */ + interface IExportTestCasesResponse { + + /** ExportTestCasesResponse gcsUri */ + gcsUri?: (string|null); + + /** ExportTestCasesResponse content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ExportTestCasesResponse. */ + class ExportTestCasesResponse implements IExportTestCasesResponse { + + /** + * Constructs a new ExportTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportTestCasesResponse); + + /** ExportTestCasesResponse gcsUri. */ + public gcsUri?: (string|null); + + /** ExportTestCasesResponse content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** ExportTestCasesResponse destination. */ + public destination?: ("gcsUri"|"content"); + + /** + * Creates a new ExportTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportTestCasesResponse): google.cloud.dialogflow.cx.v3.ExportTestCasesResponse; + + /** + * Encodes the specified ExportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesResponse.verify|verify} messages. + * @param message ExportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesResponse.verify|verify} messages. + * @param message ExportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportTestCasesResponse + * @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.dialogflow.cx.v3.ExportTestCasesResponse; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportTestCasesResponse + * @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.dialogflow.cx.v3.ExportTestCasesResponse; + + /** + * Verifies an ExportTestCasesResponse 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 ExportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportTestCasesResponse; + + /** + * Creates a plain object from an ExportTestCasesResponse message. Also converts values to other types if specified. + * @param message ExportTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportTestCasesMetadata. */ + interface IExportTestCasesMetadata { + } + + /** Represents an ExportTestCasesMetadata. */ + class ExportTestCasesMetadata implements IExportTestCasesMetadata { + + /** + * Constructs a new ExportTestCasesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata); + + /** + * Creates a new ExportTestCasesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportTestCasesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata): google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata; + + /** + * Encodes the specified ExportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata.verify|verify} messages. + * @param message ExportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata.verify|verify} messages. + * @param message ExportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportTestCasesMetadata + * @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.dialogflow.cx.v3.ExportTestCasesMetadata; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportTestCasesMetadata + * @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.dialogflow.cx.v3.ExportTestCasesMetadata; + + /** + * Verifies an ExportTestCasesMetadata 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 ExportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportTestCasesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata; + + /** + * Creates a plain object from an ExportTestCasesMetadata message. Also converts values to other types if specified. + * @param message ExportTestCasesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportTestCasesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportTestCasesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTestCaseResultsRequest. */ + interface IListTestCaseResultsRequest { + + /** ListTestCaseResultsRequest parent */ + parent?: (string|null); + + /** ListTestCaseResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListTestCaseResultsRequest pageToken */ + pageToken?: (string|null); + + /** ListTestCaseResultsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListTestCaseResultsRequest. */ + class ListTestCaseResultsRequest implements IListTestCaseResultsRequest { + + /** + * Constructs a new ListTestCaseResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest); + + /** ListTestCaseResultsRequest parent. */ + public parent: string; + + /** ListTestCaseResultsRequest pageSize. */ + public pageSize: number; + + /** ListTestCaseResultsRequest pageToken. */ + public pageToken: string; + + /** ListTestCaseResultsRequest filter. */ + public filter: string; + + /** + * Creates a new ListTestCaseResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCaseResultsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest): google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest; + + /** + * Encodes the specified ListTestCaseResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest.verify|verify} messages. + * @param message ListTestCaseResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCaseResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest.verify|verify} messages. + * @param message ListTestCaseResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCaseResultsRequest + * @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.dialogflow.cx.v3.ListTestCaseResultsRequest; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCaseResultsRequest + * @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.dialogflow.cx.v3.ListTestCaseResultsRequest; + + /** + * Verifies a ListTestCaseResultsRequest 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 ListTestCaseResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCaseResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest; + + /** + * Creates a plain object from a ListTestCaseResultsRequest message. Also converts values to other types if specified. + * @param message ListTestCaseResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCaseResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCaseResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTestCaseResultsResponse. */ + interface IListTestCaseResultsResponse { + + /** ListTestCaseResultsResponse testCaseResults */ + testCaseResults?: (google.cloud.dialogflow.cx.v3.ITestCaseResult[]|null); + + /** ListTestCaseResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTestCaseResultsResponse. */ + class ListTestCaseResultsResponse implements IListTestCaseResultsResponse { + + /** + * Constructs a new ListTestCaseResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse); + + /** ListTestCaseResultsResponse testCaseResults. */ + public testCaseResults: google.cloud.dialogflow.cx.v3.ITestCaseResult[]; + + /** ListTestCaseResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTestCaseResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCaseResultsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse): google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse; + + /** + * Encodes the specified ListTestCaseResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse.verify|verify} messages. + * @param message ListTestCaseResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCaseResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse.verify|verify} messages. + * @param message ListTestCaseResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCaseResultsResponse + * @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.dialogflow.cx.v3.ListTestCaseResultsResponse; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCaseResultsResponse + * @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.dialogflow.cx.v3.ListTestCaseResultsResponse; + + /** + * Verifies a ListTestCaseResultsResponse 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 ListTestCaseResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCaseResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse; + + /** + * Creates a plain object from a ListTestCaseResultsResponse message. Also converts values to other types if specified. + * @param message ListTestCaseResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCaseResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCaseResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTestCaseResultRequest. */ + interface IGetTestCaseResultRequest { + + /** GetTestCaseResultRequest name */ + name?: (string|null); + } + + /** Represents a GetTestCaseResultRequest. */ + class GetTestCaseResultRequest implements IGetTestCaseResultRequest { + + /** + * Constructs a new GetTestCaseResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest); + + /** GetTestCaseResultRequest name. */ + public name: string; + + /** + * Creates a new GetTestCaseResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTestCaseResultRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest): google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest; + + /** + * Encodes the specified GetTestCaseResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest.verify|verify} messages. + * @param message GetTestCaseResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTestCaseResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest.verify|verify} messages. + * @param message GetTestCaseResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTestCaseResultRequest + * @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.dialogflow.cx.v3.GetTestCaseResultRequest; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTestCaseResultRequest + * @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.dialogflow.cx.v3.GetTestCaseResultRequest; + + /** + * Verifies a GetTestCaseResultRequest 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 GetTestCaseResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTestCaseResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest; + + /** + * Creates a plain object from a GetTestCaseResultRequest message. Also converts values to other types if specified. + * @param message GetTestCaseResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTestCaseResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTestCaseResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TestResult enum. */ + enum TestResult { + TEST_RESULT_UNSPECIFIED = 0, + PASSED = 1, + FAILED = 2 + } + + /** Represents an Intents */ + class Intents extends $protobuf.rpc.Service { + + /** + * Constructs a new Intents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Intents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Intents; + + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListIntentsResponse + */ + public listIntents(request: google.cloud.dialogflow.cx.v3.IListIntentsRequest, callback: google.cloud.dialogflow.cx.v3.Intents.ListIntentsCallback): void; + + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @returns Promise + */ + public listIntents(request: google.cloud.dialogflow.cx.v3.IListIntentsRequest): Promise; + + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public getIntent(request: google.cloud.dialogflow.cx.v3.IGetIntentRequest, callback: google.cloud.dialogflow.cx.v3.Intents.GetIntentCallback): void; + + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @returns Promise + */ + public getIntent(request: google.cloud.dialogflow.cx.v3.IGetIntentRequest): Promise; + + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public createIntent(request: google.cloud.dialogflow.cx.v3.ICreateIntentRequest, callback: google.cloud.dialogflow.cx.v3.Intents.CreateIntentCallback): void; + + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @returns Promise + */ + public createIntent(request: google.cloud.dialogflow.cx.v3.ICreateIntentRequest): Promise; + + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public updateIntent(request: google.cloud.dialogflow.cx.v3.IUpdateIntentRequest, callback: google.cloud.dialogflow.cx.v3.Intents.UpdateIntentCallback): void; + + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @returns Promise + */ + public updateIntent(request: google.cloud.dialogflow.cx.v3.IUpdateIntentRequest): Promise; + + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteIntent(request: google.cloud.dialogflow.cx.v3.IDeleteIntentRequest, callback: google.cloud.dialogflow.cx.v3.Intents.DeleteIntentCallback): void; + + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @returns Promise + */ + public deleteIntent(request: google.cloud.dialogflow.cx.v3.IDeleteIntentRequest): Promise; + + /** + * Calls ImportIntents. + * @param request ImportIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importIntents(request: google.cloud.dialogflow.cx.v3.IImportIntentsRequest, callback: google.cloud.dialogflow.cx.v3.Intents.ImportIntentsCallback): void; + + /** + * Calls ImportIntents. + * @param request ImportIntentsRequest message or plain object + * @returns Promise + */ + public importIntents(request: google.cloud.dialogflow.cx.v3.IImportIntentsRequest): Promise; + + /** + * Calls ExportIntents. + * @param request ExportIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportIntents(request: google.cloud.dialogflow.cx.v3.IExportIntentsRequest, callback: google.cloud.dialogflow.cx.v3.Intents.ExportIntentsCallback): void; + + /** + * Calls ExportIntents. + * @param request ExportIntentsRequest message or plain object + * @returns Promise + */ + public exportIntents(request: google.cloud.dialogflow.cx.v3.IExportIntentsRequest): Promise; + } + + namespace Intents { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|listIntents}. + * @param error Error, if any + * @param [response] ListIntentsResponse + */ + type ListIntentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListIntentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|getIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type GetIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|createIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type CreateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|updateIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type UpdateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|deleteIntent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteIntentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|importIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|exportIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Intent. */ + interface IIntent { + + /** Intent name */ + name?: (string|null); + + /** Intent displayName */ + displayName?: (string|null); + + /** Intent trainingPhrases */ + trainingPhrases?: (google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase[]|null); + + /** Intent parameters */ + parameters?: (google.cloud.dialogflow.cx.v3.Intent.IParameter[]|null); + + /** Intent priority */ + priority?: (number|null); + + /** Intent isFallback */ + isFallback?: (boolean|null); + + /** Intent labels */ + labels?: ({ [k: string]: string }|null); + + /** Intent description */ + description?: (string|null); + + /** Intent dtmfPattern */ + dtmfPattern?: (string|null); + } + + /** Represents an Intent. */ + class Intent implements IIntent { + + /** + * Constructs a new Intent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IIntent); + + /** Intent name. */ + public name: string; + + /** Intent displayName. */ + public displayName: string; + + /** Intent trainingPhrases. */ + public trainingPhrases: google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase[]; + + /** Intent parameters. */ + public parameters: google.cloud.dialogflow.cx.v3.Intent.IParameter[]; + + /** Intent priority. */ + public priority: number; + + /** Intent isFallback. */ + public isFallback: boolean; + + /** Intent labels. */ + public labels: { [k: string]: string }; + + /** Intent description. */ + public description: string; + + /** Intent dtmfPattern. */ + public dtmfPattern: string; + + /** + * Creates a new Intent instance using the specified properties. + * @param [properties] Properties to set + * @returns Intent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IIntent): google.cloud.dialogflow.cx.v3.Intent; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intent + * @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.dialogflow.cx.v3.Intent; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intent + * @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.dialogflow.cx.v3.Intent; + + /** + * Verifies an Intent 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 Intent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Intent; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @param message Intent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Intent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Intent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Intent { + + /** Properties of a TrainingPhrase. */ + interface ITrainingPhrase { + + /** TrainingPhrase id */ + id?: (string|null); + + /** TrainingPhrase parts */ + parts?: (google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart[]|null); + + /** TrainingPhrase repeatCount */ + repeatCount?: (number|null); + } + + /** Represents a TrainingPhrase. */ + class TrainingPhrase implements ITrainingPhrase { + + /** + * Constructs a new TrainingPhrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase); + + /** TrainingPhrase id. */ + public id: string; + + /** TrainingPhrase parts. */ + public parts: google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart[]; + + /** TrainingPhrase repeatCount. */ + public repeatCount: number; + + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainingPhrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase): google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase; + + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainingPhrase + * @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.dialogflow.cx.v3.Intent.TrainingPhrase; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainingPhrase + * @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.dialogflow.cx.v3.Intent.TrainingPhrase; + + /** + * Verifies a TrainingPhrase 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 TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainingPhrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase; + + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @param message TrainingPhrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainingPhrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainingPhrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainingPhrase { + + /** Properties of a Part. */ + interface IPart { + + /** Part text */ + text?: (string|null); + + /** Part parameterId */ + parameterId?: (string|null); + } + + /** Represents a Part. */ + class Part implements IPart { + + /** + * Constructs a new Part. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart); + + /** Part text. */ + public text: string; + + /** Part parameterId. */ + public parameterId: string; + + /** + * Creates a new Part instance using the specified properties. + * @param [properties] Properties to set + * @returns Part instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart): google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Part message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Part + * @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.dialogflow.cx.v3.Intent.TrainingPhrase.Part; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Part + * @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.dialogflow.cx.v3.Intent.TrainingPhrase.Part; + + /** + * Verifies a Part 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 Part message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Part + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @param message Part + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Part to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Part + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter id */ + id?: (string|null); + + /** Parameter entityType */ + entityType?: (string|null); + + /** Parameter isList */ + isList?: (boolean|null); + + /** Parameter redact */ + redact?: (boolean|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Intent.IParameter); + + /** Parameter id. */ + public id: string; + + /** Parameter entityType. */ + public entityType: string; + + /** Parameter isList. */ + public isList: boolean; + + /** Parameter redact. */ + public redact: boolean; + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Intent.IParameter): google.cloud.dialogflow.cx.v3.Intent.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @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.dialogflow.cx.v3.Intent.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @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.dialogflow.cx.v3.Intent.Parameter; + + /** + * Verifies a Parameter 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 Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Intent.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Intent.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListIntentsRequest. */ + interface IListIntentsRequest { + + /** ListIntentsRequest parent */ + parent?: (string|null); + + /** ListIntentsRequest languageCode */ + languageCode?: (string|null); + + /** ListIntentsRequest intentView */ + intentView?: (google.cloud.dialogflow.cx.v3.IntentView|keyof typeof google.cloud.dialogflow.cx.v3.IntentView|null); + + /** ListIntentsRequest pageSize */ + pageSize?: (number|null); + + /** ListIntentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListIntentsRequest. */ + class ListIntentsRequest implements IListIntentsRequest { + + /** + * Constructs a new ListIntentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListIntentsRequest); + + /** ListIntentsRequest parent. */ + public parent: string; + + /** ListIntentsRequest languageCode. */ + public languageCode: string; + + /** ListIntentsRequest intentView. */ + public intentView: (google.cloud.dialogflow.cx.v3.IntentView|keyof typeof google.cloud.dialogflow.cx.v3.IntentView); + + /** ListIntentsRequest pageSize. */ + public pageSize: number; + + /** ListIntentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIntentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListIntentsRequest): google.cloud.dialogflow.cx.v3.ListIntentsRequest; + + /** + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIntentsRequest + * @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.dialogflow.cx.v3.ListIntentsRequest; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIntentsRequest + * @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.dialogflow.cx.v3.ListIntentsRequest; + + /** + * Verifies a ListIntentsRequest 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 ListIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIntentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListIntentsRequest; + + /** + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. + * @param message ListIntentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListIntentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListIntentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListIntentsResponse. */ + interface IListIntentsResponse { + + /** ListIntentsResponse intents */ + intents?: (google.cloud.dialogflow.cx.v3.IIntent[]|null); + + /** ListIntentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListIntentsResponse. */ + class ListIntentsResponse implements IListIntentsResponse { + + /** + * Constructs a new ListIntentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListIntentsResponse); + + /** ListIntentsResponse intents. */ + public intents: google.cloud.dialogflow.cx.v3.IIntent[]; + + /** ListIntentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListIntentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIntentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListIntentsResponse): google.cloud.dialogflow.cx.v3.ListIntentsResponse; + + /** + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIntentsResponse + * @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.dialogflow.cx.v3.ListIntentsResponse; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIntentsResponse + * @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.dialogflow.cx.v3.ListIntentsResponse; + + /** + * Verifies a ListIntentsResponse 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 ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIntentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListIntentsResponse; + + /** + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * @param message ListIntentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListIntentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListIntentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIntentRequest. */ + interface IGetIntentRequest { + + /** GetIntentRequest name */ + name?: (string|null); + + /** GetIntentRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetIntentRequest. */ + class GetIntentRequest implements IGetIntentRequest { + + /** + * Constructs a new GetIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetIntentRequest); + + /** GetIntentRequest name. */ + public name: string; + + /** GetIntentRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetIntentRequest): google.cloud.dialogflow.cx.v3.GetIntentRequest; + + /** + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIntentRequest + * @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.dialogflow.cx.v3.GetIntentRequest; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIntentRequest + * @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.dialogflow.cx.v3.GetIntentRequest; + + /** + * Verifies a GetIntentRequest 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 GetIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetIntentRequest; + + /** + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @param message GetIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateIntentRequest. */ + interface ICreateIntentRequest { + + /** CreateIntentRequest parent */ + parent?: (string|null); + + /** CreateIntentRequest intent */ + intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** CreateIntentRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateIntentRequest. */ + class CreateIntentRequest implements ICreateIntentRequest { + + /** + * Constructs a new CreateIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateIntentRequest); + + /** CreateIntentRequest parent. */ + public parent: string; + + /** CreateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** CreateIntentRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateIntentRequest): google.cloud.dialogflow.cx.v3.CreateIntentRequest; + + /** + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateIntentRequest + * @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.dialogflow.cx.v3.CreateIntentRequest; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateIntentRequest + * @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.dialogflow.cx.v3.CreateIntentRequest; + + /** + * Verifies a CreateIntentRequest 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 CreateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateIntentRequest; + + /** + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * @param message CreateIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateIntentRequest. */ + interface IUpdateIntentRequest { + + /** UpdateIntentRequest intent */ + intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** UpdateIntentRequest languageCode */ + languageCode?: (string|null); + + /** UpdateIntentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateIntentRequest. */ + class UpdateIntentRequest implements IUpdateIntentRequest { + + /** + * Constructs a new UpdateIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateIntentRequest); + + /** UpdateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** UpdateIntentRequest languageCode. */ + public languageCode: string; + + /** UpdateIntentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateIntentRequest): google.cloud.dialogflow.cx.v3.UpdateIntentRequest; + + /** + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateIntentRequest + * @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.dialogflow.cx.v3.UpdateIntentRequest; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateIntentRequest + * @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.dialogflow.cx.v3.UpdateIntentRequest; + + /** + * Verifies an UpdateIntentRequest 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 UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateIntentRequest; + + /** + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. + * @param message UpdateIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteIntentRequest. */ + interface IDeleteIntentRequest { + + /** DeleteIntentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteIntentRequest. */ + class DeleteIntentRequest implements IDeleteIntentRequest { + + /** + * Constructs a new DeleteIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteIntentRequest); + + /** DeleteIntentRequest name. */ + public name: string; + + /** + * Creates a new DeleteIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteIntentRequest): google.cloud.dialogflow.cx.v3.DeleteIntentRequest; + + /** + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteIntentRequest + * @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.dialogflow.cx.v3.DeleteIntentRequest; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteIntentRequest + * @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.dialogflow.cx.v3.DeleteIntentRequest; + + /** + * Verifies a DeleteIntentRequest 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 DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteIntentRequest; + + /** + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. + * @param message DeleteIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IntentView enum. */ + enum IntentView { + INTENT_VIEW_UNSPECIFIED = 0, + INTENT_VIEW_PARTIAL = 1, + INTENT_VIEW_FULL = 2 + } + + /** Properties of an ImportIntentsRequest. */ + interface IImportIntentsRequest { + + /** ImportIntentsRequest parent */ + parent?: (string|null); + + /** ImportIntentsRequest intentsUri */ + intentsUri?: (string|null); + + /** ImportIntentsRequest intentsContent */ + intentsContent?: (google.cloud.dialogflow.cx.v3.IInlineSource|null); + + /** ImportIntentsRequest mergeOption */ + mergeOption?: (google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption|null); + } + + /** Represents an ImportIntentsRequest. */ + class ImportIntentsRequest implements IImportIntentsRequest { + + /** + * Constructs a new ImportIntentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportIntentsRequest); + + /** ImportIntentsRequest parent. */ + public parent: string; + + /** ImportIntentsRequest intentsUri. */ + public intentsUri?: (string|null); + + /** ImportIntentsRequest intentsContent. */ + public intentsContent?: (google.cloud.dialogflow.cx.v3.IInlineSource|null); + + /** ImportIntentsRequest mergeOption. */ + public mergeOption: (google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption); + + /** ImportIntentsRequest intents. */ + public intents?: ("intentsUri"|"intentsContent"); + + /** + * Creates a new ImportIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportIntentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportIntentsRequest): google.cloud.dialogflow.cx.v3.ImportIntentsRequest; + + /** + * Encodes the specified ImportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsRequest.verify|verify} messages. + * @param message ImportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsRequest.verify|verify} messages. + * @param message ImportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportIntentsRequest + * @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.dialogflow.cx.v3.ImportIntentsRequest; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportIntentsRequest + * @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.dialogflow.cx.v3.ImportIntentsRequest; + + /** + * Verifies an ImportIntentsRequest 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 ImportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportIntentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportIntentsRequest; + + /** + * Creates a plain object from an ImportIntentsRequest message. Also converts values to other types if specified. + * @param message ImportIntentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportIntentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportIntentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportIntentsRequest { + + /** MergeOption enum. */ + enum MergeOption { + MERGE_OPTION_UNSPECIFIED = 0, + REJECT = 1, + REPLACE = 2, + MERGE = 3, + RENAME = 4, + REPORT_CONFLICT = 5, + KEEP = 6 + } + } + + /** Properties of an ImportIntentsResponse. */ + interface IImportIntentsResponse { + + /** ImportIntentsResponse intents */ + intents?: (string[]|null); + + /** ImportIntentsResponse conflictingResources */ + conflictingResources?: (google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources|null); + } + + /** Represents an ImportIntentsResponse. */ + class ImportIntentsResponse implements IImportIntentsResponse { + + /** + * Constructs a new ImportIntentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportIntentsResponse); + + /** ImportIntentsResponse intents. */ + public intents: string[]; + + /** ImportIntentsResponse conflictingResources. */ + public conflictingResources?: (google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources|null); + + /** + * Creates a new ImportIntentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportIntentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportIntentsResponse): google.cloud.dialogflow.cx.v3.ImportIntentsResponse; + + /** + * Encodes the specified ImportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.verify|verify} messages. + * @param message ImportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.verify|verify} messages. + * @param message ImportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportIntentsResponse + * @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.dialogflow.cx.v3.ImportIntentsResponse; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportIntentsResponse + * @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.dialogflow.cx.v3.ImportIntentsResponse; + + /** + * Verifies an ImportIntentsResponse 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 ImportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportIntentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportIntentsResponse; + + /** + * Creates a plain object from an ImportIntentsResponse message. Also converts values to other types if specified. + * @param message ImportIntentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportIntentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportIntentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportIntentsResponse { + + /** Properties of a ConflictingResources. */ + interface IConflictingResources { + + /** ConflictingResources intentDisplayNames */ + intentDisplayNames?: (string[]|null); + + /** ConflictingResources entityDisplayNames */ + entityDisplayNames?: (string[]|null); + } + + /** Represents a ConflictingResources. */ + class ConflictingResources implements IConflictingResources { + + /** + * Constructs a new ConflictingResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources); + + /** ConflictingResources intentDisplayNames. */ + public intentDisplayNames: string[]; + + /** ConflictingResources entityDisplayNames. */ + public entityDisplayNames: string[]; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ConflictingResources instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources): google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConflictingResources + * @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.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConflictingResources + * @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.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources; + + /** + * Verifies a ConflictingResources 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 ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConflictingResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @param message ConflictingResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConflictingResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConflictingResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportIntentsMetadata. */ + interface IImportIntentsMetadata { + } + + /** Represents an ImportIntentsMetadata. */ + class ImportIntentsMetadata implements IImportIntentsMetadata { + + /** + * Constructs a new ImportIntentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportIntentsMetadata); + + /** + * Creates a new ImportIntentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportIntentsMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportIntentsMetadata): google.cloud.dialogflow.cx.v3.ImportIntentsMetadata; + + /** + * Encodes the specified ImportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsMetadata.verify|verify} messages. + * @param message ImportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsMetadata.verify|verify} messages. + * @param message ImportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportIntentsMetadata + * @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.dialogflow.cx.v3.ImportIntentsMetadata; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportIntentsMetadata + * @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.dialogflow.cx.v3.ImportIntentsMetadata; + + /** + * Verifies an ImportIntentsMetadata 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 ImportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportIntentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportIntentsMetadata; + + /** + * Creates a plain object from an ImportIntentsMetadata message. Also converts values to other types if specified. + * @param message ImportIntentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportIntentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportIntentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportIntentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportIntentsRequest. */ + interface IExportIntentsRequest { + + /** ExportIntentsRequest parent */ + parent?: (string|null); + + /** ExportIntentsRequest intents */ + intents?: (string[]|null); + + /** ExportIntentsRequest intentsUri */ + intentsUri?: (string|null); + + /** ExportIntentsRequest intentsContentInline */ + intentsContentInline?: (boolean|null); + + /** ExportIntentsRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat|null); + } + + /** Represents an ExportIntentsRequest. */ + class ExportIntentsRequest implements IExportIntentsRequest { + + /** + * Constructs a new ExportIntentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportIntentsRequest); + + /** ExportIntentsRequest parent. */ + public parent: string; + + /** ExportIntentsRequest intents. */ + public intents: string[]; + + /** ExportIntentsRequest intentsUri. */ + public intentsUri?: (string|null); + + /** ExportIntentsRequest intentsContentInline. */ + public intentsContentInline?: (boolean|null); + + /** ExportIntentsRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat); + + /** ExportIntentsRequest destination. */ + public destination?: ("intentsUri"|"intentsContentInline"); + + /** + * Creates a new ExportIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIntentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportIntentsRequest): google.cloud.dialogflow.cx.v3.ExportIntentsRequest; + + /** + * Encodes the specified ExportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsRequest.verify|verify} messages. + * @param message ExportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsRequest.verify|verify} messages. + * @param message ExportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIntentsRequest + * @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.dialogflow.cx.v3.ExportIntentsRequest; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIntentsRequest + * @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.dialogflow.cx.v3.ExportIntentsRequest; + + /** + * Verifies an ExportIntentsRequest 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 ExportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIntentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportIntentsRequest; + + /** + * Creates a plain object from an ExportIntentsRequest message. Also converts values to other types if specified. + * @param message ExportIntentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIntentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIntentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportIntentsRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON = 2, + CSV = 3 + } + } + + /** Properties of an ExportIntentsResponse. */ + interface IExportIntentsResponse { + + /** ExportIntentsResponse intentsUri */ + intentsUri?: (string|null); + + /** ExportIntentsResponse intentsContent */ + intentsContent?: (google.cloud.dialogflow.cx.v3.IInlineDestination|null); + } + + /** Represents an ExportIntentsResponse. */ + class ExportIntentsResponse implements IExportIntentsResponse { + + /** + * Constructs a new ExportIntentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportIntentsResponse); + + /** ExportIntentsResponse intentsUri. */ + public intentsUri?: (string|null); + + /** ExportIntentsResponse intentsContent. */ + public intentsContent?: (google.cloud.dialogflow.cx.v3.IInlineDestination|null); + + /** ExportIntentsResponse intents. */ + public intents?: ("intentsUri"|"intentsContent"); + + /** + * Creates a new ExportIntentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIntentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportIntentsResponse): google.cloud.dialogflow.cx.v3.ExportIntentsResponse; + + /** + * Encodes the specified ExportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsResponse.verify|verify} messages. + * @param message ExportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsResponse.verify|verify} messages. + * @param message ExportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIntentsResponse + * @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.dialogflow.cx.v3.ExportIntentsResponse; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIntentsResponse + * @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.dialogflow.cx.v3.ExportIntentsResponse; + + /** + * Verifies an ExportIntentsResponse 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 ExportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIntentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportIntentsResponse; + + /** + * Creates a plain object from an ExportIntentsResponse message. Also converts values to other types if specified. + * @param message ExportIntentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIntentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIntentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportIntentsMetadata. */ + interface IExportIntentsMetadata { + } + + /** Represents an ExportIntentsMetadata. */ + class ExportIntentsMetadata implements IExportIntentsMetadata { + + /** + * Constructs a new ExportIntentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportIntentsMetadata); + + /** + * Creates a new ExportIntentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIntentsMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportIntentsMetadata): google.cloud.dialogflow.cx.v3.ExportIntentsMetadata; + + /** + * Encodes the specified ExportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsMetadata.verify|verify} messages. + * @param message ExportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsMetadata.verify|verify} messages. + * @param message ExportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIntentsMetadata + * @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.dialogflow.cx.v3.ExportIntentsMetadata; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIntentsMetadata + * @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.dialogflow.cx.v3.ExportIntentsMetadata; + + /** + * Verifies an ExportIntentsMetadata 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 ExportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIntentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportIntentsMetadata; + + /** + * Creates a plain object from an ExportIntentsMetadata message. Also converts values to other types if specified. + * @param message ExportIntentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportIntentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIntentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIntentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Sessions */ + class Sessions extends $protobuf.rpc.Service { + + /** + * Constructs a new Sessions service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Sessions service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Sessions; + + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectIntentResponse + */ + public detectIntent(request: google.cloud.dialogflow.cx.v3.IDetectIntentRequest, callback: google.cloud.dialogflow.cx.v3.Sessions.DetectIntentCallback): void; + + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @returns Promise + */ + public detectIntent(request: google.cloud.dialogflow.cx.v3.IDetectIntentRequest): Promise; + + /** + * Calls ServerStreamingDetectIntent. + * @param request DetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectIntentResponse + */ + public serverStreamingDetectIntent(request: google.cloud.dialogflow.cx.v3.IDetectIntentRequest, callback: google.cloud.dialogflow.cx.v3.Sessions.ServerStreamingDetectIntentCallback): void; + + /** + * Calls ServerStreamingDetectIntent. + * @param request DetectIntentRequest message or plain object + * @returns Promise + */ + public serverStreamingDetectIntent(request: google.cloud.dialogflow.cx.v3.IDetectIntentRequest): Promise; + + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + */ + public streamingDetectIntent(request: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest, callback: google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntentCallback): void; + + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @returns Promise + */ + public streamingDetectIntent(request: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest): Promise; + + /** + * Calls MatchIntent. + * @param request MatchIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MatchIntentResponse + */ + public matchIntent(request: google.cloud.dialogflow.cx.v3.IMatchIntentRequest, callback: google.cloud.dialogflow.cx.v3.Sessions.MatchIntentCallback): void; + + /** + * Calls MatchIntent. + * @param request MatchIntentRequest message or plain object + * @returns Promise + */ + public matchIntent(request: google.cloud.dialogflow.cx.v3.IMatchIntentRequest): Promise; + + /** + * Calls FulfillIntent. + * @param request FulfillIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FulfillIntentResponse + */ + public fulfillIntent(request: google.cloud.dialogflow.cx.v3.IFulfillIntentRequest, callback: google.cloud.dialogflow.cx.v3.Sessions.FulfillIntentCallback): void; + + /** + * Calls FulfillIntent. + * @param request FulfillIntentRequest message or plain object + * @returns Promise + */ + public fulfillIntent(request: google.cloud.dialogflow.cx.v3.IFulfillIntentRequest): Promise; + + /** + * Calls SubmitAnswerFeedback. + * @param request SubmitAnswerFeedbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnswerFeedback + */ + public submitAnswerFeedback(request: google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest, callback: google.cloud.dialogflow.cx.v3.Sessions.SubmitAnswerFeedbackCallback): void; + + /** + * Calls SubmitAnswerFeedback. + * @param request SubmitAnswerFeedbackRequest message or plain object + * @returns Promise + */ + public submitAnswerFeedback(request: google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest): Promise; + } + + namespace Sessions { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|detectIntent}. + * @param error Error, if any + * @param [response] DetectIntentResponse + */ + type DetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.DetectIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|serverStreamingDetectIntent}. + * @param error Error, if any + * @param [response] DetectIntentResponse + */ + type ServerStreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.DetectIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|streamingDetectIntent}. + * @param error Error, if any + * @param [response] StreamingDetectIntentResponse + */ + type StreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|matchIntent}. + * @param error Error, if any + * @param [response] MatchIntentResponse + */ + type MatchIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.MatchIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|fulfillIntent}. + * @param error Error, if any + * @param [response] FulfillIntentResponse + */ + type FulfillIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.FulfillIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|submitAnswerFeedback}. + * @param error Error, if any + * @param [response] AnswerFeedback + */ + type SubmitAnswerFeedbackCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.AnswerFeedback) => void; + } + + /** Properties of an AnswerFeedback. */ + interface IAnswerFeedback { + + /** AnswerFeedback rating */ + rating?: (google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating|keyof typeof google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating|null); + + /** AnswerFeedback ratingReason */ + ratingReason?: (google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason|null); + + /** AnswerFeedback customRating */ + customRating?: (string|null); + } + + /** Represents an AnswerFeedback. */ + class AnswerFeedback implements IAnswerFeedback { + + /** + * Constructs a new AnswerFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IAnswerFeedback); + + /** AnswerFeedback rating. */ + public rating: (google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating|keyof typeof google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating); + + /** AnswerFeedback ratingReason. */ + public ratingReason?: (google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason|null); + + /** AnswerFeedback customRating. */ + public customRating: string; + + /** + * Creates a new AnswerFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerFeedback instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IAnswerFeedback): google.cloud.dialogflow.cx.v3.AnswerFeedback; + + /** + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerFeedback + * @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.dialogflow.cx.v3.AnswerFeedback; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerFeedback + * @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.dialogflow.cx.v3.AnswerFeedback; + + /** + * Verifies an AnswerFeedback 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 AnswerFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerFeedback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AnswerFeedback; + + /** + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. + * @param message AnswerFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AnswerFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerFeedback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnswerFeedback { + + /** Rating enum. */ + enum Rating { + RATING_UNSPECIFIED = 0, + THUMBS_UP = 1, + THUMBS_DOWN = 2 + } + + /** Properties of a RatingReason. */ + interface IRatingReason { + + /** RatingReason reasonLabels */ + reasonLabels?: (string[]|null); + + /** RatingReason feedback */ + feedback?: (string|null); + } + + /** Represents a RatingReason. */ + class RatingReason implements IRatingReason { + + /** + * Constructs a new RatingReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason); + + /** RatingReason reasonLabels. */ + public reasonLabels: string[]; + + /** RatingReason feedback. */ + public feedback: string; + + /** + * Creates a new RatingReason instance using the specified properties. + * @param [properties] Properties to set + * @returns RatingReason instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason): google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason; + + /** + * Encodes the specified RatingReason message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.verify|verify} messages. + * @param message RatingReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RatingReason message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.verify|verify} messages. + * @param message RatingReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RatingReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RatingReason + * @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.dialogflow.cx.v3.AnswerFeedback.RatingReason; + + /** + * Decodes a RatingReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RatingReason + * @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.dialogflow.cx.v3.AnswerFeedback.RatingReason; + + /** + * Verifies a RatingReason 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 RatingReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RatingReason + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason; + + /** + * Creates a plain object from a RatingReason message. Also converts values to other types if specified. + * @param message RatingReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RatingReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RatingReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SubmitAnswerFeedbackRequest. */ + interface ISubmitAnswerFeedbackRequest { + + /** SubmitAnswerFeedbackRequest session */ + session?: (string|null); + + /** SubmitAnswerFeedbackRequest responseId */ + responseId?: (string|null); + + /** SubmitAnswerFeedbackRequest answerFeedback */ + answerFeedback?: (google.cloud.dialogflow.cx.v3.IAnswerFeedback|null); + + /** SubmitAnswerFeedbackRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SubmitAnswerFeedbackRequest. */ + class SubmitAnswerFeedbackRequest implements ISubmitAnswerFeedbackRequest { + + /** + * Constructs a new SubmitAnswerFeedbackRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest); + + /** SubmitAnswerFeedbackRequest session. */ + public session: string; + + /** SubmitAnswerFeedbackRequest responseId. */ + public responseId: string; + + /** SubmitAnswerFeedbackRequest answerFeedback. */ + public answerFeedback?: (google.cloud.dialogflow.cx.v3.IAnswerFeedback|null); + + /** SubmitAnswerFeedbackRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SubmitAnswerFeedbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubmitAnswerFeedbackRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest): google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @param message SubmitAnswerFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @param message SubmitAnswerFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubmitAnswerFeedbackRequest + * @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.dialogflow.cx.v3.SubmitAnswerFeedbackRequest; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubmitAnswerFeedbackRequest + * @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.dialogflow.cx.v3.SubmitAnswerFeedbackRequest; + + /** + * Verifies a SubmitAnswerFeedbackRequest 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 SubmitAnswerFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubmitAnswerFeedbackRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest; + + /** + * Creates a plain object from a SubmitAnswerFeedbackRequest message. Also converts values to other types if specified. + * @param message SubmitAnswerFeedbackRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubmitAnswerFeedbackRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubmitAnswerFeedbackRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectIntentRequest. */ + interface IDetectIntentRequest { + + /** DetectIntentRequest session */ + session?: (string|null); + + /** DetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.cx.v3.IQueryParameters|null); + + /** DetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** DetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** DetectIntentRequest responseView */ + responseView?: (google.cloud.dialogflow.cx.v3.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponseView|null); + } + + /** Represents a DetectIntentRequest. */ + class DetectIntentRequest implements IDetectIntentRequest { + + /** + * Constructs a new DetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDetectIntentRequest); + + /** DetectIntentRequest session. */ + public session: string; + + /** DetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.cx.v3.IQueryParameters|null); + + /** DetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** DetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** DetectIntentRequest responseView. */ + public responseView: (google.cloud.dialogflow.cx.v3.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponseView); + + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDetectIntentRequest): google.cloud.dialogflow.cx.v3.DetectIntentRequest; + + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentRequest + * @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.dialogflow.cx.v3.DetectIntentRequest; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentRequest + * @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.dialogflow.cx.v3.DetectIntentRequest; + + /** + * Verifies a DetectIntentRequest 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 DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DetectIntentRequest; + + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @param message DetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectIntentResponse. */ + interface IDetectIntentResponse { + + /** DetectIntentResponse responseId */ + responseId?: (string|null); + + /** DetectIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.cx.v3.IQueryResult|null); + + /** DetectIntentResponse outputAudio */ + outputAudio?: (Uint8Array|Buffer|string|null); + + /** DetectIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** DetectIntentResponse responseType */ + responseType?: (google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|null); + + /** DetectIntentResponse allowCancellation */ + allowCancellation?: (boolean|null); + } + + /** Represents a DetectIntentResponse. */ + class DetectIntentResponse implements IDetectIntentResponse { + + /** + * Constructs a new DetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDetectIntentResponse); + + /** DetectIntentResponse responseId. */ + public responseId: string; + + /** DetectIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.cx.v3.IQueryResult|null); + + /** DetectIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|Buffer|string); + + /** DetectIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** DetectIntentResponse responseType. */ + public responseType: (google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType); + + /** DetectIntentResponse allowCancellation. */ + public allowCancellation: boolean; + + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDetectIntentResponse): google.cloud.dialogflow.cx.v3.DetectIntentResponse; + + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentResponse + * @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.dialogflow.cx.v3.DetectIntentResponse; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentResponse + * @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.dialogflow.cx.v3.DetectIntentResponse; + + /** + * Verifies a DetectIntentResponse 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 DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DetectIntentResponse; + + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @param message DetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DetectIntentResponse { + + /** ResponseType enum. */ + enum ResponseType { + RESPONSE_TYPE_UNSPECIFIED = 0, + PARTIAL = 1, + FINAL = 2 + } + } + + /** Properties of a StreamingDetectIntentRequest. */ + interface IStreamingDetectIntentRequest { + + /** StreamingDetectIntentRequest session */ + session?: (string|null); + + /** StreamingDetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.cx.v3.IQueryParameters|null); + + /** StreamingDetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** StreamingDetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** StreamingDetectIntentRequest enablePartialResponse */ + enablePartialResponse?: (boolean|null); + + /** StreamingDetectIntentRequest enableDebuggingInfo */ + enableDebuggingInfo?: (boolean|null); + + /** StreamingDetectIntentRequest responseView */ + responseView?: (google.cloud.dialogflow.cx.v3.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponseView|null); + } + + /** Represents a StreamingDetectIntentRequest. */ + class StreamingDetectIntentRequest implements IStreamingDetectIntentRequest { + + /** + * Constructs a new StreamingDetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest); + + /** StreamingDetectIntentRequest session. */ + public session: string; + + /** StreamingDetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.cx.v3.IQueryParameters|null); + + /** StreamingDetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** StreamingDetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** StreamingDetectIntentRequest enablePartialResponse. */ + public enablePartialResponse: boolean; + + /** StreamingDetectIntentRequest enableDebuggingInfo. */ + public enableDebuggingInfo: boolean; + + /** StreamingDetectIntentRequest responseView. */ + public responseView: (google.cloud.dialogflow.cx.v3.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponseView); + + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest): google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest; + + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentRequest + * @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.dialogflow.cx.v3.StreamingDetectIntentRequest; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentRequest + * @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.dialogflow.cx.v3.StreamingDetectIntentRequest; + + /** + * Verifies a StreamingDetectIntentRequest 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 StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest; + + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @param message StreamingDetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingDetectIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudConversationDebuggingInfo. */ + interface ICloudConversationDebuggingInfo { + + /** CloudConversationDebuggingInfo audioDataChunks */ + audioDataChunks?: (number|null); + + /** CloudConversationDebuggingInfo resultEndTimeOffset */ + resultEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo firstAudioDuration */ + firstAudioDuration?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo singleUtterance */ + singleUtterance?: (boolean|null); + + /** CloudConversationDebuggingInfo speechPartialResultsEndTimes */ + speechPartialResultsEndTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo speechFinalResultsEndTimes */ + speechFinalResultsEndTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo partialResponses */ + partialResponses?: (number|null); + + /** CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset */ + speakerIdPassiveLatencyMsOffset?: (number|null); + + /** CloudConversationDebuggingInfo bargeinEventTriggered */ + bargeinEventTriggered?: (boolean|null); + + /** CloudConversationDebuggingInfo speechSingleUtterance */ + speechSingleUtterance?: (boolean|null); + + /** CloudConversationDebuggingInfo dtmfPartialResultsTimes */ + dtmfPartialResultsTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo dtmfFinalResultsTimes */ + dtmfFinalResultsTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo singleUtteranceEndTimeOffset */ + singleUtteranceEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo noSpeechTimeout */ + noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo endpointingTimeout */ + endpointingTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo isInputText */ + isInputText?: (boolean|null); + + /** CloudConversationDebuggingInfo clientHalfCloseTimeOffset */ + clientHalfCloseTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset */ + clientHalfCloseStreamingTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a CloudConversationDebuggingInfo. */ + class CloudConversationDebuggingInfo implements ICloudConversationDebuggingInfo { + + /** + * Constructs a new CloudConversationDebuggingInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo); + + /** CloudConversationDebuggingInfo audioDataChunks. */ + public audioDataChunks: number; + + /** CloudConversationDebuggingInfo resultEndTimeOffset. */ + public resultEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo firstAudioDuration. */ + public firstAudioDuration?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo singleUtterance. */ + public singleUtterance: boolean; + + /** CloudConversationDebuggingInfo speechPartialResultsEndTimes. */ + public speechPartialResultsEndTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo speechFinalResultsEndTimes. */ + public speechFinalResultsEndTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo partialResponses. */ + public partialResponses: number; + + /** CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset. */ + public speakerIdPassiveLatencyMsOffset: number; + + /** CloudConversationDebuggingInfo bargeinEventTriggered. */ + public bargeinEventTriggered: boolean; + + /** CloudConversationDebuggingInfo speechSingleUtterance. */ + public speechSingleUtterance: boolean; + + /** CloudConversationDebuggingInfo dtmfPartialResultsTimes. */ + public dtmfPartialResultsTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo dtmfFinalResultsTimes. */ + public dtmfFinalResultsTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo singleUtteranceEndTimeOffset. */ + public singleUtteranceEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo noSpeechTimeout. */ + public noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo endpointingTimeout. */ + public endpointingTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo isInputText. */ + public isInputText: boolean; + + /** CloudConversationDebuggingInfo clientHalfCloseTimeOffset. */ + public clientHalfCloseTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset. */ + public clientHalfCloseStreamingTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new CloudConversationDebuggingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudConversationDebuggingInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo): google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo; + + /** + * Encodes the specified CloudConversationDebuggingInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.verify|verify} messages. + * @param message CloudConversationDebuggingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudConversationDebuggingInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.verify|verify} messages. + * @param message CloudConversationDebuggingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudConversationDebuggingInfo + * @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.dialogflow.cx.v3.CloudConversationDebuggingInfo; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudConversationDebuggingInfo + * @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.dialogflow.cx.v3.CloudConversationDebuggingInfo; + + /** + * Verifies a CloudConversationDebuggingInfo 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 CloudConversationDebuggingInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudConversationDebuggingInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo; + + /** + * Creates a plain object from a CloudConversationDebuggingInfo message. Also converts values to other types if specified. + * @param message CloudConversationDebuggingInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudConversationDebuggingInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudConversationDebuggingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingDetectIntentResponse. */ + interface IStreamingDetectIntentResponse { + + /** StreamingDetectIntentResponse recognitionResult */ + recognitionResult?: (google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult|null); + + /** StreamingDetectIntentResponse detectIntentResponse */ + detectIntentResponse?: (google.cloud.dialogflow.cx.v3.IDetectIntentResponse|null); + + /** StreamingDetectIntentResponse debuggingInfo */ + debuggingInfo?: (google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo|null); + } + + /** Represents a StreamingDetectIntentResponse. */ + class StreamingDetectIntentResponse implements IStreamingDetectIntentResponse { + + /** + * Constructs a new StreamingDetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse); + + /** StreamingDetectIntentResponse recognitionResult. */ + public recognitionResult?: (google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult|null); + + /** StreamingDetectIntentResponse detectIntentResponse. */ + public detectIntentResponse?: (google.cloud.dialogflow.cx.v3.IDetectIntentResponse|null); + + /** StreamingDetectIntentResponse debuggingInfo. */ + public debuggingInfo?: (google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo|null); + + /** StreamingDetectIntentResponse response. */ + public response?: ("recognitionResult"|"detectIntentResponse"); + + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse): google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse; + + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentResponse + * @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.dialogflow.cx.v3.StreamingDetectIntentResponse; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentResponse + * @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.dialogflow.cx.v3.StreamingDetectIntentResponse; + + /** + * Verifies a StreamingDetectIntentResponse 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 StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse; + + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @param message StreamingDetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingDetectIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { + + /** StreamingRecognitionResult messageType */ + messageType?: (google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType|null); + + /** StreamingRecognitionResult transcript */ + transcript?: (string|null); + + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); + + /** StreamingRecognitionResult confidence */ + confidence?: (number|null); + + /** StreamingRecognitionResult stability */ + stability?: (number|null); + + /** StreamingRecognitionResult speechWordInfo */ + speechWordInfo?: (google.cloud.dialogflow.cx.v3.ISpeechWordInfo[]|null); + + /** StreamingRecognitionResult speechEndOffset */ + speechEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { + + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult); + + /** StreamingRecognitionResult messageType. */ + public messageType: (google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType); + + /** StreamingRecognitionResult transcript. */ + public transcript: string; + + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; + + /** StreamingRecognitionResult confidence. */ + public confidence: number; + + /** StreamingRecognitionResult stability. */ + public stability: number; + + /** StreamingRecognitionResult speechWordInfo. */ + public speechWordInfo: google.cloud.dialogflow.cx.v3.ISpeechWordInfo[]; + + /** StreamingRecognitionResult speechEndOffset. */ + public speechEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult): google.cloud.dialogflow.cx.v3.StreamingRecognitionResult; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @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.dialogflow.cx.v3.StreamingRecognitionResult; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @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.dialogflow.cx.v3.StreamingRecognitionResult; + + /** + * Verifies a StreamingRecognitionResult 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 StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.StreamingRecognitionResult; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognitionResult { + + /** MessageType enum. */ + enum MessageType { + MESSAGE_TYPE_UNSPECIFIED = 0, + TRANSCRIPT = 1, + END_OF_SINGLE_UTTERANCE = 2 + } + } + + /** Properties of a QueryParameters. */ + interface IQueryParameters { + + /** QueryParameters timeZone */ + timeZone?: (string|null); + + /** QueryParameters geoLocation */ + geoLocation?: (google.type.ILatLng|null); + + /** QueryParameters sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.cx.v3.ISessionEntityType[]|null); + + /** QueryParameters payload */ + payload?: (google.protobuf.IStruct|null); + + /** QueryParameters parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** QueryParameters parameterScope */ + parameterScope?: (string|null); + + /** QueryParameters currentPage */ + currentPage?: (string|null); + + /** QueryParameters disableWebhook */ + disableWebhook?: (boolean|null); + + /** QueryParameters analyzeQueryTextSentiment */ + analyzeQueryTextSentiment?: (boolean|null); + + /** QueryParameters webhookHeaders */ + webhookHeaders?: ({ [k: string]: string }|null); + + /** QueryParameters flowVersions */ + flowVersions?: (string[]|null); + + /** QueryParameters currentPlaybook */ + currentPlaybook?: (string|null); + + /** QueryParameters llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + + /** QueryParameters channel */ + channel?: (string|null); + + /** QueryParameters sessionTtl */ + sessionTtl?: (google.protobuf.IDuration|null); + + /** QueryParameters endUserMetadata */ + endUserMetadata?: (google.protobuf.IStruct|null); + + /** QueryParameters searchConfig */ + searchConfig?: (google.cloud.dialogflow.cx.v3.ISearchConfig|null); + + /** QueryParameters populateDataStoreConnectionSignals */ + populateDataStoreConnectionSignals?: (boolean|null); + } + + /** Represents a QueryParameters. */ + class QueryParameters implements IQueryParameters { + + /** + * Constructs a new QueryParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IQueryParameters); + + /** QueryParameters timeZone. */ + public timeZone: string; + + /** QueryParameters geoLocation. */ + public geoLocation?: (google.type.ILatLng|null); + + /** QueryParameters sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.cx.v3.ISessionEntityType[]; + + /** QueryParameters payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** QueryParameters parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** QueryParameters parameterScope. */ + public parameterScope: string; + + /** QueryParameters currentPage. */ + public currentPage: string; + + /** QueryParameters disableWebhook. */ + public disableWebhook: boolean; + + /** QueryParameters analyzeQueryTextSentiment. */ + public analyzeQueryTextSentiment: boolean; + + /** QueryParameters webhookHeaders. */ + public webhookHeaders: { [k: string]: string }; + + /** QueryParameters flowVersions. */ + public flowVersions: string[]; + + /** QueryParameters currentPlaybook. */ + public currentPlaybook: string; + + /** QueryParameters llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + + /** QueryParameters channel. */ + public channel: string; + + /** QueryParameters sessionTtl. */ + public sessionTtl?: (google.protobuf.IDuration|null); + + /** QueryParameters endUserMetadata. */ + public endUserMetadata?: (google.protobuf.IStruct|null); + + /** QueryParameters searchConfig. */ + public searchConfig?: (google.cloud.dialogflow.cx.v3.ISearchConfig|null); + + /** QueryParameters populateDataStoreConnectionSignals. */ + public populateDataStoreConnectionSignals: boolean; + + /** + * Creates a new QueryParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameters instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IQueryParameters): google.cloud.dialogflow.cx.v3.QueryParameters; + + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameters + * @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.dialogflow.cx.v3.QueryParameters; + + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameters + * @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.dialogflow.cx.v3.QueryParameters; + + /** + * Verifies a QueryParameters 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 QueryParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.QueryParameters; + + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @param message QueryParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.QueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchConfig. */ + interface ISearchConfig { + + /** SearchConfig boostSpecs */ + boostSpecs?: (google.cloud.dialogflow.cx.v3.IBoostSpecs[]|null); + + /** SearchConfig filterSpecs */ + filterSpecs?: (google.cloud.dialogflow.cx.v3.IFilterSpecs[]|null); + } + + /** Represents a SearchConfig. */ + class SearchConfig implements ISearchConfig { + + /** + * Constructs a new SearchConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISearchConfig); + + /** SearchConfig boostSpecs. */ + public boostSpecs: google.cloud.dialogflow.cx.v3.IBoostSpecs[]; + + /** SearchConfig filterSpecs. */ + public filterSpecs: google.cloud.dialogflow.cx.v3.IFilterSpecs[]; + + /** + * Creates a new SearchConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISearchConfig): google.cloud.dialogflow.cx.v3.SearchConfig; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchConfig + * @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.dialogflow.cx.v3.SearchConfig; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchConfig + * @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.dialogflow.cx.v3.SearchConfig; + + /** + * Verifies a SearchConfig 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 SearchConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SearchConfig; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @param message SearchConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SearchConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec[]|null); + } + + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { + + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IBoostSpec); + + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec[]; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IBoostSpec): google.cloud.dialogflow.cx.v3.BoostSpec; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @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.dialogflow.cx.v3.BoostSpec; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @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.dialogflow.cx.v3.BoostSpec; + + /** + * Verifies a BoostSpec 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 BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BoostSpec; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostSpec { + + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { + + /** ConditionBoostSpec condition */ + condition?: (string|null); + + /** ConditionBoostSpec boost */ + boost?: (number|null); + + /** ConditionBoostSpec boostControlSpec */ + boostControlSpec?: (google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + } + + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { + + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec); + + /** ConditionBoostSpec condition. */ + public condition: string; + + /** ConditionBoostSpec boost. */ + public boost: number; + + /** ConditionBoostSpec boostControlSpec. */ + public boostControlSpec?: (google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec): google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @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.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @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.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec; + + /** + * Verifies a ConditionBoostSpec 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 ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionBoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionBoostSpec { + + /** Properties of a BoostControlSpec. */ + interface IBoostControlSpec { + + /** BoostControlSpec fieldName */ + fieldName?: (string|null); + + /** BoostControlSpec attributeType */ + attributeType?: (google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); + + /** BoostControlSpec interpolationType */ + interpolationType?: (google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); + + /** BoostControlSpec controlPoints */ + controlPoints?: (google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); + } + + /** Represents a BoostControlSpec. */ + class BoostControlSpec implements IBoostControlSpec { + + /** + * Constructs a new BoostControlSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec); + + /** BoostControlSpec fieldName. */ + public fieldName: string; + + /** BoostControlSpec attributeType. */ + public attributeType: (google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); + + /** BoostControlSpec interpolationType. */ + public interpolationType: (google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); + + /** BoostControlSpec controlPoints. */ + public controlPoints: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostControlSpec instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostControlSpec + * @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.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostControlSpec + * @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.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Verifies a BoostControlSpec 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 BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostControlSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @param message BoostControlSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostControlSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostControlSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostControlSpec { + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + NUMERICAL = 1, + FRESHNESS = 2 + } + + /** InterpolationType enum. */ + enum InterpolationType { + INTERPOLATION_TYPE_UNSPECIFIED = 0, + LINEAR = 1 + } + + /** Properties of a ControlPoint. */ + interface IControlPoint { + + /** ControlPoint attributeValue */ + attributeValue?: (string|null); + + /** ControlPoint boostAmount */ + boostAmount?: (number|null); + } + + /** Represents a ControlPoint. */ + class ControlPoint implements IControlPoint { + + /** + * Constructs a new ControlPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); + + /** ControlPoint attributeValue. */ + public attributeValue: string; + + /** ControlPoint boostAmount. */ + public boostAmount: number; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlPoint instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ControlPoint + * @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.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ControlPoint + * @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.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Verifies a ControlPoint 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 ControlPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ControlPoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @param message ControlPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ControlPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ControlPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Properties of a BoostSpecs. */ + interface IBoostSpecs { + + /** BoostSpecs dataStores */ + dataStores?: (string[]|null); + + /** BoostSpecs spec */ + spec?: (google.cloud.dialogflow.cx.v3.IBoostSpec[]|null); + } + + /** Represents a BoostSpecs. */ + class BoostSpecs implements IBoostSpecs { + + /** + * Constructs a new BoostSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IBoostSpecs); + + /** BoostSpecs dataStores. */ + public dataStores: string[]; + + /** BoostSpecs spec. */ + public spec: google.cloud.dialogflow.cx.v3.IBoostSpec[]; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpecs instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IBoostSpecs): google.cloud.dialogflow.cx.v3.BoostSpecs; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpecs + * @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.dialogflow.cx.v3.BoostSpecs; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpecs + * @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.dialogflow.cx.v3.BoostSpecs; + + /** + * Verifies a BoostSpecs 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 BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.BoostSpecs; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @param message BoostSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FilterSpecs. */ + interface IFilterSpecs { + + /** FilterSpecs dataStores */ + dataStores?: (string[]|null); + + /** FilterSpecs filter */ + filter?: (string|null); + } + + /** Represents a FilterSpecs. */ + class FilterSpecs implements IFilterSpecs { + + /** + * Constructs a new FilterSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFilterSpecs); + + /** FilterSpecs dataStores. */ + public dataStores: string[]; + + /** FilterSpecs filter. */ + public filter: string; + + /** + * Creates a new FilterSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterSpecs instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFilterSpecs): google.cloud.dialogflow.cx.v3.FilterSpecs; + + /** + * Encodes the specified FilterSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FilterSpecs.verify|verify} messages. + * @param message FilterSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFilterSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FilterSpecs.verify|verify} messages. + * @param message FilterSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFilterSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterSpecs + * @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.dialogflow.cx.v3.FilterSpecs; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterSpecs + * @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.dialogflow.cx.v3.FilterSpecs; + + /** + * Verifies a FilterSpecs 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 FilterSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FilterSpecs; + + /** + * Creates a plain object from a FilterSpecs message. Also converts values to other types if specified. + * @param message FilterSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FilterSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryInput. */ + interface IQueryInput { + + /** QueryInput text */ + text?: (google.cloud.dialogflow.cx.v3.ITextInput|null); + + /** QueryInput intent */ + intent?: (google.cloud.dialogflow.cx.v3.IIntentInput|null); + + /** QueryInput audio */ + audio?: (google.cloud.dialogflow.cx.v3.IAudioInput|null); + + /** QueryInput event */ + event?: (google.cloud.dialogflow.cx.v3.IEventInput|null); + + /** QueryInput dtmf */ + dtmf?: (google.cloud.dialogflow.cx.v3.IDtmfInput|null); + + /** QueryInput toolCallResult */ + toolCallResult?: (google.cloud.dialogflow.cx.v3.IToolCallResult|null); + + /** QueryInput languageCode */ + languageCode?: (string|null); + } + + /** Represents a QueryInput. */ + class QueryInput implements IQueryInput { + + /** + * Constructs a new QueryInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IQueryInput); + + /** QueryInput text. */ + public text?: (google.cloud.dialogflow.cx.v3.ITextInput|null); + + /** QueryInput intent. */ + public intent?: (google.cloud.dialogflow.cx.v3.IIntentInput|null); + + /** QueryInput audio. */ + public audio?: (google.cloud.dialogflow.cx.v3.IAudioInput|null); + + /** QueryInput event. */ + public event?: (google.cloud.dialogflow.cx.v3.IEventInput|null); + + /** QueryInput dtmf. */ + public dtmf?: (google.cloud.dialogflow.cx.v3.IDtmfInput|null); + + /** QueryInput toolCallResult. */ + public toolCallResult?: (google.cloud.dialogflow.cx.v3.IToolCallResult|null); + + /** QueryInput languageCode. */ + public languageCode: string; + + /** QueryInput input. */ + public input?: ("text"|"intent"|"audio"|"event"|"dtmf"|"toolCallResult"); + + /** + * Creates a new QueryInput instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IQueryInput): google.cloud.dialogflow.cx.v3.QueryInput; + + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInput + * @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.dialogflow.cx.v3.QueryInput; + + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInput + * @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.dialogflow.cx.v3.QueryInput; + + /** + * Verifies a QueryInput 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 QueryInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.QueryInput; + + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @param message QueryInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.QueryInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryResult. */ + interface IQueryResult { + + /** QueryResult text */ + text?: (string|null); + + /** QueryResult triggerIntent */ + triggerIntent?: (string|null); + + /** QueryResult transcript */ + transcript?: (string|null); + + /** QueryResult triggerEvent */ + triggerEvent?: (string|null); + + /** QueryResult dtmf */ + dtmf?: (google.cloud.dialogflow.cx.v3.IDtmfInput|null); + + /** QueryResult languageCode */ + languageCode?: (string|null); + + /** QueryResult parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** QueryResult responseMessages */ + responseMessages?: (google.cloud.dialogflow.cx.v3.IResponseMessage[]|null); + + /** QueryResult webhookStatuses */ + webhookStatuses?: (google.rpc.IStatus[]|null); + + /** QueryResult webhookPayloads */ + webhookPayloads?: (google.protobuf.IStruct[]|null); + + /** QueryResult currentPage */ + currentPage?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** QueryResult currentFlow */ + currentFlow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + + /** QueryResult intent */ + intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** QueryResult intentDetectionConfidence */ + intentDetectionConfidence?: (number|null); + + /** QueryResult match */ + match?: (google.cloud.dialogflow.cx.v3.IMatch|null); + + /** QueryResult diagnosticInfo */ + diagnosticInfo?: (google.protobuf.IStruct|null); + + /** QueryResult sentimentAnalysisResult */ + sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult|null); + + /** QueryResult advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** QueryResult allowAnswerFeedback */ + allowAnswerFeedback?: (boolean|null); + + /** QueryResult dataStoreConnectionSignals */ + dataStoreConnectionSignals?: (google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals|null); + + /** QueryResult traceBlocks */ + traceBlocks?: (google.cloud.dialogflow.cx.v3.ITraceBlock[]|null); + } + + /** Represents a QueryResult. */ + class QueryResult implements IQueryResult { + + /** + * Constructs a new QueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IQueryResult); + + /** QueryResult text. */ + public text?: (string|null); + + /** QueryResult triggerIntent. */ + public triggerIntent?: (string|null); + + /** QueryResult transcript. */ + public transcript?: (string|null); + + /** QueryResult triggerEvent. */ + public triggerEvent?: (string|null); + + /** QueryResult dtmf. */ + public dtmf?: (google.cloud.dialogflow.cx.v3.IDtmfInput|null); + + /** QueryResult languageCode. */ + public languageCode: string; + + /** QueryResult parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** QueryResult responseMessages. */ + public responseMessages: google.cloud.dialogflow.cx.v3.IResponseMessage[]; + + /** QueryResult webhookStatuses. */ + public webhookStatuses: google.rpc.IStatus[]; + + /** QueryResult webhookPayloads. */ + public webhookPayloads: google.protobuf.IStruct[]; + + /** QueryResult currentPage. */ + public currentPage?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** QueryResult currentFlow. */ + public currentFlow?: (google.cloud.dialogflow.cx.v3.IFlow|null); + + /** QueryResult intent. */ + public intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** QueryResult intentDetectionConfidence. */ + public intentDetectionConfidence: number; + + /** QueryResult match. */ + public match?: (google.cloud.dialogflow.cx.v3.IMatch|null); + + /** QueryResult diagnosticInfo. */ + public diagnosticInfo?: (google.protobuf.IStruct|null); + + /** QueryResult sentimentAnalysisResult. */ + public sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult|null); + + /** QueryResult advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3.IAdvancedSettings|null); + + /** QueryResult allowAnswerFeedback. */ + public allowAnswerFeedback: boolean; + + /** QueryResult dataStoreConnectionSignals. */ + public dataStoreConnectionSignals?: (google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals|null); + + /** QueryResult traceBlocks. */ + public traceBlocks: google.cloud.dialogflow.cx.v3.ITraceBlock[]; + + /** QueryResult query. */ + public query?: ("text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmf"); + + /** + * Creates a new QueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IQueryResult): google.cloud.dialogflow.cx.v3.QueryResult; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResult + * @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.dialogflow.cx.v3.QueryResult; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResult + * @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.dialogflow.cx.v3.QueryResult; + + /** + * Verifies a QueryResult 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 QueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.QueryResult; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @param message QueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextInput. */ + interface ITextInput { + + /** TextInput text */ + text?: (string|null); + } + + /** Represents a TextInput. */ + class TextInput implements ITextInput { + + /** + * Constructs a new TextInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITextInput); + + /** TextInput text. */ + public text: string; + + /** + * Creates a new TextInput instance using the specified properties. + * @param [properties] Properties to set + * @returns TextInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITextInput): google.cloud.dialogflow.cx.v3.TextInput; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextInput + * @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.dialogflow.cx.v3.TextInput; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextInput + * @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.dialogflow.cx.v3.TextInput; + + /** + * Verifies a TextInput 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 TextInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TextInput; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @param message TextInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TextInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntentInput. */ + interface IIntentInput { + + /** IntentInput intent */ + intent?: (string|null); + } + + /** Represents an IntentInput. */ + class IntentInput implements IIntentInput { + + /** + * Constructs a new IntentInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IIntentInput); + + /** IntentInput intent. */ + public intent: string; + + /** + * Creates a new IntentInput instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IIntentInput): google.cloud.dialogflow.cx.v3.IntentInput; + + /** + * Encodes the specified IntentInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentInput.verify|verify} messages. + * @param message IntentInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IIntentInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentInput.verify|verify} messages. + * @param message IntentInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IIntentInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentInput + * @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.dialogflow.cx.v3.IntentInput; + + /** + * Decodes an IntentInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentInput + * @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.dialogflow.cx.v3.IntentInput; + + /** + * Verifies an IntentInput 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 IntentInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.IntentInput; + + /** + * Creates a plain object from an IntentInput message. Also converts values to other types if specified. + * @param message IntentInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.IntentInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioInput. */ + interface IAudioInput { + + /** AudioInput config */ + config?: (google.cloud.dialogflow.cx.v3.IInputAudioConfig|null); + + /** AudioInput audio */ + audio?: (Uint8Array|Buffer|string|null); + } + + /** Represents an AudioInput. */ + class AudioInput implements IAudioInput { + + /** + * Constructs a new AudioInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IAudioInput); + + /** AudioInput config. */ + public config?: (google.cloud.dialogflow.cx.v3.IInputAudioConfig|null); + + /** AudioInput audio. */ + public audio: (Uint8Array|Buffer|string); + + /** + * Creates a new AudioInput instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IAudioInput): google.cloud.dialogflow.cx.v3.AudioInput; + + /** + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioInput + * @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.dialogflow.cx.v3.AudioInput; + + /** + * Decodes an AudioInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioInput + * @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.dialogflow.cx.v3.AudioInput; + + /** + * Verifies an AudioInput 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 AudioInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AudioInput; + + /** + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. + * @param message AudioInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AudioInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EventInput. */ + interface IEventInput { + + /** EventInput event */ + event?: (string|null); + } + + /** Represents an EventInput. */ + class EventInput implements IEventInput { + + /** + * Constructs a new EventInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IEventInput); + + /** EventInput event. */ + public event: string; + + /** + * Creates a new EventInput instance using the specified properties. + * @param [properties] Properties to set + * @returns EventInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IEventInput): google.cloud.dialogflow.cx.v3.EventInput; + + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventInput + * @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.dialogflow.cx.v3.EventInput; + + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventInput + * @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.dialogflow.cx.v3.EventInput; + + /** + * Verifies an EventInput 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 EventInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.EventInput; + + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @param message EventInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.EventInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DtmfInput. */ + interface IDtmfInput { + + /** DtmfInput digits */ + digits?: (string|null); + + /** DtmfInput finishDigit */ + finishDigit?: (string|null); + } + + /** Represents a DtmfInput. */ + class DtmfInput implements IDtmfInput { + + /** + * Constructs a new DtmfInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDtmfInput); + + /** DtmfInput digits. */ + public digits: string; + + /** DtmfInput finishDigit. */ + public finishDigit: string; + + /** + * Creates a new DtmfInput instance using the specified properties. + * @param [properties] Properties to set + * @returns DtmfInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDtmfInput): google.cloud.dialogflow.cx.v3.DtmfInput; + + /** + * Encodes the specified DtmfInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DtmfInput.verify|verify} messages. + * @param message DtmfInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDtmfInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DtmfInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DtmfInput.verify|verify} messages. + * @param message DtmfInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDtmfInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DtmfInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DtmfInput + * @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.dialogflow.cx.v3.DtmfInput; + + /** + * Decodes a DtmfInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DtmfInput + * @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.dialogflow.cx.v3.DtmfInput; + + /** + * Verifies a DtmfInput 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 DtmfInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DtmfInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DtmfInput; + + /** + * Creates a plain object from a DtmfInput message. Also converts values to other types if specified. + * @param message DtmfInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DtmfInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DtmfInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DtmfInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Match. */ + interface IMatch { + + /** Match intent */ + intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** Match event */ + event?: (string|null); + + /** Match parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** Match resolvedInput */ + resolvedInput?: (string|null); + + /** Match matchType */ + matchType?: (google.cloud.dialogflow.cx.v3.Match.MatchType|keyof typeof google.cloud.dialogflow.cx.v3.Match.MatchType|null); + + /** Match confidence */ + confidence?: (number|null); + } + + /** Represents a Match. */ + class Match implements IMatch { + + /** + * Constructs a new Match. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IMatch); + + /** Match intent. */ + public intent?: (google.cloud.dialogflow.cx.v3.IIntent|null); + + /** Match event. */ + public event: string; + + /** Match parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** Match resolvedInput. */ + public resolvedInput: string; + + /** Match matchType. */ + public matchType: (google.cloud.dialogflow.cx.v3.Match.MatchType|keyof typeof google.cloud.dialogflow.cx.v3.Match.MatchType); + + /** Match confidence. */ + public confidence: number; + + /** + * Creates a new Match instance using the specified properties. + * @param [properties] Properties to set + * @returns Match instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IMatch): google.cloud.dialogflow.cx.v3.Match; + + /** + * Encodes the specified Match message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Match.verify|verify} messages. + * @param message Match message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Match message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Match.verify|verify} messages. + * @param message Match message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Match message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Match + * @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.dialogflow.cx.v3.Match; + + /** + * Decodes a Match message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Match + * @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.dialogflow.cx.v3.Match; + + /** + * Verifies a Match 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 Match message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Match + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Match; + + /** + * Creates a plain object from a Match message. Also converts values to other types if specified. + * @param message Match + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Match, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Match to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Match + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Match { + + /** MatchType enum. */ + enum MatchType { + MATCH_TYPE_UNSPECIFIED = 0, + INTENT = 1, + DIRECT_INTENT = 2, + PARAMETER_FILLING = 3, + NO_MATCH = 4, + NO_INPUT = 5, + EVENT = 6, + KNOWLEDGE_CONNECTOR = 8, + PLAYBOOK = 9 + } + } + + /** Properties of a MatchIntentRequest. */ + interface IMatchIntentRequest { + + /** MatchIntentRequest session */ + session?: (string|null); + + /** MatchIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.cx.v3.IQueryParameters|null); + + /** MatchIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** MatchIntentRequest persistParameterChanges */ + persistParameterChanges?: (boolean|null); + } + + /** Represents a MatchIntentRequest. */ + class MatchIntentRequest implements IMatchIntentRequest { + + /** + * Constructs a new MatchIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IMatchIntentRequest); + + /** MatchIntentRequest session. */ + public session: string; + + /** MatchIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.cx.v3.IQueryParameters|null); + + /** MatchIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.cx.v3.IQueryInput|null); + + /** MatchIntentRequest persistParameterChanges. */ + public persistParameterChanges: boolean; + + /** + * Creates a new MatchIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IMatchIntentRequest): google.cloud.dialogflow.cx.v3.MatchIntentRequest; + + /** + * Encodes the specified MatchIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentRequest.verify|verify} messages. + * @param message MatchIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IMatchIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentRequest.verify|verify} messages. + * @param message MatchIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IMatchIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchIntentRequest + * @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.dialogflow.cx.v3.MatchIntentRequest; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchIntentRequest + * @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.dialogflow.cx.v3.MatchIntentRequest; + + /** + * Verifies a MatchIntentRequest 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 MatchIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.MatchIntentRequest; + + /** + * Creates a plain object from a MatchIntentRequest message. Also converts values to other types if specified. + * @param message MatchIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.MatchIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MatchIntentResponse. */ + interface IMatchIntentResponse { + + /** MatchIntentResponse text */ + text?: (string|null); + + /** MatchIntentResponse triggerIntent */ + triggerIntent?: (string|null); + + /** MatchIntentResponse transcript */ + transcript?: (string|null); + + /** MatchIntentResponse triggerEvent */ + triggerEvent?: (string|null); + + /** MatchIntentResponse matches */ + matches?: (google.cloud.dialogflow.cx.v3.IMatch[]|null); + + /** MatchIntentResponse currentPage */ + currentPage?: (google.cloud.dialogflow.cx.v3.IPage|null); + } + + /** Represents a MatchIntentResponse. */ + class MatchIntentResponse implements IMatchIntentResponse { + + /** + * Constructs a new MatchIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IMatchIntentResponse); + + /** MatchIntentResponse text. */ + public text?: (string|null); + + /** MatchIntentResponse triggerIntent. */ + public triggerIntent?: (string|null); + + /** MatchIntentResponse transcript. */ + public transcript?: (string|null); + + /** MatchIntentResponse triggerEvent. */ + public triggerEvent?: (string|null); + + /** MatchIntentResponse matches. */ + public matches: google.cloud.dialogflow.cx.v3.IMatch[]; + + /** MatchIntentResponse currentPage. */ + public currentPage?: (google.cloud.dialogflow.cx.v3.IPage|null); + + /** MatchIntentResponse query. */ + public query?: ("text"|"triggerIntent"|"transcript"|"triggerEvent"); + + /** + * Creates a new MatchIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IMatchIntentResponse): google.cloud.dialogflow.cx.v3.MatchIntentResponse; + + /** + * Encodes the specified MatchIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentResponse.verify|verify} messages. + * @param message MatchIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IMatchIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentResponse.verify|verify} messages. + * @param message MatchIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IMatchIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchIntentResponse + * @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.dialogflow.cx.v3.MatchIntentResponse; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchIntentResponse + * @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.dialogflow.cx.v3.MatchIntentResponse; + + /** + * Verifies a MatchIntentResponse 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 MatchIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.MatchIntentResponse; + + /** + * Creates a plain object from a MatchIntentResponse message. Also converts values to other types if specified. + * @param message MatchIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.MatchIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FulfillIntentRequest. */ + interface IFulfillIntentRequest { + + /** FulfillIntentRequest matchIntentRequest */ + matchIntentRequest?: (google.cloud.dialogflow.cx.v3.IMatchIntentRequest|null); + + /** FulfillIntentRequest match */ + match?: (google.cloud.dialogflow.cx.v3.IMatch|null); + + /** FulfillIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + } + + /** Represents a FulfillIntentRequest. */ + class FulfillIntentRequest implements IFulfillIntentRequest { + + /** + * Constructs a new FulfillIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFulfillIntentRequest); + + /** FulfillIntentRequest matchIntentRequest. */ + public matchIntentRequest?: (google.cloud.dialogflow.cx.v3.IMatchIntentRequest|null); + + /** FulfillIntentRequest match. */ + public match?: (google.cloud.dialogflow.cx.v3.IMatch|null); + + /** FulfillIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** + * Creates a new FulfillIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFulfillIntentRequest): google.cloud.dialogflow.cx.v3.FulfillIntentRequest; + + /** + * Encodes the specified FulfillIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentRequest.verify|verify} messages. + * @param message FulfillIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFulfillIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentRequest.verify|verify} messages. + * @param message FulfillIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFulfillIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillIntentRequest + * @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.dialogflow.cx.v3.FulfillIntentRequest; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillIntentRequest + * @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.dialogflow.cx.v3.FulfillIntentRequest; + + /** + * Verifies a FulfillIntentRequest 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 FulfillIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FulfillIntentRequest; + + /** + * Creates a plain object from a FulfillIntentRequest message. Also converts values to other types if specified. + * @param message FulfillIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FulfillIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FulfillIntentResponse. */ + interface IFulfillIntentResponse { + + /** FulfillIntentResponse responseId */ + responseId?: (string|null); + + /** FulfillIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.cx.v3.IQueryResult|null); + + /** FulfillIntentResponse outputAudio */ + outputAudio?: (Uint8Array|Buffer|string|null); + + /** FulfillIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + } + + /** Represents a FulfillIntentResponse. */ + class FulfillIntentResponse implements IFulfillIntentResponse { + + /** + * Constructs a new FulfillIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFulfillIntentResponse); + + /** FulfillIntentResponse responseId. */ + public responseId: string; + + /** FulfillIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.cx.v3.IQueryResult|null); + + /** FulfillIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|Buffer|string); + + /** FulfillIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** + * Creates a new FulfillIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFulfillIntentResponse): google.cloud.dialogflow.cx.v3.FulfillIntentResponse; + + /** + * Encodes the specified FulfillIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentResponse.verify|verify} messages. + * @param message FulfillIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentResponse.verify|verify} messages. + * @param message FulfillIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillIntentResponse + * @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.dialogflow.cx.v3.FulfillIntentResponse; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillIntentResponse + * @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.dialogflow.cx.v3.FulfillIntentResponse; + + /** + * Verifies a FulfillIntentResponse 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 FulfillIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FulfillIntentResponse; + + /** + * Creates a plain object from a FulfillIntentResponse message. Also converts values to other types if specified. + * @param message FulfillIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FulfillIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SentimentAnalysisResult. */ + interface ISentimentAnalysisResult { + + /** SentimentAnalysisResult score */ + score?: (number|null); + + /** SentimentAnalysisResult magnitude */ + magnitude?: (number|null); + } + + /** Represents a SentimentAnalysisResult. */ + class SentimentAnalysisResult implements ISentimentAnalysisResult { + + /** + * Constructs a new SentimentAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult); + + /** SentimentAnalysisResult score. */ + public score: number; + + /** SentimentAnalysisResult magnitude. */ + public magnitude: number; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult): google.cloud.dialogflow.cx.v3.SentimentAnalysisResult; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3.SentimentAnalysisResult; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3.SentimentAnalysisResult; + + /** + * Verifies a SentimentAnalysisResult 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 SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SentimentAnalysisResult; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @param message SentimentAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DetectIntentResponseView enum. */ + enum DetectIntentResponseView { + DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED = 0, + DETECT_INTENT_RESPONSE_VIEW_FULL = 1, + DETECT_INTENT_RESPONSE_VIEW_BASIC = 2, + DETECT_INTENT_RESPONSE_VIEW_DEFAULT = 3 + } + + /** Represents a SessionEntityTypes */ + class SessionEntityTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new SessionEntityTypes service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SessionEntityTypes service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SessionEntityTypes; + + /** + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + */ + public listSessionEntityTypes(request: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypesCallback): void; + + /** + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object + * @returns Promise + */ + public listSessionEntityTypes(request: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest): Promise; + + /** + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public getSessionEntityType(request: google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityTypeCallback): void; + + /** + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public getSessionEntityType(request: google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest): Promise; + + /** + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public createSessionEntityType(request: google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityTypeCallback): void; + + /** + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public createSessionEntityType(request: google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest): Promise; + + /** + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public updateSessionEntityType(request: google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityTypeCallback): void; + + /** + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public updateSessionEntityType(request: google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest): Promise; + + /** + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSessionEntityType(request: google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityTypeCallback): void; + + /** + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public deleteSessionEntityType(request: google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest): Promise; + } + + namespace SessionEntityTypes { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|listSessionEntityTypes}. + * @param error Error, if any + * @param [response] ListSessionEntityTypesResponse + */ + type ListSessionEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|getSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type GetSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.SessionEntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|createSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type CreateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.SessionEntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|updateSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type UpdateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.SessionEntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|deleteSessionEntityType}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSessionEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a SessionEntityType. */ + interface ISessionEntityType { + + /** SessionEntityType name */ + name?: (string|null); + + /** SessionEntityType entityOverrideMode */ + entityOverrideMode?: (google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode|null); + + /** SessionEntityType entities */ + entities?: (google.cloud.dialogflow.cx.v3.EntityType.IEntity[]|null); + } + + /** Represents a SessionEntityType. */ + class SessionEntityType implements ISessionEntityType { + + /** + * Constructs a new SessionEntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISessionEntityType); + + /** SessionEntityType name. */ + public name: string; + + /** SessionEntityType entityOverrideMode. */ + public entityOverrideMode: (google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode); + + /** SessionEntityType entities. */ + public entities: google.cloud.dialogflow.cx.v3.EntityType.IEntity[]; + + /** + * Creates a new SessionEntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionEntityType instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISessionEntityType): google.cloud.dialogflow.cx.v3.SessionEntityType; + + /** + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionEntityType + * @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.dialogflow.cx.v3.SessionEntityType; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionEntityType + * @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.dialogflow.cx.v3.SessionEntityType; + + /** + * Verifies a SessionEntityType 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 SessionEntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionEntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SessionEntityType; + + /** + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * @param message SessionEntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SessionEntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionEntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionEntityType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionEntityType { + + /** EntityOverrideMode enum. */ + enum EntityOverrideMode { + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0, + ENTITY_OVERRIDE_MODE_OVERRIDE = 1, + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 + } + } + + /** Properties of a ListSessionEntityTypesRequest. */ + interface IListSessionEntityTypesRequest { + + /** ListSessionEntityTypesRequest parent */ + parent?: (string|null); + + /** ListSessionEntityTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionEntityTypesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSessionEntityTypesRequest. */ + class ListSessionEntityTypesRequest implements IListSessionEntityTypesRequest { + + /** + * Constructs a new ListSessionEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest); + + /** ListSessionEntityTypesRequest parent. */ + public parent: string; + + /** ListSessionEntityTypesRequest pageSize. */ + public pageSize: number; + + /** ListSessionEntityTypesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest): google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest; + + /** + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionEntityTypesRequest + * @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.dialogflow.cx.v3.ListSessionEntityTypesRequest; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionEntityTypesRequest + * @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.dialogflow.cx.v3.ListSessionEntityTypesRequest; + + /** + * Verifies a ListSessionEntityTypesRequest 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 ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest; + + /** + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionEntityTypesResponse. */ + interface IListSessionEntityTypesResponse { + + /** ListSessionEntityTypesResponse sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.cx.v3.ISessionEntityType[]|null); + + /** ListSessionEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSessionEntityTypesResponse. */ + class ListSessionEntityTypesResponse implements IListSessionEntityTypesResponse { + + /** + * Constructs a new ListSessionEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse); + + /** ListSessionEntityTypesResponse sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.cx.v3.ISessionEntityType[]; + + /** ListSessionEntityTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse): google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse; + + /** + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionEntityTypesResponse + * @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.dialogflow.cx.v3.ListSessionEntityTypesResponse; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionEntityTypesResponse + * @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.dialogflow.cx.v3.ListSessionEntityTypesResponse; + + /** + * Verifies a ListSessionEntityTypesResponse 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 ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse; + + /** + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSessionEntityTypeRequest. */ + interface IGetSessionEntityTypeRequest { + + /** GetSessionEntityTypeRequest name */ + name?: (string|null); + } + + /** Represents a GetSessionEntityTypeRequest. */ + class GetSessionEntityTypeRequest implements IGetSessionEntityTypeRequest { + + /** + * Constructs a new GetSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest); + + /** GetSessionEntityTypeRequest name. */ + public name: string; + + /** + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest; + + /** + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSessionEntityTypeRequest + * @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.dialogflow.cx.v3.GetSessionEntityTypeRequest; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSessionEntityTypeRequest + * @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.dialogflow.cx.v3.GetSessionEntityTypeRequest; + + /** + * Verifies a GetSessionEntityTypeRequest 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 GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest; + + /** + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSessionEntityTypeRequest. */ + interface ICreateSessionEntityTypeRequest { + + /** CreateSessionEntityTypeRequest parent */ + parent?: (string|null); + + /** CreateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.cx.v3.ISessionEntityType|null); + } + + /** Represents a CreateSessionEntityTypeRequest. */ + class CreateSessionEntityTypeRequest implements ICreateSessionEntityTypeRequest { + + /** + * Constructs a new CreateSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest); + + /** CreateSessionEntityTypeRequest parent. */ + public parent: string; + + /** CreateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.cx.v3.ISessionEntityType|null); + + /** + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSessionEntityTypeRequest + * @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.dialogflow.cx.v3.CreateSessionEntityTypeRequest; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSessionEntityTypeRequest + * @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.dialogflow.cx.v3.CreateSessionEntityTypeRequest; + + /** + * Verifies a CreateSessionEntityTypeRequest 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 CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest; + + /** + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSessionEntityTypeRequest. */ + interface IUpdateSessionEntityTypeRequest { + + /** UpdateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.cx.v3.ISessionEntityType|null); + + /** UpdateSessionEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSessionEntityTypeRequest. */ + class UpdateSessionEntityTypeRequest implements IUpdateSessionEntityTypeRequest { + + /** + * Constructs a new UpdateSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest); + + /** UpdateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.cx.v3.ISessionEntityType|null); + + /** UpdateSessionEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest; + + /** + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSessionEntityTypeRequest + * @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.dialogflow.cx.v3.UpdateSessionEntityTypeRequest; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSessionEntityTypeRequest + * @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.dialogflow.cx.v3.UpdateSessionEntityTypeRequest; + + /** + * Verifies an UpdateSessionEntityTypeRequest 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 UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest; + + /** + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSessionEntityTypeRequest. */ + interface IDeleteSessionEntityTypeRequest { + + /** DeleteSessionEntityTypeRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSessionEntityTypeRequest. */ + class DeleteSessionEntityTypeRequest implements IDeleteSessionEntityTypeRequest { + + /** + * Constructs a new DeleteSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest); + + /** DeleteSessionEntityTypeRequest name. */ + public name: string; + + /** + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest; + + /** + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSessionEntityTypeRequest + * @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.dialogflow.cx.v3.DeleteSessionEntityTypeRequest; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSessionEntityTypeRequest + * @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.dialogflow.cx.v3.DeleteSessionEntityTypeRequest; + + /** + * Verifies a DeleteSessionEntityTypeRequest 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 DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest; + + /** + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TraceBlock. */ + interface ITraceBlock { + + /** TraceBlock playbookTraceMetadata */ + playbookTraceMetadata?: (google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata|null); + + /** TraceBlock flowTraceMetadata */ + flowTraceMetadata?: (google.cloud.dialogflow.cx.v3.IFlowTraceMetadata|null); + + /** TraceBlock speechProcessingMetadata */ + speechProcessingMetadata?: (google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata|null); + + /** TraceBlock actions */ + actions?: (google.cloud.dialogflow.cx.v3.IAction[]|null); + + /** TraceBlock startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock inputParameters */ + inputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock outputParameters */ + outputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock endState */ + endState?: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState|null); + } + + /** Represents a TraceBlock. */ + class TraceBlock implements ITraceBlock { + + /** + * Constructs a new TraceBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITraceBlock); + + /** TraceBlock playbookTraceMetadata. */ + public playbookTraceMetadata?: (google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata|null); + + /** TraceBlock flowTraceMetadata. */ + public flowTraceMetadata?: (google.cloud.dialogflow.cx.v3.IFlowTraceMetadata|null); + + /** TraceBlock speechProcessingMetadata. */ + public speechProcessingMetadata?: (google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata|null); + + /** TraceBlock actions. */ + public actions: google.cloud.dialogflow.cx.v3.IAction[]; + + /** TraceBlock startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock inputParameters. */ + public inputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock outputParameters. */ + public outputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock endState. */ + public endState: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState); + + /** TraceBlock traceMetadata. */ + public traceMetadata?: ("playbookTraceMetadata"|"flowTraceMetadata"|"speechProcessingMetadata"); + + /** + * Creates a new TraceBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns TraceBlock instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITraceBlock): google.cloud.dialogflow.cx.v3.TraceBlock; + + /** + * Encodes the specified TraceBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TraceBlock.verify|verify} messages. + * @param message TraceBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITraceBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TraceBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TraceBlock.verify|verify} messages. + * @param message TraceBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITraceBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TraceBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TraceBlock + * @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.dialogflow.cx.v3.TraceBlock; + + /** + * Decodes a TraceBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TraceBlock + * @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.dialogflow.cx.v3.TraceBlock; + + /** + * Verifies a TraceBlock 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 TraceBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TraceBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TraceBlock; + + /** + * Creates a plain object from a TraceBlock message. Also converts values to other types if specified. + * @param message TraceBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TraceBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TraceBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TraceBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechProcessingMetadata. */ + interface ISpeechProcessingMetadata { + + /** SpeechProcessingMetadata displayName */ + displayName?: (string|null); + } + + /** Represents a SpeechProcessingMetadata. */ + class SpeechProcessingMetadata implements ISpeechProcessingMetadata { + + /** + * Constructs a new SpeechProcessingMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata); + + /** SpeechProcessingMetadata displayName. */ + public displayName: string; + + /** + * Creates a new SpeechProcessingMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechProcessingMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata): google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata; + + /** + * Encodes the specified SpeechProcessingMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.verify|verify} messages. + * @param message SpeechProcessingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechProcessingMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.verify|verify} messages. + * @param message SpeechProcessingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechProcessingMetadata + * @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.dialogflow.cx.v3.SpeechProcessingMetadata; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechProcessingMetadata + * @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.dialogflow.cx.v3.SpeechProcessingMetadata; + + /** + * Verifies a SpeechProcessingMetadata 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 SpeechProcessingMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechProcessingMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata; + + /** + * Creates a plain object from a SpeechProcessingMetadata message. Also converts values to other types if specified. + * @param message SpeechProcessingMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechProcessingMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechProcessingMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookTraceMetadata. */ + interface IPlaybookTraceMetadata { + + /** PlaybookTraceMetadata playbook */ + playbook?: (string|null); + + /** PlaybookTraceMetadata displayName */ + displayName?: (string|null); + } + + /** Represents a PlaybookTraceMetadata. */ + class PlaybookTraceMetadata implements IPlaybookTraceMetadata { + + /** + * Constructs a new PlaybookTraceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata); + + /** PlaybookTraceMetadata playbook. */ + public playbook: string; + + /** PlaybookTraceMetadata displayName. */ + public displayName: string; + + /** + * Creates a new PlaybookTraceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookTraceMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata): google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata; + + /** + * Encodes the specified PlaybookTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.verify|verify} messages. + * @param message PlaybookTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.verify|verify} messages. + * @param message PlaybookTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookTraceMetadata + * @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.dialogflow.cx.v3.PlaybookTraceMetadata; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookTraceMetadata + * @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.dialogflow.cx.v3.PlaybookTraceMetadata; + + /** + * Verifies a PlaybookTraceMetadata 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 PlaybookTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookTraceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata; + + /** + * Creates a plain object from a PlaybookTraceMetadata message. Also converts values to other types if specified. + * @param message PlaybookTraceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookTraceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookTraceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowTraceMetadata. */ + interface IFlowTraceMetadata { + + /** FlowTraceMetadata flow */ + flow?: (string|null); + + /** FlowTraceMetadata displayName */ + displayName?: (string|null); + } + + /** Represents a FlowTraceMetadata. */ + class FlowTraceMetadata implements IFlowTraceMetadata { + + /** + * Constructs a new FlowTraceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFlowTraceMetadata); + + /** FlowTraceMetadata flow. */ + public flow: string; + + /** FlowTraceMetadata displayName. */ + public displayName: string; + + /** + * Creates a new FlowTraceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowTraceMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFlowTraceMetadata): google.cloud.dialogflow.cx.v3.FlowTraceMetadata; + + /** + * Encodes the specified FlowTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTraceMetadata.verify|verify} messages. + * @param message FlowTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFlowTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTraceMetadata.verify|verify} messages. + * @param message FlowTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFlowTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowTraceMetadata + * @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.dialogflow.cx.v3.FlowTraceMetadata; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowTraceMetadata + * @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.dialogflow.cx.v3.FlowTraceMetadata; + + /** + * Verifies a FlowTraceMetadata 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 FlowTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowTraceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FlowTraceMetadata; + + /** + * Creates a plain object from a FlowTraceMetadata message. Also converts values to other types if specified. + * @param message FlowTraceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FlowTraceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowTraceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowTraceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookInput. */ + interface IPlaybookInput { + + /** PlaybookInput precedingConversationSummary */ + precedingConversationSummary?: (string|null); + } + + /** Represents a PlaybookInput. */ + class PlaybookInput implements IPlaybookInput { + + /** + * Constructs a new PlaybookInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybookInput); + + /** PlaybookInput precedingConversationSummary. */ + public precedingConversationSummary: string; + + /** + * Creates a new PlaybookInput instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybookInput): google.cloud.dialogflow.cx.v3.PlaybookInput; + + /** + * Encodes the specified PlaybookInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInput.verify|verify} messages. + * @param message PlaybookInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybookInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInput.verify|verify} messages. + * @param message PlaybookInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybookInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookInput + * @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.dialogflow.cx.v3.PlaybookInput; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookInput + * @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.dialogflow.cx.v3.PlaybookInput; + + /** + * Verifies a PlaybookInput 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 PlaybookInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PlaybookInput; + + /** + * Creates a plain object from a PlaybookInput message. Also converts values to other types if specified. + * @param message PlaybookInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PlaybookInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookOutput. */ + interface IPlaybookOutput { + + /** PlaybookOutput executionSummary */ + executionSummary?: (string|null); + } + + /** Represents a PlaybookOutput. */ + class PlaybookOutput implements IPlaybookOutput { + + /** + * Constructs a new PlaybookOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybookOutput); + + /** PlaybookOutput executionSummary. */ + public executionSummary: string; + + /** + * Creates a new PlaybookOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookOutput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybookOutput): google.cloud.dialogflow.cx.v3.PlaybookOutput; + + /** + * Encodes the specified PlaybookOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookOutput.verify|verify} messages. + * @param message PlaybookOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybookOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookOutput.verify|verify} messages. + * @param message PlaybookOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybookOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookOutput + * @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.dialogflow.cx.v3.PlaybookOutput; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookOutput + * @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.dialogflow.cx.v3.PlaybookOutput; + + /** + * Verifies a PlaybookOutput 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 PlaybookOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PlaybookOutput; + + /** + * Creates a plain object from a PlaybookOutput message. Also converts values to other types if specified. + * @param message PlaybookOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PlaybookOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Action. */ + interface IAction { + + /** Action userUtterance */ + userUtterance?: (google.cloud.dialogflow.cx.v3.IUserUtterance|null); + + /** Action agentUtterance */ + agentUtterance?: (google.cloud.dialogflow.cx.v3.IAgentUtterance|null); + + /** Action toolUse */ + toolUse?: (google.cloud.dialogflow.cx.v3.IToolUse|null); + + /** Action playbookInvocation */ + playbookInvocation?: (google.cloud.dialogflow.cx.v3.IPlaybookInvocation|null); + + /** Action flowInvocation */ + flowInvocation?: (google.cloud.dialogflow.cx.v3.IFlowInvocation|null); + + /** Action playbookTransition */ + playbookTransition?: (google.cloud.dialogflow.cx.v3.IPlaybookTransition|null); + + /** Action flowTransition */ + flowTransition?: (google.cloud.dialogflow.cx.v3.IFlowTransition|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IAction); + + /** Action userUtterance. */ + public userUtterance?: (google.cloud.dialogflow.cx.v3.IUserUtterance|null); + + /** Action agentUtterance. */ + public agentUtterance?: (google.cloud.dialogflow.cx.v3.IAgentUtterance|null); + + /** Action toolUse. */ + public toolUse?: (google.cloud.dialogflow.cx.v3.IToolUse|null); + + /** Action playbookInvocation. */ + public playbookInvocation?: (google.cloud.dialogflow.cx.v3.IPlaybookInvocation|null); + + /** Action flowInvocation. */ + public flowInvocation?: (google.cloud.dialogflow.cx.v3.IFlowInvocation|null); + + /** Action playbookTransition. */ + public playbookTransition?: (google.cloud.dialogflow.cx.v3.IPlaybookTransition|null); + + /** Action flowTransition. */ + public flowTransition?: (google.cloud.dialogflow.cx.v3.IFlowTransition|null); + + /** Action action. */ + public action?: ("userUtterance"|"agentUtterance"|"toolUse"|"playbookInvocation"|"flowInvocation"|"playbookTransition"|"flowTransition"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IAction): google.cloud.dialogflow.cx.v3.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @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.dialogflow.cx.v3.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @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.dialogflow.cx.v3.Action; + + /** + * Verifies an Action 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 Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserUtterance. */ + interface IUserUtterance { + + /** UserUtterance text */ + text?: (string|null); + } + + /** Represents a UserUtterance. */ + class UserUtterance implements IUserUtterance { + + /** + * Constructs a new UserUtterance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUserUtterance); + + /** UserUtterance text. */ + public text: string; + + /** + * Creates a new UserUtterance instance using the specified properties. + * @param [properties] Properties to set + * @returns UserUtterance instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUserUtterance): google.cloud.dialogflow.cx.v3.UserUtterance; + + /** + * Encodes the specified UserUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UserUtterance.verify|verify} messages. + * @param message UserUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUserUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UserUtterance.verify|verify} messages. + * @param message UserUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUserUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserUtterance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserUtterance + * @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.dialogflow.cx.v3.UserUtterance; + + /** + * Decodes a UserUtterance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserUtterance + * @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.dialogflow.cx.v3.UserUtterance; + + /** + * Verifies a UserUtterance 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 UserUtterance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserUtterance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UserUtterance; + + /** + * Creates a plain object from a UserUtterance message. Also converts values to other types if specified. + * @param message UserUtterance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UserUtterance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserUtterance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserUtterance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentUtterance. */ + interface IAgentUtterance { + + /** AgentUtterance text */ + text?: (string|null); + } + + /** Represents an AgentUtterance. */ + class AgentUtterance implements IAgentUtterance { + + /** + * Constructs a new AgentUtterance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IAgentUtterance); + + /** AgentUtterance text. */ + public text: string; + + /** + * Creates a new AgentUtterance instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentUtterance instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IAgentUtterance): google.cloud.dialogflow.cx.v3.AgentUtterance; + + /** + * Encodes the specified AgentUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentUtterance.verify|verify} messages. + * @param message AgentUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IAgentUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentUtterance.verify|verify} messages. + * @param message AgentUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IAgentUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentUtterance + * @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.dialogflow.cx.v3.AgentUtterance; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentUtterance + * @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.dialogflow.cx.v3.AgentUtterance; + + /** + * Verifies an AgentUtterance 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 AgentUtterance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentUtterance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.AgentUtterance; + + /** + * Creates a plain object from an AgentUtterance message. Also converts values to other types if specified. + * @param message AgentUtterance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.AgentUtterance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentUtterance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentUtterance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolUse. */ + interface IToolUse { + + /** ToolUse tool */ + tool?: (string|null); + + /** ToolUse displayName */ + displayName?: (string|null); + + /** ToolUse action */ + action?: (string|null); + + /** ToolUse inputActionParameters */ + inputActionParameters?: (google.protobuf.IStruct|null); + + /** ToolUse outputActionParameters */ + outputActionParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolUse. */ + class ToolUse implements IToolUse { + + /** + * Constructs a new ToolUse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IToolUse); + + /** ToolUse tool. */ + public tool: string; + + /** ToolUse displayName. */ + public displayName: string; + + /** ToolUse action. */ + public action: string; + + /** ToolUse inputActionParameters. */ + public inputActionParameters?: (google.protobuf.IStruct|null); + + /** ToolUse outputActionParameters. */ + public outputActionParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new ToolUse instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolUse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IToolUse): google.cloud.dialogflow.cx.v3.ToolUse; + + /** + * Encodes the specified ToolUse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolUse.verify|verify} messages. + * @param message ToolUse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IToolUse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolUse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolUse.verify|verify} messages. + * @param message ToolUse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IToolUse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolUse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolUse + * @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.dialogflow.cx.v3.ToolUse; + + /** + * Decodes a ToolUse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolUse + * @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.dialogflow.cx.v3.ToolUse; + + /** + * Verifies a ToolUse 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 ToolUse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolUse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ToolUse; + + /** + * Creates a plain object from a ToolUse message. Also converts values to other types if specified. + * @param message ToolUse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ToolUse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolUse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolUse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookInvocation. */ + interface IPlaybookInvocation { + + /** PlaybookInvocation playbook */ + playbook?: (string|null); + + /** PlaybookInvocation displayName */ + displayName?: (string|null); + + /** PlaybookInvocation playbookInput */ + playbookInput?: (google.cloud.dialogflow.cx.v3.IPlaybookInput|null); + + /** PlaybookInvocation playbookOutput */ + playbookOutput?: (google.cloud.dialogflow.cx.v3.IPlaybookOutput|null); + + /** PlaybookInvocation playbookState */ + playbookState?: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState|null); + } + + /** Represents a PlaybookInvocation. */ + class PlaybookInvocation implements IPlaybookInvocation { + + /** + * Constructs a new PlaybookInvocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybookInvocation); + + /** PlaybookInvocation playbook. */ + public playbook: string; + + /** PlaybookInvocation displayName. */ + public displayName: string; + + /** PlaybookInvocation playbookInput. */ + public playbookInput?: (google.cloud.dialogflow.cx.v3.IPlaybookInput|null); + + /** PlaybookInvocation playbookOutput. */ + public playbookOutput?: (google.cloud.dialogflow.cx.v3.IPlaybookOutput|null); + + /** PlaybookInvocation playbookState. */ + public playbookState: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState); + + /** + * Creates a new PlaybookInvocation instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookInvocation instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybookInvocation): google.cloud.dialogflow.cx.v3.PlaybookInvocation; + + /** + * Encodes the specified PlaybookInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInvocation.verify|verify} messages. + * @param message PlaybookInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybookInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInvocation.verify|verify} messages. + * @param message PlaybookInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybookInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookInvocation + * @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.dialogflow.cx.v3.PlaybookInvocation; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookInvocation + * @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.dialogflow.cx.v3.PlaybookInvocation; + + /** + * Verifies a PlaybookInvocation 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 PlaybookInvocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookInvocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PlaybookInvocation; + + /** + * Creates a plain object from a PlaybookInvocation message. Also converts values to other types if specified. + * @param message PlaybookInvocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PlaybookInvocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookInvocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookInvocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowInvocation. */ + interface IFlowInvocation { + + /** FlowInvocation flow */ + flow?: (string|null); + + /** FlowInvocation displayName */ + displayName?: (string|null); + + /** FlowInvocation flowState */ + flowState?: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState|null); + } + + /** Represents a FlowInvocation. */ + class FlowInvocation implements IFlowInvocation { + + /** + * Constructs a new FlowInvocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFlowInvocation); + + /** FlowInvocation flow. */ + public flow: string; + + /** FlowInvocation displayName. */ + public displayName: string; + + /** FlowInvocation flowState. */ + public flowState: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState); + + /** + * Creates a new FlowInvocation instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowInvocation instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFlowInvocation): google.cloud.dialogflow.cx.v3.FlowInvocation; + + /** + * Encodes the specified FlowInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowInvocation.verify|verify} messages. + * @param message FlowInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFlowInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowInvocation.verify|verify} messages. + * @param message FlowInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFlowInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowInvocation + * @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.dialogflow.cx.v3.FlowInvocation; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowInvocation + * @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.dialogflow.cx.v3.FlowInvocation; + + /** + * Verifies a FlowInvocation 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 FlowInvocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowInvocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FlowInvocation; + + /** + * Creates a plain object from a FlowInvocation message. Also converts values to other types if specified. + * @param message FlowInvocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FlowInvocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowInvocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowInvocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookTransition. */ + interface IPlaybookTransition { + + /** PlaybookTransition playbook */ + playbook?: (string|null); + + /** PlaybookTransition displayName */ + displayName?: (string|null); + } + + /** Represents a PlaybookTransition. */ + class PlaybookTransition implements IPlaybookTransition { + + /** + * Constructs a new PlaybookTransition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybookTransition); + + /** PlaybookTransition playbook. */ + public playbook: string; + + /** PlaybookTransition displayName. */ + public displayName: string; + + /** + * Creates a new PlaybookTransition instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookTransition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybookTransition): google.cloud.dialogflow.cx.v3.PlaybookTransition; + + /** + * Encodes the specified PlaybookTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTransition.verify|verify} messages. + * @param message PlaybookTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybookTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTransition.verify|verify} messages. + * @param message PlaybookTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybookTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookTransition + * @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.dialogflow.cx.v3.PlaybookTransition; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookTransition + * @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.dialogflow.cx.v3.PlaybookTransition; + + /** + * Verifies a PlaybookTransition 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 PlaybookTransition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookTransition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PlaybookTransition; + + /** + * Creates a plain object from a PlaybookTransition message. Also converts values to other types if specified. + * @param message PlaybookTransition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PlaybookTransition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookTransition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookTransition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowTransition. */ + interface IFlowTransition { + + /** FlowTransition flow */ + flow?: (string|null); + + /** FlowTransition displayName */ + displayName?: (string|null); + } + + /** Represents a FlowTransition. */ + class FlowTransition implements IFlowTransition { + + /** + * Constructs a new FlowTransition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IFlowTransition); + + /** FlowTransition flow. */ + public flow: string; + + /** FlowTransition displayName. */ + public displayName: string; + + /** + * Creates a new FlowTransition instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowTransition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IFlowTransition): google.cloud.dialogflow.cx.v3.FlowTransition; + + /** + * Encodes the specified FlowTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTransition.verify|verify} messages. + * @param message FlowTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IFlowTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTransition.verify|verify} messages. + * @param message FlowTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IFlowTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowTransition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowTransition + * @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.dialogflow.cx.v3.FlowTransition; + + /** + * Decodes a FlowTransition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowTransition + * @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.dialogflow.cx.v3.FlowTransition; + + /** + * Verifies a FlowTransition 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 FlowTransition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowTransition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.FlowTransition; + + /** + * Creates a plain object from a FlowTransition message. Also converts values to other types if specified. + * @param message FlowTransition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.FlowTransition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowTransition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowTransition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** OutputState enum. */ + enum OutputState { + OUTPUT_STATE_UNSPECIFIED = 0, + OUTPUT_STATE_OK = 1, + OUTPUT_STATE_CANCELLED = 2, + OUTPUT_STATE_FAILED = 3, + OUTPUT_STATE_ESCALATED = 4, + OUTPUT_STATE_PENDING = 5 + } + + /** Represents a TransitionRouteGroups */ + class TransitionRouteGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new TransitionRouteGroups service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TransitionRouteGroups service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TransitionRouteGroups; + + /** + * Calls ListTransitionRouteGroups. + * @param request ListTransitionRouteGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransitionRouteGroupsResponse + */ + public listTransitionRouteGroups(request: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, callback: google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroupsCallback): void; + + /** + * Calls ListTransitionRouteGroups. + * @param request ListTransitionRouteGroupsRequest message or plain object + * @returns Promise + */ + public listTransitionRouteGroups(request: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest): Promise; + + /** + * Calls GetTransitionRouteGroup. + * @param request GetTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransitionRouteGroup + */ + public getTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3.TransitionRouteGroups.GetTransitionRouteGroupCallback): void; + + /** + * Calls GetTransitionRouteGroup. + * @param request GetTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public getTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest): Promise; + + /** + * Calls CreateTransitionRouteGroup. + * @param request CreateTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransitionRouteGroup + */ + public createTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroupCallback): void; + + /** + * Calls CreateTransitionRouteGroup. + * @param request CreateTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public createTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest): Promise; + + /** + * Calls UpdateTransitionRouteGroup. + * @param request UpdateTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransitionRouteGroup + */ + public updateTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3.TransitionRouteGroups.UpdateTransitionRouteGroupCallback): void; + + /** + * Calls UpdateTransitionRouteGroup. + * @param request UpdateTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public updateTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest): Promise; + + /** + * Calls DeleteTransitionRouteGroup. + * @param request DeleteTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3.TransitionRouteGroups.DeleteTransitionRouteGroupCallback): void; + + /** + * Calls DeleteTransitionRouteGroup. + * @param request DeleteTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public deleteTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest): Promise; + } + + namespace TransitionRouteGroups { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|listTransitionRouteGroups}. + * @param error Error, if any + * @param [response] ListTransitionRouteGroupsResponse + */ + type ListTransitionRouteGroupsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|getTransitionRouteGroup}. + * @param error Error, if any + * @param [response] TransitionRouteGroup + */ + type GetTransitionRouteGroupCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.TransitionRouteGroup) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|createTransitionRouteGroup}. + * @param error Error, if any + * @param [response] TransitionRouteGroup + */ + type CreateTransitionRouteGroupCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.TransitionRouteGroup) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|updateTransitionRouteGroup}. + * @param error Error, if any + * @param [response] TransitionRouteGroup + */ + type UpdateTransitionRouteGroupCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.TransitionRouteGroup) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|deleteTransitionRouteGroup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTransitionRouteGroupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a TransitionRouteGroup. */ + interface ITransitionRouteGroup { + + /** TransitionRouteGroup name */ + name?: (string|null); + + /** TransitionRouteGroup displayName */ + displayName?: (string|null); + + /** TransitionRouteGroup transitionRoutes */ + transitionRoutes?: (google.cloud.dialogflow.cx.v3.ITransitionRoute[]|null); + } + + /** Represents a TransitionRouteGroup. */ + class TransitionRouteGroup implements ITransitionRouteGroup { + + /** + * Constructs a new TransitionRouteGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITransitionRouteGroup); + + /** TransitionRouteGroup name. */ + public name: string; + + /** TransitionRouteGroup displayName. */ + public displayName: string; + + /** TransitionRouteGroup transitionRoutes. */ + public transitionRoutes: google.cloud.dialogflow.cx.v3.ITransitionRoute[]; + + /** + * Creates a new TransitionRouteGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionRouteGroup instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITransitionRouteGroup): google.cloud.dialogflow.cx.v3.TransitionRouteGroup; + + /** + * Encodes the specified TransitionRouteGroup message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify|verify} messages. + * @param message TransitionRouteGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionRouteGroup message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify|verify} messages. + * @param message TransitionRouteGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionRouteGroup + * @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.dialogflow.cx.v3.TransitionRouteGroup; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionRouteGroup + * @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.dialogflow.cx.v3.TransitionRouteGroup; + + /** + * Verifies a TransitionRouteGroup 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 TransitionRouteGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionRouteGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.TransitionRouteGroup; + + /** + * Creates a plain object from a TransitionRouteGroup message. Also converts values to other types if specified. + * @param message TransitionRouteGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.TransitionRouteGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionRouteGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionRouteGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransitionRouteGroupsRequest. */ + interface IListTransitionRouteGroupsRequest { + + /** ListTransitionRouteGroupsRequest parent */ + parent?: (string|null); + + /** ListTransitionRouteGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListTransitionRouteGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransitionRouteGroupsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListTransitionRouteGroupsRequest. */ + class ListTransitionRouteGroupsRequest implements IListTransitionRouteGroupsRequest { + + /** + * Constructs a new ListTransitionRouteGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest); + + /** ListTransitionRouteGroupsRequest parent. */ + public parent: string; + + /** ListTransitionRouteGroupsRequest pageSize. */ + public pageSize: number; + + /** ListTransitionRouteGroupsRequest pageToken. */ + public pageToken: string; + + /** ListTransitionRouteGroupsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListTransitionRouteGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransitionRouteGroupsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest): google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @param message ListTransitionRouteGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @param message ListTransitionRouteGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransitionRouteGroupsRequest + * @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.dialogflow.cx.v3.ListTransitionRouteGroupsRequest; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransitionRouteGroupsRequest + * @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.dialogflow.cx.v3.ListTransitionRouteGroupsRequest; + + /** + * Verifies a ListTransitionRouteGroupsRequest 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 ListTransitionRouteGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransitionRouteGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest; + + /** + * Creates a plain object from a ListTransitionRouteGroupsRequest message. Also converts values to other types if specified. + * @param message ListTransitionRouteGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransitionRouteGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransitionRouteGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransitionRouteGroupsResponse. */ + interface IListTransitionRouteGroupsResponse { + + /** ListTransitionRouteGroupsResponse transitionRouteGroups */ + transitionRouteGroups?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[]|null); + + /** ListTransitionRouteGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransitionRouteGroupsResponse. */ + class ListTransitionRouteGroupsResponse implements IListTransitionRouteGroupsResponse { + + /** + * Constructs a new ListTransitionRouteGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse); + + /** ListTransitionRouteGroupsResponse transitionRouteGroups. */ + public transitionRouteGroups: google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[]; + + /** ListTransitionRouteGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransitionRouteGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransitionRouteGroupsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse): google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse; + + /** + * Encodes the specified ListTransitionRouteGroupsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @param message ListTransitionRouteGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransitionRouteGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @param message ListTransitionRouteGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransitionRouteGroupsResponse + * @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.dialogflow.cx.v3.ListTransitionRouteGroupsResponse; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransitionRouteGroupsResponse + * @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.dialogflow.cx.v3.ListTransitionRouteGroupsResponse; + + /** + * Verifies a ListTransitionRouteGroupsResponse 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 ListTransitionRouteGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransitionRouteGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse; + + /** + * Creates a plain object from a ListTransitionRouteGroupsResponse message. Also converts values to other types if specified. + * @param message ListTransitionRouteGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransitionRouteGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransitionRouteGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTransitionRouteGroupRequest. */ + interface IGetTransitionRouteGroupRequest { + + /** GetTransitionRouteGroupRequest name */ + name?: (string|null); + + /** GetTransitionRouteGroupRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetTransitionRouteGroupRequest. */ + class GetTransitionRouteGroupRequest implements IGetTransitionRouteGroupRequest { + + /** + * Constructs a new GetTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest); + + /** GetTransitionRouteGroupRequest name. */ + public name: string; + + /** GetTransitionRouteGroupRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest.verify|verify} messages. + * @param message GetTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest.verify|verify} messages. + * @param message GetTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.GetTransitionRouteGroupRequest; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.GetTransitionRouteGroupRequest; + + /** + * Verifies a GetTransitionRouteGroupRequest 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 GetTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest; + + /** + * Creates a plain object from a GetTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message GetTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTransitionRouteGroupRequest. */ + interface ICreateTransitionRouteGroupRequest { + + /** CreateTransitionRouteGroupRequest parent */ + parent?: (string|null); + + /** CreateTransitionRouteGroupRequest transitionRouteGroup */ + transitionRouteGroup?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null); + + /** CreateTransitionRouteGroupRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateTransitionRouteGroupRequest. */ + class CreateTransitionRouteGroupRequest implements ICreateTransitionRouteGroupRequest { + + /** + * Constructs a new CreateTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest); + + /** CreateTransitionRouteGroupRequest parent. */ + public parent: string; + + /** CreateTransitionRouteGroupRequest transitionRouteGroup. */ + public transitionRouteGroup?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null); + + /** CreateTransitionRouteGroupRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @param message CreateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @param message CreateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.CreateTransitionRouteGroupRequest; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.CreateTransitionRouteGroupRequest; + + /** + * Verifies a CreateTransitionRouteGroupRequest 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 CreateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest; + + /** + * Creates a plain object from a CreateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message CreateTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTransitionRouteGroupRequest. */ + interface IUpdateTransitionRouteGroupRequest { + + /** UpdateTransitionRouteGroupRequest transitionRouteGroup */ + transitionRouteGroup?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null); + + /** UpdateTransitionRouteGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransitionRouteGroupRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents an UpdateTransitionRouteGroupRequest. */ + class UpdateTransitionRouteGroupRequest implements IUpdateTransitionRouteGroupRequest { + + /** + * Constructs a new UpdateTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest); + + /** UpdateTransitionRouteGroupRequest transitionRouteGroup. */ + public transitionRouteGroup?: (google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null); + + /** UpdateTransitionRouteGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransitionRouteGroupRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new UpdateTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @param message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @param message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest; + + /** + * Verifies an UpdateTransitionRouteGroupRequest 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 UpdateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest; + + /** + * Creates a plain object from an UpdateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message UpdateTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTransitionRouteGroupRequest. */ + interface IDeleteTransitionRouteGroupRequest { + + /** DeleteTransitionRouteGroupRequest name */ + name?: (string|null); + + /** DeleteTransitionRouteGroupRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteTransitionRouteGroupRequest. */ + class DeleteTransitionRouteGroupRequest implements IDeleteTransitionRouteGroupRequest { + + /** + * Constructs a new DeleteTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest); + + /** DeleteTransitionRouteGroupRequest name. */ + public name: string; + + /** DeleteTransitionRouteGroupRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @param message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @param message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTransitionRouteGroupRequest + * @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.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest; + + /** + * Verifies a DeleteTransitionRouteGroupRequest 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 DeleteTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest; + + /** + * Creates a plain object from a DeleteTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message DeleteTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Webhooks */ + class Webhooks extends $protobuf.rpc.Service { + + /** + * Constructs a new Webhooks service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Webhooks service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Webhooks; + + /** + * Calls ListWebhooks. + * @param request ListWebhooksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWebhooksResponse + */ + public listWebhooks(request: google.cloud.dialogflow.cx.v3.IListWebhooksRequest, callback: google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooksCallback): void; + + /** + * Calls ListWebhooks. + * @param request ListWebhooksRequest message or plain object + * @returns Promise + */ + public listWebhooks(request: google.cloud.dialogflow.cx.v3.IListWebhooksRequest): Promise; + + /** + * Calls GetWebhook. + * @param request GetWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Webhook + */ + public getWebhook(request: google.cloud.dialogflow.cx.v3.IGetWebhookRequest, callback: google.cloud.dialogflow.cx.v3.Webhooks.GetWebhookCallback): void; + + /** + * Calls GetWebhook. + * @param request GetWebhookRequest message or plain object + * @returns Promise + */ + public getWebhook(request: google.cloud.dialogflow.cx.v3.IGetWebhookRequest): Promise; + + /** + * Calls CreateWebhook. + * @param request CreateWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Webhook + */ + public createWebhook(request: google.cloud.dialogflow.cx.v3.ICreateWebhookRequest, callback: google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhookCallback): void; + + /** + * Calls CreateWebhook. + * @param request CreateWebhookRequest message or plain object + * @returns Promise + */ + public createWebhook(request: google.cloud.dialogflow.cx.v3.ICreateWebhookRequest): Promise; + + /** + * Calls UpdateWebhook. + * @param request UpdateWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Webhook + */ + public updateWebhook(request: google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest, callback: google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhookCallback): void; + + /** + * Calls UpdateWebhook. + * @param request UpdateWebhookRequest message or plain object + * @returns Promise + */ + public updateWebhook(request: google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest): Promise; + + /** + * Calls DeleteWebhook. + * @param request DeleteWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteWebhook(request: google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest, callback: google.cloud.dialogflow.cx.v3.Webhooks.DeleteWebhookCallback): void; + + /** + * Calls DeleteWebhook. + * @param request DeleteWebhookRequest message or plain object + * @returns Promise + */ + public deleteWebhook(request: google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest): Promise; + } + + namespace Webhooks { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|listWebhooks}. + * @param error Error, if any + * @param [response] ListWebhooksResponse + */ + type ListWebhooksCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListWebhooksResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|getWebhook}. + * @param error Error, if any + * @param [response] Webhook + */ + type GetWebhookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Webhook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|createWebhook}. + * @param error Error, if any + * @param [response] Webhook + */ + type CreateWebhookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Webhook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|updateWebhook}. + * @param error Error, if any + * @param [response] Webhook + */ + type UpdateWebhookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Webhook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|deleteWebhook}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteWebhookCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Webhook. */ + interface IWebhook { + + /** Webhook name */ + name?: (string|null); + + /** Webhook displayName */ + displayName?: (string|null); + + /** Webhook genericWebService */ + genericWebService?: (google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null); + + /** Webhook serviceDirectory */ + serviceDirectory?: (google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig|null); + + /** Webhook timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Webhook disabled */ + disabled?: (boolean|null); + } + + /** Represents a Webhook. */ + class Webhook implements IWebhook { + + /** + * Constructs a new Webhook. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IWebhook); + + /** Webhook name. */ + public name: string; + + /** Webhook displayName. */ + public displayName: string; + + /** Webhook genericWebService. */ + public genericWebService?: (google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null); + + /** Webhook serviceDirectory. */ + public serviceDirectory?: (google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig|null); + + /** Webhook timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Webhook disabled. */ + public disabled: boolean; + + /** Webhook webhook. */ + public webhook?: ("genericWebService"|"serviceDirectory"); + + /** + * Creates a new Webhook instance using the specified properties. + * @param [properties] Properties to set + * @returns Webhook instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IWebhook): google.cloud.dialogflow.cx.v3.Webhook; + + /** + * Encodes the specified Webhook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.verify|verify} messages. + * @param message Webhook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IWebhook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Webhook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.verify|verify} messages. + * @param message Webhook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IWebhook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Webhook message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Webhook + * @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.dialogflow.cx.v3.Webhook; + + /** + * Decodes a Webhook message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Webhook + * @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.dialogflow.cx.v3.Webhook; + + /** + * Verifies a Webhook 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 Webhook message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Webhook + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Webhook; + + /** + * Creates a plain object from a Webhook message. Also converts values to other types if specified. + * @param message Webhook + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Webhook, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Webhook to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Webhook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Webhook { + + /** Properties of a GenericWebService. */ + interface IGenericWebService { + + /** GenericWebService uri */ + uri?: (string|null); + + /** GenericWebService username */ + username?: (string|null); + + /** GenericWebService password */ + password?: (string|null); + + /** GenericWebService secretVersionForUsernamePassword */ + secretVersionForUsernamePassword?: (string|null); + + /** GenericWebService requestHeaders */ + requestHeaders?: ({ [k: string]: string }|null); + + /** GenericWebService secretVersionsForRequestHeaders */ + secretVersionsForRequestHeaders?: ({ [k: string]: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue }|null); + + /** GenericWebService allowedCaCerts */ + allowedCaCerts?: (Uint8Array[]|null); + + /** GenericWebService oauthConfig */ + oauthConfig?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig|null); + + /** GenericWebService serviceAgentAuth */ + serviceAgentAuth?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth|null); + + /** GenericWebService serviceAccountAuthConfig */ + serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig|null); + + /** GenericWebService webhookType */ + webhookType?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|null); + + /** GenericWebService httpMethod */ + httpMethod?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|null); + + /** GenericWebService requestBody */ + requestBody?: (string|null); + + /** GenericWebService parameterMapping */ + parameterMapping?: ({ [k: string]: string }|null); + } + + /** Represents a GenericWebService. */ + class GenericWebService implements IGenericWebService { + + /** + * Constructs a new GenericWebService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService); + + /** GenericWebService uri. */ + public uri: string; + + /** GenericWebService username. */ + public username: string; + + /** GenericWebService password. */ + public password: string; + + /** GenericWebService secretVersionForUsernamePassword. */ + public secretVersionForUsernamePassword: string; + + /** GenericWebService requestHeaders. */ + public requestHeaders: { [k: string]: string }; + + /** GenericWebService secretVersionsForRequestHeaders. */ + public secretVersionsForRequestHeaders: { [k: string]: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue }; + + /** GenericWebService allowedCaCerts. */ + public allowedCaCerts: Uint8Array[]; + + /** GenericWebService oauthConfig. */ + public oauthConfig?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig|null); + + /** GenericWebService serviceAgentAuth. */ + public serviceAgentAuth: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth); + + /** GenericWebService serviceAccountAuthConfig. */ + public serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig|null); + + /** GenericWebService webhookType. */ + public webhookType: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType); + + /** GenericWebService httpMethod. */ + public httpMethod: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod); + + /** GenericWebService requestBody. */ + public requestBody: string; + + /** GenericWebService parameterMapping. */ + public parameterMapping: { [k: string]: string }; + + /** + * Creates a new GenericWebService instance using the specified properties. + * @param [properties] Properties to set + * @returns GenericWebService instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService; + + /** + * Encodes the specified GenericWebService message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.verify|verify} messages. + * @param message GenericWebService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenericWebService message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.verify|verify} messages. + * @param message GenericWebService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenericWebService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenericWebService + * @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.dialogflow.cx.v3.Webhook.GenericWebService; + + /** + * Decodes a GenericWebService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenericWebService + * @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.dialogflow.cx.v3.Webhook.GenericWebService; + + /** + * Verifies a GenericWebService 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 GenericWebService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenericWebService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService; + + /** + * Creates a plain object from a GenericWebService message. Also converts values to other types if specified. + * @param message GenericWebService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenericWebService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenericWebService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenericWebService { + + /** Properties of a SecretVersionHeaderValue. */ + interface ISecretVersionHeaderValue { + + /** SecretVersionHeaderValue secretVersion */ + secretVersion?: (string|null); + } + + /** Represents a SecretVersionHeaderValue. */ + class SecretVersionHeaderValue implements ISecretVersionHeaderValue { + + /** + * Constructs a new SecretVersionHeaderValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue); + + /** SecretVersionHeaderValue secretVersion. */ + public secretVersion: string; + + /** + * Creates a new SecretVersionHeaderValue instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretVersionHeaderValue instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Encodes the specified SecretVersionHeaderValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @param message SecretVersionHeaderValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretVersionHeaderValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @param message SecretVersionHeaderValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretVersionHeaderValue + * @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.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretVersionHeaderValue + * @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.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Verifies a SecretVersionHeaderValue 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 SecretVersionHeaderValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretVersionHeaderValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Creates a plain object from a SecretVersionHeaderValue message. Also converts values to other types if specified. + * @param message SecretVersionHeaderValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretVersionHeaderValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretVersionHeaderValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a OAuthConfig. */ + interface IOAuthConfig { + + /** OAuthConfig clientId */ + clientId?: (string|null); + + /** OAuthConfig clientSecret */ + clientSecret?: (string|null); + + /** OAuthConfig secretVersionForClientSecret */ + secretVersionForClientSecret?: (string|null); + + /** OAuthConfig tokenEndpoint */ + tokenEndpoint?: (string|null); + + /** OAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a OAuthConfig. */ + class OAuthConfig implements IOAuthConfig { + + /** + * Constructs a new OAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig); + + /** OAuthConfig clientId. */ + public clientId: string; + + /** OAuthConfig clientSecret. */ + public clientSecret: string; + + /** OAuthConfig secretVersionForClientSecret. */ + public secretVersionForClientSecret: string; + + /** OAuthConfig tokenEndpoint. */ + public tokenEndpoint: string; + + /** OAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthConfig + * @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.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthConfig + * @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.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig; + + /** + * Verifies a OAuthConfig 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 OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @param message OAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ServiceAgentAuth enum. */ + enum ServiceAgentAuth { + SERVICE_AGENT_AUTH_UNSPECIFIED = 0, + NONE = 1, + ID_TOKEN = 2, + ACCESS_TOKEN = 3 + } + + /** Properties of a ServiceAccountAuthConfig. */ + interface IServiceAccountAuthConfig { + + /** ServiceAccountAuthConfig serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a ServiceAccountAuthConfig. */ + class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { + + /** + * Constructs a new ServiceAccountAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig); + + /** ServiceAccountAuthConfig serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Verifies a ServiceAccountAuthConfig 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 ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAccountAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** WebhookType enum. */ + enum WebhookType { + WEBHOOK_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + FLEXIBLE = 2 + } + + /** HttpMethod enum. */ + enum HttpMethod { + HTTP_METHOD_UNSPECIFIED = 0, + POST = 1, + GET = 2, + HEAD = 3, + PUT = 4, + DELETE = 5, + PATCH = 6, + OPTIONS = 7 + } + } + + /** Properties of a ServiceDirectoryConfig. */ + interface IServiceDirectoryConfig { + + /** ServiceDirectoryConfig service */ + service?: (string|null); + + /** ServiceDirectoryConfig genericWebService */ + genericWebService?: (google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null); + } + + /** Represents a ServiceDirectoryConfig. */ + class ServiceDirectoryConfig implements IServiceDirectoryConfig { + + /** + * Constructs a new ServiceDirectoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig); + + /** ServiceDirectoryConfig service. */ + public service: string; + + /** ServiceDirectoryConfig genericWebService. */ + public genericWebService?: (google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null); + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDirectoryConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig): google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig; + + /** + * Verifies a ServiceDirectoryConfig 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 ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDirectoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @param message ServiceDirectoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListWebhooksRequest. */ + interface IListWebhooksRequest { + + /** ListWebhooksRequest parent */ + parent?: (string|null); + + /** ListWebhooksRequest pageSize */ + pageSize?: (number|null); + + /** ListWebhooksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListWebhooksRequest. */ + class ListWebhooksRequest implements IListWebhooksRequest { + + /** + * Constructs a new ListWebhooksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListWebhooksRequest); + + /** ListWebhooksRequest parent. */ + public parent: string; + + /** ListWebhooksRequest pageSize. */ + public pageSize: number; + + /** ListWebhooksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListWebhooksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWebhooksRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListWebhooksRequest): google.cloud.dialogflow.cx.v3.ListWebhooksRequest; + + /** + * Encodes the specified ListWebhooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksRequest.verify|verify} messages. + * @param message ListWebhooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListWebhooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWebhooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksRequest.verify|verify} messages. + * @param message ListWebhooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListWebhooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWebhooksRequest + * @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.dialogflow.cx.v3.ListWebhooksRequest; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWebhooksRequest + * @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.dialogflow.cx.v3.ListWebhooksRequest; + + /** + * Verifies a ListWebhooksRequest 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 ListWebhooksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWebhooksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListWebhooksRequest; + + /** + * Creates a plain object from a ListWebhooksRequest message. Also converts values to other types if specified. + * @param message ListWebhooksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListWebhooksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWebhooksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWebhooksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWebhooksResponse. */ + interface IListWebhooksResponse { + + /** ListWebhooksResponse webhooks */ + webhooks?: (google.cloud.dialogflow.cx.v3.IWebhook[]|null); + + /** ListWebhooksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListWebhooksResponse. */ + class ListWebhooksResponse implements IListWebhooksResponse { + + /** + * Constructs a new ListWebhooksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListWebhooksResponse); + + /** ListWebhooksResponse webhooks. */ + public webhooks: google.cloud.dialogflow.cx.v3.IWebhook[]; + + /** ListWebhooksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListWebhooksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWebhooksResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListWebhooksResponse): google.cloud.dialogflow.cx.v3.ListWebhooksResponse; + + /** + * Encodes the specified ListWebhooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksResponse.verify|verify} messages. + * @param message ListWebhooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListWebhooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWebhooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksResponse.verify|verify} messages. + * @param message ListWebhooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListWebhooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWebhooksResponse + * @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.dialogflow.cx.v3.ListWebhooksResponse; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWebhooksResponse + * @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.dialogflow.cx.v3.ListWebhooksResponse; + + /** + * Verifies a ListWebhooksResponse 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 ListWebhooksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWebhooksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListWebhooksResponse; + + /** + * Creates a plain object from a ListWebhooksResponse message. Also converts values to other types if specified. + * @param message ListWebhooksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListWebhooksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWebhooksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWebhooksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetWebhookRequest. */ + interface IGetWebhookRequest { + + /** GetWebhookRequest name */ + name?: (string|null); + } + + /** Represents a GetWebhookRequest. */ + class GetWebhookRequest implements IGetWebhookRequest { + + /** + * Constructs a new GetWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetWebhookRequest); + + /** GetWebhookRequest name. */ + public name: string; + + /** + * Creates a new GetWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetWebhookRequest): google.cloud.dialogflow.cx.v3.GetWebhookRequest; + + /** + * Encodes the specified GetWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetWebhookRequest.verify|verify} messages. + * @param message GetWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetWebhookRequest.verify|verify} messages. + * @param message GetWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWebhookRequest + * @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.dialogflow.cx.v3.GetWebhookRequest; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWebhookRequest + * @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.dialogflow.cx.v3.GetWebhookRequest; + + /** + * Verifies a GetWebhookRequest 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 GetWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetWebhookRequest; + + /** + * Creates a plain object from a GetWebhookRequest message. Also converts values to other types if specified. + * @param message GetWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateWebhookRequest. */ + interface ICreateWebhookRequest { + + /** CreateWebhookRequest parent */ + parent?: (string|null); + + /** CreateWebhookRequest webhook */ + webhook?: (google.cloud.dialogflow.cx.v3.IWebhook|null); + } + + /** Represents a CreateWebhookRequest. */ + class CreateWebhookRequest implements ICreateWebhookRequest { + + /** + * Constructs a new CreateWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateWebhookRequest); + + /** CreateWebhookRequest parent. */ + public parent: string; + + /** CreateWebhookRequest webhook. */ + public webhook?: (google.cloud.dialogflow.cx.v3.IWebhook|null); + + /** + * Creates a new CreateWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateWebhookRequest): google.cloud.dialogflow.cx.v3.CreateWebhookRequest; + + /** + * Encodes the specified CreateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateWebhookRequest.verify|verify} messages. + * @param message CreateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateWebhookRequest.verify|verify} messages. + * @param message CreateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWebhookRequest + * @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.dialogflow.cx.v3.CreateWebhookRequest; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWebhookRequest + * @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.dialogflow.cx.v3.CreateWebhookRequest; + + /** + * Verifies a CreateWebhookRequest 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 CreateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateWebhookRequest; + + /** + * Creates a plain object from a CreateWebhookRequest message. Also converts values to other types if specified. + * @param message CreateWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWebhookRequest. */ + interface IUpdateWebhookRequest { + + /** UpdateWebhookRequest webhook */ + webhook?: (google.cloud.dialogflow.cx.v3.IWebhook|null); + + /** UpdateWebhookRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateWebhookRequest. */ + class UpdateWebhookRequest implements IUpdateWebhookRequest { + + /** + * Constructs a new UpdateWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest); + + /** UpdateWebhookRequest webhook. */ + public webhook?: (google.cloud.dialogflow.cx.v3.IWebhook|null); + + /** UpdateWebhookRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest): google.cloud.dialogflow.cx.v3.UpdateWebhookRequest; + + /** + * Encodes the specified UpdateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateWebhookRequest.verify|verify} messages. + * @param message UpdateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateWebhookRequest.verify|verify} messages. + * @param message UpdateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWebhookRequest + * @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.dialogflow.cx.v3.UpdateWebhookRequest; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWebhookRequest + * @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.dialogflow.cx.v3.UpdateWebhookRequest; + + /** + * Verifies an UpdateWebhookRequest 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 UpdateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateWebhookRequest; + + /** + * Creates a plain object from an UpdateWebhookRequest message. Also converts values to other types if specified. + * @param message UpdateWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWebhookRequest. */ + interface IDeleteWebhookRequest { + + /** DeleteWebhookRequest name */ + name?: (string|null); + + /** DeleteWebhookRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteWebhookRequest. */ + class DeleteWebhookRequest implements IDeleteWebhookRequest { + + /** + * Constructs a new DeleteWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest); + + /** DeleteWebhookRequest name. */ + public name: string; + + /** DeleteWebhookRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest): google.cloud.dialogflow.cx.v3.DeleteWebhookRequest; + + /** + * Encodes the specified DeleteWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteWebhookRequest.verify|verify} messages. + * @param message DeleteWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteWebhookRequest.verify|verify} messages. + * @param message DeleteWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWebhookRequest + * @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.dialogflow.cx.v3.DeleteWebhookRequest; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWebhookRequest + * @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.dialogflow.cx.v3.DeleteWebhookRequest; + + /** + * Verifies a DeleteWebhookRequest 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 DeleteWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteWebhookRequest; + + /** + * Creates a plain object from a DeleteWebhookRequest message. Also converts values to other types if specified. + * @param message DeleteWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebhookRequest. */ + interface IWebhookRequest { + + /** WebhookRequest detectIntentResponseId */ + detectIntentResponseId?: (string|null); + + /** WebhookRequest text */ + text?: (string|null); + + /** WebhookRequest triggerIntent */ + triggerIntent?: (string|null); + + /** WebhookRequest transcript */ + transcript?: (string|null); + + /** WebhookRequest triggerEvent */ + triggerEvent?: (string|null); + + /** WebhookRequest dtmfDigits */ + dtmfDigits?: (string|null); + + /** WebhookRequest languageCode */ + languageCode?: (string|null); + + /** WebhookRequest fulfillmentInfo */ + fulfillmentInfo?: (google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo|null); + + /** WebhookRequest intentInfo */ + intentInfo?: (google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo|null); + + /** WebhookRequest pageInfo */ + pageInfo?: (google.cloud.dialogflow.cx.v3.IPageInfo|null); + + /** WebhookRequest sessionInfo */ + sessionInfo?: (google.cloud.dialogflow.cx.v3.ISessionInfo|null); + + /** WebhookRequest messages */ + messages?: (google.cloud.dialogflow.cx.v3.IResponseMessage[]|null); + + /** WebhookRequest payload */ + payload?: (google.protobuf.IStruct|null); + + /** WebhookRequest sentimentAnalysisResult */ + sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult|null); + + /** WebhookRequest languageInfo */ + languageInfo?: (google.cloud.dialogflow.cx.v3.ILanguageInfo|null); + } + + /** Represents a WebhookRequest. */ + class WebhookRequest implements IWebhookRequest { + + /** + * Constructs a new WebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IWebhookRequest); + + /** WebhookRequest detectIntentResponseId. */ + public detectIntentResponseId: string; + + /** WebhookRequest text. */ + public text?: (string|null); + + /** WebhookRequest triggerIntent. */ + public triggerIntent?: (string|null); + + /** WebhookRequest transcript. */ + public transcript?: (string|null); + + /** WebhookRequest triggerEvent. */ + public triggerEvent?: (string|null); + + /** WebhookRequest dtmfDigits. */ + public dtmfDigits?: (string|null); + + /** WebhookRequest languageCode. */ + public languageCode: string; + + /** WebhookRequest fulfillmentInfo. */ + public fulfillmentInfo?: (google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo|null); + + /** WebhookRequest intentInfo. */ + public intentInfo?: (google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo|null); + + /** WebhookRequest pageInfo. */ + public pageInfo?: (google.cloud.dialogflow.cx.v3.IPageInfo|null); + + /** WebhookRequest sessionInfo. */ + public sessionInfo?: (google.cloud.dialogflow.cx.v3.ISessionInfo|null); + + /** WebhookRequest messages. */ + public messages: google.cloud.dialogflow.cx.v3.IResponseMessage[]; + + /** WebhookRequest payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** WebhookRequest sentimentAnalysisResult. */ + public sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult|null); + + /** WebhookRequest languageInfo. */ + public languageInfo?: (google.cloud.dialogflow.cx.v3.ILanguageInfo|null); + + /** WebhookRequest query. */ + public query?: ("text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmfDigits"); + + /** + * Creates a new WebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IWebhookRequest): google.cloud.dialogflow.cx.v3.WebhookRequest; + + /** + * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.verify|verify} messages. + * @param message WebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.verify|verify} messages. + * @param message WebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookRequest + * @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.dialogflow.cx.v3.WebhookRequest; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookRequest + * @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.dialogflow.cx.v3.WebhookRequest; + + /** + * Verifies a WebhookRequest 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 WebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.WebhookRequest; + + /** + * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. + * @param message WebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.WebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebhookRequest { + + /** Properties of a FulfillmentInfo. */ + interface IFulfillmentInfo { + + /** FulfillmentInfo tag */ + tag?: (string|null); + } + + /** Represents a FulfillmentInfo. */ + class FulfillmentInfo implements IFulfillmentInfo { + + /** + * Constructs a new FulfillmentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo); + + /** FulfillmentInfo tag. */ + public tag: string; + + /** + * Creates a new FulfillmentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillmentInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo): google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo; + + /** + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillmentInfo + * @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.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillmentInfo + * @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.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo; + + /** + * Verifies a FulfillmentInfo 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 FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillmentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo; + + /** + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * @param message FulfillmentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillmentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillmentInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntentInfo. */ + interface IIntentInfo { + + /** IntentInfo lastMatchedIntent */ + lastMatchedIntent?: (string|null); + + /** IntentInfo displayName */ + displayName?: (string|null); + + /** IntentInfo parameters */ + parameters?: ({ [k: string]: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue }|null); + + /** IntentInfo confidence */ + confidence?: (number|null); + } + + /** Represents an IntentInfo. */ + class IntentInfo implements IIntentInfo { + + /** + * Constructs a new IntentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo); + + /** IntentInfo lastMatchedIntent. */ + public lastMatchedIntent: string; + + /** IntentInfo displayName. */ + public displayName: string; + + /** IntentInfo parameters. */ + public parameters: { [k: string]: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue }; + + /** IntentInfo confidence. */ + public confidence: number; + + /** + * Creates a new IntentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo): google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo; + + /** + * Encodes the specified IntentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.verify|verify} messages. + * @param message IntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.verify|verify} messages. + * @param message IntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentInfo + * @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.dialogflow.cx.v3.WebhookRequest.IntentInfo; + + /** + * Decodes an IntentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentInfo + * @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.dialogflow.cx.v3.WebhookRequest.IntentInfo; + + /** + * Verifies an IntentInfo 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 IntentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo; + + /** + * Creates a plain object from an IntentInfo message. Also converts values to other types if specified. + * @param message IntentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntentInfo { + + /** Properties of an IntentParameterValue. */ + interface IIntentParameterValue { + + /** IntentParameterValue originalValue */ + originalValue?: (string|null); + + /** IntentParameterValue resolvedValue */ + resolvedValue?: (google.protobuf.IValue|null); + } + + /** Represents an IntentParameterValue. */ + class IntentParameterValue implements IIntentParameterValue { + + /** + * Constructs a new IntentParameterValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue); + + /** IntentParameterValue originalValue. */ + public originalValue: string; + + /** IntentParameterValue resolvedValue. */ + public resolvedValue?: (google.protobuf.IValue|null); + + /** + * Creates a new IntentParameterValue instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentParameterValue instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue): google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Encodes the specified IntentParameterValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @param message IntentParameterValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentParameterValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @param message IntentParameterValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentParameterValue + * @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.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentParameterValue + * @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.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Verifies an IntentParameterValue 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 IntentParameterValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentParameterValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Creates a plain object from an IntentParameterValue message. Also converts values to other types if specified. + * @param message IntentParameterValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentParameterValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentParameterValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SentimentAnalysisResult. */ + interface ISentimentAnalysisResult { + + /** SentimentAnalysisResult score */ + score?: (number|null); + + /** SentimentAnalysisResult magnitude */ + magnitude?: (number|null); + } + + /** Represents a SentimentAnalysisResult. */ + class SentimentAnalysisResult implements ISentimentAnalysisResult { + + /** + * Constructs a new SentimentAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult); + + /** SentimentAnalysisResult score. */ + public score: number; + + /** SentimentAnalysisResult magnitude. */ + public magnitude: number; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult): google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult; + + /** + * Verifies a SentimentAnalysisResult 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 SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @param message SentimentAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WebhookResponse. */ + interface IWebhookResponse { + + /** WebhookResponse fulfillmentResponse */ + fulfillmentResponse?: (google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse|null); + + /** WebhookResponse pageInfo */ + pageInfo?: (google.cloud.dialogflow.cx.v3.IPageInfo|null); + + /** WebhookResponse sessionInfo */ + sessionInfo?: (google.cloud.dialogflow.cx.v3.ISessionInfo|null); + + /** WebhookResponse payload */ + payload?: (google.protobuf.IStruct|null); + + /** WebhookResponse targetPage */ + targetPage?: (string|null); + + /** WebhookResponse targetFlow */ + targetFlow?: (string|null); + } + + /** Represents a WebhookResponse. */ + class WebhookResponse implements IWebhookResponse { + + /** + * Constructs a new WebhookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IWebhookResponse); + + /** WebhookResponse fulfillmentResponse. */ + public fulfillmentResponse?: (google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse|null); + + /** WebhookResponse pageInfo. */ + public pageInfo?: (google.cloud.dialogflow.cx.v3.IPageInfo|null); + + /** WebhookResponse sessionInfo. */ + public sessionInfo?: (google.cloud.dialogflow.cx.v3.ISessionInfo|null); + + /** WebhookResponse payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** WebhookResponse targetPage. */ + public targetPage?: (string|null); + + /** WebhookResponse targetFlow. */ + public targetFlow?: (string|null); + + /** WebhookResponse transition. */ + public transition?: ("targetPage"|"targetFlow"); + + /** + * Creates a new WebhookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IWebhookResponse): google.cloud.dialogflow.cx.v3.WebhookResponse; + + /** + * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.verify|verify} messages. + * @param message WebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.verify|verify} messages. + * @param message WebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookResponse + * @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.dialogflow.cx.v3.WebhookResponse; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookResponse + * @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.dialogflow.cx.v3.WebhookResponse; + + /** + * Verifies a WebhookResponse 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 WebhookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.WebhookResponse; + + /** + * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. + * @param message WebhookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.WebhookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebhookResponse { + + /** Properties of a FulfillmentResponse. */ + interface IFulfillmentResponse { + + /** FulfillmentResponse messages */ + messages?: (google.cloud.dialogflow.cx.v3.IResponseMessage[]|null); + + /** FulfillmentResponse mergeBehavior */ + mergeBehavior?: (google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior|keyof typeof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior|null); + } + + /** Represents a FulfillmentResponse. */ + class FulfillmentResponse implements IFulfillmentResponse { + + /** + * Constructs a new FulfillmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse); + + /** FulfillmentResponse messages. */ + public messages: google.cloud.dialogflow.cx.v3.IResponseMessage[]; + + /** FulfillmentResponse mergeBehavior. */ + public mergeBehavior: (google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior|keyof typeof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior); + + /** + * Creates a new FulfillmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillmentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse): google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse; + + /** + * Encodes the specified FulfillmentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @param message FulfillmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillmentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @param message FulfillmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillmentResponse + * @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.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillmentResponse + * @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.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse; + + /** + * Verifies a FulfillmentResponse 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 FulfillmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse; + + /** + * Creates a plain object from a FulfillmentResponse message. Also converts values to other types if specified. + * @param message FulfillmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FulfillmentResponse { + + /** MergeBehavior enum. */ + enum MergeBehavior { + MERGE_BEHAVIOR_UNSPECIFIED = 0, + APPEND = 1, + REPLACE = 2 + } + } + } + + /** Properties of a PageInfo. */ + interface IPageInfo { + + /** PageInfo currentPage */ + currentPage?: (string|null); + + /** PageInfo displayName */ + displayName?: (string|null); + + /** PageInfo formInfo */ + formInfo?: (google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo|null); + } + + /** Represents a PageInfo. */ + class PageInfo implements IPageInfo { + + /** + * Constructs a new PageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPageInfo); + + /** PageInfo currentPage. */ + public currentPage: string; + + /** PageInfo displayName. */ + public displayName: string; + + /** PageInfo formInfo. */ + public formInfo?: (google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo|null); + + /** + * Creates a new PageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PageInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPageInfo): google.cloud.dialogflow.cx.v3.PageInfo; + + /** + * Encodes the specified PageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.verify|verify} messages. + * @param message PageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.verify|verify} messages. + * @param message PageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageInfo + * @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.dialogflow.cx.v3.PageInfo; + + /** + * Decodes a PageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageInfo + * @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.dialogflow.cx.v3.PageInfo; + + /** + * Verifies a PageInfo 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 PageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PageInfo; + + /** + * Creates a plain object from a PageInfo message. Also converts values to other types if specified. + * @param message PageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PageInfo { + + /** Properties of a FormInfo. */ + interface IFormInfo { + + /** FormInfo parameterInfo */ + parameterInfo?: (google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo[]|null); + } + + /** Represents a FormInfo. */ + class FormInfo implements IFormInfo { + + /** + * Constructs a new FormInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo); + + /** FormInfo parameterInfo. */ + public parameterInfo: google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo[]; + + /** + * Creates a new FormInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FormInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo): google.cloud.dialogflow.cx.v3.PageInfo.FormInfo; + + /** + * Encodes the specified FormInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.verify|verify} messages. + * @param message FormInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FormInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.verify|verify} messages. + * @param message FormInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FormInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FormInfo + * @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.dialogflow.cx.v3.PageInfo.FormInfo; + + /** + * Decodes a FormInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FormInfo + * @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.dialogflow.cx.v3.PageInfo.FormInfo; + + /** + * Verifies a FormInfo 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 FormInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FormInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PageInfo.FormInfo; + + /** + * Creates a plain object from a FormInfo message. Also converts values to other types if specified. + * @param message FormInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PageInfo.FormInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FormInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FormInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FormInfo { + + /** Properties of a ParameterInfo. */ + interface IParameterInfo { + + /** ParameterInfo displayName */ + displayName?: (string|null); + + /** ParameterInfo required */ + required?: (boolean|null); + + /** ParameterInfo state */ + state?: (google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState|keyof typeof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState|null); + + /** ParameterInfo value */ + value?: (google.protobuf.IValue|null); + + /** ParameterInfo justCollected */ + justCollected?: (boolean|null); + } + + /** Represents a ParameterInfo. */ + class ParameterInfo implements IParameterInfo { + + /** + * Constructs a new ParameterInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo); + + /** ParameterInfo displayName. */ + public displayName: string; + + /** ParameterInfo required. */ + public required: boolean; + + /** ParameterInfo state. */ + public state: (google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState|keyof typeof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState); + + /** ParameterInfo value. */ + public value?: (google.protobuf.IValue|null); + + /** ParameterInfo justCollected. */ + public justCollected: boolean; + + /** + * Creates a new ParameterInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo): google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo; + + /** + * Encodes the specified ParameterInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @param message ParameterInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @param message ParameterInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterInfo + * @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.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterInfo + * @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.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo; + + /** + * Verifies a ParameterInfo 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 ParameterInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo; + + /** + * Creates a plain object from a ParameterInfo message. Also converts values to other types if specified. + * @param message ParameterInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ParameterInfo { + + /** ParameterState enum. */ + enum ParameterState { + PARAMETER_STATE_UNSPECIFIED = 0, + EMPTY = 1, + INVALID = 2, + FILLED = 3 + } + } + } + } + + /** Properties of a SessionInfo. */ + interface ISessionInfo { + + /** SessionInfo session */ + session?: (string|null); + + /** SessionInfo parameters */ + parameters?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a SessionInfo. */ + class SessionInfo implements ISessionInfo { + + /** + * Constructs a new SessionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISessionInfo); + + /** SessionInfo session. */ + public session: string; + + /** SessionInfo parameters. */ + public parameters: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new SessionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISessionInfo): google.cloud.dialogflow.cx.v3.SessionInfo; + + /** + * Encodes the specified SessionInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionInfo.verify|verify} messages. + * @param message SessionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISessionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionInfo.verify|verify} messages. + * @param message SessionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISessionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionInfo + * @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.dialogflow.cx.v3.SessionInfo; + + /** + * Decodes a SessionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionInfo + * @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.dialogflow.cx.v3.SessionInfo; + + /** + * Verifies a SessionInfo 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 SessionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SessionInfo; + + /** + * Creates a plain object from a SessionInfo message. Also converts values to other types if specified. + * @param message SessionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SessionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LanguageInfo. */ + interface ILanguageInfo { + + /** LanguageInfo inputLanguageCode */ + inputLanguageCode?: (string|null); + + /** LanguageInfo resolvedLanguageCode */ + resolvedLanguageCode?: (string|null); + + /** LanguageInfo confidenceScore */ + confidenceScore?: (number|null); + } + + /** Represents a LanguageInfo. */ + class LanguageInfo implements ILanguageInfo { + + /** + * Constructs a new LanguageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ILanguageInfo); + + /** LanguageInfo inputLanguageCode. */ + public inputLanguageCode: string; + + /** LanguageInfo resolvedLanguageCode. */ + public resolvedLanguageCode: string; + + /** LanguageInfo confidenceScore. */ + public confidenceScore: number; + + /** + * Creates a new LanguageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ILanguageInfo): google.cloud.dialogflow.cx.v3.LanguageInfo; + + /** + * Encodes the specified LanguageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LanguageInfo.verify|verify} messages. + * @param message LanguageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ILanguageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LanguageInfo.verify|verify} messages. + * @param message LanguageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ILanguageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageInfo + * @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.dialogflow.cx.v3.LanguageInfo; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageInfo + * @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.dialogflow.cx.v3.LanguageInfo; + + /** + * Verifies a LanguageInfo 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 LanguageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.LanguageInfo; + + /** + * Creates a plain object from a LanguageInfo message. Also converts values to other types if specified. + * @param message LanguageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.LanguageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Examples */ + class Examples extends $protobuf.rpc.Service { + + /** + * Constructs a new Examples service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Examples service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Examples; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public createExample(request: google.cloud.dialogflow.cx.v3.ICreateExampleRequest, callback: google.cloud.dialogflow.cx.v3.Examples.CreateExampleCallback): void; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @returns Promise + */ + public createExample(request: google.cloud.dialogflow.cx.v3.ICreateExampleRequest): Promise; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExample(request: google.cloud.dialogflow.cx.v3.IDeleteExampleRequest, callback: google.cloud.dialogflow.cx.v3.Examples.DeleteExampleCallback): void; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @returns Promise + */ + public deleteExample(request: google.cloud.dialogflow.cx.v3.IDeleteExampleRequest): Promise; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExamplesResponse + */ + public listExamples(request: google.cloud.dialogflow.cx.v3.IListExamplesRequest, callback: google.cloud.dialogflow.cx.v3.Examples.ListExamplesCallback): void; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @returns Promise + */ + public listExamples(request: google.cloud.dialogflow.cx.v3.IListExamplesRequest): Promise; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public getExample(request: google.cloud.dialogflow.cx.v3.IGetExampleRequest, callback: google.cloud.dialogflow.cx.v3.Examples.GetExampleCallback): void; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @returns Promise + */ + public getExample(request: google.cloud.dialogflow.cx.v3.IGetExampleRequest): Promise; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public updateExample(request: google.cloud.dialogflow.cx.v3.IUpdateExampleRequest, callback: google.cloud.dialogflow.cx.v3.Examples.UpdateExampleCallback): void; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @returns Promise + */ + public updateExample(request: google.cloud.dialogflow.cx.v3.IUpdateExampleRequest): Promise; + } + + namespace Examples { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|createExample}. + * @param error Error, if any + * @param [response] Example + */ + type CreateExampleCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Example) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|deleteExample}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExampleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|listExamples}. + * @param error Error, if any + * @param [response] ListExamplesResponse + */ + type ListExamplesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListExamplesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|getExample}. + * @param error Error, if any + * @param [response] Example + */ + type GetExampleCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Example) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|updateExample}. + * @param error Error, if any + * @param [response] Example + */ + type UpdateExampleCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Example) => void; + } + + /** Properties of a CreateExampleRequest. */ + interface ICreateExampleRequest { + + /** CreateExampleRequest parent */ + parent?: (string|null); + + /** CreateExampleRequest example */ + example?: (google.cloud.dialogflow.cx.v3.IExample|null); + } + + /** Represents a CreateExampleRequest. */ + class CreateExampleRequest implements ICreateExampleRequest { + + /** + * Constructs a new CreateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateExampleRequest); + + /** CreateExampleRequest parent. */ + public parent: string; + + /** CreateExampleRequest example. */ + public example?: (google.cloud.dialogflow.cx.v3.IExample|null); + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateExampleRequest): google.cloud.dialogflow.cx.v3.CreateExampleRequest; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExampleRequest + * @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.dialogflow.cx.v3.CreateExampleRequest; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExampleRequest + * @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.dialogflow.cx.v3.CreateExampleRequest; + + /** + * Verifies a CreateExampleRequest 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 CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateExampleRequest; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @param message CreateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExampleRequest. */ + interface IDeleteExampleRequest { + + /** DeleteExampleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteExampleRequest. */ + class DeleteExampleRequest implements IDeleteExampleRequest { + + /** + * Constructs a new DeleteExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteExampleRequest); + + /** DeleteExampleRequest name. */ + public name: string; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteExampleRequest): google.cloud.dialogflow.cx.v3.DeleteExampleRequest; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExampleRequest + * @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.dialogflow.cx.v3.DeleteExampleRequest; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExampleRequest + * @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.dialogflow.cx.v3.DeleteExampleRequest; + + /** + * Verifies a DeleteExampleRequest 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 DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteExampleRequest; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @param message DeleteExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesRequest. */ + interface IListExamplesRequest { + + /** ListExamplesRequest parent */ + parent?: (string|null); + + /** ListExamplesRequest pageSize */ + pageSize?: (number|null); + + /** ListExamplesRequest pageToken */ + pageToken?: (string|null); + + /** ListExamplesRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListExamplesRequest. */ + class ListExamplesRequest implements IListExamplesRequest { + + /** + * Constructs a new ListExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListExamplesRequest); + + /** ListExamplesRequest parent. */ + public parent: string; + + /** ListExamplesRequest pageSize. */ + public pageSize: number; + + /** ListExamplesRequest pageToken. */ + public pageToken: string; + + /** ListExamplesRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListExamplesRequest): google.cloud.dialogflow.cx.v3.ListExamplesRequest; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesRequest + * @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.dialogflow.cx.v3.ListExamplesRequest; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesRequest + * @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.dialogflow.cx.v3.ListExamplesRequest; + + /** + * Verifies a ListExamplesRequest 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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListExamplesRequest; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @param message ListExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesResponse. */ + interface IListExamplesResponse { + + /** ListExamplesResponse examples */ + examples?: (google.cloud.dialogflow.cx.v3.IExample[]|null); + + /** ListExamplesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExamplesResponse. */ + class ListExamplesResponse implements IListExamplesResponse { + + /** + * Constructs a new ListExamplesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListExamplesResponse); + + /** ListExamplesResponse examples. */ + public examples: google.cloud.dialogflow.cx.v3.IExample[]; + + /** ListExamplesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListExamplesResponse): google.cloud.dialogflow.cx.v3.ListExamplesResponse; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesResponse + * @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.dialogflow.cx.v3.ListExamplesResponse; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesResponse + * @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.dialogflow.cx.v3.ListExamplesResponse; + + /** + * Verifies a ListExamplesResponse 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 ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListExamplesResponse; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @param message ListExamplesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExampleRequest. */ + interface IGetExampleRequest { + + /** GetExampleRequest name */ + name?: (string|null); + } + + /** Represents a GetExampleRequest. */ + class GetExampleRequest implements IGetExampleRequest { + + /** + * Constructs a new GetExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetExampleRequest); + + /** GetExampleRequest name. */ + public name: string; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetExampleRequest): google.cloud.dialogflow.cx.v3.GetExampleRequest; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExampleRequest + * @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.dialogflow.cx.v3.GetExampleRequest; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExampleRequest + * @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.dialogflow.cx.v3.GetExampleRequest; + + /** + * Verifies a GetExampleRequest 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 GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetExampleRequest; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @param message GetExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExampleRequest. */ + interface IUpdateExampleRequest { + + /** UpdateExampleRequest example */ + example?: (google.cloud.dialogflow.cx.v3.IExample|null); + + /** UpdateExampleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExampleRequest. */ + class UpdateExampleRequest implements IUpdateExampleRequest { + + /** + * Constructs a new UpdateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateExampleRequest); + + /** UpdateExampleRequest example. */ + public example?: (google.cloud.dialogflow.cx.v3.IExample|null); + + /** UpdateExampleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateExampleRequest): google.cloud.dialogflow.cx.v3.UpdateExampleRequest; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExampleRequest + * @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.dialogflow.cx.v3.UpdateExampleRequest; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExampleRequest + * @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.dialogflow.cx.v3.UpdateExampleRequest; + + /** + * Verifies an UpdateExampleRequest 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 UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateExampleRequest; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @param message UpdateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example name */ + name?: (string|null); + + /** Example playbookInput */ + playbookInput?: (google.cloud.dialogflow.cx.v3.IPlaybookInput|null); + + /** Example playbookOutput */ + playbookOutput?: (google.cloud.dialogflow.cx.v3.IPlaybookOutput|null); + + /** Example actions */ + actions?: (google.cloud.dialogflow.cx.v3.IAction[]|null); + + /** Example displayName */ + displayName?: (string|null); + + /** Example description */ + description?: (string|null); + + /** Example tokenCount */ + tokenCount?: (number|Long|string|null); + + /** Example createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Example conversationState */ + conversationState?: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState|null); + + /** Example languageCode */ + languageCode?: (string|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExample); + + /** Example name. */ + public name: string; + + /** Example playbookInput. */ + public playbookInput?: (google.cloud.dialogflow.cx.v3.IPlaybookInput|null); + + /** Example playbookOutput. */ + public playbookOutput?: (google.cloud.dialogflow.cx.v3.IPlaybookOutput|null); + + /** Example actions. */ + public actions: google.cloud.dialogflow.cx.v3.IAction[]; + + /** Example displayName. */ + public displayName: string; + + /** Example description. */ + public description: string; + + /** Example tokenCount. */ + public tokenCount: (number|Long|string); + + /** Example createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Example conversationState. */ + public conversationState: (google.cloud.dialogflow.cx.v3.OutputState|keyof typeof google.cloud.dialogflow.cx.v3.OutputState); + + /** Example languageCode. */ + public languageCode: string; + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExample): google.cloud.dialogflow.cx.v3.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @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.dialogflow.cx.v3.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @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.dialogflow.cx.v3.Example; + + /** + * Verifies an Example 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 Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Experiments */ + class Experiments extends $protobuf.rpc.Service { + + /** + * Constructs a new Experiments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Experiments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Experiments; + + /** + * Calls ListExperiments. + * @param request ListExperimentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExperimentsResponse + */ + public listExperiments(request: google.cloud.dialogflow.cx.v3.IListExperimentsRequest, callback: google.cloud.dialogflow.cx.v3.Experiments.ListExperimentsCallback): void; + + /** + * Calls ListExperiments. + * @param request ListExperimentsRequest message or plain object + * @returns Promise + */ + public listExperiments(request: google.cloud.dialogflow.cx.v3.IListExperimentsRequest): Promise; + + /** + * Calls GetExperiment. + * @param request GetExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public getExperiment(request: google.cloud.dialogflow.cx.v3.IGetExperimentRequest, callback: google.cloud.dialogflow.cx.v3.Experiments.GetExperimentCallback): void; + + /** + * Calls GetExperiment. + * @param request GetExperimentRequest message or plain object + * @returns Promise + */ + public getExperiment(request: google.cloud.dialogflow.cx.v3.IGetExperimentRequest): Promise; + + /** + * Calls CreateExperiment. + * @param request CreateExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public createExperiment(request: google.cloud.dialogflow.cx.v3.ICreateExperimentRequest, callback: google.cloud.dialogflow.cx.v3.Experiments.CreateExperimentCallback): void; + + /** + * Calls CreateExperiment. + * @param request CreateExperimentRequest message or plain object + * @returns Promise + */ + public createExperiment(request: google.cloud.dialogflow.cx.v3.ICreateExperimentRequest): Promise; + + /** + * Calls UpdateExperiment. + * @param request UpdateExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public updateExperiment(request: google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest, callback: google.cloud.dialogflow.cx.v3.Experiments.UpdateExperimentCallback): void; + + /** + * Calls UpdateExperiment. + * @param request UpdateExperimentRequest message or plain object + * @returns Promise + */ + public updateExperiment(request: google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest): Promise; + + /** + * Calls DeleteExperiment. + * @param request DeleteExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExperiment(request: google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest, callback: google.cloud.dialogflow.cx.v3.Experiments.DeleteExperimentCallback): void; + + /** + * Calls DeleteExperiment. + * @param request DeleteExperimentRequest message or plain object + * @returns Promise + */ + public deleteExperiment(request: google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest): Promise; + + /** + * Calls StartExperiment. + * @param request StartExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public startExperiment(request: google.cloud.dialogflow.cx.v3.IStartExperimentRequest, callback: google.cloud.dialogflow.cx.v3.Experiments.StartExperimentCallback): void; + + /** + * Calls StartExperiment. + * @param request StartExperimentRequest message or plain object + * @returns Promise + */ + public startExperiment(request: google.cloud.dialogflow.cx.v3.IStartExperimentRequest): Promise; + + /** + * Calls StopExperiment. + * @param request StopExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public stopExperiment(request: google.cloud.dialogflow.cx.v3.IStopExperimentRequest, callback: google.cloud.dialogflow.cx.v3.Experiments.StopExperimentCallback): void; + + /** + * Calls StopExperiment. + * @param request StopExperimentRequest message or plain object + * @returns Promise + */ + public stopExperiment(request: google.cloud.dialogflow.cx.v3.IStopExperimentRequest): Promise; + } + + namespace Experiments { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|listExperiments}. + * @param error Error, if any + * @param [response] ListExperimentsResponse + */ + type ListExperimentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListExperimentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|getExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type GetExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|createExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type CreateExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|updateExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type UpdateExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|deleteExperiment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExperimentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|startExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type StartExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|stopExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type StopExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Experiment) => void; + } + + /** Properties of an Experiment. */ + interface IExperiment { + + /** Experiment name */ + name?: (string|null); + + /** Experiment displayName */ + displayName?: (string|null); + + /** Experiment description */ + description?: (string|null); + + /** Experiment state */ + state?: (google.cloud.dialogflow.cx.v3.Experiment.State|keyof typeof google.cloud.dialogflow.cx.v3.Experiment.State|null); + + /** Experiment definition */ + definition?: (google.cloud.dialogflow.cx.v3.Experiment.IDefinition|null); + + /** Experiment rolloutConfig */ + rolloutConfig?: (google.cloud.dialogflow.cx.v3.IRolloutConfig|null); + + /** Experiment rolloutState */ + rolloutState?: (google.cloud.dialogflow.cx.v3.IRolloutState|null); + + /** Experiment rolloutFailureReason */ + rolloutFailureReason?: (string|null); + + /** Experiment result */ + result?: (google.cloud.dialogflow.cx.v3.Experiment.IResult|null); + + /** Experiment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Experiment startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Experiment endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Experiment lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Experiment experimentLength */ + experimentLength?: (google.protobuf.IDuration|null); + + /** Experiment variantsHistory */ + variantsHistory?: (google.cloud.dialogflow.cx.v3.IVariantsHistory[]|null); + } + + /** Represents an Experiment. */ + class Experiment implements IExperiment { + + /** + * Constructs a new Experiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExperiment); + + /** Experiment name. */ + public name: string; + + /** Experiment displayName. */ + public displayName: string; + + /** Experiment description. */ + public description: string; + + /** Experiment state. */ + public state: (google.cloud.dialogflow.cx.v3.Experiment.State|keyof typeof google.cloud.dialogflow.cx.v3.Experiment.State); + + /** Experiment definition. */ + public definition?: (google.cloud.dialogflow.cx.v3.Experiment.IDefinition|null); + + /** Experiment rolloutConfig. */ + public rolloutConfig?: (google.cloud.dialogflow.cx.v3.IRolloutConfig|null); + + /** Experiment rolloutState. */ + public rolloutState?: (google.cloud.dialogflow.cx.v3.IRolloutState|null); + + /** Experiment rolloutFailureReason. */ + public rolloutFailureReason: string; + + /** Experiment result. */ + public result?: (google.cloud.dialogflow.cx.v3.Experiment.IResult|null); + + /** Experiment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Experiment startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Experiment endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Experiment lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Experiment experimentLength. */ + public experimentLength?: (google.protobuf.IDuration|null); + + /** Experiment variantsHistory. */ + public variantsHistory: google.cloud.dialogflow.cx.v3.IVariantsHistory[]; + + /** + * Creates a new Experiment instance using the specified properties. + * @param [properties] Properties to set + * @returns Experiment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExperiment): google.cloud.dialogflow.cx.v3.Experiment; + + /** + * Encodes the specified Experiment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.verify|verify} messages. + * @param message Experiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Experiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.verify|verify} messages. + * @param message Experiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Experiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Experiment + * @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.dialogflow.cx.v3.Experiment; + + /** + * Decodes an Experiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Experiment + * @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.dialogflow.cx.v3.Experiment; + + /** + * Verifies an Experiment 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 Experiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Experiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Experiment; + + /** + * Creates a plain object from an Experiment message. Also converts values to other types if specified. + * @param message Experiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Experiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Experiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Experiment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Experiment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + DRAFT = 1, + RUNNING = 2, + DONE = 3, + ROLLOUT_FAILED = 4 + } + + /** Properties of a Definition. */ + interface IDefinition { + + /** Definition condition */ + condition?: (string|null); + + /** Definition versionVariants */ + versionVariants?: (google.cloud.dialogflow.cx.v3.IVersionVariants|null); + } + + /** Represents a Definition. */ + class Definition implements IDefinition { + + /** + * Constructs a new Definition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Experiment.IDefinition); + + /** Definition condition. */ + public condition: string; + + /** Definition versionVariants. */ + public versionVariants?: (google.cloud.dialogflow.cx.v3.IVersionVariants|null); + + /** Definition variants. */ + public variants?: "versionVariants"; + + /** + * Creates a new Definition instance using the specified properties. + * @param [properties] Properties to set + * @returns Definition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Experiment.IDefinition): google.cloud.dialogflow.cx.v3.Experiment.Definition; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Experiment.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Experiment.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Definition + * @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.dialogflow.cx.v3.Experiment.Definition; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Definition + * @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.dialogflow.cx.v3.Experiment.Definition; + + /** + * Verifies a Definition 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 Definition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Definition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Experiment.Definition; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @param message Definition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Experiment.Definition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Definition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Definition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Result. */ + interface IResult { + + /** Result versionMetrics */ + versionMetrics?: (google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics[]|null); + + /** Result lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Experiment.IResult); + + /** Result versionMetrics. */ + public versionMetrics: google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics[]; + + /** Result lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Experiment.IResult): google.cloud.dialogflow.cx.v3.Experiment.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Experiment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Experiment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @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.dialogflow.cx.v3.Experiment.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @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.dialogflow.cx.v3.Experiment.Result; + + /** + * Verifies a Result 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 Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Experiment.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Experiment.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Result + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Result { + + /** MetricType enum. */ + enum MetricType { + METRIC_UNSPECIFIED = 0, + CONTAINED_SESSION_NO_CALLBACK_RATE = 1, + LIVE_AGENT_HANDOFF_RATE = 2, + CALLBACK_SESSION_RATE = 3, + ABANDONED_SESSION_RATE = 4, + SESSION_END_RATE = 5 + } + + /** CountType enum. */ + enum CountType { + COUNT_TYPE_UNSPECIFIED = 0, + TOTAL_NO_MATCH_COUNT = 1, + TOTAL_TURN_COUNT = 2, + AVERAGE_TURN_COUNT = 3 + } + + /** Properties of a ConfidenceInterval. */ + interface IConfidenceInterval { + + /** ConfidenceInterval confidenceLevel */ + confidenceLevel?: (number|null); + + /** ConfidenceInterval ratio */ + ratio?: (number|null); + + /** ConfidenceInterval lowerBound */ + lowerBound?: (number|null); + + /** ConfidenceInterval upperBound */ + upperBound?: (number|null); + } + + /** Represents a ConfidenceInterval. */ + class ConfidenceInterval implements IConfidenceInterval { + + /** + * Constructs a new ConfidenceInterval. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval); + + /** ConfidenceInterval confidenceLevel. */ + public confidenceLevel: number; + + /** ConfidenceInterval ratio. */ + public ratio: number; + + /** ConfidenceInterval lowerBound. */ + public lowerBound: number; + + /** ConfidenceInterval upperBound. */ + public upperBound: number; + + /** + * Creates a new ConfidenceInterval instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceInterval instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval): google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval; + + /** + * Encodes the specified ConfidenceInterval message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @param message ConfidenceInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceInterval message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @param message ConfidenceInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceInterval + * @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.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceInterval + * @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.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval; + + /** + * Verifies a ConfidenceInterval 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 ConfidenceInterval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceInterval + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval; + + /** + * Creates a plain object from a ConfidenceInterval message. Also converts values to other types if specified. + * @param message ConfidenceInterval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceInterval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceInterval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metric. */ + interface IMetric { + + /** Metric type */ + type?: (google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType|keyof typeof google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType|null); + + /** Metric countType */ + countType?: (google.cloud.dialogflow.cx.v3.Experiment.Result.CountType|keyof typeof google.cloud.dialogflow.cx.v3.Experiment.Result.CountType|null); + + /** Metric ratio */ + ratio?: (number|null); + + /** Metric count */ + count?: (number|null); + + /** Metric confidenceInterval */ + confidenceInterval?: (google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric); + + /** Metric type. */ + public type: (google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType|keyof typeof google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType); + + /** Metric countType. */ + public countType: (google.cloud.dialogflow.cx.v3.Experiment.Result.CountType|keyof typeof google.cloud.dialogflow.cx.v3.Experiment.Result.CountType); + + /** Metric ratio. */ + public ratio?: (number|null); + + /** Metric count. */ + public count?: (number|null); + + /** Metric confidenceInterval. */ + public confidenceInterval?: (google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval|null); + + /** Metric value. */ + public value?: ("ratio"|"count"); + + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric): google.cloud.dialogflow.cx.v3.Experiment.Result.Metric; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @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.dialogflow.cx.v3.Experiment.Result.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @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.dialogflow.cx.v3.Experiment.Result.Metric; + + /** + * Verifies a Metric 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 Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Experiment.Result.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Experiment.Result.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VersionMetrics. */ + interface IVersionMetrics { + + /** VersionMetrics version */ + version?: (string|null); + + /** VersionMetrics metrics */ + metrics?: (google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric[]|null); + + /** VersionMetrics sessionCount */ + sessionCount?: (number|null); + } + + /** Represents a VersionMetrics. */ + class VersionMetrics implements IVersionMetrics { + + /** + * Constructs a new VersionMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics); + + /** VersionMetrics version. */ + public version: string; + + /** VersionMetrics metrics. */ + public metrics: google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric[]; + + /** VersionMetrics sessionCount. */ + public sessionCount: number; + + /** + * Creates a new VersionMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionMetrics instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics): google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics; + + /** + * Encodes the specified VersionMetrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.verify|verify} messages. + * @param message VersionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionMetrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.verify|verify} messages. + * @param message VersionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionMetrics + * @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.dialogflow.cx.v3.Experiment.Result.VersionMetrics; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionMetrics + * @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.dialogflow.cx.v3.Experiment.Result.VersionMetrics; + + /** + * Verifies a VersionMetrics 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 VersionMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics; + + /** + * Creates a plain object from a VersionMetrics message. Also converts values to other types if specified. + * @param message VersionMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a VersionVariants. */ + interface IVersionVariants { + + /** VersionVariants variants */ + variants?: (google.cloud.dialogflow.cx.v3.VersionVariants.IVariant[]|null); + } + + /** Represents a VersionVariants. */ + class VersionVariants implements IVersionVariants { + + /** + * Constructs a new VersionVariants. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IVersionVariants); + + /** VersionVariants variants. */ + public variants: google.cloud.dialogflow.cx.v3.VersionVariants.IVariant[]; + + /** + * Creates a new VersionVariants instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionVariants instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IVersionVariants): google.cloud.dialogflow.cx.v3.VersionVariants; + + /** + * Encodes the specified VersionVariants message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.verify|verify} messages. + * @param message VersionVariants message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IVersionVariants, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionVariants message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.verify|verify} messages. + * @param message VersionVariants message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IVersionVariants, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionVariants message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionVariants + * @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.dialogflow.cx.v3.VersionVariants; + + /** + * Decodes a VersionVariants message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionVariants + * @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.dialogflow.cx.v3.VersionVariants; + + /** + * Verifies a VersionVariants 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 VersionVariants message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionVariants + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.VersionVariants; + + /** + * Creates a plain object from a VersionVariants message. Also converts values to other types if specified. + * @param message VersionVariants + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.VersionVariants, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionVariants to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionVariants + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VersionVariants { + + /** Properties of a Variant. */ + interface IVariant { + + /** Variant version */ + version?: (string|null); + + /** Variant trafficAllocation */ + trafficAllocation?: (number|null); + + /** Variant isControlGroup */ + isControlGroup?: (boolean|null); + } + + /** Represents a Variant. */ + class Variant implements IVariant { + + /** + * Constructs a new Variant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.VersionVariants.IVariant); + + /** Variant version. */ + public version: string; + + /** Variant trafficAllocation. */ + public trafficAllocation: number; + + /** Variant isControlGroup. */ + public isControlGroup: boolean; + + /** + * Creates a new Variant instance using the specified properties. + * @param [properties] Properties to set + * @returns Variant instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.VersionVariants.IVariant): google.cloud.dialogflow.cx.v3.VersionVariants.Variant; + + /** + * Encodes the specified Variant message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.Variant.verify|verify} messages. + * @param message Variant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.VersionVariants.IVariant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Variant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.Variant.verify|verify} messages. + * @param message Variant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.VersionVariants.IVariant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Variant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Variant + * @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.dialogflow.cx.v3.VersionVariants.Variant; + + /** + * Decodes a Variant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Variant + * @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.dialogflow.cx.v3.VersionVariants.Variant; + + /** + * Verifies a Variant 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 Variant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Variant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.VersionVariants.Variant; + + /** + * Creates a plain object from a Variant message. Also converts values to other types if specified. + * @param message Variant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.VersionVariants.Variant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Variant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Variant + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a VariantsHistory. */ + interface IVariantsHistory { + + /** VariantsHistory versionVariants */ + versionVariants?: (google.cloud.dialogflow.cx.v3.IVersionVariants|null); + + /** VariantsHistory updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a VariantsHistory. */ + class VariantsHistory implements IVariantsHistory { + + /** + * Constructs a new VariantsHistory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IVariantsHistory); + + /** VariantsHistory versionVariants. */ + public versionVariants?: (google.cloud.dialogflow.cx.v3.IVersionVariants|null); + + /** VariantsHistory updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VariantsHistory variants. */ + public variants?: "versionVariants"; + + /** + * Creates a new VariantsHistory instance using the specified properties. + * @param [properties] Properties to set + * @returns VariantsHistory instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IVariantsHistory): google.cloud.dialogflow.cx.v3.VariantsHistory; + + /** + * Encodes the specified VariantsHistory message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VariantsHistory.verify|verify} messages. + * @param message VariantsHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IVariantsHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VariantsHistory message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VariantsHistory.verify|verify} messages. + * @param message VariantsHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IVariantsHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VariantsHistory + * @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.dialogflow.cx.v3.VariantsHistory; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VariantsHistory + * @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.dialogflow.cx.v3.VariantsHistory; + + /** + * Verifies a VariantsHistory 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 VariantsHistory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VariantsHistory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.VariantsHistory; + + /** + * Creates a plain object from a VariantsHistory message. Also converts values to other types if specified. + * @param message VariantsHistory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.VariantsHistory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VariantsHistory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VariantsHistory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RolloutConfig. */ + interface IRolloutConfig { + + /** RolloutConfig rolloutSteps */ + rolloutSteps?: (google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep[]|null); + + /** RolloutConfig rolloutCondition */ + rolloutCondition?: (string|null); + + /** RolloutConfig failureCondition */ + failureCondition?: (string|null); + } + + /** Represents a RolloutConfig. */ + class RolloutConfig implements IRolloutConfig { + + /** + * Constructs a new RolloutConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRolloutConfig); + + /** RolloutConfig rolloutSteps. */ + public rolloutSteps: google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep[]; + + /** RolloutConfig rolloutCondition. */ + public rolloutCondition: string; + + /** RolloutConfig failureCondition. */ + public failureCondition: string; + + /** + * Creates a new RolloutConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRolloutConfig): google.cloud.dialogflow.cx.v3.RolloutConfig; + + /** + * Encodes the specified RolloutConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.verify|verify} messages. + * @param message RolloutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRolloutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.verify|verify} messages. + * @param message RolloutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRolloutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutConfig + * @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.dialogflow.cx.v3.RolloutConfig; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutConfig + * @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.dialogflow.cx.v3.RolloutConfig; + + /** + * Verifies a RolloutConfig 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 RolloutConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RolloutConfig; + + /** + * Creates a plain object from a RolloutConfig message. Also converts values to other types if specified. + * @param message RolloutConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RolloutConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RolloutConfig { + + /** Properties of a RolloutStep. */ + interface IRolloutStep { + + /** RolloutStep displayName */ + displayName?: (string|null); + + /** RolloutStep trafficPercent */ + trafficPercent?: (number|null); + + /** RolloutStep minDuration */ + minDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a RolloutStep. */ + class RolloutStep implements IRolloutStep { + + /** + * Constructs a new RolloutStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep); + + /** RolloutStep displayName. */ + public displayName: string; + + /** RolloutStep trafficPercent. */ + public trafficPercent: number; + + /** RolloutStep minDuration. */ + public minDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RolloutStep instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutStep instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep): google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep; + + /** + * Encodes the specified RolloutStep message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.verify|verify} messages. + * @param message RolloutStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutStep message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.verify|verify} messages. + * @param message RolloutStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutStep + * @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.dialogflow.cx.v3.RolloutConfig.RolloutStep; + + /** + * Decodes a RolloutStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutStep + * @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.dialogflow.cx.v3.RolloutConfig.RolloutStep; + + /** + * Verifies a RolloutStep 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 RolloutStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutStep + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep; + + /** + * Creates a plain object from a RolloutStep message. Also converts values to other types if specified. + * @param message RolloutStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RolloutState. */ + interface IRolloutState { + + /** RolloutState step */ + step?: (string|null); + + /** RolloutState stepIndex */ + stepIndex?: (number|null); + + /** RolloutState startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RolloutState. */ + class RolloutState implements IRolloutState { + + /** + * Constructs a new RolloutState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRolloutState); + + /** RolloutState step. */ + public step: string; + + /** RolloutState stepIndex. */ + public stepIndex: number; + + /** RolloutState startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RolloutState instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutState instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRolloutState): google.cloud.dialogflow.cx.v3.RolloutState; + + /** + * Encodes the specified RolloutState message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutState.verify|verify} messages. + * @param message RolloutState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRolloutState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutState message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutState.verify|verify} messages. + * @param message RolloutState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRolloutState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutState + * @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.dialogflow.cx.v3.RolloutState; + + /** + * Decodes a RolloutState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutState + * @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.dialogflow.cx.v3.RolloutState; + + /** + * Verifies a RolloutState 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 RolloutState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RolloutState; + + /** + * Creates a plain object from a RolloutState message. Also converts values to other types if specified. + * @param message RolloutState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RolloutState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExperimentsRequest. */ + interface IListExperimentsRequest { + + /** ListExperimentsRequest parent */ + parent?: (string|null); + + /** ListExperimentsRequest pageSize */ + pageSize?: (number|null); + + /** ListExperimentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListExperimentsRequest. */ + class ListExperimentsRequest implements IListExperimentsRequest { + + /** + * Constructs a new ListExperimentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListExperimentsRequest); + + /** ListExperimentsRequest parent. */ + public parent: string; + + /** ListExperimentsRequest pageSize. */ + public pageSize: number; + + /** ListExperimentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListExperimentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExperimentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListExperimentsRequest): google.cloud.dialogflow.cx.v3.ListExperimentsRequest; + + /** + * Encodes the specified ListExperimentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsRequest.verify|verify} messages. + * @param message ListExperimentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsRequest.verify|verify} messages. + * @param message ListExperimentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExperimentsRequest + * @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.dialogflow.cx.v3.ListExperimentsRequest; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExperimentsRequest + * @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.dialogflow.cx.v3.ListExperimentsRequest; + + /** + * Verifies a ListExperimentsRequest 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 ListExperimentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExperimentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListExperimentsRequest; + + /** + * Creates a plain object from a ListExperimentsRequest message. Also converts values to other types if specified. + * @param message ListExperimentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListExperimentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExperimentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExperimentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExperimentsResponse. */ + interface IListExperimentsResponse { + + /** ListExperimentsResponse experiments */ + experiments?: (google.cloud.dialogflow.cx.v3.IExperiment[]|null); + + /** ListExperimentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExperimentsResponse. */ + class ListExperimentsResponse implements IListExperimentsResponse { + + /** + * Constructs a new ListExperimentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListExperimentsResponse); + + /** ListExperimentsResponse experiments. */ + public experiments: google.cloud.dialogflow.cx.v3.IExperiment[]; + + /** ListExperimentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExperimentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExperimentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListExperimentsResponse): google.cloud.dialogflow.cx.v3.ListExperimentsResponse; + + /** + * Encodes the specified ListExperimentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsResponse.verify|verify} messages. + * @param message ListExperimentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsResponse.verify|verify} messages. + * @param message ListExperimentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExperimentsResponse + * @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.dialogflow.cx.v3.ListExperimentsResponse; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExperimentsResponse + * @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.dialogflow.cx.v3.ListExperimentsResponse; + + /** + * Verifies a ListExperimentsResponse 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 ListExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExperimentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListExperimentsResponse; + + /** + * Creates a plain object from a ListExperimentsResponse message. Also converts values to other types if specified. + * @param message ListExperimentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListExperimentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExperimentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExperimentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExperimentRequest. */ + interface IGetExperimentRequest { + + /** GetExperimentRequest name */ + name?: (string|null); + } + + /** Represents a GetExperimentRequest. */ + class GetExperimentRequest implements IGetExperimentRequest { + + /** + * Constructs a new GetExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetExperimentRequest); + + /** GetExperimentRequest name. */ + public name: string; + + /** + * Creates a new GetExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetExperimentRequest): google.cloud.dialogflow.cx.v3.GetExperimentRequest; + + /** + * Encodes the specified GetExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExperimentRequest.verify|verify} messages. + * @param message GetExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExperimentRequest.verify|verify} messages. + * @param message GetExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExperimentRequest + * @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.dialogflow.cx.v3.GetExperimentRequest; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExperimentRequest + * @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.dialogflow.cx.v3.GetExperimentRequest; + + /** + * Verifies a GetExperimentRequest 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 GetExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetExperimentRequest; + + /** + * Creates a plain object from a GetExperimentRequest message. Also converts values to other types if specified. + * @param message GetExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExperimentRequest. */ + interface ICreateExperimentRequest { + + /** CreateExperimentRequest parent */ + parent?: (string|null); + + /** CreateExperimentRequest experiment */ + experiment?: (google.cloud.dialogflow.cx.v3.IExperiment|null); + } + + /** Represents a CreateExperimentRequest. */ + class CreateExperimentRequest implements ICreateExperimentRequest { + + /** + * Constructs a new CreateExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateExperimentRequest); + + /** CreateExperimentRequest parent. */ + public parent: string; + + /** CreateExperimentRequest experiment. */ + public experiment?: (google.cloud.dialogflow.cx.v3.IExperiment|null); + + /** + * Creates a new CreateExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateExperimentRequest): google.cloud.dialogflow.cx.v3.CreateExperimentRequest; + + /** + * Encodes the specified CreateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExperimentRequest.verify|verify} messages. + * @param message CreateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExperimentRequest.verify|verify} messages. + * @param message CreateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExperimentRequest + * @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.dialogflow.cx.v3.CreateExperimentRequest; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExperimentRequest + * @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.dialogflow.cx.v3.CreateExperimentRequest; + + /** + * Verifies a CreateExperimentRequest 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 CreateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateExperimentRequest; + + /** + * Creates a plain object from a CreateExperimentRequest message. Also converts values to other types if specified. + * @param message CreateExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExperimentRequest. */ + interface IUpdateExperimentRequest { + + /** UpdateExperimentRequest experiment */ + experiment?: (google.cloud.dialogflow.cx.v3.IExperiment|null); + + /** UpdateExperimentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExperimentRequest. */ + class UpdateExperimentRequest implements IUpdateExperimentRequest { + + /** + * Constructs a new UpdateExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest); + + /** UpdateExperimentRequest experiment. */ + public experiment?: (google.cloud.dialogflow.cx.v3.IExperiment|null); + + /** UpdateExperimentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest): google.cloud.dialogflow.cx.v3.UpdateExperimentRequest; + + /** + * Encodes the specified UpdateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExperimentRequest.verify|verify} messages. + * @param message UpdateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExperimentRequest.verify|verify} messages. + * @param message UpdateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExperimentRequest + * @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.dialogflow.cx.v3.UpdateExperimentRequest; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExperimentRequest + * @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.dialogflow.cx.v3.UpdateExperimentRequest; + + /** + * Verifies an UpdateExperimentRequest 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 UpdateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateExperimentRequest; + + /** + * Creates a plain object from an UpdateExperimentRequest message. Also converts values to other types if specified. + * @param message UpdateExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExperimentRequest. */ + interface IDeleteExperimentRequest { + + /** DeleteExperimentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteExperimentRequest. */ + class DeleteExperimentRequest implements IDeleteExperimentRequest { + + /** + * Constructs a new DeleteExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest); + + /** DeleteExperimentRequest name. */ + public name: string; + + /** + * Creates a new DeleteExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest): google.cloud.dialogflow.cx.v3.DeleteExperimentRequest; + + /** + * Encodes the specified DeleteExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExperimentRequest.verify|verify} messages. + * @param message DeleteExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExperimentRequest.verify|verify} messages. + * @param message DeleteExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExperimentRequest + * @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.dialogflow.cx.v3.DeleteExperimentRequest; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExperimentRequest + * @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.dialogflow.cx.v3.DeleteExperimentRequest; + + /** + * Verifies a DeleteExperimentRequest 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 DeleteExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteExperimentRequest; + + /** + * Creates a plain object from a DeleteExperimentRequest message. Also converts values to other types if specified. + * @param message DeleteExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartExperimentRequest. */ + interface IStartExperimentRequest { + + /** StartExperimentRequest name */ + name?: (string|null); + } + + /** Represents a StartExperimentRequest. */ + class StartExperimentRequest implements IStartExperimentRequest { + + /** + * Constructs a new StartExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IStartExperimentRequest); + + /** StartExperimentRequest name. */ + public name: string; + + /** + * Creates a new StartExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IStartExperimentRequest): google.cloud.dialogflow.cx.v3.StartExperimentRequest; + + /** + * Encodes the specified StartExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StartExperimentRequest.verify|verify} messages. + * @param message StartExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IStartExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StartExperimentRequest.verify|verify} messages. + * @param message StartExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IStartExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartExperimentRequest + * @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.dialogflow.cx.v3.StartExperimentRequest; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartExperimentRequest + * @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.dialogflow.cx.v3.StartExperimentRequest; + + /** + * Verifies a StartExperimentRequest 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 StartExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.StartExperimentRequest; + + /** + * Creates a plain object from a StartExperimentRequest message. Also converts values to other types if specified. + * @param message StartExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.StartExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopExperimentRequest. */ + interface IStopExperimentRequest { + + /** StopExperimentRequest name */ + name?: (string|null); + } + + /** Represents a StopExperimentRequest. */ + class StopExperimentRequest implements IStopExperimentRequest { + + /** + * Constructs a new StopExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IStopExperimentRequest); + + /** StopExperimentRequest name. */ + public name: string; + + /** + * Creates a new StopExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IStopExperimentRequest): google.cloud.dialogflow.cx.v3.StopExperimentRequest; + + /** + * Encodes the specified StopExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StopExperimentRequest.verify|verify} messages. + * @param message StopExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IStopExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StopExperimentRequest.verify|verify} messages. + * @param message StopExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IStopExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopExperimentRequest + * @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.dialogflow.cx.v3.StopExperimentRequest; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopExperimentRequest + * @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.dialogflow.cx.v3.StopExperimentRequest; + + /** + * Verifies a StopExperimentRequest 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 StopExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.StopExperimentRequest; + + /** + * Creates a plain object from a StopExperimentRequest message. Also converts values to other types if specified. + * @param message StopExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.StopExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Generators */ + class Generators extends $protobuf.rpc.Service { + + /** + * Constructs a new Generators service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Generators service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Generators; + + /** + * Calls ListGenerators. + * @param request ListGeneratorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGeneratorsResponse + */ + public listGenerators(request: google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, callback: google.cloud.dialogflow.cx.v3.Generators.ListGeneratorsCallback): void; + + /** + * Calls ListGenerators. + * @param request ListGeneratorsRequest message or plain object + * @returns Promise + */ + public listGenerators(request: google.cloud.dialogflow.cx.v3.IListGeneratorsRequest): Promise; + + /** + * Calls GetGenerator. + * @param request GetGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Generator + */ + public getGenerator(request: google.cloud.dialogflow.cx.v3.IGetGeneratorRequest, callback: google.cloud.dialogflow.cx.v3.Generators.GetGeneratorCallback): void; + + /** + * Calls GetGenerator. + * @param request GetGeneratorRequest message or plain object + * @returns Promise + */ + public getGenerator(request: google.cloud.dialogflow.cx.v3.IGetGeneratorRequest): Promise; + + /** + * Calls CreateGenerator. + * @param request CreateGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Generator + */ + public createGenerator(request: google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest, callback: google.cloud.dialogflow.cx.v3.Generators.CreateGeneratorCallback): void; + + /** + * Calls CreateGenerator. + * @param request CreateGeneratorRequest message or plain object + * @returns Promise + */ + public createGenerator(request: google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest): Promise; + + /** + * Calls UpdateGenerator. + * @param request UpdateGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Generator + */ + public updateGenerator(request: google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest, callback: google.cloud.dialogflow.cx.v3.Generators.UpdateGeneratorCallback): void; + + /** + * Calls UpdateGenerator. + * @param request UpdateGeneratorRequest message or plain object + * @returns Promise + */ + public updateGenerator(request: google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest): Promise; + + /** + * Calls DeleteGenerator. + * @param request DeleteGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteGenerator(request: google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest, callback: google.cloud.dialogflow.cx.v3.Generators.DeleteGeneratorCallback): void; + + /** + * Calls DeleteGenerator. + * @param request DeleteGeneratorRequest message or plain object + * @returns Promise + */ + public deleteGenerator(request: google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest): Promise; + } + + namespace Generators { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|listGenerators}. + * @param error Error, if any + * @param [response] ListGeneratorsResponse + */ + type ListGeneratorsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListGeneratorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|getGenerator}. + * @param error Error, if any + * @param [response] Generator + */ + type GetGeneratorCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Generator) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|createGenerator}. + * @param error Error, if any + * @param [response] Generator + */ + type CreateGeneratorCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Generator) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|updateGenerator}. + * @param error Error, if any + * @param [response] Generator + */ + type UpdateGeneratorCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Generator) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|deleteGenerator}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteGeneratorCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Generator. */ + interface IGenerator { + + /** Generator name */ + name?: (string|null); + + /** Generator displayName */ + displayName?: (string|null); + + /** Generator promptText */ + promptText?: (google.cloud.dialogflow.cx.v3.IPhrase|null); + + /** Generator placeholders */ + placeholders?: (google.cloud.dialogflow.cx.v3.Generator.IPlaceholder[]|null); + + /** Generator llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + + /** Generator modelParameter */ + modelParameter?: (google.cloud.dialogflow.cx.v3.Generator.IModelParameter|null); + } + + /** Represents a Generator. */ + class Generator implements IGenerator { + + /** + * Constructs a new Generator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGenerator); + + /** Generator name. */ + public name: string; + + /** Generator displayName. */ + public displayName: string; + + /** Generator promptText. */ + public promptText?: (google.cloud.dialogflow.cx.v3.IPhrase|null); + + /** Generator placeholders. */ + public placeholders: google.cloud.dialogflow.cx.v3.Generator.IPlaceholder[]; + + /** Generator llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + + /** Generator modelParameter. */ + public modelParameter?: (google.cloud.dialogflow.cx.v3.Generator.IModelParameter|null); + + /** + * Creates a new Generator instance using the specified properties. + * @param [properties] Properties to set + * @returns Generator instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGenerator): google.cloud.dialogflow.cx.v3.Generator; + + /** + * Encodes the specified Generator message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.verify|verify} messages. + * @param message Generator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGenerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Generator message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.verify|verify} messages. + * @param message Generator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGenerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Generator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Generator + * @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.dialogflow.cx.v3.Generator; + + /** + * Decodes a Generator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Generator + * @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.dialogflow.cx.v3.Generator; + + /** + * Verifies a Generator 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 Generator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Generator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Generator; + + /** + * Creates a plain object from a Generator message. Also converts values to other types if specified. + * @param message Generator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Generator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Generator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Generator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Generator { + + /** Properties of a Placeholder. */ + interface IPlaceholder { + + /** Placeholder id */ + id?: (string|null); + + /** Placeholder name */ + name?: (string|null); + } + + /** Represents a Placeholder. */ + class Placeholder implements IPlaceholder { + + /** + * Constructs a new Placeholder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Generator.IPlaceholder); + + /** Placeholder id. */ + public id: string; + + /** Placeholder name. */ + public name: string; + + /** + * Creates a new Placeholder instance using the specified properties. + * @param [properties] Properties to set + * @returns Placeholder instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Generator.IPlaceholder): google.cloud.dialogflow.cx.v3.Generator.Placeholder; + + /** + * Encodes the specified Placeholder message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.Placeholder.verify|verify} messages. + * @param message Placeholder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Generator.IPlaceholder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Placeholder message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.Placeholder.verify|verify} messages. + * @param message Placeholder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Generator.IPlaceholder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Placeholder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Placeholder + * @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.dialogflow.cx.v3.Generator.Placeholder; + + /** + * Decodes a Placeholder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Placeholder + * @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.dialogflow.cx.v3.Generator.Placeholder; + + /** + * Verifies a Placeholder 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 Placeholder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Placeholder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Generator.Placeholder; + + /** + * Creates a plain object from a Placeholder message. Also converts values to other types if specified. + * @param message Placeholder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Generator.Placeholder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Placeholder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Placeholder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelParameter. */ + interface IModelParameter { + + /** ModelParameter temperature */ + temperature?: (number|null); + + /** ModelParameter maxDecodeSteps */ + maxDecodeSteps?: (number|null); + + /** ModelParameter topP */ + topP?: (number|null); + + /** ModelParameter topK */ + topK?: (number|null); + } + + /** Represents a ModelParameter. */ + class ModelParameter implements IModelParameter { + + /** + * Constructs a new ModelParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Generator.IModelParameter); + + /** ModelParameter temperature. */ + public temperature?: (number|null); + + /** ModelParameter maxDecodeSteps. */ + public maxDecodeSteps?: (number|null); + + /** ModelParameter topP. */ + public topP?: (number|null); + + /** ModelParameter topK. */ + public topK?: (number|null); + + /** + * Creates a new ModelParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelParameter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Generator.IModelParameter): google.cloud.dialogflow.cx.v3.Generator.ModelParameter; + + /** + * Encodes the specified ModelParameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.ModelParameter.verify|verify} messages. + * @param message ModelParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Generator.IModelParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelParameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.ModelParameter.verify|verify} messages. + * @param message ModelParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Generator.IModelParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelParameter + * @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.dialogflow.cx.v3.Generator.ModelParameter; + + /** + * Decodes a ModelParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelParameter + * @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.dialogflow.cx.v3.Generator.ModelParameter; + + /** + * Verifies a ModelParameter 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 ModelParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Generator.ModelParameter; + + /** + * Creates a plain object from a ModelParameter message. Also converts values to other types if specified. + * @param message ModelParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Generator.ModelParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase text */ + text?: (string|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPhrase); + + /** Phrase text. */ + public text: string; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPhrase): google.cloud.dialogflow.cx.v3.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @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.dialogflow.cx.v3.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @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.dialogflow.cx.v3.Phrase; + + /** + * Verifies a Phrase 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 Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGeneratorsRequest. */ + interface IListGeneratorsRequest { + + /** ListGeneratorsRequest parent */ + parent?: (string|null); + + /** ListGeneratorsRequest languageCode */ + languageCode?: (string|null); + + /** ListGeneratorsRequest pageSize */ + pageSize?: (number|null); + + /** ListGeneratorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListGeneratorsRequest. */ + class ListGeneratorsRequest implements IListGeneratorsRequest { + + /** + * Constructs a new ListGeneratorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListGeneratorsRequest); + + /** ListGeneratorsRequest parent. */ + public parent: string; + + /** ListGeneratorsRequest languageCode. */ + public languageCode: string; + + /** ListGeneratorsRequest pageSize. */ + public pageSize: number; + + /** ListGeneratorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListGeneratorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGeneratorsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListGeneratorsRequest): google.cloud.dialogflow.cx.v3.ListGeneratorsRequest; + + /** + * Encodes the specified ListGeneratorsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsRequest.verify|verify} messages. + * @param message ListGeneratorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGeneratorsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsRequest.verify|verify} messages. + * @param message ListGeneratorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGeneratorsRequest + * @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.dialogflow.cx.v3.ListGeneratorsRequest; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGeneratorsRequest + * @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.dialogflow.cx.v3.ListGeneratorsRequest; + + /** + * Verifies a ListGeneratorsRequest 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 ListGeneratorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGeneratorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListGeneratorsRequest; + + /** + * Creates a plain object from a ListGeneratorsRequest message. Also converts values to other types if specified. + * @param message ListGeneratorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListGeneratorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGeneratorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGeneratorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGeneratorsResponse. */ + interface IListGeneratorsResponse { + + /** ListGeneratorsResponse generators */ + generators?: (google.cloud.dialogflow.cx.v3.IGenerator[]|null); + + /** ListGeneratorsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGeneratorsResponse. */ + class ListGeneratorsResponse implements IListGeneratorsResponse { + + /** + * Constructs a new ListGeneratorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListGeneratorsResponse); + + /** ListGeneratorsResponse generators. */ + public generators: google.cloud.dialogflow.cx.v3.IGenerator[]; + + /** ListGeneratorsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGeneratorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGeneratorsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListGeneratorsResponse): google.cloud.dialogflow.cx.v3.ListGeneratorsResponse; + + /** + * Encodes the specified ListGeneratorsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsResponse.verify|verify} messages. + * @param message ListGeneratorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListGeneratorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGeneratorsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsResponse.verify|verify} messages. + * @param message ListGeneratorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListGeneratorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGeneratorsResponse + * @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.dialogflow.cx.v3.ListGeneratorsResponse; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGeneratorsResponse + * @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.dialogflow.cx.v3.ListGeneratorsResponse; + + /** + * Verifies a ListGeneratorsResponse 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 ListGeneratorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGeneratorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListGeneratorsResponse; + + /** + * Creates a plain object from a ListGeneratorsResponse message. Also converts values to other types if specified. + * @param message ListGeneratorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListGeneratorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGeneratorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGeneratorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGeneratorRequest. */ + interface IGetGeneratorRequest { + + /** GetGeneratorRequest name */ + name?: (string|null); + + /** GetGeneratorRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetGeneratorRequest. */ + class GetGeneratorRequest implements IGetGeneratorRequest { + + /** + * Constructs a new GetGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetGeneratorRequest); + + /** GetGeneratorRequest name. */ + public name: string; + + /** GetGeneratorRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetGeneratorRequest): google.cloud.dialogflow.cx.v3.GetGeneratorRequest; + + /** + * Encodes the specified GetGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGeneratorRequest.verify|verify} messages. + * @param message GetGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGeneratorRequest.verify|verify} messages. + * @param message GetGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGeneratorRequest + * @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.dialogflow.cx.v3.GetGeneratorRequest; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGeneratorRequest + * @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.dialogflow.cx.v3.GetGeneratorRequest; + + /** + * Verifies a GetGeneratorRequest 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 GetGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetGeneratorRequest; + + /** + * Creates a plain object from a GetGeneratorRequest message. Also converts values to other types if specified. + * @param message GetGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGeneratorRequest. */ + interface ICreateGeneratorRequest { + + /** CreateGeneratorRequest parent */ + parent?: (string|null); + + /** CreateGeneratorRequest generator */ + generator?: (google.cloud.dialogflow.cx.v3.IGenerator|null); + + /** CreateGeneratorRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateGeneratorRequest. */ + class CreateGeneratorRequest implements ICreateGeneratorRequest { + + /** + * Constructs a new CreateGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest); + + /** CreateGeneratorRequest parent. */ + public parent: string; + + /** CreateGeneratorRequest generator. */ + public generator?: (google.cloud.dialogflow.cx.v3.IGenerator|null); + + /** CreateGeneratorRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest): google.cloud.dialogflow.cx.v3.CreateGeneratorRequest; + + /** + * Encodes the specified CreateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateGeneratorRequest.verify|verify} messages. + * @param message CreateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateGeneratorRequest.verify|verify} messages. + * @param message CreateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGeneratorRequest + * @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.dialogflow.cx.v3.CreateGeneratorRequest; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGeneratorRequest + * @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.dialogflow.cx.v3.CreateGeneratorRequest; + + /** + * Verifies a CreateGeneratorRequest 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 CreateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateGeneratorRequest; + + /** + * Creates a plain object from a CreateGeneratorRequest message. Also converts values to other types if specified. + * @param message CreateGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGeneratorRequest. */ + interface IUpdateGeneratorRequest { + + /** UpdateGeneratorRequest generator */ + generator?: (google.cloud.dialogflow.cx.v3.IGenerator|null); + + /** UpdateGeneratorRequest languageCode */ + languageCode?: (string|null); + + /** UpdateGeneratorRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGeneratorRequest. */ + class UpdateGeneratorRequest implements IUpdateGeneratorRequest { + + /** + * Constructs a new UpdateGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest); + + /** UpdateGeneratorRequest generator. */ + public generator?: (google.cloud.dialogflow.cx.v3.IGenerator|null); + + /** UpdateGeneratorRequest languageCode. */ + public languageCode: string; + + /** UpdateGeneratorRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest): google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest; + + /** + * Encodes the specified UpdateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest.verify|verify} messages. + * @param message UpdateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest.verify|verify} messages. + * @param message UpdateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGeneratorRequest + * @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.dialogflow.cx.v3.UpdateGeneratorRequest; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGeneratorRequest + * @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.dialogflow.cx.v3.UpdateGeneratorRequest; + + /** + * Verifies an UpdateGeneratorRequest 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 UpdateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest; + + /** + * Creates a plain object from an UpdateGeneratorRequest message. Also converts values to other types if specified. + * @param message UpdateGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGeneratorRequest. */ + interface IDeleteGeneratorRequest { + + /** DeleteGeneratorRequest name */ + name?: (string|null); + + /** DeleteGeneratorRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteGeneratorRequest. */ + class DeleteGeneratorRequest implements IDeleteGeneratorRequest { + + /** + * Constructs a new DeleteGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest); + + /** DeleteGeneratorRequest name. */ + public name: string; + + /** DeleteGeneratorRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest): google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest; + + /** + * Encodes the specified DeleteGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest.verify|verify} messages. + * @param message DeleteGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest.verify|verify} messages. + * @param message DeleteGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGeneratorRequest + * @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.dialogflow.cx.v3.DeleteGeneratorRequest; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGeneratorRequest + * @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.dialogflow.cx.v3.DeleteGeneratorRequest; + + /** + * Verifies a DeleteGeneratorRequest 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 DeleteGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest; + + /** + * Creates a plain object from a DeleteGeneratorRequest message. Also converts values to other types if specified. + * @param message DeleteGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Playbooks */ + class Playbooks extends $protobuf.rpc.Service { + + /** + * Constructs a new Playbooks service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Playbooks service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Playbooks; + + /** + * Calls CreatePlaybook. + * @param request CreatePlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Playbook + */ + public createPlaybook(request: google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookCallback): void; + + /** + * Calls CreatePlaybook. + * @param request CreatePlaybookRequest message or plain object + * @returns Promise + */ + public createPlaybook(request: google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest): Promise; + + /** + * Calls DeletePlaybook. + * @param request DeletePlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePlaybook(request: google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookCallback): void; + + /** + * Calls DeletePlaybook. + * @param request DeletePlaybookRequest message or plain object + * @returns Promise + */ + public deletePlaybook(request: google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest): Promise; + + /** + * Calls ListPlaybooks. + * @param request ListPlaybooksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPlaybooksResponse + */ + public listPlaybooks(request: google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybooksCallback): void; + + /** + * Calls ListPlaybooks. + * @param request ListPlaybooksRequest message or plain object + * @returns Promise + */ + public listPlaybooks(request: google.cloud.dialogflow.cx.v3.IListPlaybooksRequest): Promise; + + /** + * Calls GetPlaybook. + * @param request GetPlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Playbook + */ + public getPlaybook(request: google.cloud.dialogflow.cx.v3.IGetPlaybookRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookCallback): void; + + /** + * Calls GetPlaybook. + * @param request GetPlaybookRequest message or plain object + * @returns Promise + */ + public getPlaybook(request: google.cloud.dialogflow.cx.v3.IGetPlaybookRequest): Promise; + + /** + * Calls ExportPlaybook. + * @param request ExportPlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportPlaybook(request: google.cloud.dialogflow.cx.v3.IExportPlaybookRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.ExportPlaybookCallback): void; + + /** + * Calls ExportPlaybook. + * @param request ExportPlaybookRequest message or plain object + * @returns Promise + */ + public exportPlaybook(request: google.cloud.dialogflow.cx.v3.IExportPlaybookRequest): Promise; + + /** + * Calls ImportPlaybook. + * @param request ImportPlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importPlaybook(request: google.cloud.dialogflow.cx.v3.IImportPlaybookRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.ImportPlaybookCallback): void; + + /** + * Calls ImportPlaybook. + * @param request ImportPlaybookRequest message or plain object + * @returns Promise + */ + public importPlaybook(request: google.cloud.dialogflow.cx.v3.IImportPlaybookRequest): Promise; + + /** + * Calls UpdatePlaybook. + * @param request UpdatePlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Playbook + */ + public updatePlaybook(request: google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.UpdatePlaybookCallback): void; + + /** + * Calls UpdatePlaybook. + * @param request UpdatePlaybookRequest message or plain object + * @returns Promise + */ + public updatePlaybook(request: google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest): Promise; + + /** + * Calls CreatePlaybookVersion. + * @param request CreatePlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PlaybookVersion + */ + public createPlaybookVersion(request: google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookVersionCallback): void; + + /** + * Calls CreatePlaybookVersion. + * @param request CreatePlaybookVersionRequest message or plain object + * @returns Promise + */ + public createPlaybookVersion(request: google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest): Promise; + + /** + * Calls GetPlaybookVersion. + * @param request GetPlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PlaybookVersion + */ + public getPlaybookVersion(request: google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookVersionCallback): void; + + /** + * Calls GetPlaybookVersion. + * @param request GetPlaybookVersionRequest message or plain object + * @returns Promise + */ + public getPlaybookVersion(request: google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest): Promise; + + /** + * Calls RestorePlaybookVersion. + * @param request RestorePlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestorePlaybookVersionResponse + */ + public restorePlaybookVersion(request: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.RestorePlaybookVersionCallback): void; + + /** + * Calls RestorePlaybookVersion. + * @param request RestorePlaybookVersionRequest message or plain object + * @returns Promise + */ + public restorePlaybookVersion(request: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest): Promise; + + /** + * Calls ListPlaybookVersions. + * @param request ListPlaybookVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPlaybookVersionsResponse + */ + public listPlaybookVersions(request: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybookVersionsCallback): void; + + /** + * Calls ListPlaybookVersions. + * @param request ListPlaybookVersionsRequest message or plain object + * @returns Promise + */ + public listPlaybookVersions(request: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest): Promise; + + /** + * Calls DeletePlaybookVersion. + * @param request DeletePlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePlaybookVersion(request: google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookVersionCallback): void; + + /** + * Calls DeletePlaybookVersion. + * @param request DeletePlaybookVersionRequest message or plain object + * @returns Promise + */ + public deletePlaybookVersion(request: google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest): Promise; + } + + namespace Playbooks { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|createPlaybook}. + * @param error Error, if any + * @param [response] Playbook + */ + type CreatePlaybookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Playbook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|deletePlaybook}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePlaybookCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|listPlaybooks}. + * @param error Error, if any + * @param [response] ListPlaybooksResponse + */ + type ListPlaybooksCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListPlaybooksResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|getPlaybook}. + * @param error Error, if any + * @param [response] Playbook + */ + type GetPlaybookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Playbook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|exportPlaybook}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportPlaybookCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|importPlaybook}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportPlaybookCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|updatePlaybook}. + * @param error Error, if any + * @param [response] Playbook + */ + type UpdatePlaybookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Playbook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|createPlaybookVersion}. + * @param error Error, if any + * @param [response] PlaybookVersion + */ + type CreatePlaybookVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.PlaybookVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|getPlaybookVersion}. + * @param error Error, if any + * @param [response] PlaybookVersion + */ + type GetPlaybookVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.PlaybookVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|restorePlaybookVersion}. + * @param error Error, if any + * @param [response] RestorePlaybookVersionResponse + */ + type RestorePlaybookVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|listPlaybookVersions}. + * @param error Error, if any + * @param [response] ListPlaybookVersionsResponse + */ + type ListPlaybookVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|deletePlaybookVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePlaybookVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreatePlaybookRequest. */ + interface ICreatePlaybookRequest { + + /** CreatePlaybookRequest parent */ + parent?: (string|null); + + /** CreatePlaybookRequest playbook */ + playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + } + + /** Represents a CreatePlaybookRequest. */ + class CreatePlaybookRequest implements ICreatePlaybookRequest { + + /** + * Constructs a new CreatePlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest); + + /** CreatePlaybookRequest parent. */ + public parent: string; + + /** CreatePlaybookRequest playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + + /** + * Creates a new CreatePlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest): google.cloud.dialogflow.cx.v3.CreatePlaybookRequest; + + /** + * Encodes the specified CreatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookRequest.verify|verify} messages. + * @param message CreatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookRequest.verify|verify} messages. + * @param message CreatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePlaybookRequest + * @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.dialogflow.cx.v3.CreatePlaybookRequest; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePlaybookRequest + * @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.dialogflow.cx.v3.CreatePlaybookRequest; + + /** + * Verifies a CreatePlaybookRequest 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 CreatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreatePlaybookRequest; + + /** + * Creates a plain object from a CreatePlaybookRequest message. Also converts values to other types if specified. + * @param message CreatePlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreatePlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePlaybookRequest. */ + interface IDeletePlaybookRequest { + + /** DeletePlaybookRequest name */ + name?: (string|null); + } + + /** Represents a DeletePlaybookRequest. */ + class DeletePlaybookRequest implements IDeletePlaybookRequest { + + /** + * Constructs a new DeletePlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest); + + /** DeletePlaybookRequest name. */ + public name: string; + + /** + * Creates a new DeletePlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest): google.cloud.dialogflow.cx.v3.DeletePlaybookRequest; + + /** + * Encodes the specified DeletePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookRequest.verify|verify} messages. + * @param message DeletePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookRequest.verify|verify} messages. + * @param message DeletePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePlaybookRequest + * @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.dialogflow.cx.v3.DeletePlaybookRequest; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePlaybookRequest + * @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.dialogflow.cx.v3.DeletePlaybookRequest; + + /** + * Verifies a DeletePlaybookRequest 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 DeletePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeletePlaybookRequest; + + /** + * Creates a plain object from a DeletePlaybookRequest message. Also converts values to other types if specified. + * @param message DeletePlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeletePlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybooksRequest. */ + interface IListPlaybooksRequest { + + /** ListPlaybooksRequest parent */ + parent?: (string|null); + + /** ListPlaybooksRequest pageSize */ + pageSize?: (number|null); + + /** ListPlaybooksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPlaybooksRequest. */ + class ListPlaybooksRequest implements IListPlaybooksRequest { + + /** + * Constructs a new ListPlaybooksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListPlaybooksRequest); + + /** ListPlaybooksRequest parent. */ + public parent: string; + + /** ListPlaybooksRequest pageSize. */ + public pageSize: number; + + /** ListPlaybooksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPlaybooksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybooksRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListPlaybooksRequest): google.cloud.dialogflow.cx.v3.ListPlaybooksRequest; + + /** + * Encodes the specified ListPlaybooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksRequest.verify|verify} messages. + * @param message ListPlaybooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksRequest.verify|verify} messages. + * @param message ListPlaybooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybooksRequest + * @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.dialogflow.cx.v3.ListPlaybooksRequest; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybooksRequest + * @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.dialogflow.cx.v3.ListPlaybooksRequest; + + /** + * Verifies a ListPlaybooksRequest 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 ListPlaybooksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybooksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListPlaybooksRequest; + + /** + * Creates a plain object from a ListPlaybooksRequest message. Also converts values to other types if specified. + * @param message ListPlaybooksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListPlaybooksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybooksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybooksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybooksResponse. */ + interface IListPlaybooksResponse { + + /** ListPlaybooksResponse playbooks */ + playbooks?: (google.cloud.dialogflow.cx.v3.IPlaybook[]|null); + + /** ListPlaybooksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPlaybooksResponse. */ + class ListPlaybooksResponse implements IListPlaybooksResponse { + + /** + * Constructs a new ListPlaybooksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListPlaybooksResponse); + + /** ListPlaybooksResponse playbooks. */ + public playbooks: google.cloud.dialogflow.cx.v3.IPlaybook[]; + + /** ListPlaybooksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPlaybooksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybooksResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListPlaybooksResponse): google.cloud.dialogflow.cx.v3.ListPlaybooksResponse; + + /** + * Encodes the specified ListPlaybooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksResponse.verify|verify} messages. + * @param message ListPlaybooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListPlaybooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksResponse.verify|verify} messages. + * @param message ListPlaybooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListPlaybooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybooksResponse + * @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.dialogflow.cx.v3.ListPlaybooksResponse; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybooksResponse + * @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.dialogflow.cx.v3.ListPlaybooksResponse; + + /** + * Verifies a ListPlaybooksResponse 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 ListPlaybooksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybooksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListPlaybooksResponse; + + /** + * Creates a plain object from a ListPlaybooksResponse message. Also converts values to other types if specified. + * @param message ListPlaybooksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListPlaybooksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybooksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybooksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPlaybookRequest. */ + interface IGetPlaybookRequest { + + /** GetPlaybookRequest name */ + name?: (string|null); + } + + /** Represents a GetPlaybookRequest. */ + class GetPlaybookRequest implements IGetPlaybookRequest { + + /** + * Constructs a new GetPlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetPlaybookRequest); + + /** GetPlaybookRequest name. */ + public name: string; + + /** + * Creates a new GetPlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetPlaybookRequest): google.cloud.dialogflow.cx.v3.GetPlaybookRequest; + + /** + * Encodes the specified GetPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookRequest.verify|verify} messages. + * @param message GetPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookRequest.verify|verify} messages. + * @param message GetPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPlaybookRequest + * @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.dialogflow.cx.v3.GetPlaybookRequest; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPlaybookRequest + * @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.dialogflow.cx.v3.GetPlaybookRequest; + + /** + * Verifies a GetPlaybookRequest 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 GetPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetPlaybookRequest; + + /** + * Creates a plain object from a GetPlaybookRequest message. Also converts values to other types if specified. + * @param message GetPlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetPlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePlaybookRequest. */ + interface IUpdatePlaybookRequest { + + /** UpdatePlaybookRequest playbook */ + playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + + /** UpdatePlaybookRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePlaybookRequest. */ + class UpdatePlaybookRequest implements IUpdatePlaybookRequest { + + /** + * Constructs a new UpdatePlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest); + + /** UpdatePlaybookRequest playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + + /** UpdatePlaybookRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest): google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest; + + /** + * Encodes the specified UpdatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest.verify|verify} messages. + * @param message UpdatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest.verify|verify} messages. + * @param message UpdatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePlaybookRequest + * @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.dialogflow.cx.v3.UpdatePlaybookRequest; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePlaybookRequest + * @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.dialogflow.cx.v3.UpdatePlaybookRequest; + + /** + * Verifies an UpdatePlaybookRequest 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 UpdatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest; + + /** + * Creates a plain object from an UpdatePlaybookRequest message. Also converts values to other types if specified. + * @param message UpdatePlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Playbook. */ + interface IPlaybook { + + /** Playbook name */ + name?: (string|null); + + /** Playbook displayName */ + displayName?: (string|null); + + /** Playbook goal */ + goal?: (string|null); + + /** Playbook inputParameterDefinitions */ + inputParameterDefinitions?: (google.cloud.dialogflow.cx.v3.IParameterDefinition[]|null); + + /** Playbook outputParameterDefinitions */ + outputParameterDefinitions?: (google.cloud.dialogflow.cx.v3.IParameterDefinition[]|null); + + /** Playbook instruction */ + instruction?: (google.cloud.dialogflow.cx.v3.Playbook.IInstruction|null); + + /** Playbook tokenCount */ + tokenCount?: (number|Long|string|null); + + /** Playbook createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Playbook updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Playbook referencedPlaybooks */ + referencedPlaybooks?: (string[]|null); + + /** Playbook referencedFlows */ + referencedFlows?: (string[]|null); + + /** Playbook referencedTools */ + referencedTools?: (string[]|null); + + /** Playbook inlineActions */ + inlineActions?: (string[]|null); + + /** Playbook codeBlock */ + codeBlock?: (google.cloud.dialogflow.cx.v3.ICodeBlock|null); + + /** Playbook llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + + /** Playbook handlers */ + handlers?: (google.cloud.dialogflow.cx.v3.IHandler[]|null); + + /** Playbook playbookType */ + playbookType?: (google.cloud.dialogflow.cx.v3.Playbook.PlaybookType|keyof typeof google.cloud.dialogflow.cx.v3.Playbook.PlaybookType|null); + } + + /** Represents a Playbook. */ + class Playbook implements IPlaybook { + + /** + * Constructs a new Playbook. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybook); + + /** Playbook name. */ + public name: string; + + /** Playbook displayName. */ + public displayName: string; + + /** Playbook goal. */ + public goal: string; + + /** Playbook inputParameterDefinitions. */ + public inputParameterDefinitions: google.cloud.dialogflow.cx.v3.IParameterDefinition[]; + + /** Playbook outputParameterDefinitions. */ + public outputParameterDefinitions: google.cloud.dialogflow.cx.v3.IParameterDefinition[]; + + /** Playbook instruction. */ + public instruction?: (google.cloud.dialogflow.cx.v3.Playbook.IInstruction|null); + + /** Playbook tokenCount. */ + public tokenCount: (number|Long|string); + + /** Playbook createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Playbook updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Playbook referencedPlaybooks. */ + public referencedPlaybooks: string[]; + + /** Playbook referencedFlows. */ + public referencedFlows: string[]; + + /** Playbook referencedTools. */ + public referencedTools: string[]; + + /** Playbook inlineActions. */ + public inlineActions: string[]; + + /** Playbook codeBlock. */ + public codeBlock?: (google.cloud.dialogflow.cx.v3.ICodeBlock|null); + + /** Playbook llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3.ILlmModelSettings|null); + + /** Playbook handlers. */ + public handlers: google.cloud.dialogflow.cx.v3.IHandler[]; + + /** Playbook playbookType. */ + public playbookType: (google.cloud.dialogflow.cx.v3.Playbook.PlaybookType|keyof typeof google.cloud.dialogflow.cx.v3.Playbook.PlaybookType); + + /** + * Creates a new Playbook instance using the specified properties. + * @param [properties] Properties to set + * @returns Playbook instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybook): google.cloud.dialogflow.cx.v3.Playbook; + + /** + * Encodes the specified Playbook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.verify|verify} messages. + * @param message Playbook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Playbook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.verify|verify} messages. + * @param message Playbook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Playbook message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Playbook + * @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.dialogflow.cx.v3.Playbook; + + /** + * Decodes a Playbook message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Playbook + * @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.dialogflow.cx.v3.Playbook; + + /** + * Verifies a Playbook 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 Playbook message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Playbook + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Playbook; + + /** + * Creates a plain object from a Playbook message. Also converts values to other types if specified. + * @param message Playbook + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Playbook, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Playbook to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Playbook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Playbook { + + /** Properties of a Step. */ + interface IStep { + + /** Step text */ + text?: (string|null); + + /** Step steps */ + steps?: (google.cloud.dialogflow.cx.v3.Playbook.IStep[]|null); + } + + /** Represents a Step. */ + class Step implements IStep { + + /** + * Constructs a new Step. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Playbook.IStep); + + /** Step text. */ + public text?: (string|null); + + /** Step steps. */ + public steps: google.cloud.dialogflow.cx.v3.Playbook.IStep[]; + + /** Step instruction. */ + public instruction?: "text"; + + /** + * Creates a new Step instance using the specified properties. + * @param [properties] Properties to set + * @returns Step instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Playbook.IStep): google.cloud.dialogflow.cx.v3.Playbook.Step; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Playbook.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Playbook.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Step message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Step + * @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.dialogflow.cx.v3.Playbook.Step; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Step + * @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.dialogflow.cx.v3.Playbook.Step; + + /** + * Verifies a Step 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 Step message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Step + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Playbook.Step; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @param message Step + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Playbook.Step, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Step to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Step + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instruction. */ + interface IInstruction { + + /** Instruction guidelines */ + guidelines?: (string|null); + + /** Instruction steps */ + steps?: (google.cloud.dialogflow.cx.v3.Playbook.IStep[]|null); + } + + /** Represents an Instruction. */ + class Instruction implements IInstruction { + + /** + * Constructs a new Instruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Playbook.IInstruction); + + /** Instruction guidelines. */ + public guidelines: string; + + /** Instruction steps. */ + public steps: google.cloud.dialogflow.cx.v3.Playbook.IStep[]; + + /** + * Creates a new Instruction instance using the specified properties. + * @param [properties] Properties to set + * @returns Instruction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Playbook.IInstruction): google.cloud.dialogflow.cx.v3.Playbook.Instruction; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Playbook.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Playbook.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instruction + * @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.dialogflow.cx.v3.Playbook.Instruction; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instruction + * @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.dialogflow.cx.v3.Playbook.Instruction; + + /** + * Verifies an Instruction 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 Instruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instruction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Playbook.Instruction; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @param message Instruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Playbook.Instruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PlaybookType enum. */ + enum PlaybookType { + PLAYBOOK_TYPE_UNSPECIFIED = 0, + TASK = 1, + ROUTINE = 3 + } + } + + /** Properties of a CreatePlaybookVersionRequest. */ + interface ICreatePlaybookVersionRequest { + + /** CreatePlaybookVersionRequest parent */ + parent?: (string|null); + + /** CreatePlaybookVersionRequest playbookVersion */ + playbookVersion?: (google.cloud.dialogflow.cx.v3.IPlaybookVersion|null); + } + + /** Represents a CreatePlaybookVersionRequest. */ + class CreatePlaybookVersionRequest implements ICreatePlaybookVersionRequest { + + /** + * Constructs a new CreatePlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest); + + /** CreatePlaybookVersionRequest parent. */ + public parent: string; + + /** CreatePlaybookVersionRequest playbookVersion. */ + public playbookVersion?: (google.cloud.dialogflow.cx.v3.IPlaybookVersion|null); + + /** + * Creates a new CreatePlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest): google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest; + + /** + * Encodes the specified CreatePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest.verify|verify} messages. + * @param message CreatePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest.verify|verify} messages. + * @param message CreatePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePlaybookVersionRequest + * @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.dialogflow.cx.v3.CreatePlaybookVersionRequest; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePlaybookVersionRequest + * @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.dialogflow.cx.v3.CreatePlaybookVersionRequest; + + /** + * Verifies a CreatePlaybookVersionRequest 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 CreatePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest; + + /** + * Creates a plain object from a CreatePlaybookVersionRequest message. Also converts values to other types if specified. + * @param message CreatePlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookVersion. */ + interface IPlaybookVersion { + + /** PlaybookVersion name */ + name?: (string|null); + + /** PlaybookVersion description */ + description?: (string|null); + + /** PlaybookVersion playbook */ + playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + + /** PlaybookVersion examples */ + examples?: (google.cloud.dialogflow.cx.v3.IExample[]|null); + + /** PlaybookVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PlaybookVersion. */ + class PlaybookVersion implements IPlaybookVersion { + + /** + * Constructs a new PlaybookVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybookVersion); + + /** PlaybookVersion name. */ + public name: string; + + /** PlaybookVersion description. */ + public description: string; + + /** PlaybookVersion playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + + /** PlaybookVersion examples. */ + public examples: google.cloud.dialogflow.cx.v3.IExample[]; + + /** PlaybookVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PlaybookVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookVersion instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybookVersion): google.cloud.dialogflow.cx.v3.PlaybookVersion; + + /** + * Encodes the specified PlaybookVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookVersion.verify|verify} messages. + * @param message PlaybookVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybookVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookVersion.verify|verify} messages. + * @param message PlaybookVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybookVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookVersion + * @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.dialogflow.cx.v3.PlaybookVersion; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookVersion + * @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.dialogflow.cx.v3.PlaybookVersion; + + /** + * Verifies a PlaybookVersion 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 PlaybookVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PlaybookVersion; + + /** + * Creates a plain object from a PlaybookVersion message. Also converts values to other types if specified. + * @param message PlaybookVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PlaybookVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPlaybookVersionRequest. */ + interface IGetPlaybookVersionRequest { + + /** GetPlaybookVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetPlaybookVersionRequest. */ + class GetPlaybookVersionRequest implements IGetPlaybookVersionRequest { + + /** + * Constructs a new GetPlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest); + + /** GetPlaybookVersionRequest name. */ + public name: string; + + /** + * Creates a new GetPlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest): google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest; + + /** + * Encodes the specified GetPlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest.verify|verify} messages. + * @param message GetPlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest.verify|verify} messages. + * @param message GetPlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPlaybookVersionRequest + * @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.dialogflow.cx.v3.GetPlaybookVersionRequest; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPlaybookVersionRequest + * @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.dialogflow.cx.v3.GetPlaybookVersionRequest; + + /** + * Verifies a GetPlaybookVersionRequest 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 GetPlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest; + + /** + * Creates a plain object from a GetPlaybookVersionRequest message. Also converts values to other types if specified. + * @param message GetPlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestorePlaybookVersionRequest. */ + interface IRestorePlaybookVersionRequest { + + /** RestorePlaybookVersionRequest name */ + name?: (string|null); + } + + /** Represents a RestorePlaybookVersionRequest. */ + class RestorePlaybookVersionRequest implements IRestorePlaybookVersionRequest { + + /** + * Constructs a new RestorePlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest); + + /** RestorePlaybookVersionRequest name. */ + public name: string; + + /** + * Creates a new RestorePlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestorePlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest): google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest; + + /** + * Encodes the specified RestorePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest.verify|verify} messages. + * @param message RestorePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestorePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest.verify|verify} messages. + * @param message RestorePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestorePlaybookVersionRequest + * @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.dialogflow.cx.v3.RestorePlaybookVersionRequest; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestorePlaybookVersionRequest + * @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.dialogflow.cx.v3.RestorePlaybookVersionRequest; + + /** + * Verifies a RestorePlaybookVersionRequest 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 RestorePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestorePlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest; + + /** + * Creates a plain object from a RestorePlaybookVersionRequest message. Also converts values to other types if specified. + * @param message RestorePlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestorePlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestorePlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestorePlaybookVersionResponse. */ + interface IRestorePlaybookVersionResponse { + + /** RestorePlaybookVersionResponse playbook */ + playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + } + + /** Represents a RestorePlaybookVersionResponse. */ + class RestorePlaybookVersionResponse implements IRestorePlaybookVersionResponse { + + /** + * Constructs a new RestorePlaybookVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse); + + /** RestorePlaybookVersionResponse playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3.IPlaybook|null); + + /** + * Creates a new RestorePlaybookVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestorePlaybookVersionResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse): google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse; + + /** + * Encodes the specified RestorePlaybookVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse.verify|verify} messages. + * @param message RestorePlaybookVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestorePlaybookVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse.verify|verify} messages. + * @param message RestorePlaybookVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestorePlaybookVersionResponse + * @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.dialogflow.cx.v3.RestorePlaybookVersionResponse; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestorePlaybookVersionResponse + * @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.dialogflow.cx.v3.RestorePlaybookVersionResponse; + + /** + * Verifies a RestorePlaybookVersionResponse 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 RestorePlaybookVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestorePlaybookVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse; + + /** + * Creates a plain object from a RestorePlaybookVersionResponse message. Also converts values to other types if specified. + * @param message RestorePlaybookVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestorePlaybookVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestorePlaybookVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybookVersionsRequest. */ + interface IListPlaybookVersionsRequest { + + /** ListPlaybookVersionsRequest parent */ + parent?: (string|null); + + /** ListPlaybookVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListPlaybookVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPlaybookVersionsRequest. */ + class ListPlaybookVersionsRequest implements IListPlaybookVersionsRequest { + + /** + * Constructs a new ListPlaybookVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest); + + /** ListPlaybookVersionsRequest parent. */ + public parent: string; + + /** ListPlaybookVersionsRequest pageSize. */ + public pageSize: number; + + /** ListPlaybookVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPlaybookVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybookVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest): google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest; + + /** + * Encodes the specified ListPlaybookVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest.verify|verify} messages. + * @param message ListPlaybookVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybookVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest.verify|verify} messages. + * @param message ListPlaybookVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybookVersionsRequest + * @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.dialogflow.cx.v3.ListPlaybookVersionsRequest; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybookVersionsRequest + * @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.dialogflow.cx.v3.ListPlaybookVersionsRequest; + + /** + * Verifies a ListPlaybookVersionsRequest 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 ListPlaybookVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybookVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest; + + /** + * Creates a plain object from a ListPlaybookVersionsRequest message. Also converts values to other types if specified. + * @param message ListPlaybookVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybookVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybookVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybookVersionsResponse. */ + interface IListPlaybookVersionsResponse { + + /** ListPlaybookVersionsResponse playbookVersions */ + playbookVersions?: (google.cloud.dialogflow.cx.v3.IPlaybookVersion[]|null); + + /** ListPlaybookVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPlaybookVersionsResponse. */ + class ListPlaybookVersionsResponse implements IListPlaybookVersionsResponse { + + /** + * Constructs a new ListPlaybookVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse); + + /** ListPlaybookVersionsResponse playbookVersions. */ + public playbookVersions: google.cloud.dialogflow.cx.v3.IPlaybookVersion[]; + + /** ListPlaybookVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPlaybookVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybookVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse): google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse; + + /** + * Encodes the specified ListPlaybookVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse.verify|verify} messages. + * @param message ListPlaybookVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybookVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse.verify|verify} messages. + * @param message ListPlaybookVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybookVersionsResponse + * @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.dialogflow.cx.v3.ListPlaybookVersionsResponse; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybookVersionsResponse + * @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.dialogflow.cx.v3.ListPlaybookVersionsResponse; + + /** + * Verifies a ListPlaybookVersionsResponse 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 ListPlaybookVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybookVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse; + + /** + * Creates a plain object from a ListPlaybookVersionsResponse message. Also converts values to other types if specified. + * @param message ListPlaybookVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybookVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybookVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePlaybookVersionRequest. */ + interface IDeletePlaybookVersionRequest { + + /** DeletePlaybookVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeletePlaybookVersionRequest. */ + class DeletePlaybookVersionRequest implements IDeletePlaybookVersionRequest { + + /** + * Constructs a new DeletePlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest); + + /** DeletePlaybookVersionRequest name. */ + public name: string; + + /** + * Creates a new DeletePlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest): google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest; + + /** + * Encodes the specified DeletePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest.verify|verify} messages. + * @param message DeletePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest.verify|verify} messages. + * @param message DeletePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePlaybookVersionRequest + * @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.dialogflow.cx.v3.DeletePlaybookVersionRequest; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePlaybookVersionRequest + * @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.dialogflow.cx.v3.DeletePlaybookVersionRequest; + + /** + * Verifies a DeletePlaybookVersionRequest 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 DeletePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest; + + /** + * Creates a plain object from a DeletePlaybookVersionRequest message. Also converts values to other types if specified. + * @param message DeletePlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportPlaybookRequest. */ + interface IExportPlaybookRequest { + + /** ExportPlaybookRequest name */ + name?: (string|null); + + /** ExportPlaybookRequest playbookUri */ + playbookUri?: (string|null); + + /** ExportPlaybookRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat|null); + } + + /** Represents an ExportPlaybookRequest. */ + class ExportPlaybookRequest implements IExportPlaybookRequest { + + /** + * Constructs a new ExportPlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportPlaybookRequest); + + /** ExportPlaybookRequest name. */ + public name: string; + + /** ExportPlaybookRequest playbookUri. */ + public playbookUri: string; + + /** ExportPlaybookRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat); + + /** + * Creates a new ExportPlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportPlaybookRequest): google.cloud.dialogflow.cx.v3.ExportPlaybookRequest; + + /** + * Encodes the specified ExportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.verify|verify} messages. + * @param message ExportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.verify|verify} messages. + * @param message ExportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPlaybookRequest + * @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.dialogflow.cx.v3.ExportPlaybookRequest; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPlaybookRequest + * @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.dialogflow.cx.v3.ExportPlaybookRequest; + + /** + * Verifies an ExportPlaybookRequest 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 ExportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportPlaybookRequest; + + /** + * Creates a plain object from an ExportPlaybookRequest message. Also converts values to other types if specified. + * @param message ExportPlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportPlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportPlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportPlaybookRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON = 2 + } + } + + /** Properties of an ImportPlaybookRequest. */ + interface IImportPlaybookRequest { + + /** ImportPlaybookRequest parent */ + parent?: (string|null); + + /** ImportPlaybookRequest playbookUri */ + playbookUri?: (string|null); + + /** ImportPlaybookRequest playbookContent */ + playbookContent?: (Uint8Array|Buffer|string|null); + + /** ImportPlaybookRequest importStrategy */ + importStrategy?: (google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy|null); + } + + /** Represents an ImportPlaybookRequest. */ + class ImportPlaybookRequest implements IImportPlaybookRequest { + + /** + * Constructs a new ImportPlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportPlaybookRequest); + + /** ImportPlaybookRequest parent. */ + public parent: string; + + /** ImportPlaybookRequest playbookUri. */ + public playbookUri?: (string|null); + + /** ImportPlaybookRequest playbookContent. */ + public playbookContent?: (Uint8Array|Buffer|string|null); + + /** ImportPlaybookRequest importStrategy. */ + public importStrategy?: (google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy|null); + + /** ImportPlaybookRequest playbook. */ + public playbook?: ("playbookUri"|"playbookContent"); + + /** + * Creates a new ImportPlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportPlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportPlaybookRequest): google.cloud.dialogflow.cx.v3.ImportPlaybookRequest; + + /** + * Encodes the specified ImportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookRequest.verify|verify} messages. + * @param message ImportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookRequest.verify|verify} messages. + * @param message ImportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportPlaybookRequest + * @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.dialogflow.cx.v3.ImportPlaybookRequest; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportPlaybookRequest + * @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.dialogflow.cx.v3.ImportPlaybookRequest; + + /** + * Verifies an ImportPlaybookRequest 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 ImportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportPlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportPlaybookRequest; + + /** + * Creates a plain object from an ImportPlaybookRequest message. Also converts values to other types if specified. + * @param message ImportPlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportPlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportPlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportPlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookImportStrategy. */ + interface IPlaybookImportStrategy { + + /** PlaybookImportStrategy mainPlaybookImportStrategy */ + mainPlaybookImportStrategy?: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy|null); + + /** PlaybookImportStrategy nestedResourceImportStrategy */ + nestedResourceImportStrategy?: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy|null); + + /** PlaybookImportStrategy toolImportStrategy */ + toolImportStrategy?: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy|null); + } + + /** Represents a PlaybookImportStrategy. */ + class PlaybookImportStrategy implements IPlaybookImportStrategy { + + /** + * Constructs a new PlaybookImportStrategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy); + + /** PlaybookImportStrategy mainPlaybookImportStrategy. */ + public mainPlaybookImportStrategy: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy); + + /** PlaybookImportStrategy nestedResourceImportStrategy. */ + public nestedResourceImportStrategy: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy); + + /** PlaybookImportStrategy toolImportStrategy. */ + public toolImportStrategy: (google.cloud.dialogflow.cx.v3.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3.ImportStrategy); + + /** + * Creates a new PlaybookImportStrategy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookImportStrategy instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy): google.cloud.dialogflow.cx.v3.PlaybookImportStrategy; + + /** + * Encodes the specified PlaybookImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.verify|verify} messages. + * @param message PlaybookImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.verify|verify} messages. + * @param message PlaybookImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookImportStrategy + * @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.dialogflow.cx.v3.PlaybookImportStrategy; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookImportStrategy + * @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.dialogflow.cx.v3.PlaybookImportStrategy; + + /** + * Verifies a PlaybookImportStrategy 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 PlaybookImportStrategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookImportStrategy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.PlaybookImportStrategy; + + /** + * Creates a plain object from a PlaybookImportStrategy message. Also converts values to other types if specified. + * @param message PlaybookImportStrategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.PlaybookImportStrategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookImportStrategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookImportStrategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportPlaybookResponse. */ + interface IImportPlaybookResponse { + + /** ImportPlaybookResponse playbook */ + playbook?: (string|null); + + /** ImportPlaybookResponse conflictingResources */ + conflictingResources?: (google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources|null); + } + + /** Represents an ImportPlaybookResponse. */ + class ImportPlaybookResponse implements IImportPlaybookResponse { + + /** + * Constructs a new ImportPlaybookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IImportPlaybookResponse); + + /** ImportPlaybookResponse playbook. */ + public playbook: string; + + /** ImportPlaybookResponse conflictingResources. */ + public conflictingResources?: (google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources|null); + + /** + * Creates a new ImportPlaybookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportPlaybookResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IImportPlaybookResponse): google.cloud.dialogflow.cx.v3.ImportPlaybookResponse; + + /** + * Encodes the specified ImportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.verify|verify} messages. + * @param message ImportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.verify|verify} messages. + * @param message ImportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportPlaybookResponse + * @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.dialogflow.cx.v3.ImportPlaybookResponse; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportPlaybookResponse + * @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.dialogflow.cx.v3.ImportPlaybookResponse; + + /** + * Verifies an ImportPlaybookResponse 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 ImportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportPlaybookResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportPlaybookResponse; + + /** + * Creates a plain object from an ImportPlaybookResponse message. Also converts values to other types if specified. + * @param message ImportPlaybookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportPlaybookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportPlaybookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportPlaybookResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportPlaybookResponse { + + /** Properties of a ConflictingResources. */ + interface IConflictingResources { + + /** ConflictingResources mainPlaybookDisplayName */ + mainPlaybookDisplayName?: (string|null); + + /** ConflictingResources nestedPlaybookDisplayNames */ + nestedPlaybookDisplayNames?: (string[]|null); + + /** ConflictingResources toolDisplayNames */ + toolDisplayNames?: (string[]|null); + } + + /** Represents a ConflictingResources. */ + class ConflictingResources implements IConflictingResources { + + /** + * Constructs a new ConflictingResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources); + + /** ConflictingResources mainPlaybookDisplayName. */ + public mainPlaybookDisplayName: string; + + /** ConflictingResources nestedPlaybookDisplayNames. */ + public nestedPlaybookDisplayNames: string[]; + + /** ConflictingResources toolDisplayNames. */ + public toolDisplayNames: string[]; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ConflictingResources instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources): google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConflictingResources + * @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.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConflictingResources + * @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.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources; + + /** + * Verifies a ConflictingResources 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 ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConflictingResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @param message ConflictingResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConflictingResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConflictingResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportPlaybookResponse. */ + interface IExportPlaybookResponse { + + /** ExportPlaybookResponse playbookUri */ + playbookUri?: (string|null); + + /** ExportPlaybookResponse playbookContent */ + playbookContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ExportPlaybookResponse. */ + class ExportPlaybookResponse implements IExportPlaybookResponse { + + /** + * Constructs a new ExportPlaybookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IExportPlaybookResponse); + + /** ExportPlaybookResponse playbookUri. */ + public playbookUri?: (string|null); + + /** ExportPlaybookResponse playbookContent. */ + public playbookContent?: (Uint8Array|Buffer|string|null); + + /** ExportPlaybookResponse playbook. */ + public playbook?: ("playbookUri"|"playbookContent"); + + /** + * Creates a new ExportPlaybookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPlaybookResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IExportPlaybookResponse): google.cloud.dialogflow.cx.v3.ExportPlaybookResponse; + + /** + * Encodes the specified ExportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookResponse.verify|verify} messages. + * @param message ExportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookResponse.verify|verify} messages. + * @param message ExportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPlaybookResponse + * @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.dialogflow.cx.v3.ExportPlaybookResponse; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPlaybookResponse + * @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.dialogflow.cx.v3.ExportPlaybookResponse; + + /** + * Verifies an ExportPlaybookResponse 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 ExportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPlaybookResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ExportPlaybookResponse; + + /** + * Creates a plain object from an ExportPlaybookResponse message. Also converts values to other types if specified. + * @param message ExportPlaybookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ExportPlaybookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportPlaybookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPlaybookResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Handler. */ + interface IHandler { + + /** Handler eventHandler */ + eventHandler?: (google.cloud.dialogflow.cx.v3.Handler.IEventHandler|null); + + /** Handler lifecycleHandler */ + lifecycleHandler?: (google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler|null); + } + + /** Represents a Handler. */ + class Handler implements IHandler { + + /** + * Constructs a new Handler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IHandler); + + /** Handler eventHandler. */ + public eventHandler?: (google.cloud.dialogflow.cx.v3.Handler.IEventHandler|null); + + /** Handler lifecycleHandler. */ + public lifecycleHandler?: (google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler|null); + + /** Handler handler. */ + public handler?: ("eventHandler"|"lifecycleHandler"); + + /** + * Creates a new Handler instance using the specified properties. + * @param [properties] Properties to set + * @returns Handler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IHandler): google.cloud.dialogflow.cx.v3.Handler; + + /** + * Encodes the specified Handler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.verify|verify} messages. + * @param message Handler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Handler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.verify|verify} messages. + * @param message Handler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Handler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Handler + * @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.dialogflow.cx.v3.Handler; + + /** + * Decodes a Handler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Handler + * @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.dialogflow.cx.v3.Handler; + + /** + * Verifies a Handler 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 Handler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Handler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Handler; + + /** + * Creates a plain object from a Handler message. Also converts values to other types if specified. + * @param message Handler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Handler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Handler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Handler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Handler { + + /** Properties of an EventHandler. */ + interface IEventHandler { + + /** EventHandler event */ + event?: (string|null); + + /** EventHandler condition */ + condition?: (string|null); + + /** EventHandler fulfillment */ + fulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + } + + /** Represents an EventHandler. */ + class EventHandler implements IEventHandler { + + /** + * Constructs a new EventHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Handler.IEventHandler); + + /** EventHandler event. */ + public event: string; + + /** EventHandler condition. */ + public condition: string; + + /** EventHandler fulfillment. */ + public fulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** + * Creates a new EventHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns EventHandler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Handler.IEventHandler): google.cloud.dialogflow.cx.v3.Handler.EventHandler; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Handler.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Handler.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventHandler + * @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.dialogflow.cx.v3.Handler.EventHandler; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventHandler + * @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.dialogflow.cx.v3.Handler.EventHandler; + + /** + * Verifies an EventHandler 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 EventHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventHandler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Handler.EventHandler; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @param message EventHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Handler.EventHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LifecycleHandler. */ + interface ILifecycleHandler { + + /** LifecycleHandler lifecycleStage */ + lifecycleStage?: (string|null); + + /** LifecycleHandler condition */ + condition?: (string|null); + + /** LifecycleHandler fulfillment */ + fulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + } + + /** Represents a LifecycleHandler. */ + class LifecycleHandler implements ILifecycleHandler { + + /** + * Constructs a new LifecycleHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler); + + /** LifecycleHandler lifecycleStage. */ + public lifecycleStage: string; + + /** LifecycleHandler condition. */ + public condition: string; + + /** LifecycleHandler fulfillment. */ + public fulfillment?: (google.cloud.dialogflow.cx.v3.IFulfillment|null); + + /** + * Creates a new LifecycleHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns LifecycleHandler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler): google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler; + + /** + * Encodes the specified LifecycleHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.verify|verify} messages. + * @param message LifecycleHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LifecycleHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.verify|verify} messages. + * @param message LifecycleHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LifecycleHandler + * @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.dialogflow.cx.v3.Handler.LifecycleHandler; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LifecycleHandler + * @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.dialogflow.cx.v3.Handler.LifecycleHandler; + + /** + * Verifies a LifecycleHandler 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 LifecycleHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LifecycleHandler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler; + + /** + * Creates a plain object from a LifecycleHandler message. Also converts values to other types if specified. + * @param message LifecycleHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LifecycleHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LifecycleHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a SecuritySettingsService */ + class SecuritySettingsService extends $protobuf.rpc.Service { + + /** + * Constructs a new SecuritySettingsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SecuritySettingsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecuritySettingsService; + + /** + * Calls CreateSecuritySettings. + * @param request CreateSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public createSecuritySettings(request: google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3.SecuritySettingsService.CreateSecuritySettingsCallback): void; + + /** + * Calls CreateSecuritySettings. + * @param request CreateSecuritySettingsRequest message or plain object + * @returns Promise + */ + public createSecuritySettings(request: google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest): Promise; + + /** + * Calls GetSecuritySettings. + * @param request GetSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public getSecuritySettings(request: google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettingsCallback): void; + + /** + * Calls GetSecuritySettings. + * @param request GetSecuritySettingsRequest message or plain object + * @returns Promise + */ + public getSecuritySettings(request: google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest): Promise; + + /** + * Calls UpdateSecuritySettings. + * @param request UpdateSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public updateSecuritySettings(request: google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettingsCallback): void; + + /** + * Calls UpdateSecuritySettings. + * @param request UpdateSecuritySettingsRequest message or plain object + * @returns Promise + */ + public updateSecuritySettings(request: google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest): Promise; + + /** + * Calls ListSecuritySettings. + * @param request ListSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecuritySettingsResponse + */ + public listSecuritySettings(request: google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3.SecuritySettingsService.ListSecuritySettingsCallback): void; + + /** + * Calls ListSecuritySettings. + * @param request ListSecuritySettingsRequest message or plain object + * @returns Promise + */ + public listSecuritySettings(request: google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest): Promise; + + /** + * Calls DeleteSecuritySettings. + * @param request DeleteSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSecuritySettings(request: google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3.SecuritySettingsService.DeleteSecuritySettingsCallback): void; + + /** + * Calls DeleteSecuritySettings. + * @param request DeleteSecuritySettingsRequest message or plain object + * @returns Promise + */ + public deleteSecuritySettings(request: google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest): Promise; + } + + namespace SecuritySettingsService { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|createSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type CreateSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|getSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type GetSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|updateSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type UpdateSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|listSecuritySettings}. + * @param error Error, if any + * @param [response] ListSecuritySettingsResponse + */ + type ListSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|deleteSecuritySettings}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSecuritySettingsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetSecuritySettingsRequest. */ + interface IGetSecuritySettingsRequest { + + /** GetSecuritySettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetSecuritySettingsRequest. */ + class GetSecuritySettingsRequest implements IGetSecuritySettingsRequest { + + /** + * Constructs a new GetSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest); + + /** GetSecuritySettingsRequest name. */ + public name: string; + + /** + * Creates a new GetSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest): google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest; + + /** + * Encodes the specified GetSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest.verify|verify} messages. + * @param message GetSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest.verify|verify} messages. + * @param message GetSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecuritySettingsRequest + * @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.dialogflow.cx.v3.GetSecuritySettingsRequest; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecuritySettingsRequest + * @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.dialogflow.cx.v3.GetSecuritySettingsRequest; + + /** + * Verifies a GetSecuritySettingsRequest 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 GetSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest; + + /** + * Creates a plain object from a GetSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message GetSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSecuritySettingsRequest. */ + interface IUpdateSecuritySettingsRequest { + + /** UpdateSecuritySettingsRequest securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3.ISecuritySettings|null); + + /** UpdateSecuritySettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSecuritySettingsRequest. */ + class UpdateSecuritySettingsRequest implements IUpdateSecuritySettingsRequest { + + /** + * Constructs a new UpdateSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest); + + /** UpdateSecuritySettingsRequest securitySettings. */ + public securitySettings?: (google.cloud.dialogflow.cx.v3.ISecuritySettings|null); + + /** UpdateSecuritySettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest): google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest.verify|verify} messages. + * @param message UpdateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest.verify|verify} messages. + * @param message UpdateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecuritySettingsRequest + * @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.dialogflow.cx.v3.UpdateSecuritySettingsRequest; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecuritySettingsRequest + * @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.dialogflow.cx.v3.UpdateSecuritySettingsRequest; + + /** + * Verifies an UpdateSecuritySettingsRequest 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 UpdateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest; + + /** + * Creates a plain object from an UpdateSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message UpdateSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecuritySettingsRequest. */ + interface IListSecuritySettingsRequest { + + /** ListSecuritySettingsRequest parent */ + parent?: (string|null); + + /** ListSecuritySettingsRequest pageSize */ + pageSize?: (number|null); + + /** ListSecuritySettingsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSecuritySettingsRequest. */ + class ListSecuritySettingsRequest implements IListSecuritySettingsRequest { + + /** + * Constructs a new ListSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest); + + /** ListSecuritySettingsRequest parent. */ + public parent: string; + + /** ListSecuritySettingsRequest pageSize. */ + public pageSize: number; + + /** ListSecuritySettingsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest): google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest; + + /** + * Encodes the specified ListSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest.verify|verify} messages. + * @param message ListSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest.verify|verify} messages. + * @param message ListSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecuritySettingsRequest + * @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.dialogflow.cx.v3.ListSecuritySettingsRequest; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecuritySettingsRequest + * @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.dialogflow.cx.v3.ListSecuritySettingsRequest; + + /** + * Verifies a ListSecuritySettingsRequest 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 ListSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest; + + /** + * Creates a plain object from a ListSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message ListSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecuritySettingsResponse. */ + interface IListSecuritySettingsResponse { + + /** ListSecuritySettingsResponse securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3.ISecuritySettings[]|null); + + /** ListSecuritySettingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSecuritySettingsResponse. */ + class ListSecuritySettingsResponse implements IListSecuritySettingsResponse { + + /** + * Constructs a new ListSecuritySettingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse); + + /** ListSecuritySettingsResponse securitySettings. */ + public securitySettings: google.cloud.dialogflow.cx.v3.ISecuritySettings[]; + + /** ListSecuritySettingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSecuritySettingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecuritySettingsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse): google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse; + + /** + * Encodes the specified ListSecuritySettingsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse.verify|verify} messages. + * @param message ListSecuritySettingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecuritySettingsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse.verify|verify} messages. + * @param message ListSecuritySettingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecuritySettingsResponse + * @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.dialogflow.cx.v3.ListSecuritySettingsResponse; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecuritySettingsResponse + * @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.dialogflow.cx.v3.ListSecuritySettingsResponse; + + /** + * Verifies a ListSecuritySettingsResponse 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 ListSecuritySettingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecuritySettingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse; + + /** + * Creates a plain object from a ListSecuritySettingsResponse message. Also converts values to other types if specified. + * @param message ListSecuritySettingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecuritySettingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecuritySettingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecuritySettingsRequest. */ + interface ICreateSecuritySettingsRequest { + + /** CreateSecuritySettingsRequest parent */ + parent?: (string|null); + + /** CreateSecuritySettingsRequest securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3.ISecuritySettings|null); + } + + /** Represents a CreateSecuritySettingsRequest. */ + class CreateSecuritySettingsRequest implements ICreateSecuritySettingsRequest { + + /** + * Constructs a new CreateSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest); + + /** CreateSecuritySettingsRequest parent. */ + public parent: string; + + /** CreateSecuritySettingsRequest securitySettings. */ + public securitySettings?: (google.cloud.dialogflow.cx.v3.ISecuritySettings|null); + + /** + * Creates a new CreateSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest): google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest; + + /** + * Encodes the specified CreateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest.verify|verify} messages. + * @param message CreateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest.verify|verify} messages. + * @param message CreateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecuritySettingsRequest + * @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.dialogflow.cx.v3.CreateSecuritySettingsRequest; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecuritySettingsRequest + * @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.dialogflow.cx.v3.CreateSecuritySettingsRequest; + + /** + * Verifies a CreateSecuritySettingsRequest 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 CreateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest; + + /** + * Creates a plain object from a CreateSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message CreateSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSecuritySettingsRequest. */ + interface IDeleteSecuritySettingsRequest { + + /** DeleteSecuritySettingsRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSecuritySettingsRequest. */ + class DeleteSecuritySettingsRequest implements IDeleteSecuritySettingsRequest { + + /** + * Constructs a new DeleteSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest); + + /** DeleteSecuritySettingsRequest name. */ + public name: string; + + /** + * Creates a new DeleteSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest): google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest.verify|verify} messages. + * @param message DeleteSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest.verify|verify} messages. + * @param message DeleteSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSecuritySettingsRequest + * @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.dialogflow.cx.v3.DeleteSecuritySettingsRequest; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSecuritySettingsRequest + * @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.dialogflow.cx.v3.DeleteSecuritySettingsRequest; + + /** + * Verifies a DeleteSecuritySettingsRequest 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 DeleteSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest; + + /** + * Creates a plain object from a DeleteSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message DeleteSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecuritySettings. */ + interface ISecuritySettings { + + /** SecuritySettings name */ + name?: (string|null); + + /** SecuritySettings displayName */ + displayName?: (string|null); + + /** SecuritySettings redactionStrategy */ + redactionStrategy?: (google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy|null); + + /** SecuritySettings redactionScope */ + redactionScope?: (google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope|null); + + /** SecuritySettings inspectTemplate */ + inspectTemplate?: (string|null); + + /** SecuritySettings deidentifyTemplate */ + deidentifyTemplate?: (string|null); + + /** SecuritySettings retentionWindowDays */ + retentionWindowDays?: (number|null); + + /** SecuritySettings retentionStrategy */ + retentionStrategy?: (google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy|null); + + /** SecuritySettings purgeDataTypes */ + purgeDataTypes?: (google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType[]|null); + + /** SecuritySettings audioExportSettings */ + audioExportSettings?: (google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings|null); + + /** SecuritySettings insightsExportSettings */ + insightsExportSettings?: (google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings|null); + } + + /** Represents a SecuritySettings. */ + class SecuritySettings implements ISecuritySettings { + + /** + * Constructs a new SecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ISecuritySettings); + + /** SecuritySettings name. */ + public name: string; + + /** SecuritySettings displayName. */ + public displayName: string; + + /** SecuritySettings redactionStrategy. */ + public redactionStrategy: (google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy); + + /** SecuritySettings redactionScope. */ + public redactionScope: (google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope); + + /** SecuritySettings inspectTemplate. */ + public inspectTemplate: string; + + /** SecuritySettings deidentifyTemplate. */ + public deidentifyTemplate: string; + + /** SecuritySettings retentionWindowDays. */ + public retentionWindowDays?: (number|null); + + /** SecuritySettings retentionStrategy. */ + public retentionStrategy?: (google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy|null); + + /** SecuritySettings purgeDataTypes. */ + public purgeDataTypes: google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType[]; + + /** SecuritySettings audioExportSettings. */ + public audioExportSettings?: (google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings|null); + + /** SecuritySettings insightsExportSettings. */ + public insightsExportSettings?: (google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings|null); + + /** SecuritySettings dataRetention. */ + public dataRetention?: ("retentionWindowDays"|"retentionStrategy"); + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SecuritySettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ISecuritySettings): google.cloud.dialogflow.cx.v3.SecuritySettings; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecuritySettings + * @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.dialogflow.cx.v3.SecuritySettings; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecuritySettings + * @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.dialogflow.cx.v3.SecuritySettings; + + /** + * Verifies a SecuritySettings 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 SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SecuritySettings; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @param message SecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecuritySettings { + + /** RedactionStrategy enum. */ + enum RedactionStrategy { + REDACTION_STRATEGY_UNSPECIFIED = 0, + REDACT_WITH_SERVICE = 1 + } + + /** RedactionScope enum. */ + enum RedactionScope { + REDACTION_SCOPE_UNSPECIFIED = 0, + REDACT_DISK_STORAGE = 2 + } + + /** RetentionStrategy enum. */ + enum RetentionStrategy { + RETENTION_STRATEGY_UNSPECIFIED = 0, + REMOVE_AFTER_CONVERSATION = 1 + } + + /** PurgeDataType enum. */ + enum PurgeDataType { + PURGE_DATA_TYPE_UNSPECIFIED = 0, + DIALOGFLOW_HISTORY = 1 + } + + /** Properties of an AudioExportSettings. */ + interface IAudioExportSettings { + + /** AudioExportSettings gcsBucket */ + gcsBucket?: (string|null); + + /** AudioExportSettings audioExportPattern */ + audioExportPattern?: (string|null); + + /** AudioExportSettings enableAudioRedaction */ + enableAudioRedaction?: (boolean|null); + + /** AudioExportSettings audioFormat */ + audioFormat?: (google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat|null); + + /** AudioExportSettings storeTtsAudio */ + storeTtsAudio?: (boolean|null); + } + + /** Represents an AudioExportSettings. */ + class AudioExportSettings implements IAudioExportSettings { + + /** + * Constructs a new AudioExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings); + + /** AudioExportSettings gcsBucket. */ + public gcsBucket: string; + + /** AudioExportSettings audioExportPattern. */ + public audioExportPattern: string; + + /** AudioExportSettings enableAudioRedaction. */ + public enableAudioRedaction: boolean; + + /** AudioExportSettings audioFormat. */ + public audioFormat: (google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat); + + /** AudioExportSettings storeTtsAudio. */ + public storeTtsAudio: boolean; + + /** + * Creates a new AudioExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioExportSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings): google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings; + + /** + * Encodes the specified AudioExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @param message AudioExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @param message AudioExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioExportSettings + * @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.dialogflow.cx.v3.SecuritySettings.AudioExportSettings; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioExportSettings + * @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.dialogflow.cx.v3.SecuritySettings.AudioExportSettings; + + /** + * Verifies an AudioExportSettings 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 AudioExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings; + + /** + * Creates a plain object from an AudioExportSettings message. Also converts values to other types if specified. + * @param message AudioExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AudioExportSettings { + + /** AudioFormat enum. */ + enum AudioFormat { + AUDIO_FORMAT_UNSPECIFIED = 0, + MULAW = 1, + MP3 = 2, + OGG = 3 + } + } + + /** Properties of an InsightsExportSettings. */ + interface IInsightsExportSettings { + + /** InsightsExportSettings enableInsightsExport */ + enableInsightsExport?: (boolean|null); + } + + /** Represents an InsightsExportSettings. */ + class InsightsExportSettings implements IInsightsExportSettings { + + /** + * Constructs a new InsightsExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings); + + /** InsightsExportSettings enableInsightsExport. */ + public enableInsightsExport: boolean; + + /** + * Creates a new InsightsExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns InsightsExportSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings): google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings; + + /** + * Encodes the specified InsightsExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @param message InsightsExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsightsExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @param message InsightsExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsightsExportSettings + * @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.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsightsExportSettings + * @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.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings; + + /** + * Verifies an InsightsExportSettings 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 InsightsExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsightsExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings; + + /** + * Creates a plain object from an InsightsExportSettings message. Also converts values to other types if specified. + * @param message InsightsExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsightsExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsightsExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a Tools */ + class Tools extends $protobuf.rpc.Service { + + /** + * Constructs a new Tools service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Tools service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Tools; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public createTool(request: google.cloud.dialogflow.cx.v3.ICreateToolRequest, callback: google.cloud.dialogflow.cx.v3.Tools.CreateToolCallback): void; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @returns Promise + */ + public createTool(request: google.cloud.dialogflow.cx.v3.ICreateToolRequest): Promise; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsResponse + */ + public listTools(request: google.cloud.dialogflow.cx.v3.IListToolsRequest, callback: google.cloud.dialogflow.cx.v3.Tools.ListToolsCallback): void; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @returns Promise + */ + public listTools(request: google.cloud.dialogflow.cx.v3.IListToolsRequest): Promise; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public getTool(request: google.cloud.dialogflow.cx.v3.IGetToolRequest, callback: google.cloud.dialogflow.cx.v3.Tools.GetToolCallback): void; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @returns Promise + */ + public getTool(request: google.cloud.dialogflow.cx.v3.IGetToolRequest): Promise; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public updateTool(request: google.cloud.dialogflow.cx.v3.IUpdateToolRequest, callback: google.cloud.dialogflow.cx.v3.Tools.UpdateToolCallback): void; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @returns Promise + */ + public updateTool(request: google.cloud.dialogflow.cx.v3.IUpdateToolRequest): Promise; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTool(request: google.cloud.dialogflow.cx.v3.IDeleteToolRequest, callback: google.cloud.dialogflow.cx.v3.Tools.DeleteToolCallback): void; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @returns Promise + */ + public deleteTool(request: google.cloud.dialogflow.cx.v3.IDeleteToolRequest): Promise; + + /** + * Calls ListToolVersions. + * @param request ListToolVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolVersionsResponse + */ + public listToolVersions(request: google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, callback: google.cloud.dialogflow.cx.v3.Tools.ListToolVersionsCallback): void; + + /** + * Calls ListToolVersions. + * @param request ListToolVersionsRequest message or plain object + * @returns Promise + */ + public listToolVersions(request: google.cloud.dialogflow.cx.v3.IListToolVersionsRequest): Promise; + + /** + * Calls CreateToolVersion. + * @param request CreateToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ToolVersion + */ + public createToolVersion(request: google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest, callback: google.cloud.dialogflow.cx.v3.Tools.CreateToolVersionCallback): void; + + /** + * Calls CreateToolVersion. + * @param request CreateToolVersionRequest message or plain object + * @returns Promise + */ + public createToolVersion(request: google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest): Promise; + + /** + * Calls GetToolVersion. + * @param request GetToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ToolVersion + */ + public getToolVersion(request: google.cloud.dialogflow.cx.v3.IGetToolVersionRequest, callback: google.cloud.dialogflow.cx.v3.Tools.GetToolVersionCallback): void; + + /** + * Calls GetToolVersion. + * @param request GetToolVersionRequest message or plain object + * @returns Promise + */ + public getToolVersion(request: google.cloud.dialogflow.cx.v3.IGetToolVersionRequest): Promise; + + /** + * Calls DeleteToolVersion. + * @param request DeleteToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteToolVersion(request: google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest, callback: google.cloud.dialogflow.cx.v3.Tools.DeleteToolVersionCallback): void; + + /** + * Calls DeleteToolVersion. + * @param request DeleteToolVersionRequest message or plain object + * @returns Promise + */ + public deleteToolVersion(request: google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest): Promise; + + /** + * Calls RestoreToolVersion. + * @param request RestoreToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestoreToolVersionResponse + */ + public restoreToolVersion(request: google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest, callback: google.cloud.dialogflow.cx.v3.Tools.RestoreToolVersionCallback): void; + + /** + * Calls RestoreToolVersion. + * @param request RestoreToolVersionRequest message or plain object + * @returns Promise + */ + public restoreToolVersion(request: google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest): Promise; + } + + namespace Tools { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|createTool}. + * @param error Error, if any + * @param [response] Tool + */ + type CreateToolCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Tool) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|listTools}. + * @param error Error, if any + * @param [response] ListToolsResponse + */ + type ListToolsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListToolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|getTool}. + * @param error Error, if any + * @param [response] Tool + */ + type GetToolCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Tool) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|updateTool}. + * @param error Error, if any + * @param [response] Tool + */ + type UpdateToolCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Tool) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|deleteTool}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|listToolVersions}. + * @param error Error, if any + * @param [response] ListToolVersionsResponse + */ + type ListToolVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListToolVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|createToolVersion}. + * @param error Error, if any + * @param [response] ToolVersion + */ + type CreateToolVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ToolVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|getToolVersion}. + * @param error Error, if any + * @param [response] ToolVersion + */ + type GetToolVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ToolVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|deleteToolVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|restoreToolVersion}. + * @param error Error, if any + * @param [response] RestoreToolVersionResponse + */ + type RestoreToolVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse) => void; + } + + /** Properties of a CreateToolRequest. */ + interface ICreateToolRequest { + + /** CreateToolRequest parent */ + parent?: (string|null); + + /** CreateToolRequest tool */ + tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + } + + /** Represents a CreateToolRequest. */ + class CreateToolRequest implements ICreateToolRequest { + + /** + * Constructs a new CreateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateToolRequest); + + /** CreateToolRequest parent. */ + public parent: string; + + /** CreateToolRequest tool. */ + public tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateToolRequest): google.cloud.dialogflow.cx.v3.CreateToolRequest; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolRequest + * @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.dialogflow.cx.v3.CreateToolRequest; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolRequest + * @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.dialogflow.cx.v3.CreateToolRequest; + + /** + * Verifies a CreateToolRequest 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 CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateToolRequest; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @param message CreateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsRequest. */ + interface IListToolsRequest { + + /** ListToolsRequest parent */ + parent?: (string|null); + + /** ListToolsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListToolsRequest. */ + class ListToolsRequest implements IListToolsRequest { + + /** + * Constructs a new ListToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListToolsRequest); + + /** ListToolsRequest parent. */ + public parent: string; + + /** ListToolsRequest pageSize. */ + public pageSize: number; + + /** ListToolsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListToolsRequest): google.cloud.dialogflow.cx.v3.ListToolsRequest; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsRequest + * @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.dialogflow.cx.v3.ListToolsRequest; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsRequest + * @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.dialogflow.cx.v3.ListToolsRequest; + + /** + * Verifies a ListToolsRequest 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 ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListToolsRequest; + + /** + * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. + * @param message ListToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsResponse. */ + interface IListToolsResponse { + + /** ListToolsResponse tools */ + tools?: (google.cloud.dialogflow.cx.v3.ITool[]|null); + + /** ListToolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsResponse. */ + class ListToolsResponse implements IListToolsResponse { + + /** + * Constructs a new ListToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListToolsResponse); + + /** ListToolsResponse tools. */ + public tools: google.cloud.dialogflow.cx.v3.ITool[]; + + /** ListToolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListToolsResponse): google.cloud.dialogflow.cx.v3.ListToolsResponse; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsResponse + * @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.dialogflow.cx.v3.ListToolsResponse; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsResponse + * @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.dialogflow.cx.v3.ListToolsResponse; + + /** + * Verifies a ListToolsResponse 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 ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListToolsResponse; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @param message ListToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolRequest. */ + interface IGetToolRequest { + + /** GetToolRequest name */ + name?: (string|null); + } + + /** Represents a GetToolRequest. */ + class GetToolRequest implements IGetToolRequest { + + /** + * Constructs a new GetToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetToolRequest); + + /** GetToolRequest name. */ + public name: string; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetToolRequest): google.cloud.dialogflow.cx.v3.GetToolRequest; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolRequest + * @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.dialogflow.cx.v3.GetToolRequest; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolRequest + * @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.dialogflow.cx.v3.GetToolRequest; + + /** + * Verifies a GetToolRequest 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 GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetToolRequest; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @param message GetToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolRequest. */ + interface IUpdateToolRequest { + + /** UpdateToolRequest tool */ + tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + + /** UpdateToolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolRequest. */ + class UpdateToolRequest implements IUpdateToolRequest { + + /** + * Constructs a new UpdateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateToolRequest); + + /** UpdateToolRequest tool. */ + public tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + + /** UpdateToolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateToolRequest): google.cloud.dialogflow.cx.v3.UpdateToolRequest; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolRequest + * @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.dialogflow.cx.v3.UpdateToolRequest; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolRequest + * @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.dialogflow.cx.v3.UpdateToolRequest; + + /** + * Verifies an UpdateToolRequest 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 UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateToolRequest; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @param message UpdateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolRequest. */ + interface IDeleteToolRequest { + + /** DeleteToolRequest name */ + name?: (string|null); + + /** DeleteToolRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteToolRequest. */ + class DeleteToolRequest implements IDeleteToolRequest { + + /** + * Constructs a new DeleteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteToolRequest); + + /** DeleteToolRequest name. */ + public name: string; + + /** DeleteToolRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteToolRequest): google.cloud.dialogflow.cx.v3.DeleteToolRequest; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolRequest + * @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.dialogflow.cx.v3.DeleteToolRequest; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolRequest + * @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.dialogflow.cx.v3.DeleteToolRequest; + + /** + * Verifies a DeleteToolRequest 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 DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteToolRequest; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @param message DeleteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tool. */ + interface ITool { + + /** Tool name */ + name?: (string|null); + + /** Tool displayName */ + displayName?: (string|null); + + /** Tool description */ + description?: (string|null); + + /** Tool openApiSpec */ + openApiSpec?: (google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool|null); + + /** Tool dataStoreSpec */ + dataStoreSpec?: (google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool|null); + + /** Tool functionSpec */ + functionSpec?: (google.cloud.dialogflow.cx.v3.Tool.IFunctionTool|null); + + /** Tool toolType */ + toolType?: (google.cloud.dialogflow.cx.v3.Tool.ToolType|keyof typeof google.cloud.dialogflow.cx.v3.Tool.ToolType|null); + } + + /** Represents a Tool. */ + class Tool implements ITool { + + /** + * Constructs a new Tool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ITool); + + /** Tool name. */ + public name: string; + + /** Tool displayName. */ + public displayName: string; + + /** Tool description. */ + public description: string; + + /** Tool openApiSpec. */ + public openApiSpec?: (google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool|null); + + /** Tool dataStoreSpec. */ + public dataStoreSpec?: (google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool|null); + + /** Tool functionSpec. */ + public functionSpec?: (google.cloud.dialogflow.cx.v3.Tool.IFunctionTool|null); + + /** Tool toolType. */ + public toolType: (google.cloud.dialogflow.cx.v3.Tool.ToolType|keyof typeof google.cloud.dialogflow.cx.v3.Tool.ToolType); + + /** Tool specification. */ + public specification?: ("openApiSpec"|"dataStoreSpec"|"functionSpec"); + + /** + * Creates a new Tool instance using the specified properties. + * @param [properties] Properties to set + * @returns Tool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ITool): google.cloud.dialogflow.cx.v3.Tool; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tool + * @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.dialogflow.cx.v3.Tool; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tool + * @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.dialogflow.cx.v3.Tool; + + /** + * Verifies a Tool 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 Tool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @param message Tool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Tool { + + /** Properties of an OpenApiTool. */ + interface IOpenApiTool { + + /** OpenApiTool textSchema */ + textSchema?: (string|null); + + /** OpenApiTool authentication */ + authentication?: (google.cloud.dialogflow.cx.v3.Tool.IAuthentication|null); + + /** OpenApiTool tlsConfig */ + tlsConfig?: (google.cloud.dialogflow.cx.v3.Tool.ITLSConfig|null); + + /** OpenApiTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig|null); + } + + /** Represents an OpenApiTool. */ + class OpenApiTool implements IOpenApiTool { + + /** + * Constructs a new OpenApiTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool); + + /** OpenApiTool textSchema. */ + public textSchema?: (string|null); + + /** OpenApiTool authentication. */ + public authentication?: (google.cloud.dialogflow.cx.v3.Tool.IAuthentication|null); + + /** OpenApiTool tlsConfig. */ + public tlsConfig?: (google.cloud.dialogflow.cx.v3.Tool.ITLSConfig|null); + + /** OpenApiTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig|null); + + /** OpenApiTool schema. */ + public schema?: "textSchema"; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool): google.cloud.dialogflow.cx.v3.Tool.OpenApiTool; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiTool + * @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.dialogflow.cx.v3.Tool.OpenApiTool; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiTool + * @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.dialogflow.cx.v3.Tool.OpenApiTool; + + /** + * Verifies an OpenApiTool 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 OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.OpenApiTool; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @param message OpenApiTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.OpenApiTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreTool. */ + interface IDataStoreTool { + + /** DataStoreTool dataStoreConnections */ + dataStoreConnections?: (google.cloud.dialogflow.cx.v3.IDataStoreConnection[]|null); + + /** DataStoreTool fallbackPrompt */ + fallbackPrompt?: (google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt|null); + } + + /** Represents a DataStoreTool. */ + class DataStoreTool implements IDataStoreTool { + + /** + * Constructs a new DataStoreTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool); + + /** DataStoreTool dataStoreConnections. */ + public dataStoreConnections: google.cloud.dialogflow.cx.v3.IDataStoreConnection[]; + + /** DataStoreTool fallbackPrompt. */ + public fallbackPrompt?: (google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt|null); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool): google.cloud.dialogflow.cx.v3.Tool.DataStoreTool; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreTool + * @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.dialogflow.cx.v3.Tool.DataStoreTool; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreTool + * @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.dialogflow.cx.v3.Tool.DataStoreTool; + + /** + * Verifies a DataStoreTool 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 DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.DataStoreTool; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @param message DataStoreTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.DataStoreTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreTool { + + /** Properties of a FallbackPrompt. */ + interface IFallbackPrompt { + } + + /** Represents a FallbackPrompt. */ + class FallbackPrompt implements IFallbackPrompt { + + /** + * Constructs a new FallbackPrompt. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt); + + /** + * Creates a new FallbackPrompt instance using the specified properties. + * @param [properties] Properties to set + * @returns FallbackPrompt instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt): google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt; + + /** + * Encodes the specified FallbackPrompt message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @param message FallbackPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FallbackPrompt message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @param message FallbackPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FallbackPrompt + * @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.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FallbackPrompt + * @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.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt; + + /** + * Verifies a FallbackPrompt 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 FallbackPrompt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FallbackPrompt + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt; + + /** + * Creates a plain object from a FallbackPrompt message. Also converts values to other types if specified. + * @param message FallbackPrompt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FallbackPrompt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FallbackPrompt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FunctionTool. */ + interface IFunctionTool { + + /** FunctionTool inputSchema */ + inputSchema?: (google.protobuf.IStruct|null); + + /** FunctionTool outputSchema */ + outputSchema?: (google.protobuf.IStruct|null); + } + + /** Represents a FunctionTool. */ + class FunctionTool implements IFunctionTool { + + /** + * Constructs a new FunctionTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.IFunctionTool); + + /** FunctionTool inputSchema. */ + public inputSchema?: (google.protobuf.IStruct|null); + + /** FunctionTool outputSchema. */ + public outputSchema?: (google.protobuf.IStruct|null); + + /** + * Creates a new FunctionTool instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.IFunctionTool): google.cloud.dialogflow.cx.v3.Tool.FunctionTool; + + /** + * Encodes the specified FunctionTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.FunctionTool.verify|verify} messages. + * @param message FunctionTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.IFunctionTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.FunctionTool.verify|verify} messages. + * @param message FunctionTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.IFunctionTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionTool + * @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.dialogflow.cx.v3.Tool.FunctionTool; + + /** + * Decodes a FunctionTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionTool + * @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.dialogflow.cx.v3.Tool.FunctionTool; + + /** + * Verifies a FunctionTool 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 FunctionTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.FunctionTool; + + /** + * Creates a plain object from a FunctionTool message. Also converts values to other types if specified. + * @param message FunctionTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.FunctionTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunctionTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Authentication. */ + interface IAuthentication { + + /** Authentication apiKeyConfig */ + apiKeyConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig|null); + + /** Authentication oauthConfig */ + oauthConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig|null); + + /** Authentication serviceAgentAuthConfig */ + serviceAgentAuthConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig|null); + + /** Authentication bearerTokenConfig */ + bearerTokenConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig|null); + + /** Authentication serviceAccountAuthConfig */ + serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig|null); + } + + /** Represents an Authentication. */ + class Authentication implements IAuthentication { + + /** + * Constructs a new Authentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.IAuthentication); + + /** Authentication apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig|null); + + /** Authentication oauthConfig. */ + public oauthConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig|null); + + /** Authentication serviceAgentAuthConfig. */ + public serviceAgentAuthConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig|null); + + /** Authentication bearerTokenConfig. */ + public bearerTokenConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig|null); + + /** Authentication serviceAccountAuthConfig. */ + public serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig|null); + + /** Authentication authConfig. */ + public authConfig?: ("apiKeyConfig"|"oauthConfig"|"serviceAgentAuthConfig"|"bearerTokenConfig"|"serviceAccountAuthConfig"); + + /** + * Creates a new Authentication instance using the specified properties. + * @param [properties] Properties to set + * @returns Authentication instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.IAuthentication): google.cloud.dialogflow.cx.v3.Tool.Authentication; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Authentication + * @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.dialogflow.cx.v3.Tool.Authentication; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Authentication + * @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.dialogflow.cx.v3.Tool.Authentication; + + /** + * Verifies an Authentication 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 Authentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Authentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.Authentication; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @param message Authentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.Authentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Authentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Authentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Authentication { + + /** Properties of an ApiKeyConfig. */ + interface IApiKeyConfig { + + /** ApiKeyConfig keyName */ + keyName?: (string|null); + + /** ApiKeyConfig apiKey */ + apiKey?: (string|null); + + /** ApiKeyConfig secretVersionForApiKey */ + secretVersionForApiKey?: (string|null); + + /** ApiKeyConfig requestLocation */ + requestLocation?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation|keyof typeof google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation|null); + } + + /** Represents an ApiKeyConfig. */ + class ApiKeyConfig implements IApiKeyConfig { + + /** + * Constructs a new ApiKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig); + + /** ApiKeyConfig keyName. */ + public keyName: string; + + /** ApiKeyConfig apiKey. */ + public apiKey: string; + + /** ApiKeyConfig secretVersionForApiKey. */ + public secretVersionForApiKey: string; + + /** ApiKeyConfig requestLocation. */ + public requestLocation: (google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation|keyof typeof google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation); + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiKeyConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig): google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiKeyConfig + * @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.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiKeyConfig + * @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.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig; + + /** + * Verifies an ApiKeyConfig 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 ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @param message ApiKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RequestLocation enum. */ + enum RequestLocation { + REQUEST_LOCATION_UNSPECIFIED = 0, + HEADER = 1, + QUERY_STRING = 2 + } + + /** Properties of a OAuthConfig. */ + interface IOAuthConfig { + + /** OAuthConfig oauthGrantType */ + oauthGrantType?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType|keyof typeof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType|null); + + /** OAuthConfig clientId */ + clientId?: (string|null); + + /** OAuthConfig clientSecret */ + clientSecret?: (string|null); + + /** OAuthConfig secretVersionForClientSecret */ + secretVersionForClientSecret?: (string|null); + + /** OAuthConfig tokenEndpoint */ + tokenEndpoint?: (string|null); + + /** OAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a OAuthConfig. */ + class OAuthConfig implements IOAuthConfig { + + /** + * Constructs a new OAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig); + + /** OAuthConfig oauthGrantType. */ + public oauthGrantType: (google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType|keyof typeof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType); + + /** OAuthConfig clientId. */ + public clientId: string; + + /** OAuthConfig clientSecret. */ + public clientSecret: string; + + /** OAuthConfig secretVersionForClientSecret. */ + public secretVersionForClientSecret: string; + + /** OAuthConfig tokenEndpoint. */ + public tokenEndpoint: string; + + /** OAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig): google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthConfig + * @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.dialogflow.cx.v3.Tool.Authentication.OAuthConfig; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthConfig + * @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.dialogflow.cx.v3.Tool.Authentication.OAuthConfig; + + /** + * Verifies a OAuthConfig 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 OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @param message OAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OAuthConfig { + + /** OauthGrantType enum. */ + enum OauthGrantType { + OAUTH_GRANT_TYPE_UNSPECIFIED = 0, + CLIENT_CREDENTIAL = 1 + } + } + + /** Properties of a ServiceAgentAuthConfig. */ + interface IServiceAgentAuthConfig { + + /** ServiceAgentAuthConfig serviceAgentAuth */ + serviceAgentAuth?: (google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|null); + } + + /** Represents a ServiceAgentAuthConfig. */ + class ServiceAgentAuthConfig implements IServiceAgentAuthConfig { + + /** + * Constructs a new ServiceAgentAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig); + + /** ServiceAgentAuthConfig serviceAgentAuth. */ + public serviceAgentAuth: (google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth); + + /** + * Creates a new ServiceAgentAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAgentAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig): google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Encodes the specified ServiceAgentAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @param message ServiceAgentAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAgentAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @param message ServiceAgentAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAgentAuthConfig + * @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.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAgentAuthConfig + * @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.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Verifies a ServiceAgentAuthConfig 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 ServiceAgentAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAgentAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Creates a plain object from a ServiceAgentAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAgentAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAgentAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAgentAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServiceAgentAuthConfig { + + /** ServiceAgentAuth enum. */ + enum ServiceAgentAuth { + SERVICE_AGENT_AUTH_UNSPECIFIED = 0, + ID_TOKEN = 1, + ACCESS_TOKEN = 2 + } + } + + /** Properties of a BearerTokenConfig. */ + interface IBearerTokenConfig { + + /** BearerTokenConfig token */ + token?: (string|null); + + /** BearerTokenConfig secretVersionForToken */ + secretVersionForToken?: (string|null); + } + + /** Represents a BearerTokenConfig. */ + class BearerTokenConfig implements IBearerTokenConfig { + + /** + * Constructs a new BearerTokenConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig); + + /** BearerTokenConfig token. */ + public token: string; + + /** BearerTokenConfig secretVersionForToken. */ + public secretVersionForToken: string; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BearerTokenConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig): google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BearerTokenConfig + * @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.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BearerTokenConfig + * @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.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig; + + /** + * Verifies a BearerTokenConfig 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 BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BearerTokenConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @param message BearerTokenConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BearerTokenConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BearerTokenConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceAccountAuthConfig. */ + interface IServiceAccountAuthConfig { + + /** ServiceAccountAuthConfig serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a ServiceAccountAuthConfig. */ + class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { + + /** + * Constructs a new ServiceAccountAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig); + + /** ServiceAccountAuthConfig serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig): google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Verifies a ServiceAccountAuthConfig 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 ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAccountAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TLSConfig. */ + interface ITLSConfig { + + /** TLSConfig caCerts */ + caCerts?: (google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert[]|null); + } + + /** Represents a TLSConfig. */ + class TLSConfig implements ITLSConfig { + + /** + * Constructs a new TLSConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.ITLSConfig); + + /** TLSConfig caCerts. */ + public caCerts: google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert[]; + + /** + * Creates a new TLSConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TLSConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.ITLSConfig): google.cloud.dialogflow.cx.v3.Tool.TLSConfig; + + /** + * Encodes the specified TLSConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.verify|verify} messages. + * @param message TLSConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.ITLSConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TLSConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.verify|verify} messages. + * @param message TLSConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.ITLSConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TLSConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TLSConfig + * @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.dialogflow.cx.v3.Tool.TLSConfig; + + /** + * Decodes a TLSConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TLSConfig + * @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.dialogflow.cx.v3.Tool.TLSConfig; + + /** + * Verifies a TLSConfig 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 TLSConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TLSConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.TLSConfig; + + /** + * Creates a plain object from a TLSConfig message. Also converts values to other types if specified. + * @param message TLSConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.TLSConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TLSConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TLSConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TLSConfig { + + /** Properties of a CACert. */ + interface ICACert { + + /** CACert displayName */ + displayName?: (string|null); + + /** CACert cert */ + cert?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CACert. */ + class CACert implements ICACert { + + /** + * Constructs a new CACert. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert); + + /** CACert displayName. */ + public displayName: string; + + /** CACert cert. */ + public cert: (Uint8Array|Buffer|string); + + /** + * Creates a new CACert instance using the specified properties. + * @param [properties] Properties to set + * @returns CACert instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert): google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert; + + /** + * Encodes the specified CACert message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.verify|verify} messages. + * @param message CACert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CACert message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.verify|verify} messages. + * @param message CACert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CACert message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CACert + * @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.dialogflow.cx.v3.Tool.TLSConfig.CACert; + + /** + * Decodes a CACert message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CACert + * @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.dialogflow.cx.v3.Tool.TLSConfig.CACert; + + /** + * Verifies a CACert 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 CACert message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CACert + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert; + + /** + * Creates a plain object from a CACert message. Also converts values to other types if specified. + * @param message CACert + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CACert to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CACert + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ServiceDirectoryConfig. */ + interface IServiceDirectoryConfig { + + /** ServiceDirectoryConfig service */ + service?: (string|null); + } + + /** Represents a ServiceDirectoryConfig. */ + class ServiceDirectoryConfig implements IServiceDirectoryConfig { + + /** + * Constructs a new ServiceDirectoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig); + + /** ServiceDirectoryConfig service. */ + public service: string; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDirectoryConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig): google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3.Tool.ServiceDirectoryConfig; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3.Tool.ServiceDirectoryConfig; + + /** + * Verifies a ServiceDirectoryConfig 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 ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDirectoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @param message ServiceDirectoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ToolType enum. */ + enum ToolType { + TOOL_TYPE_UNSPECIFIED = 0, + CUSTOMIZED_TOOL = 1, + BUILTIN_TOOL = 2 + } + } + + /** Properties of a ListToolVersionsRequest. */ + interface IListToolVersionsRequest { + + /** ListToolVersionsRequest parent */ + parent?: (string|null); + + /** ListToolVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListToolVersionsRequest. */ + class ListToolVersionsRequest implements IListToolVersionsRequest { + + /** + * Constructs a new ListToolVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListToolVersionsRequest); + + /** ListToolVersionsRequest parent. */ + public parent: string; + + /** ListToolVersionsRequest pageSize. */ + public pageSize: number; + + /** ListToolVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListToolVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListToolVersionsRequest): google.cloud.dialogflow.cx.v3.ListToolVersionsRequest; + + /** + * Encodes the specified ListToolVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsRequest.verify|verify} messages. + * @param message ListToolVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsRequest.verify|verify} messages. + * @param message ListToolVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolVersionsRequest + * @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.dialogflow.cx.v3.ListToolVersionsRequest; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolVersionsRequest + * @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.dialogflow.cx.v3.ListToolVersionsRequest; + + /** + * Verifies a ListToolVersionsRequest 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 ListToolVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListToolVersionsRequest; + + /** + * Creates a plain object from a ListToolVersionsRequest message. Also converts values to other types if specified. + * @param message ListToolVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListToolVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolVersionsResponse. */ + interface IListToolVersionsResponse { + + /** ListToolVersionsResponse toolVersions */ + toolVersions?: (google.cloud.dialogflow.cx.v3.IToolVersion[]|null); + + /** ListToolVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolVersionsResponse. */ + class ListToolVersionsResponse implements IListToolVersionsResponse { + + /** + * Constructs a new ListToolVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListToolVersionsResponse); + + /** ListToolVersionsResponse toolVersions. */ + public toolVersions: google.cloud.dialogflow.cx.v3.IToolVersion[]; + + /** ListToolVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListToolVersionsResponse): google.cloud.dialogflow.cx.v3.ListToolVersionsResponse; + + /** + * Encodes the specified ListToolVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsResponse.verify|verify} messages. + * @param message ListToolVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListToolVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsResponse.verify|verify} messages. + * @param message ListToolVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListToolVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolVersionsResponse + * @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.dialogflow.cx.v3.ListToolVersionsResponse; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolVersionsResponse + * @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.dialogflow.cx.v3.ListToolVersionsResponse; + + /** + * Verifies a ListToolVersionsResponse 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 ListToolVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListToolVersionsResponse; + + /** + * Creates a plain object from a ListToolVersionsResponse message. Also converts values to other types if specified. + * @param message ListToolVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListToolVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolVersionRequest. */ + interface ICreateToolVersionRequest { + + /** CreateToolVersionRequest parent */ + parent?: (string|null); + + /** CreateToolVersionRequest toolVersion */ + toolVersion?: (google.cloud.dialogflow.cx.v3.IToolVersion|null); + } + + /** Represents a CreateToolVersionRequest. */ + class CreateToolVersionRequest implements ICreateToolVersionRequest { + + /** + * Constructs a new CreateToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest); + + /** CreateToolVersionRequest parent. */ + public parent: string; + + /** CreateToolVersionRequest toolVersion. */ + public toolVersion?: (google.cloud.dialogflow.cx.v3.IToolVersion|null); + + /** + * Creates a new CreateToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest): google.cloud.dialogflow.cx.v3.CreateToolVersionRequest; + + /** + * Encodes the specified CreateToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolVersionRequest.verify|verify} messages. + * @param message CreateToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolVersionRequest.verify|verify} messages. + * @param message CreateToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolVersionRequest + * @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.dialogflow.cx.v3.CreateToolVersionRequest; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolVersionRequest + * @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.dialogflow.cx.v3.CreateToolVersionRequest; + + /** + * Verifies a CreateToolVersionRequest 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 CreateToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateToolVersionRequest; + + /** + * Creates a plain object from a CreateToolVersionRequest message. Also converts values to other types if specified. + * @param message CreateToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolVersionRequest. */ + interface IGetToolVersionRequest { + + /** GetToolVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetToolVersionRequest. */ + class GetToolVersionRequest implements IGetToolVersionRequest { + + /** + * Constructs a new GetToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetToolVersionRequest); + + /** GetToolVersionRequest name. */ + public name: string; + + /** + * Creates a new GetToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetToolVersionRequest): google.cloud.dialogflow.cx.v3.GetToolVersionRequest; + + /** + * Encodes the specified GetToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolVersionRequest.verify|verify} messages. + * @param message GetToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolVersionRequest.verify|verify} messages. + * @param message GetToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolVersionRequest + * @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.dialogflow.cx.v3.GetToolVersionRequest; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolVersionRequest + * @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.dialogflow.cx.v3.GetToolVersionRequest; + + /** + * Verifies a GetToolVersionRequest 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 GetToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetToolVersionRequest; + + /** + * Creates a plain object from a GetToolVersionRequest message. Also converts values to other types if specified. + * @param message GetToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolVersionRequest. */ + interface IDeleteToolVersionRequest { + + /** DeleteToolVersionRequest name */ + name?: (string|null); + + /** DeleteToolVersionRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteToolVersionRequest. */ + class DeleteToolVersionRequest implements IDeleteToolVersionRequest { + + /** + * Constructs a new DeleteToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest); + + /** DeleteToolVersionRequest name. */ + public name: string; + + /** DeleteToolVersionRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest): google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest; + + /** + * Encodes the specified DeleteToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest.verify|verify} messages. + * @param message DeleteToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest.verify|verify} messages. + * @param message DeleteToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolVersionRequest + * @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.dialogflow.cx.v3.DeleteToolVersionRequest; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolVersionRequest + * @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.dialogflow.cx.v3.DeleteToolVersionRequest; + + /** + * Verifies a DeleteToolVersionRequest 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 DeleteToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest; + + /** + * Creates a plain object from a DeleteToolVersionRequest message. Also converts values to other types if specified. + * @param message DeleteToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreToolVersionRequest. */ + interface IRestoreToolVersionRequest { + + /** RestoreToolVersionRequest name */ + name?: (string|null); + } + + /** Represents a RestoreToolVersionRequest. */ + class RestoreToolVersionRequest implements IRestoreToolVersionRequest { + + /** + * Constructs a new RestoreToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest); + + /** RestoreToolVersionRequest name. */ + public name: string; + + /** + * Creates a new RestoreToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest): google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest; + + /** + * Encodes the specified RestoreToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest.verify|verify} messages. + * @param message RestoreToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest.verify|verify} messages. + * @param message RestoreToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreToolVersionRequest + * @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.dialogflow.cx.v3.RestoreToolVersionRequest; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreToolVersionRequest + * @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.dialogflow.cx.v3.RestoreToolVersionRequest; + + /** + * Verifies a RestoreToolVersionRequest 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 RestoreToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest; + + /** + * Creates a plain object from a RestoreToolVersionRequest message. Also converts values to other types if specified. + * @param message RestoreToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreToolVersionResponse. */ + interface IRestoreToolVersionResponse { + + /** RestoreToolVersionResponse tool */ + tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + } + + /** Represents a RestoreToolVersionResponse. */ + class RestoreToolVersionResponse implements IRestoreToolVersionResponse { + + /** + * Constructs a new RestoreToolVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse); + + /** RestoreToolVersionResponse tool. */ + public tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + + /** + * Creates a new RestoreToolVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreToolVersionResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse): google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse; + + /** + * Encodes the specified RestoreToolVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse.verify|verify} messages. + * @param message RestoreToolVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreToolVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse.verify|verify} messages. + * @param message RestoreToolVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreToolVersionResponse + * @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.dialogflow.cx.v3.RestoreToolVersionResponse; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreToolVersionResponse + * @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.dialogflow.cx.v3.RestoreToolVersionResponse; + + /** + * Verifies a RestoreToolVersionResponse 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 RestoreToolVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreToolVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse; + + /** + * Creates a plain object from a RestoreToolVersionResponse message. Also converts values to other types if specified. + * @param message RestoreToolVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreToolVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreToolVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolVersion. */ + interface IToolVersion { + + /** ToolVersion name */ + name?: (string|null); + + /** ToolVersion displayName */ + displayName?: (string|null); + + /** ToolVersion tool */ + tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + + /** ToolVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ToolVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ToolVersion. */ + class ToolVersion implements IToolVersion { + + /** + * Constructs a new ToolVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IToolVersion); + + /** ToolVersion name. */ + public name: string; + + /** ToolVersion displayName. */ + public displayName: string; + + /** ToolVersion tool. */ + public tool?: (google.cloud.dialogflow.cx.v3.ITool|null); + + /** ToolVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ToolVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ToolVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolVersion instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IToolVersion): google.cloud.dialogflow.cx.v3.ToolVersion; + + /** + * Encodes the specified ToolVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolVersion.verify|verify} messages. + * @param message ToolVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IToolVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolVersion.verify|verify} messages. + * @param message ToolVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IToolVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolVersion + * @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.dialogflow.cx.v3.ToolVersion; + + /** + * Decodes a ToolVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolVersion + * @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.dialogflow.cx.v3.ToolVersion; + + /** + * Verifies a ToolVersion 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 ToolVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ToolVersion; + + /** + * Creates a plain object from a ToolVersion message. Also converts values to other types if specified. + * @param message ToolVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ToolVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Versions */ + class Versions extends $protobuf.rpc.Service { + + /** + * Constructs a new Versions service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Versions service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Versions; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVersionsResponse + */ + public listVersions(request: google.cloud.dialogflow.cx.v3.IListVersionsRequest, callback: google.cloud.dialogflow.cx.v3.Versions.ListVersionsCallback): void; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @returns Promise + */ + public listVersions(request: google.cloud.dialogflow.cx.v3.IListVersionsRequest): Promise; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public getVersion(request: google.cloud.dialogflow.cx.v3.IGetVersionRequest, callback: google.cloud.dialogflow.cx.v3.Versions.GetVersionCallback): void; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @returns Promise + */ + public getVersion(request: google.cloud.dialogflow.cx.v3.IGetVersionRequest): Promise; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createVersion(request: google.cloud.dialogflow.cx.v3.ICreateVersionRequest, callback: google.cloud.dialogflow.cx.v3.Versions.CreateVersionCallback): void; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @returns Promise + */ + public createVersion(request: google.cloud.dialogflow.cx.v3.ICreateVersionRequest): Promise; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public updateVersion(request: google.cloud.dialogflow.cx.v3.IUpdateVersionRequest, callback: google.cloud.dialogflow.cx.v3.Versions.UpdateVersionCallback): void; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @returns Promise + */ + public updateVersion(request: google.cloud.dialogflow.cx.v3.IUpdateVersionRequest): Promise; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteVersion(request: google.cloud.dialogflow.cx.v3.IDeleteVersionRequest, callback: google.cloud.dialogflow.cx.v3.Versions.DeleteVersionCallback): void; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @returns Promise + */ + public deleteVersion(request: google.cloud.dialogflow.cx.v3.IDeleteVersionRequest): Promise; + + /** + * Calls LoadVersion. + * @param request LoadVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public loadVersion(request: google.cloud.dialogflow.cx.v3.ILoadVersionRequest, callback: google.cloud.dialogflow.cx.v3.Versions.LoadVersionCallback): void; + + /** + * Calls LoadVersion. + * @param request LoadVersionRequest message or plain object + * @returns Promise + */ + public loadVersion(request: google.cloud.dialogflow.cx.v3.ILoadVersionRequest): Promise; + + /** + * Calls CompareVersions. + * @param request CompareVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompareVersionsResponse + */ + public compareVersions(request: google.cloud.dialogflow.cx.v3.ICompareVersionsRequest, callback: google.cloud.dialogflow.cx.v3.Versions.CompareVersionsCallback): void; + + /** + * Calls CompareVersions. + * @param request CompareVersionsRequest message or plain object + * @returns Promise + */ + public compareVersions(request: google.cloud.dialogflow.cx.v3.ICompareVersionsRequest): Promise; + } + + namespace Versions { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|listVersions}. + * @param error Error, if any + * @param [response] ListVersionsResponse + */ + type ListVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|getVersion}. + * @param error Error, if any + * @param [response] Version + */ + type GetVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Version) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|createVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|updateVersion}. + * @param error Error, if any + * @param [response] Version + */ + type UpdateVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.Version) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|deleteVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|loadVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type LoadVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|compareVersions}. + * @param error Error, if any + * @param [response] CompareVersionsResponse + */ + type CompareVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.CompareVersionsResponse) => void; + } + + /** Properties of a CreateVersionOperationMetadata. */ + interface ICreateVersionOperationMetadata { + + /** CreateVersionOperationMetadata version */ + version?: (string|null); + } + + /** Represents a CreateVersionOperationMetadata. */ + class CreateVersionOperationMetadata implements ICreateVersionOperationMetadata { + + /** + * Constructs a new CreateVersionOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata); + + /** CreateVersionOperationMetadata version. */ + public version: string; + + /** + * Creates a new CreateVersionOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionOperationMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata): google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata; + + /** + * Encodes the specified CreateVersionOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata.verify|verify} messages. + * @param message CreateVersionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata.verify|verify} messages. + * @param message CreateVersionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionOperationMetadata + * @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.dialogflow.cx.v3.CreateVersionOperationMetadata; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionOperationMetadata + * @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.dialogflow.cx.v3.CreateVersionOperationMetadata; + + /** + * Verifies a CreateVersionOperationMetadata 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 CreateVersionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata; + + /** + * Creates a plain object from a CreateVersionOperationMetadata message. Also converts values to other types if specified. + * @param message CreateVersionOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Version. */ + interface IVersion { + + /** Version name */ + name?: (string|null); + + /** Version displayName */ + displayName?: (string|null); + + /** Version description */ + description?: (string|null); + + /** Version nluSettings */ + nluSettings?: (google.cloud.dialogflow.cx.v3.INluSettings|null); + + /** Version createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Version state */ + state?: (google.cloud.dialogflow.cx.v3.Version.State|keyof typeof google.cloud.dialogflow.cx.v3.Version.State|null); + } + + /** Represents a Version. */ + class Version implements IVersion { + + /** + * Constructs a new Version. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IVersion); + + /** Version name. */ + public name: string; + + /** Version displayName. */ + public displayName: string; + + /** Version description. */ + public description: string; + + /** Version nluSettings. */ + public nluSettings?: (google.cloud.dialogflow.cx.v3.INluSettings|null); + + /** Version createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Version state. */ + public state: (google.cloud.dialogflow.cx.v3.Version.State|keyof typeof google.cloud.dialogflow.cx.v3.Version.State); + + /** + * Creates a new Version instance using the specified properties. + * @param [properties] Properties to set + * @returns Version instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IVersion): google.cloud.dialogflow.cx.v3.Version; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Version message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Version + * @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.dialogflow.cx.v3.Version; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Version + * @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.dialogflow.cx.v3.Version; + + /** + * Verifies a Version 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 Version message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Version + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.Version; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @param message Version + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Version to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Version + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Version { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3 + } + } + + /** Properties of a ListVersionsRequest. */ + interface IListVersionsRequest { + + /** ListVersionsRequest parent */ + parent?: (string|null); + + /** ListVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListVersionsRequest. */ + class ListVersionsRequest implements IListVersionsRequest { + + /** + * Constructs a new ListVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListVersionsRequest); + + /** ListVersionsRequest parent. */ + public parent: string; + + /** ListVersionsRequest pageSize. */ + public pageSize: number; + + /** ListVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListVersionsRequest): google.cloud.dialogflow.cx.v3.ListVersionsRequest; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsRequest + * @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.dialogflow.cx.v3.ListVersionsRequest; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsRequest + * @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.dialogflow.cx.v3.ListVersionsRequest; + + /** + * Verifies a ListVersionsRequest 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 ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListVersionsRequest; + + /** + * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. + * @param message ListVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVersionsResponse. */ + interface IListVersionsResponse { + + /** ListVersionsResponse versions */ + versions?: (google.cloud.dialogflow.cx.v3.IVersion[]|null); + + /** ListVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVersionsResponse. */ + class ListVersionsResponse implements IListVersionsResponse { + + /** + * Constructs a new ListVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListVersionsResponse); + + /** ListVersionsResponse versions. */ + public versions: google.cloud.dialogflow.cx.v3.IVersion[]; + + /** ListVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListVersionsResponse): google.cloud.dialogflow.cx.v3.ListVersionsResponse; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsResponse + * @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.dialogflow.cx.v3.ListVersionsResponse; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsResponse + * @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.dialogflow.cx.v3.ListVersionsResponse; + + /** + * Verifies a ListVersionsResponse 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 ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListVersionsResponse; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @param message ListVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVersionRequest. */ + interface IGetVersionRequest { + + /** GetVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetVersionRequest. */ + class GetVersionRequest implements IGetVersionRequest { + + /** + * Constructs a new GetVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IGetVersionRequest); + + /** GetVersionRequest name. */ + public name: string; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IGetVersionRequest): google.cloud.dialogflow.cx.v3.GetVersionRequest; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVersionRequest + * @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.dialogflow.cx.v3.GetVersionRequest; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVersionRequest + * @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.dialogflow.cx.v3.GetVersionRequest; + + /** + * Verifies a GetVersionRequest 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 GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.GetVersionRequest; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @param message GetVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.GetVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVersionRequest. */ + interface ICreateVersionRequest { + + /** CreateVersionRequest parent */ + parent?: (string|null); + + /** CreateVersionRequest version */ + version?: (google.cloud.dialogflow.cx.v3.IVersion|null); + } + + /** Represents a CreateVersionRequest. */ + class CreateVersionRequest implements ICreateVersionRequest { + + /** + * Constructs a new CreateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICreateVersionRequest); + + /** CreateVersionRequest parent. */ + public parent: string; + + /** CreateVersionRequest version. */ + public version?: (google.cloud.dialogflow.cx.v3.IVersion|null); + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICreateVersionRequest): google.cloud.dialogflow.cx.v3.CreateVersionRequest; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionRequest + * @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.dialogflow.cx.v3.CreateVersionRequest; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionRequest + * @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.dialogflow.cx.v3.CreateVersionRequest; + + /** + * Verifies a CreateVersionRequest 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 CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CreateVersionRequest; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @param message CreateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CreateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVersionRequest. */ + interface IUpdateVersionRequest { + + /** UpdateVersionRequest version */ + version?: (google.cloud.dialogflow.cx.v3.IVersion|null); + + /** UpdateVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateVersionRequest. */ + class UpdateVersionRequest implements IUpdateVersionRequest { + + /** + * Constructs a new UpdateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IUpdateVersionRequest); + + /** UpdateVersionRequest version. */ + public version?: (google.cloud.dialogflow.cx.v3.IVersion|null); + + /** UpdateVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IUpdateVersionRequest): google.cloud.dialogflow.cx.v3.UpdateVersionRequest; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVersionRequest + * @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.dialogflow.cx.v3.UpdateVersionRequest; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVersionRequest + * @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.dialogflow.cx.v3.UpdateVersionRequest; + + /** + * Verifies an UpdateVersionRequest 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.UpdateVersionRequest; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @param message UpdateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.UpdateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteVersionRequest. */ + interface IDeleteVersionRequest { + + /** DeleteVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteVersionRequest. */ + class DeleteVersionRequest implements IDeleteVersionRequest { + + /** + * Constructs a new DeleteVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IDeleteVersionRequest); + + /** DeleteVersionRequest name. */ + public name: string; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IDeleteVersionRequest): google.cloud.dialogflow.cx.v3.DeleteVersionRequest; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVersionRequest + * @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.dialogflow.cx.v3.DeleteVersionRequest; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVersionRequest + * @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.dialogflow.cx.v3.DeleteVersionRequest; + + /** + * Verifies a DeleteVersionRequest 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 DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.DeleteVersionRequest; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @param message DeleteVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.DeleteVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoadVersionRequest. */ + interface ILoadVersionRequest { + + /** LoadVersionRequest name */ + name?: (string|null); + + /** LoadVersionRequest allowOverrideAgentResources */ + allowOverrideAgentResources?: (boolean|null); + } + + /** Represents a LoadVersionRequest. */ + class LoadVersionRequest implements ILoadVersionRequest { + + /** + * Constructs a new LoadVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ILoadVersionRequest); + + /** LoadVersionRequest name. */ + public name: string; + + /** LoadVersionRequest allowOverrideAgentResources. */ + public allowOverrideAgentResources: boolean; + + /** + * Creates a new LoadVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ILoadVersionRequest): google.cloud.dialogflow.cx.v3.LoadVersionRequest; + + /** + * Encodes the specified LoadVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LoadVersionRequest.verify|verify} messages. + * @param message LoadVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ILoadVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LoadVersionRequest.verify|verify} messages. + * @param message LoadVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ILoadVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadVersionRequest + * @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.dialogflow.cx.v3.LoadVersionRequest; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadVersionRequest + * @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.dialogflow.cx.v3.LoadVersionRequest; + + /** + * Verifies a LoadVersionRequest 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 LoadVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.LoadVersionRequest; + + /** + * Creates a plain object from a LoadVersionRequest message. Also converts values to other types if specified. + * @param message LoadVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.LoadVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompareVersionsRequest. */ + interface ICompareVersionsRequest { + + /** CompareVersionsRequest baseVersion */ + baseVersion?: (string|null); + + /** CompareVersionsRequest targetVersion */ + targetVersion?: (string|null); + + /** CompareVersionsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CompareVersionsRequest. */ + class CompareVersionsRequest implements ICompareVersionsRequest { + + /** + * Constructs a new CompareVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICompareVersionsRequest); + + /** CompareVersionsRequest baseVersion. */ + public baseVersion: string; + + /** CompareVersionsRequest targetVersion. */ + public targetVersion: string; + + /** CompareVersionsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CompareVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompareVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICompareVersionsRequest): google.cloud.dialogflow.cx.v3.CompareVersionsRequest; + + /** + * Encodes the specified CompareVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsRequest.verify|verify} messages. + * @param message CompareVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICompareVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompareVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsRequest.verify|verify} messages. + * @param message CompareVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICompareVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompareVersionsRequest + * @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.dialogflow.cx.v3.CompareVersionsRequest; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompareVersionsRequest + * @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.dialogflow.cx.v3.CompareVersionsRequest; + + /** + * Verifies a CompareVersionsRequest 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 CompareVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompareVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CompareVersionsRequest; + + /** + * Creates a plain object from a CompareVersionsRequest message. Also converts values to other types if specified. + * @param message CompareVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CompareVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompareVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompareVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompareVersionsResponse. */ + interface ICompareVersionsResponse { + + /** CompareVersionsResponse baseVersionContentJson */ + baseVersionContentJson?: (string|null); + + /** CompareVersionsResponse targetVersionContentJson */ + targetVersionContentJson?: (string|null); + + /** CompareVersionsResponse compareTime */ + compareTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CompareVersionsResponse. */ + class CompareVersionsResponse implements ICompareVersionsResponse { + + /** + * Constructs a new CompareVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.ICompareVersionsResponse); + + /** CompareVersionsResponse baseVersionContentJson. */ + public baseVersionContentJson: string; + + /** CompareVersionsResponse targetVersionContentJson. */ + public targetVersionContentJson: string; + + /** CompareVersionsResponse compareTime. */ + public compareTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CompareVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CompareVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.ICompareVersionsResponse): google.cloud.dialogflow.cx.v3.CompareVersionsResponse; + + /** + * Encodes the specified CompareVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsResponse.verify|verify} messages. + * @param message CompareVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompareVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsResponse.verify|verify} messages. + * @param message CompareVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompareVersionsResponse + * @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.dialogflow.cx.v3.CompareVersionsResponse; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompareVersionsResponse + * @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.dialogflow.cx.v3.CompareVersionsResponse; + + /** + * Verifies a CompareVersionsResponse 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 CompareVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompareVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.CompareVersionsResponse; + + /** + * Creates a plain object from a CompareVersionsResponse message. Also converts values to other types if specified. + * @param message CompareVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.CompareVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompareVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompareVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v3beta1. */ + namespace v3beta1 { + + /** Properties of an AdvancedSettings. */ + interface IAdvancedSettings { + + /** AdvancedSettings audioExportGcsDestination */ + audioExportGcsDestination?: (google.cloud.dialogflow.cx.v3beta1.IGcsDestination|null); + + /** AdvancedSettings speechSettings */ + speechSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null); + + /** AdvancedSettings dtmfSettings */ + dtmfSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings|null); + + /** AdvancedSettings loggingSettings */ + loggingSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings|null); + } + + /** Represents an AdvancedSettings. */ + class AdvancedSettings implements IAdvancedSettings { + + /** + * Constructs a new AdvancedSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings); + + /** AdvancedSettings audioExportGcsDestination. */ + public audioExportGcsDestination?: (google.cloud.dialogflow.cx.v3beta1.IGcsDestination|null); + + /** AdvancedSettings speechSettings. */ + public speechSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null); + + /** AdvancedSettings dtmfSettings. */ + public dtmfSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings|null); + + /** AdvancedSettings loggingSettings. */ + public loggingSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings|null); + + /** + * Creates a new AdvancedSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings; + + /** + * Encodes the specified AdvancedSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify|verify} messages. + * @param message AdvancedSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify|verify} messages. + * @param message AdvancedSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings; + + /** + * Verifies an AdvancedSettings 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 AdvancedSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings; + + /** + * Creates a plain object from an AdvancedSettings message. Also converts values to other types if specified. + * @param message AdvancedSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AdvancedSettings { + + /** Properties of a SpeechSettings. */ + interface ISpeechSettings { + + /** SpeechSettings endpointerSensitivity */ + endpointerSensitivity?: (number|null); + + /** SpeechSettings noSpeechTimeout */ + noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** SpeechSettings useTimeoutBasedEndpointing */ + useTimeoutBasedEndpointing?: (boolean|null); + + /** SpeechSettings models */ + models?: ({ [k: string]: string }|null); + } + + /** Represents a SpeechSettings. */ + class SpeechSettings implements ISpeechSettings { + + /** + * Constructs a new SpeechSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings); + + /** SpeechSettings endpointerSensitivity. */ + public endpointerSensitivity: number; + + /** SpeechSettings noSpeechTimeout. */ + public noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** SpeechSettings useTimeoutBasedEndpointing. */ + public useTimeoutBasedEndpointing: boolean; + + /** SpeechSettings models. */ + public models: { [k: string]: string }; + + /** + * Creates a new SpeechSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings; + + /** + * Encodes the specified SpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @param message SpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @param message SpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings; + + /** + * Verifies a SpeechSettings 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 SpeechSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings; + + /** + * Creates a plain object from a SpeechSettings message. Also converts values to other types if specified. + * @param message SpeechSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DtmfSettings. */ + interface IDtmfSettings { + + /** DtmfSettings enabled */ + enabled?: (boolean|null); + + /** DtmfSettings maxDigits */ + maxDigits?: (number|null); + + /** DtmfSettings finishDigit */ + finishDigit?: (string|null); + + /** DtmfSettings interdigitTimeoutDuration */ + interdigitTimeoutDuration?: (google.protobuf.IDuration|null); + + /** DtmfSettings endpointingTimeoutDuration */ + endpointingTimeoutDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a DtmfSettings. */ + class DtmfSettings implements IDtmfSettings { + + /** + * Constructs a new DtmfSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings); + + /** DtmfSettings enabled. */ + public enabled: boolean; + + /** DtmfSettings maxDigits. */ + public maxDigits: number; + + /** DtmfSettings finishDigit. */ + public finishDigit: string; + + /** DtmfSettings interdigitTimeoutDuration. */ + public interdigitTimeoutDuration?: (google.protobuf.IDuration|null); + + /** DtmfSettings endpointingTimeoutDuration. */ + public endpointingTimeoutDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new DtmfSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DtmfSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings; + + /** + * Encodes the specified DtmfSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @param message DtmfSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DtmfSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @param message DtmfSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DtmfSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DtmfSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings; + + /** + * Verifies a DtmfSettings 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 DtmfSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DtmfSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings; + + /** + * Creates a plain object from a DtmfSettings message. Also converts values to other types if specified. + * @param message DtmfSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DtmfSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DtmfSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoggingSettings. */ + interface ILoggingSettings { + + /** LoggingSettings enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); + + /** LoggingSettings enableInteractionLogging */ + enableInteractionLogging?: (boolean|null); + + /** LoggingSettings enableConsentBasedRedaction */ + enableConsentBasedRedaction?: (boolean|null); + } + + /** Represents a LoggingSettings. */ + class LoggingSettings implements ILoggingSettings { + + /** + * Constructs a new LoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings); + + /** LoggingSettings enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; + + /** LoggingSettings enableInteractionLogging. */ + public enableInteractionLogging: boolean; + + /** LoggingSettings enableConsentBasedRedaction. */ + public enableConsentBasedRedaction: boolean; + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingSettings + * @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.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings; + + /** + * Verifies a LoggingSettings 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 LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @param message LoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGcsDestination): google.cloud.dialogflow.cx.v3beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.dialogflow.cx.v3beta1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.dialogflow.cx.v3beta1.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Agents */ + class Agents extends $protobuf.rpc.Service { + + /** + * Constructs a new Agents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Agents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Agents; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAgentsResponse + */ + public listAgents(request: google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.ListAgentsCallback): void; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @returns Promise + */ + public listAgents(request: google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest): Promise; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public getAgent(request: google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentCallback): void; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @returns Promise + */ + public getAgent(request: google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest): Promise; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public createAgent(request: google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgentCallback): void; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @returns Promise + */ + public createAgent(request: google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest): Promise; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public updateAgent(request: google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgentCallback): void; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @returns Promise + */ + public updateAgent(request: google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest): Promise; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgent(request: google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgentCallback): void; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @returns Promise + */ + public deleteAgent(request: google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest): Promise; + + /** + * Calls ExportAgent. + * @param request ExportAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAgent(request: google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgentCallback): void; + + /** + * Calls ExportAgent. + * @param request ExportAgentRequest message or plain object + * @returns Promise + */ + public exportAgent(request: google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest): Promise; + + /** + * Calls RestoreAgent. + * @param request RestoreAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreAgent(request: google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgentCallback): void; + + /** + * Calls RestoreAgent. + * @param request RestoreAgentRequest message or plain object + * @returns Promise + */ + public restoreAgent(request: google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest): Promise; + + /** + * Calls ValidateAgent. + * @param request ValidateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentValidationResult + */ + public validateAgent(request: google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.ValidateAgentCallback): void; + + /** + * Calls ValidateAgent. + * @param request ValidateAgentRequest message or plain object + * @returns Promise + */ + public validateAgent(request: google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest): Promise; + + /** + * Calls GetAgentValidationResult. + * @param request GetAgentValidationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentValidationResult + */ + public getAgentValidationResult(request: google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentValidationResultCallback): void; + + /** + * Calls GetAgentValidationResult. + * @param request GetAgentValidationResultRequest message or plain object + * @returns Promise + */ + public getAgentValidationResult(request: google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest): Promise; + + /** + * Calls GetGenerativeSettings. + * @param request GetGenerativeSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerativeSettings + */ + public getGenerativeSettings(request: google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.GetGenerativeSettingsCallback): void; + + /** + * Calls GetGenerativeSettings. + * @param request GetGenerativeSettingsRequest message or plain object + * @returns Promise + */ + public getGenerativeSettings(request: google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest): Promise; + + /** + * Calls UpdateGenerativeSettings. + * @param request UpdateGenerativeSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerativeSettings + */ + public updateGenerativeSettings(request: google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Agents.UpdateGenerativeSettingsCallback): void; + + /** + * Calls UpdateGenerativeSettings. + * @param request UpdateGenerativeSettingsRequest message or plain object + * @returns Promise + */ + public updateGenerativeSettings(request: google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest): Promise; + } + + namespace Agents { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|listAgents}. + * @param error Error, if any + * @param [response] ListAgentsResponse + */ + type ListAgentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|getAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type GetAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|createAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type CreateAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|updateAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type UpdateAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|deleteAgent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|exportAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|restoreAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|validateAgent}. + * @param error Error, if any + * @param [response] AgentValidationResult + */ + type ValidateAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.AgentValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|getAgentValidationResult}. + * @param error Error, if any + * @param [response] AgentValidationResult + */ + type GetAgentValidationResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.AgentValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|getGenerativeSettings}. + * @param error Error, if any + * @param [response] GenerativeSettings + */ + type GetGenerativeSettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|updateGenerativeSettings}. + * @param error Error, if any + * @param [response] GenerativeSettings + */ + type UpdateGenerativeSettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings) => void; + } + + /** Properties of a SpeechToTextSettings. */ + interface ISpeechToTextSettings { + + /** SpeechToTextSettings enableSpeechAdaptation */ + enableSpeechAdaptation?: (boolean|null); + } + + /** Represents a SpeechToTextSettings. */ + class SpeechToTextSettings implements ISpeechToTextSettings { + + /** + * Constructs a new SpeechToTextSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings); + + /** SpeechToTextSettings enableSpeechAdaptation. */ + public enableSpeechAdaptation: boolean; + + /** + * Creates a new SpeechToTextSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechToTextSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings): google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings; + + /** + * Encodes the specified SpeechToTextSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.verify|verify} messages. + * @param message SpeechToTextSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechToTextSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.verify|verify} messages. + * @param message SpeechToTextSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechToTextSettings + * @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.dialogflow.cx.v3beta1.SpeechToTextSettings; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechToTextSettings + * @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.dialogflow.cx.v3beta1.SpeechToTextSettings; + + /** + * Verifies a SpeechToTextSettings 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 SpeechToTextSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechToTextSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings; + + /** + * Creates a plain object from a SpeechToTextSettings message. Also converts values to other types if specified. + * @param message SpeechToTextSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechToTextSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechToTextSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Agent. */ + interface IAgent { + + /** Agent name */ + name?: (string|null); + + /** Agent displayName */ + displayName?: (string|null); + + /** Agent defaultLanguageCode */ + defaultLanguageCode?: (string|null); + + /** Agent supportedLanguageCodes */ + supportedLanguageCodes?: (string[]|null); + + /** Agent timeZone */ + timeZone?: (string|null); + + /** Agent description */ + description?: (string|null); + + /** Agent avatarUri */ + avatarUri?: (string|null); + + /** Agent speechToTextSettings */ + speechToTextSettings?: (google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings|null); + + /** Agent startFlow */ + startFlow?: (string|null); + + /** Agent startPlaybook */ + startPlaybook?: (string|null); + + /** Agent securitySettings */ + securitySettings?: (string|null); + + /** Agent enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); + + /** Agent enableSpellCorrection */ + enableSpellCorrection?: (boolean|null); + + /** Agent enableMultiLanguageTraining */ + enableMultiLanguageTraining?: (boolean|null); + + /** Agent locked */ + locked?: (boolean|null); + + /** Agent advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Agent gitIntegrationSettings */ + gitIntegrationSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings|null); + + /** Agent bigqueryExportSettings */ + bigqueryExportSettings?: (google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings|null); + + /** Agent textToSpeechSettings */ + textToSpeechSettings?: (google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings|null); + + /** Agent genAppBuilderSettings */ + genAppBuilderSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings|null); + + /** Agent answerFeedbackSettings */ + answerFeedbackSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings|null); + + /** Agent personalizationSettings */ + personalizationSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings|null); + + /** Agent clientCertificateSettings */ + clientCertificateSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings|null); + + /** Agent satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Agent satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents an Agent. */ + class Agent implements IAgent { + + /** + * Constructs a new Agent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IAgent); + + /** Agent name. */ + public name: string; + + /** Agent displayName. */ + public displayName: string; + + /** Agent defaultLanguageCode. */ + public defaultLanguageCode: string; + + /** Agent supportedLanguageCodes. */ + public supportedLanguageCodes: string[]; + + /** Agent timeZone. */ + public timeZone: string; + + /** Agent description. */ + public description: string; + + /** Agent avatarUri. */ + public avatarUri: string; + + /** Agent speechToTextSettings. */ + public speechToTextSettings?: (google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings|null); + + /** Agent startFlow. */ + public startFlow?: (string|null); + + /** Agent startPlaybook. */ + public startPlaybook?: (string|null); + + /** Agent securitySettings. */ + public securitySettings: string; + + /** Agent enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; + + /** Agent enableSpellCorrection. */ + public enableSpellCorrection: boolean; + + /** Agent enableMultiLanguageTraining. */ + public enableMultiLanguageTraining: boolean; + + /** Agent locked. */ + public locked: boolean; + + /** Agent advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Agent gitIntegrationSettings. */ + public gitIntegrationSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings|null); + + /** Agent bigqueryExportSettings. */ + public bigqueryExportSettings?: (google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings|null); + + /** Agent textToSpeechSettings. */ + public textToSpeechSettings?: (google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings|null); + + /** Agent genAppBuilderSettings. */ + public genAppBuilderSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings|null); + + /** Agent answerFeedbackSettings. */ + public answerFeedbackSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings|null); + + /** Agent personalizationSettings. */ + public personalizationSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings|null); + + /** Agent clientCertificateSettings. */ + public clientCertificateSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings|null); + + /** Agent satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Agent satisfiesPzi. */ + public satisfiesPzi?: (boolean|null); + + /** Agent sessionEntryResource. */ + public sessionEntryResource?: ("startFlow"|"startPlaybook"); + + /** + * Creates a new Agent instance using the specified properties. + * @param [properties] Properties to set + * @returns Agent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IAgent): google.cloud.dialogflow.cx.v3beta1.Agent; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Agent + * @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.dialogflow.cx.v3beta1.Agent; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Agent + * @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.dialogflow.cx.v3beta1.Agent; + + /** + * Verifies an Agent 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 Agent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Agent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @param message Agent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Agent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Agent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Agent { + + /** Properties of a GitIntegrationSettings. */ + interface IGitIntegrationSettings { + + /** GitIntegrationSettings githubSettings */ + githubSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings|null); + + /** GitIntegrationSettings gitConnectionSettings */ + gitConnectionSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings|null); + } + + /** Represents a GitIntegrationSettings. */ + class GitIntegrationSettings implements IGitIntegrationSettings { + + /** + * Constructs a new GitIntegrationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings); + + /** GitIntegrationSettings githubSettings. */ + public githubSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings|null); + + /** GitIntegrationSettings gitConnectionSettings. */ + public gitConnectionSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings|null); + + /** GitIntegrationSettings gitSettings. */ + public gitSettings?: ("githubSettings"|"gitConnectionSettings"); + + /** + * Creates a new GitIntegrationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GitIntegrationSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings): google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings; + + /** + * Encodes the specified GitIntegrationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.verify|verify} messages. + * @param message GitIntegrationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitIntegrationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.verify|verify} messages. + * @param message GitIntegrationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitIntegrationSettings + * @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.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitIntegrationSettings + * @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.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings; + + /** + * Verifies a GitIntegrationSettings 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 GitIntegrationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitIntegrationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings; + + /** + * Creates a plain object from a GitIntegrationSettings message. Also converts values to other types if specified. + * @param message GitIntegrationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitIntegrationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitIntegrationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GitIntegrationSettings { + + /** Properties of a GithubSettings. */ + interface IGithubSettings { + + /** GithubSettings displayName */ + displayName?: (string|null); + + /** GithubSettings repositoryUri */ + repositoryUri?: (string|null); + + /** GithubSettings trackingBranch */ + trackingBranch?: (string|null); + + /** GithubSettings accessToken */ + accessToken?: (string|null); + + /** GithubSettings branches */ + branches?: (string[]|null); + } + + /** Represents a GithubSettings. */ + class GithubSettings implements IGithubSettings { + + /** + * Constructs a new GithubSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings); + + /** GithubSettings displayName. */ + public displayName: string; + + /** GithubSettings repositoryUri. */ + public repositoryUri: string; + + /** GithubSettings trackingBranch. */ + public trackingBranch: string; + + /** GithubSettings accessToken. */ + public accessToken: string; + + /** GithubSettings branches. */ + public branches: string[]; + + /** + * Creates a new GithubSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GithubSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings): google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Encodes the specified GithubSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @param message GithubSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GithubSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @param message GithubSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GithubSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GithubSettings + * @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.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Decodes a GithubSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GithubSettings + * @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.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Verifies a GithubSettings 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 GithubSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GithubSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings; + + /** + * Creates a plain object from a GithubSettings message. Also converts values to other types if specified. + * @param message GithubSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GithubSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GithubSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GitConnectionSettings. */ + interface IGitConnectionSettings { + + /** GitConnectionSettings displayName */ + displayName?: (string|null); + + /** GitConnectionSettings repositoryUri */ + repositoryUri?: (string|null); + + /** GitConnectionSettings trackingBranch */ + trackingBranch?: (string|null); + + /** GitConnectionSettings branches */ + branches?: (string[]|null); + + /** GitConnectionSettings accessTokenSecret */ + accessTokenSecret?: (string|null); + } + + /** Represents a GitConnectionSettings. */ + class GitConnectionSettings implements IGitConnectionSettings { + + /** + * Constructs a new GitConnectionSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings); + + /** GitConnectionSettings displayName. */ + public displayName: string; + + /** GitConnectionSettings repositoryUri. */ + public repositoryUri: string; + + /** GitConnectionSettings trackingBranch. */ + public trackingBranch: string; + + /** GitConnectionSettings branches. */ + public branches: string[]; + + /** GitConnectionSettings accessTokenSecret. */ + public accessTokenSecret?: (string|null); + + /** GitConnectionSettings gitAuthentication. */ + public gitAuthentication?: "accessTokenSecret"; + + /** + * Creates a new GitConnectionSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GitConnectionSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings): google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings; + + /** + * Encodes the specified GitConnectionSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.verify|verify} messages. + * @param message GitConnectionSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitConnectionSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.verify|verify} messages. + * @param message GitConnectionSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitConnectionSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitConnectionSettings + * @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.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings; + + /** + * Decodes a GitConnectionSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitConnectionSettings + * @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.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings; + + /** + * Verifies a GitConnectionSettings 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 GitConnectionSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitConnectionSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings; + + /** + * Creates a plain object from a GitConnectionSettings message. Also converts values to other types if specified. + * @param message GitConnectionSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitConnectionSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitConnectionSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GenAppBuilderSettings. */ + interface IGenAppBuilderSettings { + + /** GenAppBuilderSettings engine */ + engine?: (string|null); + } + + /** Represents a GenAppBuilderSettings. */ + class GenAppBuilderSettings implements IGenAppBuilderSettings { + + /** + * Constructs a new GenAppBuilderSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings); + + /** GenAppBuilderSettings engine. */ + public engine: string; + + /** + * Creates a new GenAppBuilderSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAppBuilderSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings): google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings; + + /** + * Encodes the specified GenAppBuilderSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.verify|verify} messages. + * @param message GenAppBuilderSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAppBuilderSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.verify|verify} messages. + * @param message GenAppBuilderSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAppBuilderSettings + * @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.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAppBuilderSettings + * @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.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings; + + /** + * Verifies a GenAppBuilderSettings 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 GenAppBuilderSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAppBuilderSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings; + + /** + * Creates a plain object from a GenAppBuilderSettings message. Also converts values to other types if specified. + * @param message GenAppBuilderSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAppBuilderSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAppBuilderSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnswerFeedbackSettings. */ + interface IAnswerFeedbackSettings { + + /** AnswerFeedbackSettings enableAnswerFeedback */ + enableAnswerFeedback?: (boolean|null); + } + + /** Represents an AnswerFeedbackSettings. */ + class AnswerFeedbackSettings implements IAnswerFeedbackSettings { + + /** + * Constructs a new AnswerFeedbackSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings); + + /** AnswerFeedbackSettings enableAnswerFeedback. */ + public enableAnswerFeedback: boolean; + + /** + * Creates a new AnswerFeedbackSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerFeedbackSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings): google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings; + + /** + * Encodes the specified AnswerFeedbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @param message AnswerFeedbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerFeedbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @param message AnswerFeedbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerFeedbackSettings + * @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.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerFeedbackSettings + * @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.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings; + + /** + * Verifies an AnswerFeedbackSettings 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 AnswerFeedbackSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerFeedbackSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings; + + /** + * Creates a plain object from an AnswerFeedbackSettings message. Also converts values to other types if specified. + * @param message AnswerFeedbackSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerFeedbackSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerFeedbackSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonalizationSettings. */ + interface IPersonalizationSettings { + + /** PersonalizationSettings defaultEndUserMetadata */ + defaultEndUserMetadata?: (google.protobuf.IStruct|null); + } + + /** Represents a PersonalizationSettings. */ + class PersonalizationSettings implements IPersonalizationSettings { + + /** + * Constructs a new PersonalizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings); + + /** PersonalizationSettings defaultEndUserMetadata. */ + public defaultEndUserMetadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new PersonalizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonalizationSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings): google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings; + + /** + * Encodes the specified PersonalizationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.verify|verify} messages. + * @param message PersonalizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonalizationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.verify|verify} messages. + * @param message PersonalizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonalizationSettings + * @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.dialogflow.cx.v3beta1.Agent.PersonalizationSettings; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonalizationSettings + * @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.dialogflow.cx.v3beta1.Agent.PersonalizationSettings; + + /** + * Verifies a PersonalizationSettings 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 PersonalizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonalizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings; + + /** + * Creates a plain object from a PersonalizationSettings message. Also converts values to other types if specified. + * @param message PersonalizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonalizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonalizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientCertificateSettings. */ + interface IClientCertificateSettings { + + /** ClientCertificateSettings sslCertificate */ + sslCertificate?: (string|null); + + /** ClientCertificateSettings privateKey */ + privateKey?: (string|null); + + /** ClientCertificateSettings passphrase */ + passphrase?: (string|null); + } + + /** Represents a ClientCertificateSettings. */ + class ClientCertificateSettings implements IClientCertificateSettings { + + /** + * Constructs a new ClientCertificateSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings); + + /** ClientCertificateSettings sslCertificate. */ + public sslCertificate: string; + + /** ClientCertificateSettings privateKey. */ + public privateKey: string; + + /** ClientCertificateSettings passphrase. */ + public passphrase: string; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientCertificateSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings): google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientCertificateSettings + * @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.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientCertificateSettings + * @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.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings; + + /** + * Verifies a ClientCertificateSettings 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 ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientCertificateSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @param message ClientCertificateSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientCertificateSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListAgentsRequest. */ + interface IListAgentsRequest { + + /** ListAgentsRequest parent */ + parent?: (string|null); + + /** ListAgentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAgentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAgentsRequest. */ + class ListAgentsRequest implements IListAgentsRequest { + + /** + * Constructs a new ListAgentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest); + + /** ListAgentsRequest parent. */ + public parent: string; + + /** ListAgentsRequest pageSize. */ + public pageSize: number; + + /** ListAgentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest): google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsRequest + * @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.dialogflow.cx.v3beta1.ListAgentsRequest; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsRequest + * @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.dialogflow.cx.v3beta1.ListAgentsRequest; + + /** + * Verifies a ListAgentsRequest 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 ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest; + + /** + * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. + * @param message ListAgentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsResponse. */ + interface IListAgentsResponse { + + /** ListAgentsResponse agents */ + agents?: (google.cloud.dialogflow.cx.v3beta1.IAgent[]|null); + + /** ListAgentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAgentsResponse. */ + class ListAgentsResponse implements IListAgentsResponse { + + /** + * Constructs a new ListAgentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse); + + /** ListAgentsResponse agents. */ + public agents: google.cloud.dialogflow.cx.v3beta1.IAgent[]; + + /** ListAgentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse): google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsResponse + * @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.dialogflow.cx.v3beta1.ListAgentsResponse; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsResponse + * @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.dialogflow.cx.v3beta1.ListAgentsResponse; + + /** + * Verifies a ListAgentsResponse 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 ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @param message ListAgentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentRequest. */ + interface IGetAgentRequest { + + /** GetAgentRequest name */ + name?: (string|null); + } + + /** Represents a GetAgentRequest. */ + class GetAgentRequest implements IGetAgentRequest { + + /** + * Constructs a new GetAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest); + + /** GetAgentRequest name. */ + public name: string; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest): google.cloud.dialogflow.cx.v3beta1.GetAgentRequest; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentRequest + * @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.dialogflow.cx.v3beta1.GetAgentRequest; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentRequest + * @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.dialogflow.cx.v3beta1.GetAgentRequest; + + /** + * Verifies a GetAgentRequest 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 GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetAgentRequest; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @param message GetAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAgentRequest. */ + interface ICreateAgentRequest { + + /** CreateAgentRequest parent */ + parent?: (string|null); + + /** CreateAgentRequest agent */ + agent?: (google.cloud.dialogflow.cx.v3beta1.IAgent|null); + } + + /** Represents a CreateAgentRequest. */ + class CreateAgentRequest implements ICreateAgentRequest { + + /** + * Constructs a new CreateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest); + + /** CreateAgentRequest parent. */ + public parent: string; + + /** CreateAgentRequest agent. */ + public agent?: (google.cloud.dialogflow.cx.v3beta1.IAgent|null); + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest): google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAgentRequest + * @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.dialogflow.cx.v3beta1.CreateAgentRequest; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAgentRequest + * @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.dialogflow.cx.v3beta1.CreateAgentRequest; + + /** + * Verifies a CreateAgentRequest 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 CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @param message CreateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAgentRequest. */ + interface IUpdateAgentRequest { + + /** UpdateAgentRequest agent */ + agent?: (google.cloud.dialogflow.cx.v3beta1.IAgent|null); + + /** UpdateAgentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAgentRequest. */ + class UpdateAgentRequest implements IUpdateAgentRequest { + + /** + * Constructs a new UpdateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest); + + /** UpdateAgentRequest agent. */ + public agent?: (google.cloud.dialogflow.cx.v3beta1.IAgent|null); + + /** UpdateAgentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest): google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAgentRequest + * @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.dialogflow.cx.v3beta1.UpdateAgentRequest; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAgentRequest + * @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.dialogflow.cx.v3beta1.UpdateAgentRequest; + + /** + * Verifies an UpdateAgentRequest 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 UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @param message UpdateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAgentRequest. */ + interface IDeleteAgentRequest { + + /** DeleteAgentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAgentRequest. */ + class DeleteAgentRequest implements IDeleteAgentRequest { + + /** + * Constructs a new DeleteAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest); + + /** DeleteAgentRequest name. */ + public name: string; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest): google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAgentRequest + * @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.dialogflow.cx.v3beta1.DeleteAgentRequest; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAgentRequest + * @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.dialogflow.cx.v3beta1.DeleteAgentRequest; + + /** + * Verifies a DeleteAgentRequest 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 DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @param message DeleteAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAgentRequest. */ + interface IExportAgentRequest { + + /** ExportAgentRequest name */ + name?: (string|null); + + /** ExportAgentRequest agentUri */ + agentUri?: (string|null); + + /** ExportAgentRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat|null); + + /** ExportAgentRequest environment */ + environment?: (string|null); + + /** ExportAgentRequest gitDestination */ + gitDestination?: (google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination|null); + + /** ExportAgentRequest includeBigqueryExportSettings */ + includeBigqueryExportSettings?: (boolean|null); + } + + /** Represents an ExportAgentRequest. */ + class ExportAgentRequest implements IExportAgentRequest { + + /** + * Constructs a new ExportAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest); + + /** ExportAgentRequest name. */ + public name: string; + + /** ExportAgentRequest agentUri. */ + public agentUri: string; + + /** ExportAgentRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat); + + /** ExportAgentRequest environment. */ + public environment: string; + + /** ExportAgentRequest gitDestination. */ + public gitDestination?: (google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination|null); + + /** ExportAgentRequest includeBigqueryExportSettings. */ + public includeBigqueryExportSettings: boolean; + + /** + * Creates a new ExportAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest): google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest; + + /** + * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.verify|verify} messages. + * @param message ExportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.verify|verify} messages. + * @param message ExportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAgentRequest + * @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.dialogflow.cx.v3beta1.ExportAgentRequest; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAgentRequest + * @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.dialogflow.cx.v3beta1.ExportAgentRequest; + + /** + * Verifies an ExportAgentRequest 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 ExportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest; + + /** + * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. + * @param message ExportAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportAgentRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON_PACKAGE = 4 + } + + /** Properties of a GitDestination. */ + interface IGitDestination { + + /** GitDestination trackingBranch */ + trackingBranch?: (string|null); + + /** GitDestination commitMessage */ + commitMessage?: (string|null); + } + + /** Represents a GitDestination. */ + class GitDestination implements IGitDestination { + + /** + * Constructs a new GitDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination); + + /** GitDestination trackingBranch. */ + public trackingBranch: string; + + /** GitDestination commitMessage. */ + public commitMessage: string; + + /** + * Creates a new GitDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GitDestination instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination): google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination; + + /** + * Encodes the specified GitDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.verify|verify} messages. + * @param message GitDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.verify|verify} messages. + * @param message GitDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitDestination + * @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.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination; + + /** + * Decodes a GitDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitDestination + * @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.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination; + + /** + * Verifies a GitDestination 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 GitDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination; + + /** + * Creates a plain object from a GitDestination message. Also converts values to other types if specified. + * @param message GitDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportAgentResponse. */ + interface IExportAgentResponse { + + /** ExportAgentResponse agentUri */ + agentUri?: (string|null); + + /** ExportAgentResponse agentContent */ + agentContent?: (Uint8Array|Buffer|string|null); + + /** ExportAgentResponse commitSha */ + commitSha?: (string|null); + } + + /** Represents an ExportAgentResponse. */ + class ExportAgentResponse implements IExportAgentResponse { + + /** + * Constructs a new ExportAgentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse); + + /** ExportAgentResponse agentUri. */ + public agentUri?: (string|null); + + /** ExportAgentResponse agentContent. */ + public agentContent?: (Uint8Array|Buffer|string|null); + + /** ExportAgentResponse commitSha. */ + public commitSha?: (string|null); + + /** ExportAgentResponse agent. */ + public agent?: ("agentUri"|"agentContent"|"commitSha"); + + /** + * Creates a new ExportAgentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAgentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse): google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse; + + /** + * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.verify|verify} messages. + * @param message ExportAgentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.verify|verify} messages. + * @param message ExportAgentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAgentResponse + * @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.dialogflow.cx.v3beta1.ExportAgentResponse; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAgentResponse + * @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.dialogflow.cx.v3beta1.ExportAgentResponse; + + /** + * Verifies an ExportAgentResponse 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 ExportAgentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAgentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse; + + /** + * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. + * @param message ExportAgentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAgentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAgentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAgentRequest. */ + interface IRestoreAgentRequest { + + /** RestoreAgentRequest name */ + name?: (string|null); + + /** RestoreAgentRequest agentUri */ + agentUri?: (string|null); + + /** RestoreAgentRequest agentContent */ + agentContent?: (Uint8Array|Buffer|string|null); + + /** RestoreAgentRequest gitSource */ + gitSource?: (google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource|null); + + /** RestoreAgentRequest restoreOption */ + restoreOption?: (google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption|null); + } + + /** Represents a RestoreAgentRequest. */ + class RestoreAgentRequest implements IRestoreAgentRequest { + + /** + * Constructs a new RestoreAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest); + + /** RestoreAgentRequest name. */ + public name: string; + + /** RestoreAgentRequest agentUri. */ + public agentUri?: (string|null); + + /** RestoreAgentRequest agentContent. */ + public agentContent?: (Uint8Array|Buffer|string|null); + + /** RestoreAgentRequest gitSource. */ + public gitSource?: (google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource|null); + + /** RestoreAgentRequest restoreOption. */ + public restoreOption: (google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption); + + /** RestoreAgentRequest agent. */ + public agent?: ("agentUri"|"agentContent"|"gitSource"); + + /** + * Creates a new RestoreAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest): google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest; + + /** + * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.verify|verify} messages. + * @param message RestoreAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.verify|verify} messages. + * @param message RestoreAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAgentRequest + * @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.dialogflow.cx.v3beta1.RestoreAgentRequest; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAgentRequest + * @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.dialogflow.cx.v3beta1.RestoreAgentRequest; + + /** + * Verifies a RestoreAgentRequest 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 RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest; + + /** + * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. + * @param message RestoreAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RestoreAgentRequest { + + /** Properties of a GitSource. */ + interface IGitSource { + + /** GitSource trackingBranch */ + trackingBranch?: (string|null); + } + + /** Represents a GitSource. */ + class GitSource implements IGitSource { + + /** + * Constructs a new GitSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource); + + /** GitSource trackingBranch. */ + public trackingBranch: string; + + /** + * Creates a new GitSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GitSource instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource): google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource; + + /** + * Encodes the specified GitSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.verify|verify} messages. + * @param message GitSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.verify|verify} messages. + * @param message GitSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitSource + * @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.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource; + + /** + * Decodes a GitSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitSource + * @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.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource; + + /** + * Verifies a GitSource 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 GitSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource; + + /** + * Creates a plain object from a GitSource message. Also converts values to other types if specified. + * @param message GitSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RestoreOption enum. */ + enum RestoreOption { + RESTORE_OPTION_UNSPECIFIED = 0, + KEEP = 1, + FALLBACK = 2 + } + } + + /** Properties of a ValidateAgentRequest. */ + interface IValidateAgentRequest { + + /** ValidateAgentRequest name */ + name?: (string|null); + + /** ValidateAgentRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ValidateAgentRequest. */ + class ValidateAgentRequest implements IValidateAgentRequest { + + /** + * Constructs a new ValidateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest); + + /** ValidateAgentRequest name. */ + public name: string; + + /** ValidateAgentRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ValidateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest): google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest; + + /** + * Encodes the specified ValidateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest.verify|verify} messages. + * @param message ValidateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest.verify|verify} messages. + * @param message ValidateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateAgentRequest + * @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.dialogflow.cx.v3beta1.ValidateAgentRequest; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateAgentRequest + * @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.dialogflow.cx.v3beta1.ValidateAgentRequest; + + /** + * Verifies a ValidateAgentRequest 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 ValidateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest; + + /** + * Creates a plain object from a ValidateAgentRequest message. Also converts values to other types if specified. + * @param message ValidateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentValidationResultRequest. */ + interface IGetAgentValidationResultRequest { + + /** GetAgentValidationResultRequest name */ + name?: (string|null); + + /** GetAgentValidationResultRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetAgentValidationResultRequest. */ + class GetAgentValidationResultRequest implements IGetAgentValidationResultRequest { + + /** + * Constructs a new GetAgentValidationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest); + + /** GetAgentValidationResultRequest name. */ + public name: string; + + /** GetAgentValidationResultRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetAgentValidationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentValidationResultRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest): google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest; + + /** + * Encodes the specified GetAgentValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest.verify|verify} messages. + * @param message GetAgentValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest.verify|verify} messages. + * @param message GetAgentValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentValidationResultRequest + * @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.dialogflow.cx.v3beta1.GetAgentValidationResultRequest; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentValidationResultRequest + * @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.dialogflow.cx.v3beta1.GetAgentValidationResultRequest; + + /** + * Verifies a GetAgentValidationResultRequest 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 GetAgentValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentValidationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest; + + /** + * Creates a plain object from a GetAgentValidationResultRequest message. Also converts values to other types if specified. + * @param message GetAgentValidationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentValidationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentValidationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentValidationResult. */ + interface IAgentValidationResult { + + /** AgentValidationResult name */ + name?: (string|null); + + /** AgentValidationResult flowValidationResults */ + flowValidationResults?: (google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult[]|null); + } + + /** Represents an AgentValidationResult. */ + class AgentValidationResult implements IAgentValidationResult { + + /** + * Constructs a new AgentValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult); + + /** AgentValidationResult name. */ + public name: string; + + /** AgentValidationResult flowValidationResults. */ + public flowValidationResults: google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult[]; + + /** + * Creates a new AgentValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentValidationResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult): google.cloud.dialogflow.cx.v3beta1.AgentValidationResult; + + /** + * Encodes the specified AgentValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentValidationResult.verify|verify} messages. + * @param message AgentValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentValidationResult.verify|verify} messages. + * @param message AgentValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentValidationResult + * @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.dialogflow.cx.v3beta1.AgentValidationResult; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentValidationResult + * @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.dialogflow.cx.v3beta1.AgentValidationResult; + + /** + * Verifies an AgentValidationResult 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 AgentValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AgentValidationResult; + + /** + * Creates a plain object from an AgentValidationResult message. Also converts values to other types if specified. + * @param message AgentValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AgentValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentValidationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGenerativeSettingsRequest. */ + interface IGetGenerativeSettingsRequest { + + /** GetGenerativeSettingsRequest name */ + name?: (string|null); + + /** GetGenerativeSettingsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetGenerativeSettingsRequest. */ + class GetGenerativeSettingsRequest implements IGetGenerativeSettingsRequest { + + /** + * Constructs a new GetGenerativeSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest); + + /** GetGenerativeSettingsRequest name. */ + public name: string; + + /** GetGenerativeSettingsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetGenerativeSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGenerativeSettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest): google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest; + + /** + * Encodes the specified GetGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest.verify|verify} messages. + * @param message GetGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest.verify|verify} messages. + * @param message GetGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGenerativeSettingsRequest + * @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.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGenerativeSettingsRequest + * @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.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest; + + /** + * Verifies a GetGenerativeSettingsRequest 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 GetGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGenerativeSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest; + + /** + * Creates a plain object from a GetGenerativeSettingsRequest message. Also converts values to other types if specified. + * @param message GetGenerativeSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGenerativeSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGenerativeSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGenerativeSettingsRequest. */ + interface IUpdateGenerativeSettingsRequest { + + /** UpdateGenerativeSettingsRequest generativeSettings */ + generativeSettings?: (google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings|null); + + /** UpdateGenerativeSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGenerativeSettingsRequest. */ + class UpdateGenerativeSettingsRequest implements IUpdateGenerativeSettingsRequest { + + /** + * Constructs a new UpdateGenerativeSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest); + + /** UpdateGenerativeSettingsRequest generativeSettings. */ + public generativeSettings?: (google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings|null); + + /** UpdateGenerativeSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGenerativeSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGenerativeSettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest): google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest; + + /** + * Encodes the specified UpdateGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @param message UpdateGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @param message UpdateGenerativeSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGenerativeSettingsRequest + * @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.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGenerativeSettingsRequest + * @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.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest; + + /** + * Verifies an UpdateGenerativeSettingsRequest 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 UpdateGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGenerativeSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest; + + /** + * Creates a plain object from an UpdateGenerativeSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateGenerativeSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGenerativeSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGenerativeSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + AUDIO_ENCODING_LINEAR_16 = 1, + AUDIO_ENCODING_FLAC = 2, + AUDIO_ENCODING_MULAW = 3, + AUDIO_ENCODING_AMR = 4, + AUDIO_ENCODING_AMR_WB = 5, + AUDIO_ENCODING_OGG_OPUS = 6, + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7, + AUDIO_ENCODING_ALAW = 8 + } + + /** SpeechModelVariant enum. */ + enum SpeechModelVariant { + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0, + USE_BEST_AVAILABLE = 1, + USE_STANDARD = 2, + USE_ENHANCED = 3 + } + + /** Properties of a SpeechWordInfo. */ + interface ISpeechWordInfo { + + /** SpeechWordInfo word */ + word?: (string|null); + + /** SpeechWordInfo startOffset */ + startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset */ + endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence */ + confidence?: (number|null); + } + + /** Represents a SpeechWordInfo. */ + class SpeechWordInfo implements ISpeechWordInfo { + + /** + * Constructs a new SpeechWordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo); + + /** SpeechWordInfo word. */ + public word: string; + + /** SpeechWordInfo startOffset. */ + public startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset. */ + public endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence. */ + public confidence: number; + + /** + * Creates a new SpeechWordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechWordInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo): google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo; + + /** + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechWordInfo + * @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.dialogflow.cx.v3beta1.SpeechWordInfo; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechWordInfo + * @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.dialogflow.cx.v3beta1.SpeechWordInfo; + + /** + * Verifies a SpeechWordInfo 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 SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechWordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo; + + /** + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * @param message SpeechWordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechWordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechWordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BargeInConfig. */ + interface IBargeInConfig { + + /** BargeInConfig noBargeInDuration */ + noBargeInDuration?: (google.protobuf.IDuration|null); + + /** BargeInConfig totalDuration */ + totalDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a BargeInConfig. */ + class BargeInConfig implements IBargeInConfig { + + /** + * Constructs a new BargeInConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBargeInConfig); + + /** BargeInConfig noBargeInDuration. */ + public noBargeInDuration?: (google.protobuf.IDuration|null); + + /** BargeInConfig totalDuration. */ + public totalDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BargeInConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBargeInConfig): google.cloud.dialogflow.cx.v3beta1.BargeInConfig; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BargeInConfig + * @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.dialogflow.cx.v3beta1.BargeInConfig; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BargeInConfig + * @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.dialogflow.cx.v3beta1.BargeInConfig; + + /** + * Verifies a BargeInConfig 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 BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BargeInConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BargeInConfig; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @param message BargeInConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BargeInConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BargeInConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BargeInConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InputAudioConfig. */ + interface IInputAudioConfig { + + /** InputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.cx.v3beta1.AudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3beta1.AudioEncoding|null); + + /** InputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** InputAudioConfig enableWordInfo */ + enableWordInfo?: (boolean|null); + + /** InputAudioConfig phraseHints */ + phraseHints?: (string[]|null); + + /** InputAudioConfig model */ + model?: (string|null); + + /** InputAudioConfig modelVariant */ + modelVariant?: (google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant|null); + + /** InputAudioConfig singleUtterance */ + singleUtterance?: (boolean|null); + + /** InputAudioConfig bargeInConfig */ + bargeInConfig?: (google.cloud.dialogflow.cx.v3beta1.IBargeInConfig|null); + + /** InputAudioConfig optOutConformerModelMigration */ + optOutConformerModelMigration?: (boolean|null); + } + + /** Represents an InputAudioConfig. */ + class InputAudioConfig implements IInputAudioConfig { + + /** + * Constructs a new InputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig); + + /** InputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.cx.v3beta1.AudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3beta1.AudioEncoding); + + /** InputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** InputAudioConfig enableWordInfo. */ + public enableWordInfo: boolean; + + /** InputAudioConfig phraseHints. */ + public phraseHints: string[]; + + /** InputAudioConfig model. */ + public model: string; + + /** InputAudioConfig modelVariant. */ + public modelVariant: (google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant); + + /** InputAudioConfig singleUtterance. */ + public singleUtterance: boolean; + + /** InputAudioConfig bargeInConfig. */ + public bargeInConfig?: (google.cloud.dialogflow.cx.v3beta1.IBargeInConfig|null); + + /** InputAudioConfig optOutConformerModelMigration. */ + public optOutConformerModelMigration: boolean; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudioConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig): google.cloud.dialogflow.cx.v3beta1.InputAudioConfig; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudioConfig + * @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.dialogflow.cx.v3beta1.InputAudioConfig; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudioConfig + * @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.dialogflow.cx.v3beta1.InputAudioConfig; + + /** + * Verifies an InputAudioConfig 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 InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.InputAudioConfig; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @param message InputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SsmlVoiceGender enum. */ + enum SsmlVoiceGender { + SSML_VOICE_GENDER_UNSPECIFIED = 0, + SSML_VOICE_GENDER_MALE = 1, + SSML_VOICE_GENDER_FEMALE = 2, + SSML_VOICE_GENDER_NEUTRAL = 3 + } + + /** Properties of a VoiceSelectionParams. */ + interface IVoiceSelectionParams { + + /** VoiceSelectionParams name */ + name?: (string|null); + + /** VoiceSelectionParams ssmlGender */ + ssmlGender?: (google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender|null); + } + + /** Represents a VoiceSelectionParams. */ + class VoiceSelectionParams implements IVoiceSelectionParams { + + /** + * Constructs a new VoiceSelectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams); + + /** VoiceSelectionParams name. */ + public name: string; + + /** VoiceSelectionParams ssmlGender. */ + public ssmlGender: (google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender); + + /** + * Creates a new VoiceSelectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceSelectionParams instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams): google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams; + + /** + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceSelectionParams + * @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.dialogflow.cx.v3beta1.VoiceSelectionParams; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceSelectionParams + * @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.dialogflow.cx.v3beta1.VoiceSelectionParams; + + /** + * Verifies a VoiceSelectionParams 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 VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceSelectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams; + + /** + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @param message VoiceSelectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceSelectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceSelectionParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SynthesizeSpeechConfig. */ + interface ISynthesizeSpeechConfig { + + /** SynthesizeSpeechConfig speakingRate */ + speakingRate?: (number|null); + + /** SynthesizeSpeechConfig pitch */ + pitch?: (number|null); + + /** SynthesizeSpeechConfig volumeGainDb */ + volumeGainDb?: (number|null); + + /** SynthesizeSpeechConfig effectsProfileId */ + effectsProfileId?: (string[]|null); + + /** SynthesizeSpeechConfig voice */ + voice?: (google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams|null); + } + + /** Represents a SynthesizeSpeechConfig. */ + class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + + /** + * Constructs a new SynthesizeSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig); + + /** SynthesizeSpeechConfig speakingRate. */ + public speakingRate: number; + + /** SynthesizeSpeechConfig pitch. */ + public pitch: number; + + /** SynthesizeSpeechConfig volumeGainDb. */ + public volumeGainDb: number; + + /** SynthesizeSpeechConfig effectsProfileId. */ + public effectsProfileId: string[]; + + /** SynthesizeSpeechConfig voice. */ + public voice?: (google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams|null); + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SynthesizeSpeechConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig): google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SynthesizeSpeechConfig + * @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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SynthesizeSpeechConfig + * @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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig; + + /** + * Verifies a SynthesizeSpeechConfig 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 SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SynthesizeSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @param message SynthesizeSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** OutputAudioEncoding enum. */ + enum OutputAudioEncoding { + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0, + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1, + OUTPUT_AUDIO_ENCODING_MP3 = 2, + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4, + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3, + OUTPUT_AUDIO_ENCODING_MULAW = 5, + OUTPUT_AUDIO_ENCODING_ALAW = 6 + } + + /** Properties of an OutputAudioConfig. */ + interface IOutputAudioConfig { + + /** OutputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding|null); + + /** OutputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** OutputAudioConfig synthesizeSpeechConfig */ + synthesizeSpeechConfig?: (google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig|null); + } + + /** Represents an OutputAudioConfig. */ + class OutputAudioConfig implements IOutputAudioConfig { + + /** + * Constructs a new OutputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig); + + /** OutputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding); + + /** OutputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** OutputAudioConfig synthesizeSpeechConfig. */ + public synthesizeSpeechConfig?: (google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig|null); + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig): google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioConfig + * @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.dialogflow.cx.v3beta1.OutputAudioConfig; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioConfig + * @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.dialogflow.cx.v3beta1.OutputAudioConfig; + + /** + * Verifies an OutputAudioConfig 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 OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @param message OutputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextToSpeechSettings. */ + interface ITextToSpeechSettings { + + /** TextToSpeechSettings synthesizeSpeechConfigs */ + synthesizeSpeechConfigs?: ({ [k: string]: google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig }|null); + } + + /** Represents a TextToSpeechSettings. */ + class TextToSpeechSettings implements ITextToSpeechSettings { + + /** + * Constructs a new TextToSpeechSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings); + + /** TextToSpeechSettings synthesizeSpeechConfigs. */ + public synthesizeSpeechConfigs: { [k: string]: google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig }; + + /** + * Creates a new TextToSpeechSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns TextToSpeechSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings): google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings; + + /** + * Encodes the specified TextToSpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.verify|verify} messages. + * @param message TextToSpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextToSpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.verify|verify} messages. + * @param message TextToSpeechSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextToSpeechSettings + * @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.dialogflow.cx.v3beta1.TextToSpeechSettings; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextToSpeechSettings + * @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.dialogflow.cx.v3beta1.TextToSpeechSettings; + + /** + * Verifies a TextToSpeechSettings 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 TextToSpeechSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextToSpeechSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings; + + /** + * Creates a plain object from a TextToSpeechSettings message. Also converts values to other types if specified. + * @param message TextToSpeechSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextToSpeechSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextToSpeechSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryExportSettings. */ + interface IBigQueryExportSettings { + + /** BigQueryExportSettings enabled */ + enabled?: (boolean|null); + + /** BigQueryExportSettings bigqueryTable */ + bigqueryTable?: (string|null); + } + + /** Represents a BigQueryExportSettings. */ + class BigQueryExportSettings implements IBigQueryExportSettings { + + /** + * Constructs a new BigQueryExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings); + + /** BigQueryExportSettings enabled. */ + public enabled: boolean; + + /** BigQueryExportSettings bigqueryTable. */ + public bigqueryTable: string; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryExportSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings): google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryExportSettings + * @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.dialogflow.cx.v3beta1.BigQueryExportSettings; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryExportSettings + * @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.dialogflow.cx.v3beta1.BigQueryExportSettings; + + /** + * Verifies a BigQueryExportSettings 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 BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @param message BigQueryExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Flows */ + class Flows extends $protobuf.rpc.Service { + + /** + * Constructs a new Flows service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Flows service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Flows; + + /** + * Calls CreateFlow. + * @param request CreateFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Flow + */ + public createFlow(request: google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlowCallback): void; + + /** + * Calls CreateFlow. + * @param request CreateFlowRequest message or plain object + * @returns Promise + */ + public createFlow(request: google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest): Promise; + + /** + * Calls DeleteFlow. + * @param request DeleteFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFlow(request: google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlowCallback): void; + + /** + * Calls DeleteFlow. + * @param request DeleteFlowRequest message or plain object + * @returns Promise + */ + public deleteFlow(request: google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest): Promise; + + /** + * Calls ListFlows. + * @param request ListFlowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFlowsResponse + */ + public listFlows(request: google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.ListFlowsCallback): void; + + /** + * Calls ListFlows. + * @param request ListFlowsRequest message or plain object + * @returns Promise + */ + public listFlows(request: google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest): Promise; + + /** + * Calls GetFlow. + * @param request GetFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Flow + */ + public getFlow(request: google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowCallback): void; + + /** + * Calls GetFlow. + * @param request GetFlowRequest message or plain object + * @returns Promise + */ + public getFlow(request: google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest): Promise; + + /** + * Calls UpdateFlow. + * @param request UpdateFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Flow + */ + public updateFlow(request: google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlowCallback): void; + + /** + * Calls UpdateFlow. + * @param request UpdateFlowRequest message or plain object + * @returns Promise + */ + public updateFlow(request: google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest): Promise; + + /** + * Calls TrainFlow. + * @param request TrainFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public trainFlow(request: google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlowCallback): void; + + /** + * Calls TrainFlow. + * @param request TrainFlowRequest message or plain object + * @returns Promise + */ + public trainFlow(request: google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest): Promise; + + /** + * Calls ValidateFlow. + * @param request ValidateFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FlowValidationResult + */ + public validateFlow(request: google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.ValidateFlowCallback): void; + + /** + * Calls ValidateFlow. + * @param request ValidateFlowRequest message or plain object + * @returns Promise + */ + public validateFlow(request: google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest): Promise; + + /** + * Calls GetFlowValidationResult. + * @param request GetFlowValidationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FlowValidationResult + */ + public getFlowValidationResult(request: google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowValidationResultCallback): void; + + /** + * Calls GetFlowValidationResult. + * @param request GetFlowValidationResultRequest message or plain object + * @returns Promise + */ + public getFlowValidationResult(request: google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest): Promise; + + /** + * Calls ImportFlow. + * @param request ImportFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importFlow(request: google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlowCallback): void; + + /** + * Calls ImportFlow. + * @param request ImportFlowRequest message or plain object + * @returns Promise + */ + public importFlow(request: google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest): Promise; + + /** + * Calls ExportFlow. + * @param request ExportFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportFlow(request: google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlowCallback): void; + + /** + * Calls ExportFlow. + * @param request ExportFlowRequest message or plain object + * @returns Promise + */ + public exportFlow(request: google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest): Promise; + } + + namespace Flows { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|createFlow}. + * @param error Error, if any + * @param [response] Flow + */ + type CreateFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Flow) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|deleteFlow}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFlowCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|listFlows}. + * @param error Error, if any + * @param [response] ListFlowsResponse + */ + type ListFlowsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|getFlow}. + * @param error Error, if any + * @param [response] Flow + */ + type GetFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Flow) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|updateFlow}. + * @param error Error, if any + * @param [response] Flow + */ + type UpdateFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Flow) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|trainFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type TrainFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|validateFlow}. + * @param error Error, if any + * @param [response] FlowValidationResult + */ + type ValidateFlowCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.FlowValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|getFlowValidationResult}. + * @param error Error, if any + * @param [response] FlowValidationResult + */ + type GetFlowValidationResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.FlowValidationResult) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|importFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|exportFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NluSettings. */ + interface INluSettings { + + /** NluSettings modelType */ + modelType?: (google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType|keyof typeof google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType|null); + + /** NluSettings classificationThreshold */ + classificationThreshold?: (number|null); + + /** NluSettings modelTrainingMode */ + modelTrainingMode?: (google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode|null); + } + + /** Represents a NluSettings. */ + class NluSettings implements INluSettings { + + /** + * Constructs a new NluSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.INluSettings); + + /** NluSettings modelType. */ + public modelType: (google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType|keyof typeof google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType); + + /** NluSettings classificationThreshold. */ + public classificationThreshold: number; + + /** NluSettings modelTrainingMode. */ + public modelTrainingMode: (google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode); + + /** + * Creates a new NluSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NluSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.INluSettings): google.cloud.dialogflow.cx.v3beta1.NluSettings; + + /** + * Encodes the specified NluSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NluSettings.verify|verify} messages. + * @param message NluSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.INluSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NluSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NluSettings.verify|verify} messages. + * @param message NluSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.INluSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NluSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NluSettings + * @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.dialogflow.cx.v3beta1.NluSettings; + + /** + * Decodes a NluSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NluSettings + * @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.dialogflow.cx.v3beta1.NluSettings; + + /** + * Verifies a NluSettings 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 NluSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NluSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.NluSettings; + + /** + * Creates a plain object from a NluSettings message. Also converts values to other types if specified. + * @param message NluSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.NluSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NluSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NluSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NluSettings { + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + MODEL_TYPE_STANDARD = 1, + MODEL_TYPE_ADVANCED = 3 + } + + /** ModelTrainingMode enum. */ + enum ModelTrainingMode { + MODEL_TRAINING_MODE_UNSPECIFIED = 0, + MODEL_TRAINING_MODE_AUTOMATIC = 1, + MODEL_TRAINING_MODE_MANUAL = 2 + } + } + + /** Properties of a Flow. */ + interface IFlow { + + /** Flow name */ + name?: (string|null); + + /** Flow displayName */ + displayName?: (string|null); + + /** Flow description */ + description?: (string|null); + + /** Flow transitionRoutes */ + transitionRoutes?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRoute[]|null); + + /** Flow eventHandlers */ + eventHandlers?: (google.cloud.dialogflow.cx.v3beta1.IEventHandler[]|null); + + /** Flow transitionRouteGroups */ + transitionRouteGroups?: (string[]|null); + + /** Flow nluSettings */ + nluSettings?: (google.cloud.dialogflow.cx.v3beta1.INluSettings|null); + + /** Flow advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Flow knowledgeConnectorSettings */ + knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null); + + /** Flow inputParameterDefinitions */ + inputParameterDefinitions?: (google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]|null); + + /** Flow outputParameterDefinitions */ + outputParameterDefinitions?: (google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]|null); + + /** Flow multiLanguageSettings */ + multiLanguageSettings?: (google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings|null); + + /** Flow locked */ + locked?: (boolean|null); + } + + /** Represents a Flow. */ + class Flow implements IFlow { + + /** + * Constructs a new Flow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFlow); + + /** Flow name. */ + public name: string; + + /** Flow displayName. */ + public displayName: string; + + /** Flow description. */ + public description: string; + + /** Flow transitionRoutes. */ + public transitionRoutes: google.cloud.dialogflow.cx.v3beta1.ITransitionRoute[]; + + /** Flow eventHandlers. */ + public eventHandlers: google.cloud.dialogflow.cx.v3beta1.IEventHandler[]; + + /** Flow transitionRouteGroups. */ + public transitionRouteGroups: string[]; + + /** Flow nluSettings. */ + public nluSettings?: (google.cloud.dialogflow.cx.v3beta1.INluSettings|null); + + /** Flow advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Flow knowledgeConnectorSettings. */ + public knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null); + + /** Flow inputParameterDefinitions. */ + public inputParameterDefinitions: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]; + + /** Flow outputParameterDefinitions. */ + public outputParameterDefinitions: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]; + + /** Flow multiLanguageSettings. */ + public multiLanguageSettings?: (google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings|null); + + /** Flow locked. */ + public locked: boolean; + + /** + * Creates a new Flow instance using the specified properties. + * @param [properties] Properties to set + * @returns Flow instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFlow): google.cloud.dialogflow.cx.v3beta1.Flow; + + /** + * Encodes the specified Flow message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.verify|verify} messages. + * @param message Flow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFlow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Flow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.verify|verify} messages. + * @param message Flow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFlow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Flow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Flow + * @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.dialogflow.cx.v3beta1.Flow; + + /** + * Decodes a Flow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Flow + * @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.dialogflow.cx.v3beta1.Flow; + + /** + * Verifies a Flow 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 Flow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Flow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Flow; + + /** + * Creates a plain object from a Flow message. Also converts values to other types if specified. + * @param message Flow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Flow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Flow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Flow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Flow { + + /** Properties of a MultiLanguageSettings. */ + interface IMultiLanguageSettings { + + /** MultiLanguageSettings enableMultiLanguageDetection */ + enableMultiLanguageDetection?: (boolean|null); + + /** MultiLanguageSettings supportedResponseLanguageCodes */ + supportedResponseLanguageCodes?: (string[]|null); + } + + /** Represents a MultiLanguageSettings. */ + class MultiLanguageSettings implements IMultiLanguageSettings { + + /** + * Constructs a new MultiLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings); + + /** MultiLanguageSettings enableMultiLanguageDetection. */ + public enableMultiLanguageDetection: boolean; + + /** MultiLanguageSettings supportedResponseLanguageCodes. */ + public supportedResponseLanguageCodes: string[]; + + /** + * Creates a new MultiLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiLanguageSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings): google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings; + + /** + * Encodes the specified MultiLanguageSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.verify|verify} messages. + * @param message MultiLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiLanguageSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.verify|verify} messages. + * @param message MultiLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiLanguageSettings + * @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.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiLanguageSettings + * @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.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings; + + /** + * Verifies a MultiLanguageSettings 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 MultiLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings; + + /** + * Creates a plain object from a MultiLanguageSettings message. Also converts values to other types if specified. + * @param message MultiLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateFlowRequest. */ + interface ICreateFlowRequest { + + /** CreateFlowRequest parent */ + parent?: (string|null); + + /** CreateFlowRequest flow */ + flow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + + /** CreateFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateFlowRequest. */ + class CreateFlowRequest implements ICreateFlowRequest { + + /** + * Constructs a new CreateFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest); + + /** CreateFlowRequest parent. */ + public parent: string; + + /** CreateFlowRequest flow. */ + public flow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + + /** CreateFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest): google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest; + + /** + * Encodes the specified CreateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.verify|verify} messages. + * @param message CreateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.verify|verify} messages. + * @param message CreateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFlowRequest + * @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.dialogflow.cx.v3beta1.CreateFlowRequest; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFlowRequest + * @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.dialogflow.cx.v3beta1.CreateFlowRequest; + + /** + * Verifies a CreateFlowRequest 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 CreateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest; + + /** + * Creates a plain object from a CreateFlowRequest message. Also converts values to other types if specified. + * @param message CreateFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFlowRequest. */ + interface IDeleteFlowRequest { + + /** DeleteFlowRequest name */ + name?: (string|null); + + /** DeleteFlowRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteFlowRequest. */ + class DeleteFlowRequest implements IDeleteFlowRequest { + + /** + * Constructs a new DeleteFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest); + + /** DeleteFlowRequest name. */ + public name: string; + + /** DeleteFlowRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest): google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest; + + /** + * Encodes the specified DeleteFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.verify|verify} messages. + * @param message DeleteFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.verify|verify} messages. + * @param message DeleteFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFlowRequest + * @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.dialogflow.cx.v3beta1.DeleteFlowRequest; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFlowRequest + * @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.dialogflow.cx.v3beta1.DeleteFlowRequest; + + /** + * Verifies a DeleteFlowRequest 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 DeleteFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest; + + /** + * Creates a plain object from a DeleteFlowRequest message. Also converts values to other types if specified. + * @param message DeleteFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFlowsRequest. */ + interface IListFlowsRequest { + + /** ListFlowsRequest parent */ + parent?: (string|null); + + /** ListFlowsRequest pageSize */ + pageSize?: (number|null); + + /** ListFlowsRequest pageToken */ + pageToken?: (string|null); + + /** ListFlowsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListFlowsRequest. */ + class ListFlowsRequest implements IListFlowsRequest { + + /** + * Constructs a new ListFlowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest); + + /** ListFlowsRequest parent. */ + public parent: string; + + /** ListFlowsRequest pageSize. */ + public pageSize: number; + + /** ListFlowsRequest pageToken. */ + public pageToken: string; + + /** ListFlowsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListFlowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFlowsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest): google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest; + + /** + * Encodes the specified ListFlowsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.verify|verify} messages. + * @param message ListFlowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFlowsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.verify|verify} messages. + * @param message ListFlowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFlowsRequest + * @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.dialogflow.cx.v3beta1.ListFlowsRequest; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFlowsRequest + * @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.dialogflow.cx.v3beta1.ListFlowsRequest; + + /** + * Verifies a ListFlowsRequest 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 ListFlowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFlowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest; + + /** + * Creates a plain object from a ListFlowsRequest message. Also converts values to other types if specified. + * @param message ListFlowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFlowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFlowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFlowsResponse. */ + interface IListFlowsResponse { + + /** ListFlowsResponse flows */ + flows?: (google.cloud.dialogflow.cx.v3beta1.IFlow[]|null); + + /** ListFlowsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFlowsResponse. */ + class ListFlowsResponse implements IListFlowsResponse { + + /** + * Constructs a new ListFlowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse); + + /** ListFlowsResponse flows. */ + public flows: google.cloud.dialogflow.cx.v3beta1.IFlow[]; + + /** ListFlowsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFlowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFlowsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse): google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse; + + /** + * Encodes the specified ListFlowsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.verify|verify} messages. + * @param message ListFlowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFlowsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.verify|verify} messages. + * @param message ListFlowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFlowsResponse + * @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.dialogflow.cx.v3beta1.ListFlowsResponse; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFlowsResponse + * @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.dialogflow.cx.v3beta1.ListFlowsResponse; + + /** + * Verifies a ListFlowsResponse 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 ListFlowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFlowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse; + + /** + * Creates a plain object from a ListFlowsResponse message. Also converts values to other types if specified. + * @param message ListFlowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFlowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFlowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFlowRequest. */ + interface IGetFlowRequest { + + /** GetFlowRequest name */ + name?: (string|null); + + /** GetFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetFlowRequest. */ + class GetFlowRequest implements IGetFlowRequest { + + /** + * Constructs a new GetFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest); + + /** GetFlowRequest name. */ + public name: string; + + /** GetFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest): google.cloud.dialogflow.cx.v3beta1.GetFlowRequest; + + /** + * Encodes the specified GetFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.verify|verify} messages. + * @param message GetFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.verify|verify} messages. + * @param message GetFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFlowRequest + * @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.dialogflow.cx.v3beta1.GetFlowRequest; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFlowRequest + * @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.dialogflow.cx.v3beta1.GetFlowRequest; + + /** + * Verifies a GetFlowRequest 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 GetFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetFlowRequest; + + /** + * Creates a plain object from a GetFlowRequest message. Also converts values to other types if specified. + * @param message GetFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFlowRequest. */ + interface IUpdateFlowRequest { + + /** UpdateFlowRequest flow */ + flow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + + /** UpdateFlowRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents an UpdateFlowRequest. */ + class UpdateFlowRequest implements IUpdateFlowRequest { + + /** + * Constructs a new UpdateFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest); + + /** UpdateFlowRequest flow. */ + public flow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + + /** UpdateFlowRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new UpdateFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest): google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest; + + /** + * Encodes the specified UpdateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.verify|verify} messages. + * @param message UpdateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.verify|verify} messages. + * @param message UpdateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFlowRequest + * @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.dialogflow.cx.v3beta1.UpdateFlowRequest; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFlowRequest + * @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.dialogflow.cx.v3beta1.UpdateFlowRequest; + + /** + * Verifies an UpdateFlowRequest 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 UpdateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest; + + /** + * Creates a plain object from an UpdateFlowRequest message. Also converts values to other types if specified. + * @param message UpdateFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrainFlowRequest. */ + interface ITrainFlowRequest { + + /** TrainFlowRequest name */ + name?: (string|null); + } + + /** Represents a TrainFlowRequest. */ + class TrainFlowRequest implements ITrainFlowRequest { + + /** + * Constructs a new TrainFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest); + + /** TrainFlowRequest name. */ + public name: string; + + /** + * Creates a new TrainFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest): google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest; + + /** + * Encodes the specified TrainFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.verify|verify} messages. + * @param message TrainFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.verify|verify} messages. + * @param message TrainFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainFlowRequest + * @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.dialogflow.cx.v3beta1.TrainFlowRequest; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainFlowRequest + * @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.dialogflow.cx.v3beta1.TrainFlowRequest; + + /** + * Verifies a TrainFlowRequest 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 TrainFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest; + + /** + * Creates a plain object from a TrainFlowRequest message. Also converts values to other types if specified. + * @param message TrainFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateFlowRequest. */ + interface IValidateFlowRequest { + + /** ValidateFlowRequest name */ + name?: (string|null); + + /** ValidateFlowRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ValidateFlowRequest. */ + class ValidateFlowRequest implements IValidateFlowRequest { + + /** + * Constructs a new ValidateFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest); + + /** ValidateFlowRequest name. */ + public name: string; + + /** ValidateFlowRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ValidateFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest): google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest; + + /** + * Encodes the specified ValidateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest.verify|verify} messages. + * @param message ValidateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest.verify|verify} messages. + * @param message ValidateFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateFlowRequest + * @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.dialogflow.cx.v3beta1.ValidateFlowRequest; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateFlowRequest + * @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.dialogflow.cx.v3beta1.ValidateFlowRequest; + + /** + * Verifies a ValidateFlowRequest 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 ValidateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest; + + /** + * Creates a plain object from a ValidateFlowRequest message. Also converts values to other types if specified. + * @param message ValidateFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFlowValidationResultRequest. */ + interface IGetFlowValidationResultRequest { + + /** GetFlowValidationResultRequest name */ + name?: (string|null); + + /** GetFlowValidationResultRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetFlowValidationResultRequest. */ + class GetFlowValidationResultRequest implements IGetFlowValidationResultRequest { + + /** + * Constructs a new GetFlowValidationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest); + + /** GetFlowValidationResultRequest name. */ + public name: string; + + /** GetFlowValidationResultRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetFlowValidationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFlowValidationResultRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest): google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest; + + /** + * Encodes the specified GetFlowValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest.verify|verify} messages. + * @param message GetFlowValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFlowValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest.verify|verify} messages. + * @param message GetFlowValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFlowValidationResultRequest + * @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.dialogflow.cx.v3beta1.GetFlowValidationResultRequest; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFlowValidationResultRequest + * @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.dialogflow.cx.v3beta1.GetFlowValidationResultRequest; + + /** + * Verifies a GetFlowValidationResultRequest 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 GetFlowValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFlowValidationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest; + + /** + * Creates a plain object from a GetFlowValidationResultRequest message. Also converts values to other types if specified. + * @param message GetFlowValidationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFlowValidationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFlowValidationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowValidationResult. */ + interface IFlowValidationResult { + + /** FlowValidationResult name */ + name?: (string|null); + + /** FlowValidationResult validationMessages */ + validationMessages?: (google.cloud.dialogflow.cx.v3beta1.IValidationMessage[]|null); + + /** FlowValidationResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a FlowValidationResult. */ + class FlowValidationResult implements IFlowValidationResult { + + /** + * Constructs a new FlowValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult); + + /** FlowValidationResult name. */ + public name: string; + + /** FlowValidationResult validationMessages. */ + public validationMessages: google.cloud.dialogflow.cx.v3beta1.IValidationMessage[]; + + /** FlowValidationResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new FlowValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowValidationResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult): google.cloud.dialogflow.cx.v3beta1.FlowValidationResult; + + /** + * Encodes the specified FlowValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.verify|verify} messages. + * @param message FlowValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.verify|verify} messages. + * @param message FlowValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowValidationResult + * @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.dialogflow.cx.v3beta1.FlowValidationResult; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowValidationResult + * @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.dialogflow.cx.v3beta1.FlowValidationResult; + + /** + * Verifies a FlowValidationResult 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 FlowValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FlowValidationResult; + + /** + * Creates a plain object from a FlowValidationResult message. Also converts values to other types if specified. + * @param message FlowValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FlowValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowValidationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportFlowRequest. */ + interface IImportFlowRequest { + + /** ImportFlowRequest parent */ + parent?: (string|null); + + /** ImportFlowRequest flowUri */ + flowUri?: (string|null); + + /** ImportFlowRequest flowContent */ + flowContent?: (Uint8Array|Buffer|string|null); + + /** ImportFlowRequest importOption */ + importOption?: (google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption|null); + + /** ImportFlowRequest flowImportStrategy */ + flowImportStrategy?: (google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy|null); + } + + /** Represents an ImportFlowRequest. */ + class ImportFlowRequest implements IImportFlowRequest { + + /** + * Constructs a new ImportFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest); + + /** ImportFlowRequest parent. */ + public parent: string; + + /** ImportFlowRequest flowUri. */ + public flowUri?: (string|null); + + /** ImportFlowRequest flowContent. */ + public flowContent?: (Uint8Array|Buffer|string|null); + + /** ImportFlowRequest importOption. */ + public importOption: (google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption); + + /** ImportFlowRequest flowImportStrategy. */ + public flowImportStrategy?: (google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy|null); + + /** ImportFlowRequest flow. */ + public flow?: ("flowUri"|"flowContent"); + + /** + * Creates a new ImportFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest): google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest; + + /** + * Encodes the specified ImportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.verify|verify} messages. + * @param message ImportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.verify|verify} messages. + * @param message ImportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportFlowRequest + * @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.dialogflow.cx.v3beta1.ImportFlowRequest; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportFlowRequest + * @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.dialogflow.cx.v3beta1.ImportFlowRequest; + + /** + * Verifies an ImportFlowRequest 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 ImportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest; + + /** + * Creates a plain object from an ImportFlowRequest message. Also converts values to other types if specified. + * @param message ImportFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportFlowRequest { + + /** ImportOption enum. */ + enum ImportOption { + IMPORT_OPTION_UNSPECIFIED = 0, + KEEP = 1, + FALLBACK = 2 + } + } + + /** Properties of a FlowImportStrategy. */ + interface IFlowImportStrategy { + + /** FlowImportStrategy globalImportStrategy */ + globalImportStrategy?: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null); + } + + /** Represents a FlowImportStrategy. */ + class FlowImportStrategy implements IFlowImportStrategy { + + /** + * Constructs a new FlowImportStrategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy); + + /** FlowImportStrategy globalImportStrategy. */ + public globalImportStrategy: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy); + + /** + * Creates a new FlowImportStrategy instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowImportStrategy instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy): google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy; + + /** + * Encodes the specified FlowImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.verify|verify} messages. + * @param message FlowImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.verify|verify} messages. + * @param message FlowImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowImportStrategy + * @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.dialogflow.cx.v3beta1.FlowImportStrategy; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowImportStrategy + * @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.dialogflow.cx.v3beta1.FlowImportStrategy; + + /** + * Verifies a FlowImportStrategy 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 FlowImportStrategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowImportStrategy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy; + + /** + * Creates a plain object from a FlowImportStrategy message. Also converts values to other types if specified. + * @param message FlowImportStrategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowImportStrategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowImportStrategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportFlowResponse. */ + interface IImportFlowResponse { + + /** ImportFlowResponse flow */ + flow?: (string|null); + } + + /** Represents an ImportFlowResponse. */ + class ImportFlowResponse implements IImportFlowResponse { + + /** + * Constructs a new ImportFlowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse); + + /** ImportFlowResponse flow. */ + public flow: string; + + /** + * Creates a new ImportFlowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportFlowResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse): google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse; + + /** + * Encodes the specified ImportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse.verify|verify} messages. + * @param message ImportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse.verify|verify} messages. + * @param message ImportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportFlowResponse + * @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.dialogflow.cx.v3beta1.ImportFlowResponse; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportFlowResponse + * @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.dialogflow.cx.v3beta1.ImportFlowResponse; + + /** + * Verifies an ImportFlowResponse 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 ImportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportFlowResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse; + + /** + * Creates a plain object from an ImportFlowResponse message. Also converts values to other types if specified. + * @param message ImportFlowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportFlowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportFlowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportFlowRequest. */ + interface IExportFlowRequest { + + /** ExportFlowRequest name */ + name?: (string|null); + + /** ExportFlowRequest flowUri */ + flowUri?: (string|null); + + /** ExportFlowRequest includeReferencedFlows */ + includeReferencedFlows?: (boolean|null); + } + + /** Represents an ExportFlowRequest. */ + class ExportFlowRequest implements IExportFlowRequest { + + /** + * Constructs a new ExportFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest); + + /** ExportFlowRequest name. */ + public name: string; + + /** ExportFlowRequest flowUri. */ + public flowUri: string; + + /** ExportFlowRequest includeReferencedFlows. */ + public includeReferencedFlows: boolean; + + /** + * Creates a new ExportFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest): google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest; + + /** + * Encodes the specified ExportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.verify|verify} messages. + * @param message ExportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.verify|verify} messages. + * @param message ExportFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportFlowRequest + * @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.dialogflow.cx.v3beta1.ExportFlowRequest; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportFlowRequest + * @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.dialogflow.cx.v3beta1.ExportFlowRequest; + + /** + * Verifies an ExportFlowRequest 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 ExportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest; + + /** + * Creates a plain object from an ExportFlowRequest message. Also converts values to other types if specified. + * @param message ExportFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportFlowResponse. */ + interface IExportFlowResponse { + + /** ExportFlowResponse flowUri */ + flowUri?: (string|null); + + /** ExportFlowResponse flowContent */ + flowContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ExportFlowResponse. */ + class ExportFlowResponse implements IExportFlowResponse { + + /** + * Constructs a new ExportFlowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse); + + /** ExportFlowResponse flowUri. */ + public flowUri?: (string|null); + + /** ExportFlowResponse flowContent. */ + public flowContent?: (Uint8Array|Buffer|string|null); + + /** ExportFlowResponse flow. */ + public flow?: ("flowUri"|"flowContent"); + + /** + * Creates a new ExportFlowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportFlowResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse): google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse; + + /** + * Encodes the specified ExportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse.verify|verify} messages. + * @param message ExportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse.verify|verify} messages. + * @param message ExportFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportFlowResponse + * @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.dialogflow.cx.v3beta1.ExportFlowResponse; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportFlowResponse + * @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.dialogflow.cx.v3beta1.ExportFlowResponse; + + /** + * Verifies an ExportFlowResponse 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 ExportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportFlowResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse; + + /** + * Creates a plain object from an ExportFlowResponse message. Also converts values to other types if specified. + * @param message ExportFlowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportFlowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportFlowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ImportStrategy enum. */ + enum ImportStrategy { + IMPORT_STRATEGY_UNSPECIFIED = 0, + IMPORT_STRATEGY_CREATE_NEW = 1, + IMPORT_STRATEGY_REPLACE = 2, + IMPORT_STRATEGY_KEEP = 3, + IMPORT_STRATEGY_MERGE = 4, + IMPORT_STRATEGY_THROW_ERROR = 5 + } + + /** Represents a Pages */ + class Pages extends $protobuf.rpc.Service { + + /** + * Constructs a new Pages service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Pages service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Pages; + + /** + * Calls ListPages. + * @param request ListPagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPagesResponse + */ + public listPages(request: google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, callback: google.cloud.dialogflow.cx.v3beta1.Pages.ListPagesCallback): void; + + /** + * Calls ListPages. + * @param request ListPagesRequest message or plain object + * @returns Promise + */ + public listPages(request: google.cloud.dialogflow.cx.v3beta1.IListPagesRequest): Promise; + + /** + * Calls GetPage. + * @param request GetPageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Page + */ + public getPage(request: google.cloud.dialogflow.cx.v3beta1.IGetPageRequest, callback: google.cloud.dialogflow.cx.v3beta1.Pages.GetPageCallback): void; + + /** + * Calls GetPage. + * @param request GetPageRequest message or plain object + * @returns Promise + */ + public getPage(request: google.cloud.dialogflow.cx.v3beta1.IGetPageRequest): Promise; + + /** + * Calls CreatePage. + * @param request CreatePageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Page + */ + public createPage(request: google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest, callback: google.cloud.dialogflow.cx.v3beta1.Pages.CreatePageCallback): void; + + /** + * Calls CreatePage. + * @param request CreatePageRequest message or plain object + * @returns Promise + */ + public createPage(request: google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest): Promise; + + /** + * Calls UpdatePage. + * @param request UpdatePageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Page + */ + public updatePage(request: google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest, callback: google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePageCallback): void; + + /** + * Calls UpdatePage. + * @param request UpdatePageRequest message or plain object + * @returns Promise + */ + public updatePage(request: google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest): Promise; + + /** + * Calls DeletePage. + * @param request DeletePageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePage(request: google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest, callback: google.cloud.dialogflow.cx.v3beta1.Pages.DeletePageCallback): void; + + /** + * Calls DeletePage. + * @param request DeletePageRequest message or plain object + * @returns Promise + */ + public deletePage(request: google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest): Promise; + } + + namespace Pages { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|listPages}. + * @param error Error, if any + * @param [response] ListPagesResponse + */ + type ListPagesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|getPage}. + * @param error Error, if any + * @param [response] Page + */ + type GetPageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Page) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|createPage}. + * @param error Error, if any + * @param [response] Page + */ + type CreatePageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Page) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|updatePage}. + * @param error Error, if any + * @param [response] Page + */ + type UpdatePageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Page) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|deletePage}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Page. */ + interface IPage { + + /** Page name */ + name?: (string|null); + + /** Page displayName */ + displayName?: (string|null); + + /** Page description */ + description?: (string|null); + + /** Page entryFulfillment */ + entryFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** Page form */ + form?: (google.cloud.dialogflow.cx.v3beta1.IForm|null); + + /** Page transitionRouteGroups */ + transitionRouteGroups?: (string[]|null); + + /** Page transitionRoutes */ + transitionRoutes?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRoute[]|null); + + /** Page eventHandlers */ + eventHandlers?: (google.cloud.dialogflow.cx.v3beta1.IEventHandler[]|null); + + /** Page advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Page knowledgeConnectorSettings */ + knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPage); + + /** Page name. */ + public name: string; + + /** Page displayName. */ + public displayName: string; + + /** Page description. */ + public description: string; + + /** Page entryFulfillment. */ + public entryFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** Page form. */ + public form?: (google.cloud.dialogflow.cx.v3beta1.IForm|null); + + /** Page transitionRouteGroups. */ + public transitionRouteGroups: string[]; + + /** Page transitionRoutes. */ + public transitionRoutes: google.cloud.dialogflow.cx.v3beta1.ITransitionRoute[]; + + /** Page eventHandlers. */ + public eventHandlers: google.cloud.dialogflow.cx.v3beta1.IEventHandler[]; + + /** Page advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Page knowledgeConnectorSettings. */ + public knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null); + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPage): google.cloud.dialogflow.cx.v3beta1.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @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.dialogflow.cx.v3beta1.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @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.dialogflow.cx.v3beta1.Page; + + /** + * Verifies a Page 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 Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Page + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Form. */ + interface IForm { + + /** Form parameters */ + parameters?: (google.cloud.dialogflow.cx.v3beta1.Form.IParameter[]|null); + } + + /** Represents a Form. */ + class Form implements IForm { + + /** + * Constructs a new Form. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IForm); + + /** Form parameters. */ + public parameters: google.cloud.dialogflow.cx.v3beta1.Form.IParameter[]; + + /** + * Creates a new Form instance using the specified properties. + * @param [properties] Properties to set + * @returns Form instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IForm): google.cloud.dialogflow.cx.v3beta1.Form; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Form message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Form + * @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.dialogflow.cx.v3beta1.Form; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Form + * @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.dialogflow.cx.v3beta1.Form; + + /** + * Verifies a Form 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 Form message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Form + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Form; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @param message Form + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Form, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Form to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Form + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Form { + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter displayName */ + displayName?: (string|null); + + /** Parameter required */ + required?: (boolean|null); + + /** Parameter entityType */ + entityType?: (string|null); + + /** Parameter isList */ + isList?: (boolean|null); + + /** Parameter fillBehavior */ + fillBehavior?: (google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior|null); + + /** Parameter defaultValue */ + defaultValue?: (google.protobuf.IValue|null); + + /** Parameter redact */ + redact?: (boolean|null); + + /** Parameter advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Form.IParameter); + + /** Parameter displayName. */ + public displayName: string; + + /** Parameter required. */ + public required: boolean; + + /** Parameter entityType. */ + public entityType: string; + + /** Parameter isList. */ + public isList: boolean; + + /** Parameter fillBehavior. */ + public fillBehavior?: (google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior|null); + + /** Parameter defaultValue. */ + public defaultValue?: (google.protobuf.IValue|null); + + /** Parameter redact. */ + public redact: boolean; + + /** Parameter advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Form.IParameter): google.cloud.dialogflow.cx.v3beta1.Form.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Form.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Form.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @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.dialogflow.cx.v3beta1.Form.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @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.dialogflow.cx.v3beta1.Form.Parameter; + + /** + * Verifies a Parameter 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 Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Form.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Form.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Parameter { + + /** Properties of a FillBehavior. */ + interface IFillBehavior { + + /** FillBehavior initialPromptFulfillment */ + initialPromptFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** FillBehavior repromptEventHandlers */ + repromptEventHandlers?: (google.cloud.dialogflow.cx.v3beta1.IEventHandler[]|null); + } + + /** Represents a FillBehavior. */ + class FillBehavior implements IFillBehavior { + + /** + * Constructs a new FillBehavior. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior); + + /** FillBehavior initialPromptFulfillment. */ + public initialPromptFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** FillBehavior repromptEventHandlers. */ + public repromptEventHandlers: google.cloud.dialogflow.cx.v3beta1.IEventHandler[]; + + /** + * Creates a new FillBehavior instance using the specified properties. + * @param [properties] Properties to set + * @returns FillBehavior instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior): google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior; + + /** + * Encodes the specified FillBehavior message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.verify|verify} messages. + * @param message FillBehavior message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FillBehavior message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.verify|verify} messages. + * @param message FillBehavior message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FillBehavior message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FillBehavior + * @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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior; + + /** + * Decodes a FillBehavior message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FillBehavior + * @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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior; + + /** + * Verifies a FillBehavior 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 FillBehavior message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FillBehavior + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior; + + /** + * Creates a plain object from a FillBehavior message. Also converts values to other types if specified. + * @param message FillBehavior + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FillBehavior to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FillBehavior + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an EventHandler. */ + interface IEventHandler { + + /** EventHandler name */ + name?: (string|null); + + /** EventHandler event */ + event?: (string|null); + + /** EventHandler triggerFulfillment */ + triggerFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** EventHandler targetPage */ + targetPage?: (string|null); + + /** EventHandler targetFlow */ + targetFlow?: (string|null); + + /** EventHandler targetPlaybook */ + targetPlaybook?: (string|null); + } + + /** Represents an EventHandler. */ + class EventHandler implements IEventHandler { + + /** + * Constructs a new EventHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IEventHandler); + + /** EventHandler name. */ + public name: string; + + /** EventHandler event. */ + public event: string; + + /** EventHandler triggerFulfillment. */ + public triggerFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** EventHandler targetPage. */ + public targetPage?: (string|null); + + /** EventHandler targetFlow. */ + public targetFlow?: (string|null); + + /** EventHandler targetPlaybook. */ + public targetPlaybook?: (string|null); + + /** EventHandler target. */ + public target?: ("targetPage"|"targetFlow"|"targetPlaybook"); + + /** + * Creates a new EventHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns EventHandler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IEventHandler): google.cloud.dialogflow.cx.v3beta1.EventHandler; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventHandler + * @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.dialogflow.cx.v3beta1.EventHandler; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventHandler + * @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.dialogflow.cx.v3beta1.EventHandler; + + /** + * Verifies an EventHandler 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 EventHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventHandler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.EventHandler; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @param message EventHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.EventHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitionRoute. */ + interface ITransitionRoute { + + /** TransitionRoute name */ + name?: (string|null); + + /** TransitionRoute description */ + description?: (string|null); + + /** TransitionRoute intent */ + intent?: (string|null); + + /** TransitionRoute condition */ + condition?: (string|null); + + /** TransitionRoute triggerFulfillment */ + triggerFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** TransitionRoute targetPage */ + targetPage?: (string|null); + + /** TransitionRoute targetFlow */ + targetFlow?: (string|null); + } + + /** Represents a TransitionRoute. */ + class TransitionRoute implements ITransitionRoute { + + /** + * Constructs a new TransitionRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionRoute); + + /** TransitionRoute name. */ + public name: string; + + /** TransitionRoute description. */ + public description: string; + + /** TransitionRoute intent. */ + public intent: string; + + /** TransitionRoute condition. */ + public condition: string; + + /** TransitionRoute triggerFulfillment. */ + public triggerFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** TransitionRoute targetPage. */ + public targetPage?: (string|null); + + /** TransitionRoute targetFlow. */ + public targetFlow?: (string|null); + + /** TransitionRoute target. */ + public target?: ("targetPage"|"targetFlow"); + + /** + * Creates a new TransitionRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionRoute instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionRoute): google.cloud.dialogflow.cx.v3beta1.TransitionRoute; + + /** + * Encodes the specified TransitionRoute message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify|verify} messages. + * @param message TransitionRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITransitionRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionRoute message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify|verify} messages. + * @param message TransitionRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITransitionRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionRoute + * @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.dialogflow.cx.v3beta1.TransitionRoute; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionRoute + * @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.dialogflow.cx.v3beta1.TransitionRoute; + + /** + * Verifies a TransitionRoute 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 TransitionRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionRoute; + + /** + * Creates a plain object from a TransitionRoute message. Also converts values to other types if specified. + * @param message TransitionRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPagesRequest. */ + interface IListPagesRequest { + + /** ListPagesRequest parent */ + parent?: (string|null); + + /** ListPagesRequest languageCode */ + languageCode?: (string|null); + + /** ListPagesRequest pageSize */ + pageSize?: (number|null); + + /** ListPagesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPagesRequest. */ + class ListPagesRequest implements IListPagesRequest { + + /** + * Constructs a new ListPagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListPagesRequest); + + /** ListPagesRequest parent. */ + public parent: string; + + /** ListPagesRequest languageCode. */ + public languageCode: string; + + /** ListPagesRequest pageSize. */ + public pageSize: number; + + /** ListPagesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPagesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListPagesRequest): google.cloud.dialogflow.cx.v3beta1.ListPagesRequest; + + /** + * Encodes the specified ListPagesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.verify|verify} messages. + * @param message ListPagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.verify|verify} messages. + * @param message ListPagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPagesRequest + * @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.dialogflow.cx.v3beta1.ListPagesRequest; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPagesRequest + * @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.dialogflow.cx.v3beta1.ListPagesRequest; + + /** + * Verifies a ListPagesRequest 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 ListPagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListPagesRequest; + + /** + * Creates a plain object from a ListPagesRequest message. Also converts values to other types if specified. + * @param message ListPagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListPagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPagesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPagesResponse. */ + interface IListPagesResponse { + + /** ListPagesResponse pages */ + pages?: (google.cloud.dialogflow.cx.v3beta1.IPage[]|null); + + /** ListPagesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPagesResponse. */ + class ListPagesResponse implements IListPagesResponse { + + /** + * Constructs a new ListPagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListPagesResponse); + + /** ListPagesResponse pages. */ + public pages: google.cloud.dialogflow.cx.v3beta1.IPage[]; + + /** ListPagesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPagesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListPagesResponse): google.cloud.dialogflow.cx.v3beta1.ListPagesResponse; + + /** + * Encodes the specified ListPagesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.verify|verify} messages. + * @param message ListPagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListPagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.verify|verify} messages. + * @param message ListPagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListPagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPagesResponse + * @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.dialogflow.cx.v3beta1.ListPagesResponse; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPagesResponse + * @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.dialogflow.cx.v3beta1.ListPagesResponse; + + /** + * Verifies a ListPagesResponse 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 ListPagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListPagesResponse; + + /** + * Creates a plain object from a ListPagesResponse message. Also converts values to other types if specified. + * @param message ListPagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListPagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPagesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPageRequest. */ + interface IGetPageRequest { + + /** GetPageRequest name */ + name?: (string|null); + + /** GetPageRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetPageRequest. */ + class GetPageRequest implements IGetPageRequest { + + /** + * Constructs a new GetPageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetPageRequest); + + /** GetPageRequest name. */ + public name: string; + + /** GetPageRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetPageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetPageRequest): google.cloud.dialogflow.cx.v3beta1.GetPageRequest; + + /** + * Encodes the specified GetPageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPageRequest.verify|verify} messages. + * @param message GetPageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPageRequest.verify|verify} messages. + * @param message GetPageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPageRequest + * @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.dialogflow.cx.v3beta1.GetPageRequest; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPageRequest + * @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.dialogflow.cx.v3beta1.GetPageRequest; + + /** + * Verifies a GetPageRequest 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 GetPageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetPageRequest; + + /** + * Creates a plain object from a GetPageRequest message. Also converts values to other types if specified. + * @param message GetPageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetPageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreatePageRequest. */ + interface ICreatePageRequest { + + /** CreatePageRequest parent */ + parent?: (string|null); + + /** CreatePageRequest page */ + page?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** CreatePageRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreatePageRequest. */ + class CreatePageRequest implements ICreatePageRequest { + + /** + * Constructs a new CreatePageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest); + + /** CreatePageRequest parent. */ + public parent: string; + + /** CreatePageRequest page. */ + public page?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** CreatePageRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreatePageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest): google.cloud.dialogflow.cx.v3beta1.CreatePageRequest; + + /** + * Encodes the specified CreatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.verify|verify} messages. + * @param message CreatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.verify|verify} messages. + * @param message CreatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePageRequest + * @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.dialogflow.cx.v3beta1.CreatePageRequest; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePageRequest + * @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.dialogflow.cx.v3beta1.CreatePageRequest; + + /** + * Verifies a CreatePageRequest 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 CreatePageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreatePageRequest; + + /** + * Creates a plain object from a CreatePageRequest message. Also converts values to other types if specified. + * @param message CreatePageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreatePageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePageRequest. */ + interface IUpdatePageRequest { + + /** UpdatePageRequest page */ + page?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** UpdatePageRequest languageCode */ + languageCode?: (string|null); + + /** UpdatePageRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePageRequest. */ + class UpdatePageRequest implements IUpdatePageRequest { + + /** + * Constructs a new UpdatePageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest); + + /** UpdatePageRequest page. */ + public page?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** UpdatePageRequest languageCode. */ + public languageCode: string; + + /** UpdatePageRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest): google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest; + + /** + * Encodes the specified UpdatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.verify|verify} messages. + * @param message UpdatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.verify|verify} messages. + * @param message UpdatePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePageRequest + * @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.dialogflow.cx.v3beta1.UpdatePageRequest; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePageRequest + * @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.dialogflow.cx.v3beta1.UpdatePageRequest; + + /** + * Verifies an UpdatePageRequest 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 UpdatePageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest; + + /** + * Creates a plain object from an UpdatePageRequest message. Also converts values to other types if specified. + * @param message UpdatePageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePageRequest. */ + interface IDeletePageRequest { + + /** DeletePageRequest name */ + name?: (string|null); + + /** DeletePageRequest force */ + force?: (boolean|null); + } + + /** Represents a DeletePageRequest. */ + class DeletePageRequest implements IDeletePageRequest { + + /** + * Constructs a new DeletePageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest); + + /** DeletePageRequest name. */ + public name: string; + + /** DeletePageRequest force. */ + public force: boolean; + + /** + * Creates a new DeletePageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest): google.cloud.dialogflow.cx.v3beta1.DeletePageRequest; + + /** + * Encodes the specified DeletePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.verify|verify} messages. + * @param message DeletePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.verify|verify} messages. + * @param message DeletePageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePageRequest + * @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.dialogflow.cx.v3beta1.DeletePageRequest; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePageRequest + * @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.dialogflow.cx.v3beta1.DeletePageRequest; + + /** + * Verifies a DeletePageRequest 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 DeletePageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeletePageRequest; + + /** + * Creates a plain object from a DeletePageRequest message. Also converts values to other types if specified. + * @param message DeletePageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeletePageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KnowledgeConnectorSettings. */ + interface IKnowledgeConnectorSettings { + + /** KnowledgeConnectorSettings enabled */ + enabled?: (boolean|null); + + /** KnowledgeConnectorSettings triggerFulfillment */ + triggerFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** KnowledgeConnectorSettings targetPage */ + targetPage?: (string|null); + + /** KnowledgeConnectorSettings targetFlow */ + targetFlow?: (string|null); + + /** KnowledgeConnectorSettings dataStoreConnections */ + dataStoreConnections?: (google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection[]|null); + } + + /** Represents a KnowledgeConnectorSettings. */ + class KnowledgeConnectorSettings implements IKnowledgeConnectorSettings { + + /** + * Constructs a new KnowledgeConnectorSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings); + + /** KnowledgeConnectorSettings enabled. */ + public enabled: boolean; + + /** KnowledgeConnectorSettings triggerFulfillment. */ + public triggerFulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** KnowledgeConnectorSettings targetPage. */ + public targetPage?: (string|null); + + /** KnowledgeConnectorSettings targetFlow. */ + public targetFlow?: (string|null); + + /** KnowledgeConnectorSettings dataStoreConnections. */ + public dataStoreConnections: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection[]; + + /** KnowledgeConnectorSettings target. */ + public target?: ("targetPage"|"targetFlow"); + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeConnectorSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings): google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3beta1.KnowledgeConnectorSettings; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3beta1.KnowledgeConnectorSettings; + + /** + * Verifies a KnowledgeConnectorSettings 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 KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeConnectorSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @param message KnowledgeConnectorSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreConnection. */ + interface IDataStoreConnection { + + /** DataStoreConnection dataStoreType */ + dataStoreType?: (google.cloud.dialogflow.cx.v3beta1.DataStoreType|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreType|null); + + /** DataStoreConnection dataStore */ + dataStore?: (string|null); + + /** DataStoreConnection documentProcessingMode */ + documentProcessingMode?: (google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode|null); + } + + /** Represents a DataStoreConnection. */ + class DataStoreConnection implements IDataStoreConnection { + + /** + * Constructs a new DataStoreConnection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection); + + /** DataStoreConnection dataStoreType. */ + public dataStoreType: (google.cloud.dialogflow.cx.v3beta1.DataStoreType|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreType); + + /** DataStoreConnection dataStore. */ + public dataStore: string; + + /** DataStoreConnection documentProcessingMode. */ + public documentProcessingMode: (google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode); + + /** + * Creates a new DataStoreConnection instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreConnection instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection): google.cloud.dialogflow.cx.v3beta1.DataStoreConnection; + + /** + * Encodes the specified DataStoreConnection message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.verify|verify} messages. + * @param message DataStoreConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreConnection message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.verify|verify} messages. + * @param message DataStoreConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreConnection + * @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.dialogflow.cx.v3beta1.DataStoreConnection; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreConnection + * @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.dialogflow.cx.v3beta1.DataStoreConnection; + + /** + * Verifies a DataStoreConnection 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 DataStoreConnection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreConnection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnection; + + /** + * Creates a plain object from a DataStoreConnection message. Also converts values to other types if specified. + * @param message DataStoreConnection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreConnection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreConnection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreConnectionSignals. */ + interface IDataStoreConnectionSignals { + + /** DataStoreConnectionSignals rewriterModelCallSignals */ + rewriterModelCallSignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals|null); + + /** DataStoreConnectionSignals rewrittenQuery */ + rewrittenQuery?: (string|null); + + /** DataStoreConnectionSignals searchSnippets */ + searchSnippets?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet[]|null); + + /** DataStoreConnectionSignals answerGenerationModelCallSignals */ + answerGenerationModelCallSignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null); + + /** DataStoreConnectionSignals answer */ + answer?: (string|null); + + /** DataStoreConnectionSignals answerParts */ + answerParts?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart[]|null); + + /** DataStoreConnectionSignals citedSnippets */ + citedSnippets?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet[]|null); + + /** DataStoreConnectionSignals groundingSignals */ + groundingSignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals|null); + + /** DataStoreConnectionSignals safetySignals */ + safetySignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals|null); + } + + /** Represents a DataStoreConnectionSignals. */ + class DataStoreConnectionSignals implements IDataStoreConnectionSignals { + + /** + * Constructs a new DataStoreConnectionSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals); + + /** DataStoreConnectionSignals rewriterModelCallSignals. */ + public rewriterModelCallSignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals|null); + + /** DataStoreConnectionSignals rewrittenQuery. */ + public rewrittenQuery: string; + + /** DataStoreConnectionSignals searchSnippets. */ + public searchSnippets: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet[]; + + /** DataStoreConnectionSignals answerGenerationModelCallSignals. */ + public answerGenerationModelCallSignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null); + + /** DataStoreConnectionSignals answer. */ + public answer: string; + + /** DataStoreConnectionSignals answerParts. */ + public answerParts: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart[]; + + /** DataStoreConnectionSignals citedSnippets. */ + public citedSnippets: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet[]; + + /** DataStoreConnectionSignals groundingSignals. */ + public groundingSignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals|null); + + /** DataStoreConnectionSignals safetySignals. */ + public safetySignals?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals|null); + + /** + * Creates a new DataStoreConnectionSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreConnectionSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals; + + /** + * Encodes the specified DataStoreConnectionSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.verify|verify} messages. + * @param message DataStoreConnectionSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreConnectionSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.verify|verify} messages. + * @param message DataStoreConnectionSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreConnectionSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreConnectionSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals; + + /** + * Verifies a DataStoreConnectionSignals 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 DataStoreConnectionSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreConnectionSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals; + + /** + * Creates a plain object from a DataStoreConnectionSignals message. Also converts values to other types if specified. + * @param message DataStoreConnectionSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreConnectionSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreConnectionSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreConnectionSignals { + + /** Properties of a RewriterModelCallSignals. */ + interface IRewriterModelCallSignals { + + /** RewriterModelCallSignals renderedPrompt */ + renderedPrompt?: (string|null); + + /** RewriterModelCallSignals modelOutput */ + modelOutput?: (string|null); + + /** RewriterModelCallSignals model */ + model?: (string|null); + } + + /** Represents a RewriterModelCallSignals. */ + class RewriterModelCallSignals implements IRewriterModelCallSignals { + + /** + * Constructs a new RewriterModelCallSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals); + + /** RewriterModelCallSignals renderedPrompt. */ + public renderedPrompt: string; + + /** RewriterModelCallSignals modelOutput. */ + public modelOutput: string; + + /** RewriterModelCallSignals model. */ + public model: string; + + /** + * Creates a new RewriterModelCallSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns RewriterModelCallSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Encodes the specified RewriterModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @param message RewriterModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RewriterModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @param message RewriterModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RewriterModelCallSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RewriterModelCallSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Verifies a RewriterModelCallSignals 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 RewriterModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RewriterModelCallSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals; + + /** + * Creates a plain object from a RewriterModelCallSignals message. Also converts values to other types if specified. + * @param message RewriterModelCallSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RewriterModelCallSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RewriterModelCallSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchSnippet. */ + interface ISearchSnippet { + + /** SearchSnippet documentTitle */ + documentTitle?: (string|null); + + /** SearchSnippet documentUri */ + documentUri?: (string|null); + + /** SearchSnippet text */ + text?: (string|null); + + /** SearchSnippet metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents a SearchSnippet. */ + class SearchSnippet implements ISearchSnippet { + + /** + * Constructs a new SearchSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet); + + /** SearchSnippet documentTitle. */ + public documentTitle: string; + + /** SearchSnippet documentUri. */ + public documentUri: string; + + /** SearchSnippet text. */ + public text: string; + + /** SearchSnippet metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new SearchSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchSnippet instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet; + + /** + * Encodes the specified SearchSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @param message SearchSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @param message SearchSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchSnippet + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchSnippet + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet; + + /** + * Verifies a SearchSnippet 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 SearchSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet; + + /** + * Creates a plain object from a SearchSnippet message. Also converts values to other types if specified. + * @param message SearchSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnswerGenerationModelCallSignals. */ + interface IAnswerGenerationModelCallSignals { + + /** AnswerGenerationModelCallSignals renderedPrompt */ + renderedPrompt?: (string|null); + + /** AnswerGenerationModelCallSignals modelOutput */ + modelOutput?: (string|null); + + /** AnswerGenerationModelCallSignals model */ + model?: (string|null); + } + + /** Represents an AnswerGenerationModelCallSignals. */ + class AnswerGenerationModelCallSignals implements IAnswerGenerationModelCallSignals { + + /** + * Constructs a new AnswerGenerationModelCallSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals); + + /** AnswerGenerationModelCallSignals renderedPrompt. */ + public renderedPrompt: string; + + /** AnswerGenerationModelCallSignals modelOutput. */ + public modelOutput: string; + + /** AnswerGenerationModelCallSignals model. */ + public model: string; + + /** + * Creates a new AnswerGenerationModelCallSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerGenerationModelCallSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @param message AnswerGenerationModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @param message AnswerGenerationModelCallSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerGenerationModelCallSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerGenerationModelCallSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Verifies an AnswerGenerationModelCallSignals 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 AnswerGenerationModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerGenerationModelCallSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals; + + /** + * Creates a plain object from an AnswerGenerationModelCallSignals message. Also converts values to other types if specified. + * @param message AnswerGenerationModelCallSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerGenerationModelCallSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerGenerationModelCallSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnswerPart. */ + interface IAnswerPart { + + /** AnswerPart text */ + text?: (string|null); + + /** AnswerPart supportingIndices */ + supportingIndices?: (number[]|null); + } + + /** Represents an AnswerPart. */ + class AnswerPart implements IAnswerPart { + + /** + * Constructs a new AnswerPart. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart); + + /** AnswerPart text. */ + public text: string; + + /** AnswerPart supportingIndices. */ + public supportingIndices: number[]; + + /** + * Creates a new AnswerPart instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerPart instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart; + + /** + * Encodes the specified AnswerPart message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @param message AnswerPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerPart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @param message AnswerPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerPart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerPart + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart; + + /** + * Decodes an AnswerPart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerPart + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart; + + /** + * Verifies an AnswerPart 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 AnswerPart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerPart + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart; + + /** + * Creates a plain object from an AnswerPart message. Also converts values to other types if specified. + * @param message AnswerPart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerPart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerPart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CitedSnippet. */ + interface ICitedSnippet { + + /** CitedSnippet searchSnippet */ + searchSnippet?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet|null); + + /** CitedSnippet snippetIndex */ + snippetIndex?: (number|null); + } + + /** Represents a CitedSnippet. */ + class CitedSnippet implements ICitedSnippet { + + /** + * Constructs a new CitedSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet); + + /** CitedSnippet searchSnippet. */ + public searchSnippet?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet|null); + + /** CitedSnippet snippetIndex. */ + public snippetIndex: number; + + /** + * Creates a new CitedSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns CitedSnippet instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet; + + /** + * Encodes the specified CitedSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @param message CitedSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitedSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @param message CitedSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitedSnippet + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitedSnippet + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet; + + /** + * Verifies a CitedSnippet 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 CitedSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitedSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet; + + /** + * Creates a plain object from a CitedSnippet message. Also converts values to other types if specified. + * @param message CitedSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitedSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CitedSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingSignals. */ + interface IGroundingSignals { + + /** GroundingSignals decision */ + decision?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|null); + + /** GroundingSignals score */ + score?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|null); + } + + /** Represents a GroundingSignals. */ + class GroundingSignals implements IGroundingSignals { + + /** + * Constructs a new GroundingSignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals); + + /** GroundingSignals decision. */ + public decision: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision); + + /** GroundingSignals score. */ + public score: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket); + + /** + * Creates a new GroundingSignals instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingSignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals; + + /** + * Encodes the specified GroundingSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @param message GroundingSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @param message GroundingSignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingSignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals; + + /** + * Verifies a GroundingSignals 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 GroundingSignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingSignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals; + + /** + * Creates a plain object from a GroundingSignals message. Also converts values to other types if specified. + * @param message GroundingSignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingSignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingSignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GroundingSignals { + + /** GroundingDecision enum. */ + enum GroundingDecision { + GROUNDING_DECISION_UNSPECIFIED = 0, + ACCEPTED_BY_GROUNDING = 1, + REJECTED_BY_GROUNDING = 2 + } + + /** GroundingScoreBucket enum. */ + enum GroundingScoreBucket { + GROUNDING_SCORE_BUCKET_UNSPECIFIED = 0, + VERY_LOW = 1, + LOW = 3, + MEDIUM = 4, + HIGH = 5, + VERY_HIGH = 6 + } + } + + /** Properties of a SafetySignals. */ + interface ISafetySignals { + + /** SafetySignals decision */ + decision?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision|null); + + /** SafetySignals bannedPhraseMatch */ + bannedPhraseMatch?: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|null); + + /** SafetySignals matchedBannedPhrase */ + matchedBannedPhrase?: (string|null); + } + + /** Represents a SafetySignals. */ + class SafetySignals implements ISafetySignals { + + /** + * Constructs a new SafetySignals. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals); + + /** SafetySignals decision. */ + public decision: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision); + + /** SafetySignals bannedPhraseMatch. */ + public bannedPhraseMatch: (google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch); + + /** SafetySignals matchedBannedPhrase. */ + public matchedBannedPhrase: string; + + /** + * Creates a new SafetySignals instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySignals instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals; + + /** + * Encodes the specified SafetySignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @param message SafetySignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @param message SafetySignals message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySignals message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals; + + /** + * Decodes a SafetySignals message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySignals + * @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.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals; + + /** + * Verifies a SafetySignals 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 SafetySignals message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySignals + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals; + + /** + * Creates a plain object from a SafetySignals message. Also converts values to other types if specified. + * @param message SafetySignals + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySignals to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySignals + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetySignals { + + /** SafetyDecision enum. */ + enum SafetyDecision { + SAFETY_DECISION_UNSPECIFIED = 0, + ACCEPTED_BY_SAFETY_CHECK = 1, + REJECTED_BY_SAFETY_CHECK = 2 + } + + /** BannedPhraseMatch enum. */ + enum BannedPhraseMatch { + BANNED_PHRASE_MATCH_UNSPECIFIED = 0, + BANNED_PHRASE_MATCH_NONE = 1, + BANNED_PHRASE_MATCH_QUERY = 2, + BANNED_PHRASE_MATCH_RESPONSE = 3 + } + } + } + + /** DataStoreType enum. */ + enum DataStoreType { + DATA_STORE_TYPE_UNSPECIFIED = 0, + PUBLIC_WEB = 1, + UNSTRUCTURED = 2, + STRUCTURED = 3 + } + + /** DocumentProcessingMode enum. */ + enum DocumentProcessingMode { + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0, + DOCUMENTS = 1, + CHUNKS = 2 + } + + /** Properties of a Fulfillment. */ + interface IFulfillment { + + /** Fulfillment messages */ + messages?: (google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]|null); + + /** Fulfillment webhook */ + webhook?: (string|null); + + /** Fulfillment returnPartialResponses */ + returnPartialResponses?: (boolean|null); + + /** Fulfillment tag */ + tag?: (string|null); + + /** Fulfillment setParameterActions */ + setParameterActions?: (google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction[]|null); + + /** Fulfillment conditionalCases */ + conditionalCases?: (google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases[]|null); + + /** Fulfillment advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Fulfillment enableGenerativeFallback */ + enableGenerativeFallback?: (boolean|null); + + /** Fulfillment generators */ + generators?: (google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings[]|null); + } + + /** Represents a Fulfillment. */ + class Fulfillment implements IFulfillment { + + /** + * Constructs a new Fulfillment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFulfillment); + + /** Fulfillment messages. */ + public messages: google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]; + + /** Fulfillment webhook. */ + public webhook: string; + + /** Fulfillment returnPartialResponses. */ + public returnPartialResponses: boolean; + + /** Fulfillment tag. */ + public tag: string; + + /** Fulfillment setParameterActions. */ + public setParameterActions: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction[]; + + /** Fulfillment conditionalCases. */ + public conditionalCases: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases[]; + + /** Fulfillment advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** Fulfillment enableGenerativeFallback. */ + public enableGenerativeFallback: boolean; + + /** Fulfillment generators. */ + public generators: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings[]; + + /** + * Creates a new Fulfillment instance using the specified properties. + * @param [properties] Properties to set + * @returns Fulfillment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFulfillment): google.cloud.dialogflow.cx.v3beta1.Fulfillment; + + /** + * Encodes the specified Fulfillment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify|verify} messages. + * @param message Fulfillment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFulfillment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Fulfillment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify|verify} messages. + * @param message Fulfillment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFulfillment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fulfillment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fulfillment + * @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.dialogflow.cx.v3beta1.Fulfillment; + + /** + * Decodes a Fulfillment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fulfillment + * @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.dialogflow.cx.v3beta1.Fulfillment; + + /** + * Verifies a Fulfillment 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 Fulfillment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fulfillment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Fulfillment; + + /** + * Creates a plain object from a Fulfillment message. Also converts values to other types if specified. + * @param message Fulfillment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Fulfillment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Fulfillment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Fulfillment { + + /** Properties of a SetParameterAction. */ + interface ISetParameterAction { + + /** SetParameterAction parameter */ + parameter?: (string|null); + + /** SetParameterAction value */ + value?: (google.protobuf.IValue|null); + } + + /** Represents a SetParameterAction. */ + class SetParameterAction implements ISetParameterAction { + + /** + * Constructs a new SetParameterAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction); + + /** SetParameterAction parameter. */ + public parameter: string; + + /** SetParameterAction value. */ + public value?: (google.protobuf.IValue|null); + + /** + * Creates a new SetParameterAction instance using the specified properties. + * @param [properties] Properties to set + * @returns SetParameterAction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction): google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction; + + /** + * Encodes the specified SetParameterAction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.verify|verify} messages. + * @param message SetParameterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetParameterAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.verify|verify} messages. + * @param message SetParameterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetParameterAction + * @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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetParameterAction + * @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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction; + + /** + * Verifies a SetParameterAction 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 SetParameterAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetParameterAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction; + + /** + * Creates a plain object from a SetParameterAction message. Also converts values to other types if specified. + * @param message SetParameterAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetParameterAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetParameterAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConditionalCases. */ + interface IConditionalCases { + + /** ConditionalCases cases */ + cases?: (google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase[]|null); + } + + /** Represents a ConditionalCases. */ + class ConditionalCases implements IConditionalCases { + + /** + * Constructs a new ConditionalCases. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases); + + /** ConditionalCases cases. */ + public cases: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase[]; + + /** + * Creates a new ConditionalCases instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionalCases instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases): google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases; + + /** + * Encodes the specified ConditionalCases message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.verify|verify} messages. + * @param message ConditionalCases message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionalCases message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.verify|verify} messages. + * @param message ConditionalCases message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionalCases + * @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionalCases + * @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases; + + /** + * Verifies a ConditionalCases 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 ConditionalCases message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionalCases + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases; + + /** + * Creates a plain object from a ConditionalCases message. Also converts values to other types if specified. + * @param message ConditionalCases + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionalCases to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionalCases + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionalCases { + + /** Properties of a Case. */ + interface ICase { + + /** Case condition */ + condition?: (string|null); + + /** Case caseContent */ + caseContent?: (google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent[]|null); + } + + /** Represents a Case. */ + class Case implements ICase { + + /** + * Constructs a new Case. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase); + + /** Case condition. */ + public condition: string; + + /** Case caseContent. */ + public caseContent: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent[]; + + /** + * Creates a new Case instance using the specified properties. + * @param [properties] Properties to set + * @returns Case instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase): google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Case message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Case + * @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Case + * @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case; + + /** + * Verifies a Case 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 Case message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Case + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @param message Case + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Case to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Case + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Case { + + /** Properties of a CaseContent. */ + interface ICaseContent { + + /** CaseContent message */ + message?: (google.cloud.dialogflow.cx.v3beta1.IResponseMessage|null); + + /** CaseContent additionalCases */ + additionalCases?: (google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases|null); + } + + /** Represents a CaseContent. */ + class CaseContent implements ICaseContent { + + /** + * Constructs a new CaseContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent); + + /** CaseContent message. */ + public message?: (google.cloud.dialogflow.cx.v3beta1.IResponseMessage|null); + + /** CaseContent additionalCases. */ + public additionalCases?: (google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases|null); + + /** CaseContent casesOrMessage. */ + public casesOrMessage?: ("message"|"additionalCases"); + + /** + * Creates a new CaseContent instance using the specified properties. + * @param [properties] Properties to set + * @returns CaseContent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent): google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Encodes the specified CaseContent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @param message CaseContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaseContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @param message CaseContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaseContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaseContent + * @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Decodes a CaseContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaseContent + * @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Verifies a CaseContent 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 CaseContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaseContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent; + + /** + * Creates a plain object from a CaseContent message. Also converts values to other types if specified. + * @param message CaseContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaseContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaseContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a GeneratorSettings. */ + interface IGeneratorSettings { + + /** GeneratorSettings generator */ + generator?: (string|null); + + /** GeneratorSettings inputParameters */ + inputParameters?: ({ [k: string]: string }|null); + + /** GeneratorSettings outputParameter */ + outputParameter?: (string|null); + } + + /** Represents a GeneratorSettings. */ + class GeneratorSettings implements IGeneratorSettings { + + /** + * Constructs a new GeneratorSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings); + + /** GeneratorSettings generator. */ + public generator: string; + + /** GeneratorSettings inputParameters. */ + public inputParameters: { [k: string]: string }; + + /** GeneratorSettings outputParameter. */ + public outputParameter: string; + + /** + * Creates a new GeneratorSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratorSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings): google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings; + + /** + * Encodes the specified GeneratorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.verify|verify} messages. + * @param message GeneratorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.verify|verify} messages. + * @param message GeneratorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratorSettings + * @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.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratorSettings + * @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.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings; + + /** + * Verifies a GeneratorSettings 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 GeneratorSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratorSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings; + + /** + * Creates a plain object from a GeneratorSettings message. Also converts values to other types if specified. + * @param message GeneratorSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratorSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratorSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResponseMessage. */ + interface IResponseMessage { + + /** ResponseMessage text */ + text?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText|null); + + /** ResponseMessage payload */ + payload?: (google.protobuf.IStruct|null); + + /** ResponseMessage conversationSuccess */ + conversationSuccess?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess|null); + + /** ResponseMessage outputAudioText */ + outputAudioText?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText|null); + + /** ResponseMessage liveAgentHandoff */ + liveAgentHandoff?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff|null); + + /** ResponseMessage endInteraction */ + endInteraction?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction|null); + + /** ResponseMessage playAudio */ + playAudio?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio|null); + + /** ResponseMessage mixedAudio */ + mixedAudio?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio|null); + + /** ResponseMessage telephonyTransferCall */ + telephonyTransferCall?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall|null); + + /** ResponseMessage knowledgeInfoCard */ + knowledgeInfoCard?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard|null); + + /** ResponseMessage toolCall */ + toolCall?: (google.cloud.dialogflow.cx.v3beta1.IToolCall|null); + + /** ResponseMessage channel */ + channel?: (string|null); + } + + /** Represents a ResponseMessage. */ + class ResponseMessage implements IResponseMessage { + + /** + * Constructs a new ResponseMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IResponseMessage); + + /** ResponseMessage text. */ + public text?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText|null); + + /** ResponseMessage payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** ResponseMessage conversationSuccess. */ + public conversationSuccess?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess|null); + + /** ResponseMessage outputAudioText. */ + public outputAudioText?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText|null); + + /** ResponseMessage liveAgentHandoff. */ + public liveAgentHandoff?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff|null); + + /** ResponseMessage endInteraction. */ + public endInteraction?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction|null); + + /** ResponseMessage playAudio. */ + public playAudio?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio|null); + + /** ResponseMessage mixedAudio. */ + public mixedAudio?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio|null); + + /** ResponseMessage telephonyTransferCall. */ + public telephonyTransferCall?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall|null); + + /** ResponseMessage knowledgeInfoCard. */ + public knowledgeInfoCard?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard|null); + + /** ResponseMessage toolCall. */ + public toolCall?: (google.cloud.dialogflow.cx.v3beta1.IToolCall|null); + + /** ResponseMessage channel. */ + public channel: string; + + /** ResponseMessage message. */ + public message?: ("text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"|"toolCall"); + + /** + * Creates a new ResponseMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMessage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IResponseMessage): google.cloud.dialogflow.cx.v3beta1.ResponseMessage; + + /** + * Encodes the specified ResponseMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify|verify} messages. + * @param message ResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify|verify} messages. + * @param message ResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMessage + * @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.dialogflow.cx.v3beta1.ResponseMessage; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMessage + * @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.dialogflow.cx.v3beta1.ResponseMessage; + + /** + * Verifies a ResponseMessage 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 ResponseMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage; + + /** + * Creates a plain object from a ResponseMessage message. Also converts values to other types if specified. + * @param message ResponseMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResponseMessage { + + /** Properties of a Text. */ + interface IText { + + /** Text text */ + text?: (string[]|null); + + /** Text allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents a Text. */ + class Text implements IText { + + /** + * Constructs a new Text. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText); + + /** Text text. */ + public text: string[]; + + /** Text allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** + * Creates a new Text instance using the specified properties. + * @param [properties] Properties to set + * @returns Text instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Text message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Text + * @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.dialogflow.cx.v3beta1.ResponseMessage.Text; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Text + * @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.dialogflow.cx.v3beta1.ResponseMessage.Text; + + /** + * Verifies a Text 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 Text message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Text + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @param message Text + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Text to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Text + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LiveAgentHandoff. */ + interface ILiveAgentHandoff { + + /** LiveAgentHandoff metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents a LiveAgentHandoff. */ + class LiveAgentHandoff implements ILiveAgentHandoff { + + /** + * Constructs a new LiveAgentHandoff. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff); + + /** LiveAgentHandoff metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new LiveAgentHandoff instance using the specified properties. + * @param [properties] Properties to set + * @returns LiveAgentHandoff instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Encodes the specified LiveAgentHandoff message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @param message LiveAgentHandoff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LiveAgentHandoff message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @param message LiveAgentHandoff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LiveAgentHandoff + * @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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LiveAgentHandoff + * @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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Verifies a LiveAgentHandoff 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 LiveAgentHandoff message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LiveAgentHandoff + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Creates a plain object from a LiveAgentHandoff message. Also converts values to other types if specified. + * @param message LiveAgentHandoff + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LiveAgentHandoff to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LiveAgentHandoff + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationSuccess. */ + interface IConversationSuccess { + + /** ConversationSuccess metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents a ConversationSuccess. */ + class ConversationSuccess implements IConversationSuccess { + + /** + * Constructs a new ConversationSuccess. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess); + + /** ConversationSuccess metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new ConversationSuccess instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationSuccess instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess; + + /** + * Encodes the specified ConversationSuccess message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @param message ConversationSuccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationSuccess message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @param message ConversationSuccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationSuccess + * @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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationSuccess + * @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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess; + + /** + * Verifies a ConversationSuccess 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 ConversationSuccess message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationSuccess + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess; + + /** + * Creates a plain object from a ConversationSuccess message. Also converts values to other types if specified. + * @param message ConversationSuccess + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationSuccess to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationSuccess + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputAudioText. */ + interface IOutputAudioText { + + /** OutputAudioText text */ + text?: (string|null); + + /** OutputAudioText ssml */ + ssml?: (string|null); + + /** OutputAudioText allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents an OutputAudioText. */ + class OutputAudioText implements IOutputAudioText { + + /** + * Constructs a new OutputAudioText. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText); + + /** OutputAudioText text. */ + public text?: (string|null); + + /** OutputAudioText ssml. */ + public ssml?: (string|null); + + /** OutputAudioText allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** OutputAudioText source. */ + public source?: ("text"|"ssml"); + + /** + * Creates a new OutputAudioText instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioText instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText; + + /** + * Encodes the specified OutputAudioText message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.verify|verify} messages. + * @param message OutputAudioText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.verify|verify} messages. + * @param message OutputAudioText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioText + * @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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioText + * @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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText; + + /** + * Verifies an OutputAudioText 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 OutputAudioText message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioText + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText; + + /** + * Creates a plain object from an OutputAudioText message. Also converts values to other types if specified. + * @param message OutputAudioText + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioText to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputAudioText + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndInteraction. */ + interface IEndInteraction { + } + + /** Represents an EndInteraction. */ + class EndInteraction implements IEndInteraction { + + /** + * Constructs a new EndInteraction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction); + + /** + * Creates a new EndInteraction instance using the specified properties. + * @param [properties] Properties to set + * @returns EndInteraction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndInteraction + * @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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndInteraction + * @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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Verifies an EndInteraction 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 EndInteraction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndInteraction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @param message EndInteraction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndInteraction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndInteraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlayAudio. */ + interface IPlayAudio { + + /** PlayAudio audioUri */ + audioUri?: (string|null); + + /** PlayAudio allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents a PlayAudio. */ + class PlayAudio implements IPlayAudio { + + /** + * Constructs a new PlayAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio); + + /** PlayAudio audioUri. */ + public audioUri: string; + + /** PlayAudio allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** + * Creates a new PlayAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns PlayAudio instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio; + + /** + * Encodes the specified PlayAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.verify|verify} messages. + * @param message PlayAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.verify|verify} messages. + * @param message PlayAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlayAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlayAudio + * @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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio; + + /** + * Decodes a PlayAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlayAudio + * @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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio; + + /** + * Verifies a PlayAudio 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 PlayAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlayAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio; + + /** + * Creates a plain object from a PlayAudio message. Also converts values to other types if specified. + * @param message PlayAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlayAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlayAudio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MixedAudio. */ + interface IMixedAudio { + + /** MixedAudio segments */ + segments?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment[]|null); + } + + /** Represents a MixedAudio. */ + class MixedAudio implements IMixedAudio { + + /** + * Constructs a new MixedAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio); + + /** MixedAudio segments. */ + public segments: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment[]; + + /** + * Creates a new MixedAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns MixedAudio instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio; + + /** + * Encodes the specified MixedAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.verify|verify} messages. + * @param message MixedAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MixedAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.verify|verify} messages. + * @param message MixedAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MixedAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MixedAudio + * @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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio; + + /** + * Decodes a MixedAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MixedAudio + * @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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio; + + /** + * Verifies a MixedAudio 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 MixedAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MixedAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio; + + /** + * Creates a plain object from a MixedAudio message. Also converts values to other types if specified. + * @param message MixedAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MixedAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MixedAudio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MixedAudio { + + /** Properties of a Segment. */ + interface ISegment { + + /** Segment audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** Segment uri */ + uri?: (string|null); + + /** Segment allowPlaybackInterruption */ + allowPlaybackInterruption?: (boolean|null); + } + + /** Represents a Segment. */ + class Segment implements ISegment { + + /** + * Constructs a new Segment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment); + + /** Segment audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** Segment uri. */ + public uri?: (string|null); + + /** Segment allowPlaybackInterruption. */ + public allowPlaybackInterruption: boolean; + + /** Segment content. */ + public content?: ("audio"|"uri"); + + /** + * Creates a new Segment instance using the specified properties. + * @param [properties] Properties to set + * @returns Segment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Segment + * @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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Segment + * @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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment; + + /** + * Verifies a Segment 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 Segment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Segment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @param message Segment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Segment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Segment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TelephonyTransferCall. */ + interface ITelephonyTransferCall { + + /** TelephonyTransferCall phoneNumber */ + phoneNumber?: (string|null); + } + + /** Represents a TelephonyTransferCall. */ + class TelephonyTransferCall implements ITelephonyTransferCall { + + /** + * Constructs a new TelephonyTransferCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall); + + /** TelephonyTransferCall phoneNumber. */ + public phoneNumber?: (string|null); + + /** TelephonyTransferCall endpoint. */ + public endpoint?: "phoneNumber"; + + /** + * Creates a new TelephonyTransferCall instance using the specified properties. + * @param [properties] Properties to set + * @returns TelephonyTransferCall instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall; + + /** + * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @param message TelephonyTransferCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @param message TelephonyTransferCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TelephonyTransferCall + * @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.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TelephonyTransferCall + * @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.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall; + + /** + * Verifies a TelephonyTransferCall 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 TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TelephonyTransferCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall; + + /** + * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. + * @param message TelephonyTransferCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TelephonyTransferCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TelephonyTransferCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KnowledgeInfoCard. */ + interface IKnowledgeInfoCard { + } + + /** Represents a KnowledgeInfoCard. */ + class KnowledgeInfoCard implements IKnowledgeInfoCard { + + /** + * Constructs a new KnowledgeInfoCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard); + + /** + * Creates a new KnowledgeInfoCard instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeInfoCard instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard; + + /** + * Encodes the specified KnowledgeInfoCard message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @param message KnowledgeInfoCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeInfoCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @param message KnowledgeInfoCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeInfoCard + * @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.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeInfoCard + * @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.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard; + + /** + * Verifies a KnowledgeInfoCard 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 KnowledgeInfoCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeInfoCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard; + + /** + * Creates a plain object from a KnowledgeInfoCard message. Also converts values to other types if specified. + * @param message KnowledgeInfoCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeInfoCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KnowledgeInfoCard + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToolCall. */ + interface IToolCall { + + /** ToolCall tool */ + tool?: (string|null); + + /** ToolCall action */ + action?: (string|null); + + /** ToolCall inputParameters */ + inputParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCall. */ + class ToolCall implements IToolCall { + + /** + * Constructs a new ToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCall); + + /** ToolCall tool. */ + public tool: string; + + /** ToolCall action. */ + public action: string; + + /** ToolCall inputParameters. */ + public inputParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new ToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCall instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCall): google.cloud.dialogflow.cx.v3beta1.ToolCall; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCall + * @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.dialogflow.cx.v3beta1.ToolCall; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCall + * @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.dialogflow.cx.v3beta1.ToolCall; + + /** + * Verifies a ToolCall 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 ToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCall; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @param message ToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCallResult. */ + interface IToolCallResult { + + /** ToolCallResult tool */ + tool?: (string|null); + + /** ToolCallResult action */ + action?: (string|null); + + /** ToolCallResult error */ + error?: (google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null); + + /** ToolCallResult outputParameters */ + outputParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCallResult. */ + class ToolCallResult implements IToolCallResult { + + /** + * Constructs a new ToolCallResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCallResult); + + /** ToolCallResult tool. */ + public tool: string; + + /** ToolCallResult action. */ + public action: string; + + /** ToolCallResult error. */ + public error?: (google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null); + + /** ToolCallResult outputParameters. */ + public outputParameters?: (google.protobuf.IStruct|null); + + /** ToolCallResult result. */ + public result?: ("error"|"outputParameters"); + + /** + * Creates a new ToolCallResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCallResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCallResult): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @param message ToolCallResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @param message ToolCallResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCallResult + * @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.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCallResult + * @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.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Verifies a ToolCallResult 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 ToolCallResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCallResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Creates a plain object from a ToolCallResult message. Also converts values to other types if specified. + * @param message ToolCallResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCallResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCallResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolCallResult { + + /** Properties of an Error. */ + interface IError { + + /** Error message */ + message?: (string|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError); + + /** Error message. */ + public message: string; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @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.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @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.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Verifies an Error 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 Error message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Error + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Error + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ParameterDefinition. */ + interface IParameterDefinition { + + /** ParameterDefinition name */ + name?: (string|null); + + /** ParameterDefinition type */ + type?: (google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType|keyof typeof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType|null); + + /** ParameterDefinition typeSchema */ + typeSchema?: (google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null); + + /** ParameterDefinition description */ + description?: (string|null); + } + + /** Represents a ParameterDefinition. */ + class ParameterDefinition implements IParameterDefinition { + + /** + * Constructs a new ParameterDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition); + + /** ParameterDefinition name. */ + public name: string; + + /** ParameterDefinition type. */ + public type: (google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType|keyof typeof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType); + + /** ParameterDefinition typeSchema. */ + public typeSchema?: (google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null); + + /** ParameterDefinition description. */ + public description: string; + + /** + * Creates a new ParameterDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterDefinition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition): google.cloud.dialogflow.cx.v3beta1.ParameterDefinition; + + /** + * Encodes the specified ParameterDefinition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify|verify} messages. + * @param message ParameterDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterDefinition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify|verify} messages. + * @param message ParameterDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterDefinition + * @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.dialogflow.cx.v3beta1.ParameterDefinition; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterDefinition + * @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.dialogflow.cx.v3beta1.ParameterDefinition; + + /** + * Verifies a ParameterDefinition 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 ParameterDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ParameterDefinition; + + /** + * Creates a plain object from a ParameterDefinition message. Also converts values to other types if specified. + * @param message ParameterDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ParameterDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ParameterDefinition { + + /** ParameterType enum. */ + enum ParameterType { + PARAMETER_TYPE_UNSPECIFIED = 0, + STRING = 1, + NUMBER = 2, + BOOLEAN = 3, + NULL = 4, + OBJECT = 5, + LIST = 6 + } + } + + /** Properties of a TypeSchema. */ + interface ITypeSchema { + + /** TypeSchema inlineSchema */ + inlineSchema?: (google.cloud.dialogflow.cx.v3beta1.IInlineSchema|null); + + /** TypeSchema schemaReference */ + schemaReference?: (google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference|null); + } + + /** Represents a TypeSchema. */ + class TypeSchema implements ITypeSchema { + + /** + * Constructs a new TypeSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITypeSchema); + + /** TypeSchema inlineSchema. */ + public inlineSchema?: (google.cloud.dialogflow.cx.v3beta1.IInlineSchema|null); + + /** TypeSchema schemaReference. */ + public schemaReference?: (google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference|null); + + /** TypeSchema schema. */ + public schema?: ("inlineSchema"|"schemaReference"); + + /** + * Creates a new TypeSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeSchema instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITypeSchema): google.cloud.dialogflow.cx.v3beta1.TypeSchema; + + /** + * Encodes the specified TypeSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.verify|verify} messages. + * @param message TypeSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITypeSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.verify|verify} messages. + * @param message TypeSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITypeSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeSchema + * @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.dialogflow.cx.v3beta1.TypeSchema; + + /** + * Decodes a TypeSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeSchema + * @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.dialogflow.cx.v3beta1.TypeSchema; + + /** + * Verifies a TypeSchema 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 TypeSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TypeSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TypeSchema; + + /** + * Creates a plain object from a TypeSchema message. Also converts values to other types if specified. + * @param message TypeSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TypeSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TypeSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TypeSchema { + + /** Properties of a SchemaReference. */ + interface ISchemaReference { + + /** SchemaReference tool */ + tool?: (string|null); + + /** SchemaReference schema */ + schema?: (string|null); + } + + /** Represents a SchemaReference. */ + class SchemaReference implements ISchemaReference { + + /** + * Constructs a new SchemaReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference); + + /** SchemaReference tool. */ + public tool: string; + + /** SchemaReference schema. */ + public schema: string; + + /** + * Creates a new SchemaReference instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaReference instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference): google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference; + + /** + * Encodes the specified SchemaReference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.verify|verify} messages. + * @param message SchemaReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaReference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.verify|verify} messages. + * @param message SchemaReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaReference + * @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.dialogflow.cx.v3beta1.TypeSchema.SchemaReference; + + /** + * Decodes a SchemaReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaReference + * @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.dialogflow.cx.v3beta1.TypeSchema.SchemaReference; + + /** + * Verifies a SchemaReference 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 SchemaReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference; + + /** + * Creates a plain object from a SchemaReference message. Also converts values to other types if specified. + * @param message SchemaReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an InlineSchema. */ + interface IInlineSchema { + + /** InlineSchema type */ + type?: (google.cloud.dialogflow.cx.v3beta1.DataType|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataType|null); + + /** InlineSchema items */ + items?: (google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null); + } + + /** Represents an InlineSchema. */ + class InlineSchema implements IInlineSchema { + + /** + * Constructs a new InlineSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IInlineSchema); + + /** InlineSchema type. */ + public type: (google.cloud.dialogflow.cx.v3beta1.DataType|keyof typeof google.cloud.dialogflow.cx.v3beta1.DataType); + + /** InlineSchema items. */ + public items?: (google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null); + + /** + * Creates a new InlineSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSchema instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IInlineSchema): google.cloud.dialogflow.cx.v3beta1.InlineSchema; + + /** + * Encodes the specified InlineSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSchema.verify|verify} messages. + * @param message InlineSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IInlineSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSchema.verify|verify} messages. + * @param message InlineSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IInlineSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSchema + * @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.dialogflow.cx.v3beta1.InlineSchema; + + /** + * Decodes an InlineSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSchema + * @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.dialogflow.cx.v3beta1.InlineSchema; + + /** + * Verifies an InlineSchema 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 InlineSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.InlineSchema; + + /** + * Creates a plain object from an InlineSchema message. Also converts values to other types if specified. + * @param message InlineSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.InlineSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + STRING = 1, + NUMBER = 2, + BOOLEAN = 3, + ARRAY = 6 + } + + /** Properties of a ValidationMessage. */ + interface IValidationMessage { + + /** ValidationMessage resourceType */ + resourceType?: (google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType|keyof typeof google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType|null); + + /** ValidationMessage resources */ + resources?: (string[]|null); + + /** ValidationMessage resourceNames */ + resourceNames?: (google.cloud.dialogflow.cx.v3beta1.IResourceName[]|null); + + /** ValidationMessage severity */ + severity?: (google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity|keyof typeof google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity|null); + + /** ValidationMessage detail */ + detail?: (string|null); + } + + /** Represents a ValidationMessage. */ + class ValidationMessage implements IValidationMessage { + + /** + * Constructs a new ValidationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IValidationMessage); + + /** ValidationMessage resourceType. */ + public resourceType: (google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType|keyof typeof google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType); + + /** ValidationMessage resources. */ + public resources: string[]; + + /** ValidationMessage resourceNames. */ + public resourceNames: google.cloud.dialogflow.cx.v3beta1.IResourceName[]; + + /** ValidationMessage severity. */ + public severity: (google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity|keyof typeof google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity); + + /** ValidationMessage detail. */ + public detail: string; + + /** + * Creates a new ValidationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidationMessage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IValidationMessage): google.cloud.dialogflow.cx.v3beta1.ValidationMessage; + + /** + * Encodes the specified ValidationMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidationMessage.verify|verify} messages. + * @param message ValidationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IValidationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidationMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidationMessage.verify|verify} messages. + * @param message ValidationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IValidationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidationMessage + * @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.dialogflow.cx.v3beta1.ValidationMessage; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidationMessage + * @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.dialogflow.cx.v3beta1.ValidationMessage; + + /** + * Verifies a ValidationMessage 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 ValidationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidationMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ValidationMessage; + + /** + * Creates a plain object from a ValidationMessage message. Also converts values to other types if specified. + * @param message ValidationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ValidationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidationMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ValidationMessage { + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + AGENT = 1, + INTENT = 2, + INTENT_TRAINING_PHRASE = 8, + INTENT_PARAMETER = 9, + INTENTS = 10, + INTENT_TRAINING_PHRASES = 11, + ENTITY_TYPE = 3, + ENTITY_TYPES = 12, + WEBHOOK = 4, + FLOW = 5, + PAGE = 6, + PAGES = 13, + TRANSITION_ROUTE_GROUP = 7, + AGENT_TRANSITION_ROUTE_GROUP = 14 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + INFO = 1, + WARNING = 2, + ERROR = 3 + } + } + + /** Properties of a ResourceName. */ + interface IResourceName { + + /** ResourceName name */ + name?: (string|null); + + /** ResourceName displayName */ + displayName?: (string|null); + } + + /** Represents a ResourceName. */ + class ResourceName implements IResourceName { + + /** + * Constructs a new ResourceName. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IResourceName); + + /** ResourceName name. */ + public name: string; + + /** ResourceName displayName. */ + public displayName: string; + + /** + * Creates a new ResourceName instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceName instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IResourceName): google.cloud.dialogflow.cx.v3beta1.ResourceName; + + /** + * Encodes the specified ResourceName message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResourceName.verify|verify} messages. + * @param message ResourceName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IResourceName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceName message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResourceName.verify|verify} messages. + * @param message ResourceName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IResourceName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceName message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceName + * @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.dialogflow.cx.v3beta1.ResourceName; + + /** + * Decodes a ResourceName message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceName + * @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.dialogflow.cx.v3beta1.ResourceName; + + /** + * Verifies a ResourceName 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 ResourceName message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceName + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResourceName; + + /** + * Creates a plain object from a ResourceName message. Also converts values to other types if specified. + * @param message ResourceName + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResourceName, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceName to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceName + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerativeSettings. */ + interface IGenerativeSettings { + + /** GenerativeSettings name */ + name?: (string|null); + + /** GenerativeSettings fallbackSettings */ + fallbackSettings?: (google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings|null); + + /** GenerativeSettings generativeSafetySettings */ + generativeSafetySettings?: (google.cloud.dialogflow.cx.v3beta1.ISafetySettings|null); + + /** GenerativeSettings knowledgeConnectorSettings */ + knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings|null); + + /** GenerativeSettings languageCode */ + languageCode?: (string|null); + + /** GenerativeSettings llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + } + + /** Represents a GenerativeSettings. */ + class GenerativeSettings implements IGenerativeSettings { + + /** + * Constructs a new GenerativeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings); + + /** GenerativeSettings name. */ + public name: string; + + /** GenerativeSettings fallbackSettings. */ + public fallbackSettings?: (google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings|null); + + /** GenerativeSettings generativeSafetySettings. */ + public generativeSafetySettings?: (google.cloud.dialogflow.cx.v3beta1.ISafetySettings|null); + + /** GenerativeSettings knowledgeConnectorSettings. */ + public knowledgeConnectorSettings?: (google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings|null); + + /** GenerativeSettings languageCode. */ + public languageCode: string; + + /** GenerativeSettings llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + + /** + * Creates a new GenerativeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerativeSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings; + + /** + * Encodes the specified GenerativeSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.verify|verify} messages. + * @param message GenerativeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerativeSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.verify|verify} messages. + * @param message GenerativeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerativeSettings + * @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.dialogflow.cx.v3beta1.GenerativeSettings; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerativeSettings + * @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.dialogflow.cx.v3beta1.GenerativeSettings; + + /** + * Verifies a GenerativeSettings 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 GenerativeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerativeSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings; + + /** + * Creates a plain object from a GenerativeSettings message. Also converts values to other types if specified. + * @param message GenerativeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerativeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerativeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerativeSettings { + + /** Properties of a FallbackSettings. */ + interface IFallbackSettings { + + /** FallbackSettings selectedPrompt */ + selectedPrompt?: (string|null); + + /** FallbackSettings promptTemplates */ + promptTemplates?: (google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate[]|null); + } + + /** Represents a FallbackSettings. */ + class FallbackSettings implements IFallbackSettings { + + /** + * Constructs a new FallbackSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings); + + /** FallbackSettings selectedPrompt. */ + public selectedPrompt: string; + + /** FallbackSettings promptTemplates. */ + public promptTemplates: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate[]; + + /** + * Creates a new FallbackSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns FallbackSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings; + + /** + * Encodes the specified FallbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @param message FallbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FallbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @param message FallbackSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FallbackSettings + * @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.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FallbackSettings + * @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.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings; + + /** + * Verifies a FallbackSettings 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 FallbackSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FallbackSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings; + + /** + * Creates a plain object from a FallbackSettings message. Also converts values to other types if specified. + * @param message FallbackSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FallbackSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FallbackSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FallbackSettings { + + /** Properties of a PromptTemplate. */ + interface IPromptTemplate { + + /** PromptTemplate displayName */ + displayName?: (string|null); + + /** PromptTemplate promptText */ + promptText?: (string|null); + + /** PromptTemplate frozen */ + frozen?: (boolean|null); + } + + /** Represents a PromptTemplate. */ + class PromptTemplate implements IPromptTemplate { + + /** + * Constructs a new PromptTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate); + + /** PromptTemplate displayName. */ + public displayName: string; + + /** PromptTemplate promptText. */ + public promptText: string; + + /** PromptTemplate frozen. */ + public frozen: boolean; + + /** + * Creates a new PromptTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptTemplate instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Encodes the specified PromptTemplate message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @param message PromptTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptTemplate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @param message PromptTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptTemplate + * @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.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptTemplate + * @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.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Verifies a PromptTemplate 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 PromptTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate; + + /** + * Creates a plain object from a PromptTemplate message. Also converts values to other types if specified. + * @param message PromptTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a KnowledgeConnectorSettings. */ + interface IKnowledgeConnectorSettings { + + /** KnowledgeConnectorSettings business */ + business?: (string|null); + + /** KnowledgeConnectorSettings agent */ + agent?: (string|null); + + /** KnowledgeConnectorSettings agentIdentity */ + agentIdentity?: (string|null); + + /** KnowledgeConnectorSettings businessDescription */ + businessDescription?: (string|null); + + /** KnowledgeConnectorSettings agentScope */ + agentScope?: (string|null); + + /** KnowledgeConnectorSettings disableDataStoreFallback */ + disableDataStoreFallback?: (boolean|null); + } + + /** Represents a KnowledgeConnectorSettings. */ + class KnowledgeConnectorSettings implements IKnowledgeConnectorSettings { + + /** + * Constructs a new KnowledgeConnectorSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings); + + /** KnowledgeConnectorSettings business. */ + public business: string; + + /** KnowledgeConnectorSettings agent. */ + public agent: string; + + /** KnowledgeConnectorSettings agentIdentity. */ + public agentIdentity: string; + + /** KnowledgeConnectorSettings businessDescription. */ + public businessDescription: string; + + /** KnowledgeConnectorSettings agentScope. */ + public agentScope: string; + + /** KnowledgeConnectorSettings disableDataStoreFallback. */ + public disableDataStoreFallback: boolean; + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeConnectorSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @param message KnowledgeConnectorSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeConnectorSettings + * @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.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Verifies a KnowledgeConnectorSettings 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 KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeConnectorSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @param message KnowledgeConnectorSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LlmModelSettings. */ + interface ILlmModelSettings { + + /** LlmModelSettings model */ + model?: (string|null); + + /** LlmModelSettings promptText */ + promptText?: (string|null); + + /** LlmModelSettings parameters */ + parameters?: (google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters|null); + } + + /** Represents a LlmModelSettings. */ + class LlmModelSettings implements ILlmModelSettings { + + /** + * Constructs a new LlmModelSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings); + + /** LlmModelSettings model. */ + public model: string; + + /** LlmModelSettings promptText. */ + public promptText: string; + + /** LlmModelSettings parameters. */ + public parameters?: (google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters|null); + + /** + * Creates a new LlmModelSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmModelSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings): google.cloud.dialogflow.cx.v3beta1.LlmModelSettings; + + /** + * Encodes the specified LlmModelSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify|verify} messages. + * @param message LlmModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmModelSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify|verify} messages. + * @param message LlmModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmModelSettings + * @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.dialogflow.cx.v3beta1.LlmModelSettings; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmModelSettings + * @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.dialogflow.cx.v3beta1.LlmModelSettings; + + /** + * Verifies a LlmModelSettings 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 LlmModelSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmModelSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LlmModelSettings; + + /** + * Creates a plain object from a LlmModelSettings message. Also converts values to other types if specified. + * @param message LlmModelSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LlmModelSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmModelSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmModelSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmModelSettings { + + /** Properties of a Parameters. */ + interface IParameters { + + /** Parameters temperature */ + temperature?: (number|null); + + /** Parameters inputTokenLimit */ + inputTokenLimit?: (google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit|keyof typeof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit|null); + + /** Parameters outputTokenLimit */ + outputTokenLimit?: (google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit|keyof typeof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit|null); + } + + /** Represents a Parameters. */ + class Parameters implements IParameters { + + /** + * Constructs a new Parameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters); + + /** Parameters temperature. */ + public temperature?: (number|null); + + /** Parameters inputTokenLimit. */ + public inputTokenLimit?: (google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit|keyof typeof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit|null); + + /** Parameters outputTokenLimit. */ + public outputTokenLimit?: (google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit|keyof typeof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit|null); + + /** + * Creates a new Parameters instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameters instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters): google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters; + + /** + * Encodes the specified Parameters message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.verify|verify} messages. + * @param message Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.verify|verify} messages. + * @param message Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameters + * @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.dialogflow.cx.v3beta1.LlmModelSettings.Parameters; + + /** + * Decodes a Parameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameters + * @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.dialogflow.cx.v3beta1.LlmModelSettings.Parameters; + + /** + * Verifies a Parameters 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 Parameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters; + + /** + * Creates a plain object from a Parameters message. Also converts values to other types if specified. + * @param message Parameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Parameters { + + /** InputTokenLimit enum. */ + enum InputTokenLimit { + INPUT_TOKEN_LIMIT_UNSPECIFIED = 0, + INPUT_TOKEN_LIMIT_SHORT = 1, + INPUT_TOKEN_LIMIT_MEDIUM = 2, + INPUT_TOKEN_LIMIT_LONG = 3 + } + + /** OutputTokenLimit enum. */ + enum OutputTokenLimit { + OUTPUT_TOKEN_LIMIT_UNSPECIFIED = 0, + OUTPUT_TOKEN_LIMIT_SHORT = 1, + OUTPUT_TOKEN_LIMIT_MEDIUM = 2, + OUTPUT_TOKEN_LIMIT_LONG = 3 + } + } + } + + /** Properties of a SafetySettings. */ + interface ISafetySettings { + + /** SafetySettings defaultBannedPhraseMatchStrategy */ + defaultBannedPhraseMatchStrategy?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy|null); + + /** SafetySettings bannedPhrases */ + bannedPhrases?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase[]|null); + + /** SafetySettings raiSettings */ + raiSettings?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null); + + /** SafetySettings defaultRaiSettings */ + defaultRaiSettings?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null); + + /** SafetySettings promptSecuritySettings */ + promptSecuritySettings?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings|null); + } + + /** Represents a SafetySettings. */ + class SafetySettings implements ISafetySettings { + + /** + * Constructs a new SafetySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISafetySettings); + + /** SafetySettings defaultBannedPhraseMatchStrategy. */ + public defaultBannedPhraseMatchStrategy: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy); + + /** SafetySettings bannedPhrases. */ + public bannedPhrases: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase[]; + + /** SafetySettings raiSettings. */ + public raiSettings?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null); + + /** SafetySettings defaultRaiSettings. */ + public defaultRaiSettings?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null); + + /** SafetySettings promptSecuritySettings. */ + public promptSecuritySettings?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings|null); + + /** + * Creates a new SafetySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISafetySettings): google.cloud.dialogflow.cx.v3beta1.SafetySettings; + + /** + * Encodes the specified SafetySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.verify|verify} messages. + * @param message SafetySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISafetySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.verify|verify} messages. + * @param message SafetySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISafetySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySettings + * @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.dialogflow.cx.v3beta1.SafetySettings; + + /** + * Decodes a SafetySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySettings + * @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.dialogflow.cx.v3beta1.SafetySettings; + + /** + * Verifies a SafetySettings 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 SafetySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SafetySettings; + + /** + * Creates a plain object from a SafetySettings message. Also converts values to other types if specified. + * @param message SafetySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetySettings { + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase text */ + text?: (string|null); + + /** Phrase languageCode */ + languageCode?: (string|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase); + + /** Phrase text. */ + public text: string; + + /** Phrase languageCode. */ + public languageCode: string; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase): google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @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.dialogflow.cx.v3beta1.SafetySettings.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @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.dialogflow.cx.v3beta1.SafetySettings.Phrase; + + /** + * Verifies a Phrase 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 Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PhraseMatchStrategy enum. */ + enum PhraseMatchStrategy { + PHRASE_MATCH_STRATEGY_UNSPECIFIED = 0, + PARTIAL_MATCH = 1, + WORD_MATCH = 2 + } + + /** Properties of a RaiSettings. */ + interface IRaiSettings { + + /** RaiSettings categoryFilters */ + categoryFilters?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter[]|null); + } + + /** Represents a RaiSettings. */ + class RaiSettings implements IRaiSettings { + + /** + * Constructs a new RaiSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings); + + /** RaiSettings categoryFilters. */ + public categoryFilters: google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter[]; + + /** + * Creates a new RaiSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RaiSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings): google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings; + + /** + * Encodes the specified RaiSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.verify|verify} messages. + * @param message RaiSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RaiSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.verify|verify} messages. + * @param message RaiSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RaiSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RaiSettings + * @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.dialogflow.cx.v3beta1.SafetySettings.RaiSettings; + + /** + * Decodes a RaiSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RaiSettings + * @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.dialogflow.cx.v3beta1.SafetySettings.RaiSettings; + + /** + * Verifies a RaiSettings 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 RaiSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RaiSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings; + + /** + * Creates a plain object from a RaiSettings message. Also converts values to other types if specified. + * @param message RaiSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RaiSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RaiSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RaiSettings { + + /** SafetyFilterLevel enum. */ + enum SafetyFilterLevel { + SAFETY_FILTER_LEVEL_UNSPECIFIED = 0, + BLOCK_NONE = 1, + BLOCK_FEW = 2, + BLOCK_SOME = 3, + BLOCK_MOST = 4 + } + + /** SafetyCategory enum. */ + enum SafetyCategory { + SAFETY_CATEGORY_UNSPECIFIED = 0, + DANGEROUS_CONTENT = 1, + HATE_SPEECH = 2, + HARASSMENT = 3, + SEXUALLY_EXPLICIT_CONTENT = 4 + } + + /** Properties of a CategoryFilter. */ + interface ICategoryFilter { + + /** CategoryFilter category */ + category?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory|keyof typeof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory|null); + + /** CategoryFilter filterLevel */ + filterLevel?: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel|keyof typeof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel|null); + } + + /** Represents a CategoryFilter. */ + class CategoryFilter implements ICategoryFilter { + + /** + * Constructs a new CategoryFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter); + + /** CategoryFilter category. */ + public category: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory|keyof typeof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory); + + /** CategoryFilter filterLevel. */ + public filterLevel: (google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel|keyof typeof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel); + + /** + * Creates a new CategoryFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoryFilter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter): google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Encodes the specified CategoryFilter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @param message CategoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoryFilter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @param message CategoryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoryFilter + * @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.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoryFilter + * @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.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Verifies a CategoryFilter 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 CategoryFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoryFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter; + + /** + * Creates a plain object from a CategoryFilter message. Also converts values to other types if specified. + * @param message CategoryFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoryFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoryFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PromptSecuritySettings. */ + interface IPromptSecuritySettings { + + /** PromptSecuritySettings enablePromptSecurity */ + enablePromptSecurity?: (boolean|null); + } + + /** Represents a PromptSecuritySettings. */ + class PromptSecuritySettings implements IPromptSecuritySettings { + + /** + * Constructs a new PromptSecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings); + + /** PromptSecuritySettings enablePromptSecurity. */ + public enablePromptSecurity: boolean; + + /** + * Creates a new PromptSecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptSecuritySettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings): google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings; + + /** + * Encodes the specified PromptSecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @param message PromptSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @param message PromptSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptSecuritySettings + * @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.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptSecuritySettings + * @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.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings; + + /** + * Verifies a PromptSecuritySettings 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 PromptSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptSecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings; + + /** + * Creates a plain object from a PromptSecuritySettings message. Also converts values to other types if specified. + * @param message PromptSecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptSecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptSecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a Changelogs */ + class Changelogs extends $protobuf.rpc.Service { + + /** + * Constructs a new Changelogs service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Changelogs service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Changelogs; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChangelogsResponse + */ + public listChangelogs(request: google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Changelogs.ListChangelogsCallback): void; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @returns Promise + */ + public listChangelogs(request: google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest): Promise; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Changelog + */ + public getChangelog(request: google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest, callback: google.cloud.dialogflow.cx.v3beta1.Changelogs.GetChangelogCallback): void; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @returns Promise + */ + public getChangelog(request: google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest): Promise; + } + + namespace Changelogs { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Changelogs|listChangelogs}. + * @param error Error, if any + * @param [response] ListChangelogsResponse + */ + type ListChangelogsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Changelogs|getChangelog}. + * @param error Error, if any + * @param [response] Changelog + */ + type GetChangelogCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Changelog) => void; + } + + /** Properties of a ListChangelogsRequest. */ + interface IListChangelogsRequest { + + /** ListChangelogsRequest parent */ + parent?: (string|null); + + /** ListChangelogsRequest filter */ + filter?: (string|null); + + /** ListChangelogsRequest pageSize */ + pageSize?: (number|null); + + /** ListChangelogsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListChangelogsRequest. */ + class ListChangelogsRequest implements IListChangelogsRequest { + + /** + * Constructs a new ListChangelogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest); + + /** ListChangelogsRequest parent. */ + public parent: string; + + /** ListChangelogsRequest filter. */ + public filter: string; + + /** ListChangelogsRequest pageSize. */ + public pageSize: number; + + /** ListChangelogsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest): google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsRequest + * @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.dialogflow.cx.v3beta1.ListChangelogsRequest; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsRequest + * @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.dialogflow.cx.v3beta1.ListChangelogsRequest; + + /** + * Verifies a ListChangelogsRequest 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 ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest; + + /** + * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. + * @param message ListChangelogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChangelogsResponse. */ + interface IListChangelogsResponse { + + /** ListChangelogsResponse changelogs */ + changelogs?: (google.cloud.dialogflow.cx.v3beta1.IChangelog[]|null); + + /** ListChangelogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChangelogsResponse. */ + class ListChangelogsResponse implements IListChangelogsResponse { + + /** + * Constructs a new ListChangelogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse); + + /** ListChangelogsResponse changelogs. */ + public changelogs: google.cloud.dialogflow.cx.v3beta1.IChangelog[]; + + /** ListChangelogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse): google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsResponse + * @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.dialogflow.cx.v3beta1.ListChangelogsResponse; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsResponse + * @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.dialogflow.cx.v3beta1.ListChangelogsResponse; + + /** + * Verifies a ListChangelogsResponse 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 ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @param message ListChangelogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChangelogRequest. */ + interface IGetChangelogRequest { + + /** GetChangelogRequest name */ + name?: (string|null); + } + + /** Represents a GetChangelogRequest. */ + class GetChangelogRequest implements IGetChangelogRequest { + + /** + * Constructs a new GetChangelogRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest); + + /** GetChangelogRequest name. */ + public name: string; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChangelogRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest): google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChangelogRequest + * @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.dialogflow.cx.v3beta1.GetChangelogRequest; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChangelogRequest + * @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.dialogflow.cx.v3beta1.GetChangelogRequest; + + /** + * Verifies a GetChangelogRequest 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 GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChangelogRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @param message GetChangelogRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChangelogRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChangelogRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Changelog. */ + interface IChangelog { + + /** Changelog name */ + name?: (string|null); + + /** Changelog userEmail */ + userEmail?: (string|null); + + /** Changelog displayName */ + displayName?: (string|null); + + /** Changelog action */ + action?: (string|null); + + /** Changelog type */ + type?: (string|null); + + /** Changelog resource */ + resource?: (string|null); + + /** Changelog createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog languageCode */ + languageCode?: (string|null); + } + + /** Represents a Changelog. */ + class Changelog implements IChangelog { + + /** + * Constructs a new Changelog. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IChangelog); + + /** Changelog name. */ + public name: string; + + /** Changelog userEmail. */ + public userEmail: string; + + /** Changelog displayName. */ + public displayName: string; + + /** Changelog action. */ + public action: string; + + /** Changelog type. */ + public type: string; + + /** Changelog resource. */ + public resource: string; + + /** Changelog createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog languageCode. */ + public languageCode: string; + + /** + * Creates a new Changelog instance using the specified properties. + * @param [properties] Properties to set + * @returns Changelog instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IChangelog): google.cloud.dialogflow.cx.v3beta1.Changelog; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Changelog + * @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.dialogflow.cx.v3beta1.Changelog; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Changelog + * @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.dialogflow.cx.v3beta1.Changelog; + + /** + * Verifies a Changelog 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 Changelog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Changelog + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Changelog; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @param message Changelog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Changelog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Changelog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Changelog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CodeBlock. */ + interface ICodeBlock { + + /** CodeBlock code */ + code?: (string|null); + } + + /** Represents a CodeBlock. */ + class CodeBlock implements ICodeBlock { + + /** + * Constructs a new CodeBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICodeBlock); + + /** CodeBlock code. */ + public code: string; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeBlock instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICodeBlock): google.cloud.dialogflow.cx.v3beta1.CodeBlock; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeBlock + * @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.dialogflow.cx.v3beta1.CodeBlock; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeBlock + * @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.dialogflow.cx.v3beta1.CodeBlock; + + /** + * Verifies a CodeBlock 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 CodeBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CodeBlock; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @param message CodeBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CodeBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a ConversationHistory */ + class ConversationHistory extends $protobuf.rpc.Service { + + /** + * Constructs a new ConversationHistory service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new ConversationHistory service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ConversationHistory; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationsResponse + */ + public listConversations(request: google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, callback: google.cloud.dialogflow.cx.v3beta1.ConversationHistory.ListConversationsCallback): void; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @returns Promise + */ + public listConversations(request: google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest): Promise; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation + */ + public getConversation(request: google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest, callback: google.cloud.dialogflow.cx.v3beta1.ConversationHistory.GetConversationCallback): void; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @returns Promise + */ + public getConversation(request: google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest): Promise; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteConversation(request: google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest, callback: google.cloud.dialogflow.cx.v3beta1.ConversationHistory.DeleteConversationCallback): void; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @returns Promise + */ + public deleteConversation(request: google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest): Promise; + } + + namespace ConversationHistory { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.ConversationHistory|listConversations}. + * @param error Error, if any + * @param [response] ListConversationsResponse + */ + type ListConversationsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.ConversationHistory|getConversation}. + * @param error Error, if any + * @param [response] Conversation + */ + type GetConversationCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Conversation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.ConversationHistory|deleteConversation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteConversationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetConversationRequest. */ + interface IGetConversationRequest { + + /** GetConversationRequest name */ + name?: (string|null); + } + + /** Represents a GetConversationRequest. */ + class GetConversationRequest implements IGetConversationRequest { + + /** + * Constructs a new GetConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest); + + /** GetConversationRequest name. */ + public name: string; + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConversationRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest): google.cloud.dialogflow.cx.v3beta1.GetConversationRequest; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConversationRequest + * @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.dialogflow.cx.v3beta1.GetConversationRequest; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConversationRequest + * @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.dialogflow.cx.v3beta1.GetConversationRequest; + + /** + * Verifies a GetConversationRequest 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 GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetConversationRequest; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @param message GetConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteConversationRequest. */ + interface IDeleteConversationRequest { + + /** DeleteConversationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteConversationRequest. */ + class DeleteConversationRequest implements IDeleteConversationRequest { + + /** + * Constructs a new DeleteConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest); + + /** DeleteConversationRequest name. */ + public name: string; + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConversationRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest): google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConversationRequest + * @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.dialogflow.cx.v3beta1.DeleteConversationRequest; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConversationRequest + * @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.dialogflow.cx.v3beta1.DeleteConversationRequest; + + /** + * Verifies a DeleteConversationRequest 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 DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @param message DeleteConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsRequest. */ + interface IListConversationsRequest { + + /** ListConversationsRequest parent */ + parent?: (string|null); + + /** ListConversationsRequest filter */ + filter?: (string|null); + + /** ListConversationsRequest pageSize */ + pageSize?: (number|null); + + /** ListConversationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListConversationsRequest. */ + class ListConversationsRequest implements IListConversationsRequest { + + /** + * Constructs a new ListConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest); + + /** ListConversationsRequest parent. */ + public parent: string; + + /** ListConversationsRequest filter. */ + public filter: string; + + /** ListConversationsRequest pageSize. */ + public pageSize: number; + + /** ListConversationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest): google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsRequest + * @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.dialogflow.cx.v3beta1.ListConversationsRequest; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsRequest + * @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.dialogflow.cx.v3beta1.ListConversationsRequest; + + /** + * Verifies a ListConversationsRequest 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 ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @param message ListConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsResponse. */ + interface IListConversationsResponse { + + /** ListConversationsResponse conversations */ + conversations?: (google.cloud.dialogflow.cx.v3beta1.IConversation[]|null); + + /** ListConversationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListConversationsResponse. */ + class ListConversationsResponse implements IListConversationsResponse { + + /** + * Constructs a new ListConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse); + + /** ListConversationsResponse conversations. */ + public conversations: google.cloud.dialogflow.cx.v3beta1.IConversation[]; + + /** ListConversationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse): google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsResponse + * @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.dialogflow.cx.v3beta1.ListConversationsResponse; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsResponse + * @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.dialogflow.cx.v3beta1.ListConversationsResponse; + + /** + * Verifies a ListConversationsResponse 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 ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @param message ListConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Conversation. */ + interface IConversation { + + /** Conversation name */ + name?: (string|null); + + /** Conversation type */ + type?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Type|keyof typeof google.cloud.dialogflow.cx.v3beta1.Conversation.Type|null); + + /** Conversation languageCode */ + languageCode?: (string|null); + + /** Conversation startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation duration */ + duration?: (google.protobuf.IDuration|null); + + /** Conversation metrics */ + metrics?: (google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics|null); + + /** Conversation intents */ + intents?: (google.cloud.dialogflow.cx.v3beta1.IIntent[]|null); + + /** Conversation flows */ + flows?: (google.cloud.dialogflow.cx.v3beta1.IFlow[]|null); + + /** Conversation pages */ + pages?: (google.cloud.dialogflow.cx.v3beta1.IPage[]|null); + + /** Conversation interactions */ + interactions?: (google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction[]|null); + + /** Conversation environment */ + environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + + /** Conversation flowVersions */ + flowVersions?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a Conversation. */ + class Conversation implements IConversation { + + /** + * Constructs a new Conversation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IConversation); + + /** Conversation name. */ + public name: string; + + /** Conversation type. */ + public type: (google.cloud.dialogflow.cx.v3beta1.Conversation.Type|keyof typeof google.cloud.dialogflow.cx.v3beta1.Conversation.Type); + + /** Conversation languageCode. */ + public languageCode: string; + + /** Conversation startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Conversation metrics. */ + public metrics?: (google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics|null); + + /** Conversation intents. */ + public intents: google.cloud.dialogflow.cx.v3beta1.IIntent[]; + + /** Conversation flows. */ + public flows: google.cloud.dialogflow.cx.v3beta1.IFlow[]; + + /** Conversation pages. */ + public pages: google.cloud.dialogflow.cx.v3beta1.IPage[]; + + /** Conversation interactions. */ + public interactions: google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction[]; + + /** Conversation environment. */ + public environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + + /** Conversation flowVersions. */ + public flowVersions: { [k: string]: (number|Long|string) }; + + /** + * Creates a new Conversation instance using the specified properties. + * @param [properties] Properties to set + * @returns Conversation instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IConversation): google.cloud.dialogflow.cx.v3beta1.Conversation; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Conversation + * @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.dialogflow.cx.v3beta1.Conversation; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Conversation + * @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.dialogflow.cx.v3beta1.Conversation; + + /** + * Verifies a Conversation 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 Conversation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Conversation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Conversation; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @param message Conversation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Conversation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Conversation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Conversation { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + AUDIO = 1, + TEXT = 2, + UNDETERMINED = 3 + } + + /** Properties of a Metrics. */ + interface IMetrics { + + /** Metrics interactionCount */ + interactionCount?: (number|null); + + /** Metrics inputAudioDuration */ + inputAudioDuration?: (google.protobuf.IDuration|null); + + /** Metrics outputAudioDuration */ + outputAudioDuration?: (google.protobuf.IDuration|null); + + /** Metrics maxWebhookLatency */ + maxWebhookLatency?: (google.protobuf.IDuration|null); + + /** Metrics hasEndInteraction */ + hasEndInteraction?: (boolean|null); + + /** Metrics hasLiveAgentHandoff */ + hasLiveAgentHandoff?: (boolean|null); + + /** Metrics averageMatchConfidence */ + averageMatchConfidence?: (number|null); + + /** Metrics queryInputCount */ + queryInputCount?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount|null); + + /** Metrics matchTypeCount */ + matchTypeCount?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount|null); + } + + /** Represents a Metrics. */ + class Metrics implements IMetrics { + + /** + * Constructs a new Metrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics); + + /** Metrics interactionCount. */ + public interactionCount: number; + + /** Metrics inputAudioDuration. */ + public inputAudioDuration?: (google.protobuf.IDuration|null); + + /** Metrics outputAudioDuration. */ + public outputAudioDuration?: (google.protobuf.IDuration|null); + + /** Metrics maxWebhookLatency. */ + public maxWebhookLatency?: (google.protobuf.IDuration|null); + + /** Metrics hasEndInteraction. */ + public hasEndInteraction: boolean; + + /** Metrics hasLiveAgentHandoff. */ + public hasLiveAgentHandoff: boolean; + + /** Metrics averageMatchConfidence. */ + public averageMatchConfidence: number; + + /** Metrics queryInputCount. */ + public queryInputCount?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount|null); + + /** Metrics matchTypeCount. */ + public matchTypeCount?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount|null); + + /** + * Creates a new Metrics instance using the specified properties. + * @param [properties] Properties to set + * @returns Metrics instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics): google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metrics + * @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.dialogflow.cx.v3beta1.Conversation.Metrics; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metrics + * @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.dialogflow.cx.v3beta1.Conversation.Metrics; + + /** + * Verifies a Metrics 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 Metrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @param message Metrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Metrics { + + /** Properties of a QueryInputCount. */ + interface IQueryInputCount { + + /** QueryInputCount textCount */ + textCount?: (number|null); + + /** QueryInputCount intentCount */ + intentCount?: (number|null); + + /** QueryInputCount audioCount */ + audioCount?: (number|null); + + /** QueryInputCount eventCount */ + eventCount?: (number|null); + + /** QueryInputCount dtmfCount */ + dtmfCount?: (number|null); + } + + /** Represents a QueryInputCount. */ + class QueryInputCount implements IQueryInputCount { + + /** + * Constructs a new QueryInputCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount); + + /** QueryInputCount textCount. */ + public textCount: number; + + /** QueryInputCount intentCount. */ + public intentCount: number; + + /** QueryInputCount audioCount. */ + public audioCount: number; + + /** QueryInputCount eventCount. */ + public eventCount: number; + + /** QueryInputCount dtmfCount. */ + public dtmfCount: number; + + /** + * Creates a new QueryInputCount instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInputCount instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount): google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount; + + /** + * Encodes the specified QueryInputCount message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.verify|verify} messages. + * @param message QueryInputCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInputCount message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.verify|verify} messages. + * @param message QueryInputCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInputCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInputCount + * @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.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount; + + /** + * Decodes a QueryInputCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInputCount + * @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.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount; + + /** + * Verifies a QueryInputCount 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 QueryInputCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInputCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount; + + /** + * Creates a plain object from a QueryInputCount message. Also converts values to other types if specified. + * @param message QueryInputCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInputCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInputCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MatchTypeCount. */ + interface IMatchTypeCount { + + /** MatchTypeCount unspecifiedCount */ + unspecifiedCount?: (number|null); + + /** MatchTypeCount intentCount */ + intentCount?: (number|null); + + /** MatchTypeCount directIntentCount */ + directIntentCount?: (number|null); + + /** MatchTypeCount parameterFillingCount */ + parameterFillingCount?: (number|null); + + /** MatchTypeCount noMatchCount */ + noMatchCount?: (number|null); + + /** MatchTypeCount noInputCount */ + noInputCount?: (number|null); + + /** MatchTypeCount eventCount */ + eventCount?: (number|null); + } + + /** Represents a MatchTypeCount. */ + class MatchTypeCount implements IMatchTypeCount { + + /** + * Constructs a new MatchTypeCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount); + + /** MatchTypeCount unspecifiedCount. */ + public unspecifiedCount: number; + + /** MatchTypeCount intentCount. */ + public intentCount: number; + + /** MatchTypeCount directIntentCount. */ + public directIntentCount: number; + + /** MatchTypeCount parameterFillingCount. */ + public parameterFillingCount: number; + + /** MatchTypeCount noMatchCount. */ + public noMatchCount: number; + + /** MatchTypeCount noInputCount. */ + public noInputCount: number; + + /** MatchTypeCount eventCount. */ + public eventCount: number; + + /** + * Creates a new MatchTypeCount instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchTypeCount instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount): google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount; + + /** + * Encodes the specified MatchTypeCount message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.verify|verify} messages. + * @param message MatchTypeCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchTypeCount message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.verify|verify} messages. + * @param message MatchTypeCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchTypeCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchTypeCount + * @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.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount; + + /** + * Decodes a MatchTypeCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchTypeCount + * @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.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount; + + /** + * Verifies a MatchTypeCount 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 MatchTypeCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchTypeCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount; + + /** + * Creates a plain object from a MatchTypeCount message. Also converts values to other types if specified. + * @param message MatchTypeCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchTypeCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchTypeCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Interaction. */ + interface IInteraction { + + /** Interaction request */ + request?: (google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest|null); + + /** Interaction response */ + response?: (google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null); + + /** Interaction partialResponses */ + partialResponses?: (google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse[]|null); + + /** Interaction requestUtterances */ + requestUtterances?: (string|null); + + /** Interaction responseUtterances */ + responseUtterances?: (string|null); + + /** Interaction createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Interaction answerFeedback */ + answerFeedback?: (google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null); + + /** Interaction missingTransition */ + missingTransition?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition|null); + + /** Interaction stepMetrics */ + stepMetrics?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics[]|null); + } + + /** Represents an Interaction. */ + class Interaction implements IInteraction { + + /** + * Constructs a new Interaction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction); + + /** Interaction request. */ + public request?: (google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest|null); + + /** Interaction response. */ + public response?: (google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null); + + /** Interaction partialResponses. */ + public partialResponses: google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse[]; + + /** Interaction requestUtterances. */ + public requestUtterances: string; + + /** Interaction responseUtterances. */ + public responseUtterances: string; + + /** Interaction createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Interaction answerFeedback. */ + public answerFeedback?: (google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null); + + /** Interaction missingTransition. */ + public missingTransition?: (google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition|null); + + /** Interaction stepMetrics. */ + public stepMetrics: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics[]; + + /** + * Creates a new Interaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Interaction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction): google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction; + + /** + * Encodes the specified Interaction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.verify|verify} messages. + * @param message Interaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interaction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.verify|verify} messages. + * @param message Interaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interaction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interaction + * @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.dialogflow.cx.v3beta1.Conversation.Interaction; + + /** + * Decodes an Interaction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interaction + * @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.dialogflow.cx.v3beta1.Conversation.Interaction; + + /** + * Verifies an Interaction 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 Interaction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interaction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction; + + /** + * Creates a plain object from an Interaction message. Also converts values to other types if specified. + * @param message Interaction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interaction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Interaction { + + /** Properties of a MissingTransition. */ + interface IMissingTransition { + + /** MissingTransition intentDisplayName */ + intentDisplayName?: (string|null); + + /** MissingTransition score */ + score?: (number|null); + } + + /** Represents a MissingTransition. */ + class MissingTransition implements IMissingTransition { + + /** + * Constructs a new MissingTransition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition); + + /** MissingTransition intentDisplayName. */ + public intentDisplayName: string; + + /** MissingTransition score. */ + public score: number; + + /** + * Creates a new MissingTransition instance using the specified properties. + * @param [properties] Properties to set + * @returns MissingTransition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition): google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition; + + /** + * Encodes the specified MissingTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.verify|verify} messages. + * @param message MissingTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MissingTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.verify|verify} messages. + * @param message MissingTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MissingTransition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MissingTransition + * @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.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition; + + /** + * Decodes a MissingTransition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MissingTransition + * @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.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition; + + /** + * Verifies a MissingTransition 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 MissingTransition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MissingTransition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition; + + /** + * Creates a plain object from a MissingTransition message. Also converts values to other types if specified. + * @param message MissingTransition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MissingTransition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MissingTransition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StepMetrics. */ + interface IStepMetrics { + + /** StepMetrics name */ + name?: (string|null); + + /** StepMetrics latency */ + latency?: (google.protobuf.IDuration|null); + } + + /** Represents a StepMetrics. */ + class StepMetrics implements IStepMetrics { + + /** + * Constructs a new StepMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics); + + /** StepMetrics name. */ + public name: string; + + /** StepMetrics latency. */ + public latency?: (google.protobuf.IDuration|null); + + /** + * Creates a new StepMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns StepMetrics instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics): google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics; + + /** + * Encodes the specified StepMetrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.verify|verify} messages. + * @param message StepMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StepMetrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.verify|verify} messages. + * @param message StepMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StepMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StepMetrics + * @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.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics; + + /** + * Decodes a StepMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StepMetrics + * @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.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics; + + /** + * Verifies a StepMetrics 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 StepMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StepMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics; + + /** + * Creates a plain object from a StepMetrics message. Also converts values to other types if specified. + * @param message StepMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StepMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StepMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Represents an Environments */ + class Environments extends $protobuf.rpc.Service { + + /** + * Constructs a new Environments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Environments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + */ + public listEnvironments(request: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironmentsCallback): void; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @returns Promise + */ + public listEnvironments(request: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest): Promise; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Environment + */ + public getEnvironment(request: google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironmentCallback): void; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @returns Promise + */ + public getEnvironment(request: google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest): Promise; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEnvironment(request: google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironmentCallback): void; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @returns Promise + */ + public createEnvironment(request: google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest): Promise; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateEnvironment(request: google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironmentCallback): void; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @returns Promise + */ + public updateEnvironment(request: google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest): Promise; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEnvironment(request: google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironmentCallback): void; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @returns Promise + */ + public deleteEnvironment(request: google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest): Promise; + + /** + * Calls LookupEnvironmentHistory. + * @param request LookupEnvironmentHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupEnvironmentHistoryResponse + */ + public lookupEnvironmentHistory(request: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistoryCallback): void; + + /** + * Calls LookupEnvironmentHistory. + * @param request LookupEnvironmentHistoryRequest message or plain object + * @returns Promise + */ + public lookupEnvironmentHistory(request: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest): Promise; + + /** + * Calls RunContinuousTest. + * @param request RunContinuousTestRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runContinuousTest(request: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTestCallback): void; + + /** + * Calls RunContinuousTest. + * @param request RunContinuousTestRequest message or plain object + * @returns Promise + */ + public runContinuousTest(request: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest): Promise; + + /** + * Calls ListContinuousTestResults. + * @param request ListContinuousTestResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListContinuousTestResultsResponse + */ + public listContinuousTestResults(request: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.ListContinuousTestResultsCallback): void; + + /** + * Calls ListContinuousTestResults. + * @param request ListContinuousTestResultsRequest message or plain object + * @returns Promise + */ + public listContinuousTestResults(request: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest): Promise; + + /** + * Calls DeployFlow. + * @param request DeployFlowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployFlow(request: google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest, callback: google.cloud.dialogflow.cx.v3beta1.Environments.DeployFlowCallback): void; + + /** + * Calls DeployFlow. + * @param request DeployFlowRequest message or plain object + * @returns Promise + */ + public deployFlow(request: google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest): Promise; + } + + namespace Environments { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|listEnvironments}. + * @param error Error, if any + * @param [response] ListEnvironmentsResponse + */ + type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|getEnvironment}. + * @param error Error, if any + * @param [response] Environment + */ + type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Environment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|createEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|updateEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|deleteEnvironment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEnvironmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|lookupEnvironmentHistory}. + * @param error Error, if any + * @param [response] LookupEnvironmentHistoryResponse + */ + type LookupEnvironmentHistoryCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|runContinuousTest}. + * @param error Error, if any + * @param [response] Operation + */ + type RunContinuousTestCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|listContinuousTestResults}. + * @param error Error, if any + * @param [response] ListContinuousTestResultsResponse + */ + type ListContinuousTestResultsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|deployFlow}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployFlowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ + name?: (string|null); + + /** Environment displayName */ + displayName?: (string|null); + + /** Environment description */ + description?: (string|null); + + /** Environment versionConfigs */ + versionConfigs?: (google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig[]|null); + + /** Environment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment testCasesConfig */ + testCasesConfig?: (google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig|null); + + /** Environment webhookConfig */ + webhookConfig?: (google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IEnvironment); + + /** Environment name. */ + public name: string; + + /** Environment displayName. */ + public displayName: string; + + /** Environment description. */ + public description: string; + + /** Environment versionConfigs. */ + public versionConfigs: google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig[]; + + /** Environment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment testCasesConfig. */ + public testCasesConfig?: (google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig|null); + + /** Environment webhookConfig. */ + public webhookConfig?: (google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IEnvironment): google.cloud.dialogflow.cx.v3beta1.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @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.dialogflow.cx.v3beta1.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @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.dialogflow.cx.v3beta1.Environment; + + /** + * Verifies an Environment 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 Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** Properties of a VersionConfig. */ + interface IVersionConfig { + + /** VersionConfig version */ + version?: (string|null); + } + + /** Represents a VersionConfig. */ + class VersionConfig implements IVersionConfig { + + /** + * Constructs a new VersionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig); + + /** VersionConfig version. */ + public version: string; + + /** + * Creates a new VersionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig): google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig; + + /** + * Encodes the specified VersionConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.verify|verify} messages. + * @param message VersionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.verify|verify} messages. + * @param message VersionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionConfig + * @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.dialogflow.cx.v3beta1.Environment.VersionConfig; + + /** + * Decodes a VersionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionConfig + * @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.dialogflow.cx.v3beta1.Environment.VersionConfig; + + /** + * Verifies a VersionConfig 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 VersionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig; + + /** + * Creates a plain object from a VersionConfig message. Also converts values to other types if specified. + * @param message VersionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestCasesConfig. */ + interface ITestCasesConfig { + + /** TestCasesConfig testCases */ + testCases?: (string[]|null); + + /** TestCasesConfig enableContinuousRun */ + enableContinuousRun?: (boolean|null); + + /** TestCasesConfig enablePredeploymentRun */ + enablePredeploymentRun?: (boolean|null); + } + + /** Represents a TestCasesConfig. */ + class TestCasesConfig implements ITestCasesConfig { + + /** + * Constructs a new TestCasesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig); + + /** TestCasesConfig testCases. */ + public testCases: string[]; + + /** TestCasesConfig enableContinuousRun. */ + public enableContinuousRun: boolean; + + /** TestCasesConfig enablePredeploymentRun. */ + public enablePredeploymentRun: boolean; + + /** + * Creates a new TestCasesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCasesConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig): google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig; + + /** + * Encodes the specified TestCasesConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.verify|verify} messages. + * @param message TestCasesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCasesConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.verify|verify} messages. + * @param message TestCasesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCasesConfig + * @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.dialogflow.cx.v3beta1.Environment.TestCasesConfig; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCasesConfig + * @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.dialogflow.cx.v3beta1.Environment.TestCasesConfig; + + /** + * Verifies a TestCasesConfig 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 TestCasesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCasesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig; + + /** + * Creates a plain object from a TestCasesConfig message. Also converts values to other types if specified. + * @param message TestCasesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCasesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCasesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebhookConfig. */ + interface IWebhookConfig { + + /** WebhookConfig webhookOverrides */ + webhookOverrides?: (google.cloud.dialogflow.cx.v3beta1.IWebhook[]|null); + } + + /** Represents a WebhookConfig. */ + class WebhookConfig implements IWebhookConfig { + + /** + * Constructs a new WebhookConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig); + + /** WebhookConfig webhookOverrides. */ + public webhookOverrides: google.cloud.dialogflow.cx.v3beta1.IWebhook[]; + + /** + * Creates a new WebhookConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig): google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig; + + /** + * Encodes the specified WebhookConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.verify|verify} messages. + * @param message WebhookConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.verify|verify} messages. + * @param message WebhookConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookConfig + * @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.dialogflow.cx.v3beta1.Environment.WebhookConfig; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookConfig + * @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.dialogflow.cx.v3beta1.Environment.WebhookConfig; + + /** + * Verifies a WebhookConfig 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 WebhookConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig; + + /** + * Creates a plain object from a WebhookConfig message. Also converts values to other types if specified. + * @param message WebhookConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListEnvironmentsRequest. */ + interface IListEnvironmentsRequest { + + /** ListEnvironmentsRequest parent */ + parent?: (string|null); + + /** ListEnvironmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListEnvironmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEnvironmentsRequest. */ + class ListEnvironmentsRequest implements IListEnvironmentsRequest { + + /** + * Constructs a new ListEnvironmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest); + + /** ListEnvironmentsRequest parent. */ + public parent: string; + + /** ListEnvironmentsRequest pageSize. */ + public pageSize: number; + + /** ListEnvironmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest): google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsRequest + * @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.dialogflow.cx.v3beta1.ListEnvironmentsRequest; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsRequest + * @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.dialogflow.cx.v3beta1.ListEnvironmentsRequest; + + /** + * Verifies a ListEnvironmentsRequest 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 ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @param message ListEnvironmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEnvironmentsResponse. */ + interface IListEnvironmentsResponse { + + /** ListEnvironmentsResponse environments */ + environments?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment[]|null); + + /** ListEnvironmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEnvironmentsResponse. */ + class ListEnvironmentsResponse implements IListEnvironmentsResponse { + + /** + * Constructs a new ListEnvironmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse); + + /** ListEnvironmentsResponse environments. */ + public environments: google.cloud.dialogflow.cx.v3beta1.IEnvironment[]; + + /** ListEnvironmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse): google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsResponse + * @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.dialogflow.cx.v3beta1.ListEnvironmentsResponse; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsResponse + * @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.dialogflow.cx.v3beta1.ListEnvironmentsResponse; + + /** + * Verifies a ListEnvironmentsResponse 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 ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @param message ListEnvironmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEnvironmentRequest. */ + interface IGetEnvironmentRequest { + + /** GetEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a GetEnvironmentRequest. */ + class GetEnvironmentRequest implements IGetEnvironmentRequest { + + /** + * Constructs a new GetEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest); + + /** GetEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest): google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEnvironmentRequest + * @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.dialogflow.cx.v3beta1.GetEnvironmentRequest; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEnvironmentRequest + * @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.dialogflow.cx.v3beta1.GetEnvironmentRequest; + + /** + * Verifies a GetEnvironmentRequest 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 GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @param message GetEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEnvironmentRequest. */ + interface ICreateEnvironmentRequest { + + /** CreateEnvironmentRequest parent */ + parent?: (string|null); + + /** CreateEnvironmentRequest environment */ + environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + } + + /** Represents a CreateEnvironmentRequest. */ + class CreateEnvironmentRequest implements ICreateEnvironmentRequest { + + /** + * Constructs a new CreateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest); + + /** CreateEnvironmentRequest parent. */ + public parent: string; + + /** CreateEnvironmentRequest environment. */ + public environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest): google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest; + + /** + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEnvironmentRequest + * @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.dialogflow.cx.v3beta1.CreateEnvironmentRequest; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEnvironmentRequest + * @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.dialogflow.cx.v3beta1.CreateEnvironmentRequest; + + /** + * Verifies a CreateEnvironmentRequest 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 CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest; + + /** + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @param message CreateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEnvironmentRequest. */ + interface IUpdateEnvironmentRequest { + + /** UpdateEnvironmentRequest environment */ + environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + + /** UpdateEnvironmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEnvironmentRequest. */ + class UpdateEnvironmentRequest implements IUpdateEnvironmentRequest { + + /** + * Constructs a new UpdateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest); + + /** UpdateEnvironmentRequest environment. */ + public environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + + /** UpdateEnvironmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest): google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEnvironmentRequest + * @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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEnvironmentRequest + * @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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest; + + /** + * Verifies an UpdateEnvironmentRequest 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 UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest; + + /** + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @param message UpdateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEnvironmentRequest. */ + interface IDeleteEnvironmentRequest { + + /** DeleteEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEnvironmentRequest. */ + class DeleteEnvironmentRequest implements IDeleteEnvironmentRequest { + + /** + * Constructs a new DeleteEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest); + + /** DeleteEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest): google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEnvironmentRequest + * @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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEnvironmentRequest + * @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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest; + + /** + * Verifies a DeleteEnvironmentRequest 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 DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @param message DeleteEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupEnvironmentHistoryRequest. */ + interface ILookupEnvironmentHistoryRequest { + + /** LookupEnvironmentHistoryRequest name */ + name?: (string|null); + + /** LookupEnvironmentHistoryRequest pageSize */ + pageSize?: (number|null); + + /** LookupEnvironmentHistoryRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a LookupEnvironmentHistoryRequest. */ + class LookupEnvironmentHistoryRequest implements ILookupEnvironmentHistoryRequest { + + /** + * Constructs a new LookupEnvironmentHistoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest); + + /** LookupEnvironmentHistoryRequest name. */ + public name: string; + + /** LookupEnvironmentHistoryRequest pageSize. */ + public pageSize: number; + + /** LookupEnvironmentHistoryRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new LookupEnvironmentHistoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupEnvironmentHistoryRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest): google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @param message LookupEnvironmentHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @param message LookupEnvironmentHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupEnvironmentHistoryRequest + * @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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupEnvironmentHistoryRequest + * @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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest; + + /** + * Verifies a LookupEnvironmentHistoryRequest 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 LookupEnvironmentHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupEnvironmentHistoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest; + + /** + * Creates a plain object from a LookupEnvironmentHistoryRequest message. Also converts values to other types if specified. + * @param message LookupEnvironmentHistoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupEnvironmentHistoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupEnvironmentHistoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupEnvironmentHistoryResponse. */ + interface ILookupEnvironmentHistoryResponse { + + /** LookupEnvironmentHistoryResponse environments */ + environments?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment[]|null); + + /** LookupEnvironmentHistoryResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a LookupEnvironmentHistoryResponse. */ + class LookupEnvironmentHistoryResponse implements ILookupEnvironmentHistoryResponse { + + /** + * Constructs a new LookupEnvironmentHistoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse); + + /** LookupEnvironmentHistoryResponse environments. */ + public environments: google.cloud.dialogflow.cx.v3beta1.IEnvironment[]; + + /** LookupEnvironmentHistoryResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new LookupEnvironmentHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupEnvironmentHistoryResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse): google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse; + + /** + * Encodes the specified LookupEnvironmentHistoryResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @param message LookupEnvironmentHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupEnvironmentHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @param message LookupEnvironmentHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupEnvironmentHistoryResponse + * @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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupEnvironmentHistoryResponse + * @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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse; + + /** + * Verifies a LookupEnvironmentHistoryResponse 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 LookupEnvironmentHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupEnvironmentHistoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse; + + /** + * Creates a plain object from a LookupEnvironmentHistoryResponse message. Also converts values to other types if specified. + * @param message LookupEnvironmentHistoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupEnvironmentHistoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupEnvironmentHistoryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousTestResult. */ + interface IContinuousTestResult { + + /** ContinuousTestResult name */ + name?: (string|null); + + /** ContinuousTestResult result */ + result?: (google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult|keyof typeof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult|null); + + /** ContinuousTestResult testCaseResults */ + testCaseResults?: (string[]|null); + + /** ContinuousTestResult runTime */ + runTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousTestResult. */ + class ContinuousTestResult implements IContinuousTestResult { + + /** + * Constructs a new ContinuousTestResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult); + + /** ContinuousTestResult name. */ + public name: string; + + /** ContinuousTestResult result. */ + public result: (google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult|keyof typeof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult); + + /** ContinuousTestResult testCaseResults. */ + public testCaseResults: string[]; + + /** ContinuousTestResult runTime. */ + public runTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousTestResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousTestResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult): google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult; + + /** + * Encodes the specified ContinuousTestResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.verify|verify} messages. + * @param message ContinuousTestResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousTestResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.verify|verify} messages. + * @param message ContinuousTestResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousTestResult + * @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.dialogflow.cx.v3beta1.ContinuousTestResult; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousTestResult + * @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.dialogflow.cx.v3beta1.ContinuousTestResult; + + /** + * Verifies a ContinuousTestResult 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 ContinuousTestResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousTestResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult; + + /** + * Creates a plain object from a ContinuousTestResult message. Also converts values to other types if specified. + * @param message ContinuousTestResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousTestResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousTestResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContinuousTestResult { + + /** AggregatedTestResult enum. */ + enum AggregatedTestResult { + AGGREGATED_TEST_RESULT_UNSPECIFIED = 0, + PASSED = 1, + FAILED = 2 + } + } + + /** Properties of a RunContinuousTestRequest. */ + interface IRunContinuousTestRequest { + + /** RunContinuousTestRequest environment */ + environment?: (string|null); + } + + /** Represents a RunContinuousTestRequest. */ + class RunContinuousTestRequest implements IRunContinuousTestRequest { + + /** + * Constructs a new RunContinuousTestRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest); + + /** RunContinuousTestRequest environment. */ + public environment: string; + + /** + * Creates a new RunContinuousTestRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest): google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest; + + /** + * Encodes the specified RunContinuousTestRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest.verify|verify} messages. + * @param message RunContinuousTestRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest.verify|verify} messages. + * @param message RunContinuousTestRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestRequest + * @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.dialogflow.cx.v3beta1.RunContinuousTestRequest; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestRequest + * @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.dialogflow.cx.v3beta1.RunContinuousTestRequest; + + /** + * Verifies a RunContinuousTestRequest 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 RunContinuousTestRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest; + + /** + * Creates a plain object from a RunContinuousTestRequest message. Also converts values to other types if specified. + * @param message RunContinuousTestRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunContinuousTestRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunContinuousTestResponse. */ + interface IRunContinuousTestResponse { + + /** RunContinuousTestResponse continuousTestResult */ + continuousTestResult?: (google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult|null); + } + + /** Represents a RunContinuousTestResponse. */ + class RunContinuousTestResponse implements IRunContinuousTestResponse { + + /** + * Constructs a new RunContinuousTestResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse); + + /** RunContinuousTestResponse continuousTestResult. */ + public continuousTestResult?: (google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult|null); + + /** + * Creates a new RunContinuousTestResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse): google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse; + + /** + * Encodes the specified RunContinuousTestResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse.verify|verify} messages. + * @param message RunContinuousTestResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse.verify|verify} messages. + * @param message RunContinuousTestResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestResponse + * @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.dialogflow.cx.v3beta1.RunContinuousTestResponse; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestResponse + * @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.dialogflow.cx.v3beta1.RunContinuousTestResponse; + + /** + * Verifies a RunContinuousTestResponse 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 RunContinuousTestResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse; + + /** + * Creates a plain object from a RunContinuousTestResponse message. Also converts values to other types if specified. + * @param message RunContinuousTestResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunContinuousTestResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunContinuousTestMetadata. */ + interface IRunContinuousTestMetadata { + + /** RunContinuousTestMetadata errors */ + errors?: (google.cloud.dialogflow.cx.v3beta1.ITestError[]|null); + } + + /** Represents a RunContinuousTestMetadata. */ + class RunContinuousTestMetadata implements IRunContinuousTestMetadata { + + /** + * Constructs a new RunContinuousTestMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata); + + /** RunContinuousTestMetadata errors. */ + public errors: google.cloud.dialogflow.cx.v3beta1.ITestError[]; + + /** + * Creates a new RunContinuousTestMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata): google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata; + + /** + * Encodes the specified RunContinuousTestMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata.verify|verify} messages. + * @param message RunContinuousTestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata.verify|verify} messages. + * @param message RunContinuousTestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestMetadata + * @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.dialogflow.cx.v3beta1.RunContinuousTestMetadata; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestMetadata + * @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.dialogflow.cx.v3beta1.RunContinuousTestMetadata; + + /** + * Verifies a RunContinuousTestMetadata 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 RunContinuousTestMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata; + + /** + * Creates a plain object from a RunContinuousTestMetadata message. Also converts values to other types if specified. + * @param message RunContinuousTestMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunContinuousTestMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListContinuousTestResultsRequest. */ + interface IListContinuousTestResultsRequest { + + /** ListContinuousTestResultsRequest parent */ + parent?: (string|null); + + /** ListContinuousTestResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListContinuousTestResultsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListContinuousTestResultsRequest. */ + class ListContinuousTestResultsRequest implements IListContinuousTestResultsRequest { + + /** + * Constructs a new ListContinuousTestResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest); + + /** ListContinuousTestResultsRequest parent. */ + public parent: string; + + /** ListContinuousTestResultsRequest pageSize. */ + public pageSize: number; + + /** ListContinuousTestResultsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListContinuousTestResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContinuousTestResultsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest): google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest; + + /** + * Encodes the specified ListContinuousTestResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest.verify|verify} messages. + * @param message ListContinuousTestResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContinuousTestResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest.verify|verify} messages. + * @param message ListContinuousTestResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContinuousTestResultsRequest + * @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.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContinuousTestResultsRequest + * @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.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest; + + /** + * Verifies a ListContinuousTestResultsRequest 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 ListContinuousTestResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContinuousTestResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest; + + /** + * Creates a plain object from a ListContinuousTestResultsRequest message. Also converts values to other types if specified. + * @param message ListContinuousTestResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContinuousTestResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContinuousTestResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListContinuousTestResultsResponse. */ + interface IListContinuousTestResultsResponse { + + /** ListContinuousTestResultsResponse continuousTestResults */ + continuousTestResults?: (google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[]|null); + + /** ListContinuousTestResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListContinuousTestResultsResponse. */ + class ListContinuousTestResultsResponse implements IListContinuousTestResultsResponse { + + /** + * Constructs a new ListContinuousTestResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse); + + /** ListContinuousTestResultsResponse continuousTestResults. */ + public continuousTestResults: google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[]; + + /** ListContinuousTestResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListContinuousTestResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContinuousTestResultsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse): google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse; + + /** + * Encodes the specified ListContinuousTestResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse.verify|verify} messages. + * @param message ListContinuousTestResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContinuousTestResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse.verify|verify} messages. + * @param message ListContinuousTestResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContinuousTestResultsResponse + * @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.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContinuousTestResultsResponse + * @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.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse; + + /** + * Verifies a ListContinuousTestResultsResponse 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 ListContinuousTestResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContinuousTestResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse; + + /** + * Creates a plain object from a ListContinuousTestResultsResponse message. Also converts values to other types if specified. + * @param message ListContinuousTestResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContinuousTestResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContinuousTestResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployFlowRequest. */ + interface IDeployFlowRequest { + + /** DeployFlowRequest environment */ + environment?: (string|null); + + /** DeployFlowRequest flowVersion */ + flowVersion?: (string|null); + } + + /** Represents a DeployFlowRequest. */ + class DeployFlowRequest implements IDeployFlowRequest { + + /** + * Constructs a new DeployFlowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest); + + /** DeployFlowRequest environment. */ + public environment: string; + + /** DeployFlowRequest flowVersion. */ + public flowVersion: string; + + /** + * Creates a new DeployFlowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployFlowRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest): google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest; + + /** + * Encodes the specified DeployFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest.verify|verify} messages. + * @param message DeployFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest.verify|verify} messages. + * @param message DeployFlowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployFlowRequest + * @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.dialogflow.cx.v3beta1.DeployFlowRequest; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployFlowRequest + * @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.dialogflow.cx.v3beta1.DeployFlowRequest; + + /** + * Verifies a DeployFlowRequest 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 DeployFlowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployFlowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest; + + /** + * Creates a plain object from a DeployFlowRequest message. Also converts values to other types if specified. + * @param message DeployFlowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployFlowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployFlowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployFlowResponse. */ + interface IDeployFlowResponse { + + /** DeployFlowResponse environment */ + environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + + /** DeployFlowResponse deployment */ + deployment?: (string|null); + } + + /** Represents a DeployFlowResponse. */ + class DeployFlowResponse implements IDeployFlowResponse { + + /** + * Constructs a new DeployFlowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse); + + /** DeployFlowResponse environment. */ + public environment?: (google.cloud.dialogflow.cx.v3beta1.IEnvironment|null); + + /** DeployFlowResponse deployment. */ + public deployment: string; + + /** + * Creates a new DeployFlowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployFlowResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse): google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse; + + /** + * Encodes the specified DeployFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse.verify|verify} messages. + * @param message DeployFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse.verify|verify} messages. + * @param message DeployFlowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployFlowResponse + * @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.dialogflow.cx.v3beta1.DeployFlowResponse; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployFlowResponse + * @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.dialogflow.cx.v3beta1.DeployFlowResponse; + + /** + * Verifies a DeployFlowResponse 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 DeployFlowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployFlowResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse; + + /** + * Creates a plain object from a DeployFlowResponse message. Also converts values to other types if specified. + * @param message DeployFlowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployFlowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployFlowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployFlowMetadata. */ + interface IDeployFlowMetadata { + + /** DeployFlowMetadata testErrors */ + testErrors?: (google.cloud.dialogflow.cx.v3beta1.ITestError[]|null); + } + + /** Represents a DeployFlowMetadata. */ + class DeployFlowMetadata implements IDeployFlowMetadata { + + /** + * Constructs a new DeployFlowMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata); + + /** DeployFlowMetadata testErrors. */ + public testErrors: google.cloud.dialogflow.cx.v3beta1.ITestError[]; + + /** + * Creates a new DeployFlowMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployFlowMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata): google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata; + + /** + * Encodes the specified DeployFlowMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata.verify|verify} messages. + * @param message DeployFlowMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployFlowMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata.verify|verify} messages. + * @param message DeployFlowMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployFlowMetadata + * @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.dialogflow.cx.v3beta1.DeployFlowMetadata; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployFlowMetadata + * @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.dialogflow.cx.v3beta1.DeployFlowMetadata; + + /** + * Verifies a DeployFlowMetadata 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 DeployFlowMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployFlowMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata; + + /** + * Creates a plain object from a DeployFlowMetadata message. Also converts values to other types if specified. + * @param message DeployFlowMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployFlowMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployFlowMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TestCases */ + class TestCases extends $protobuf.rpc.Service { + + /** + * Constructs a new TestCases service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TestCases service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TestCases; + + /** + * Calls ListTestCases. + * @param request ListTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTestCasesResponse + */ + public listTestCases(request: google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCasesCallback): void; + + /** + * Calls ListTestCases. + * @param request ListTestCasesRequest message or plain object + * @returns Promise + */ + public listTestCases(request: google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest): Promise; + + /** + * Calls BatchDeleteTestCases. + * @param request BatchDeleteTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public batchDeleteTestCases(request: google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.BatchDeleteTestCasesCallback): void; + + /** + * Calls BatchDeleteTestCases. + * @param request BatchDeleteTestCasesRequest message or plain object + * @returns Promise + */ + public batchDeleteTestCases(request: google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest): Promise; + + /** + * Calls GetTestCase. + * @param request GetTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCase + */ + public getTestCase(request: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCaseCallback): void; + + /** + * Calls GetTestCase. + * @param request GetTestCaseRequest message or plain object + * @returns Promise + */ + public getTestCase(request: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest): Promise; + + /** + * Calls CreateTestCase. + * @param request CreateTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCase + */ + public createTestCase(request: google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCaseCallback): void; + + /** + * Calls CreateTestCase. + * @param request CreateTestCaseRequest message or plain object + * @returns Promise + */ + public createTestCase(request: google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest): Promise; + + /** + * Calls UpdateTestCase. + * @param request UpdateTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCase + */ + public updateTestCase(request: google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.UpdateTestCaseCallback): void; + + /** + * Calls UpdateTestCase. + * @param request UpdateTestCaseRequest message or plain object + * @returns Promise + */ + public updateTestCase(request: google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest): Promise; + + /** + * Calls RunTestCase. + * @param request RunTestCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runTestCase(request: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.RunTestCaseCallback): void; + + /** + * Calls RunTestCase. + * @param request RunTestCaseRequest message or plain object + * @returns Promise + */ + public runTestCase(request: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest): Promise; + + /** + * Calls BatchRunTestCases. + * @param request BatchRunTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchRunTestCases(request: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCasesCallback): void; + + /** + * Calls BatchRunTestCases. + * @param request BatchRunTestCasesRequest message or plain object + * @returns Promise + */ + public batchRunTestCases(request: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest): Promise; + + /** + * Calls CalculateCoverage. + * @param request CalculateCoverageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CalculateCoverageResponse + */ + public calculateCoverage(request: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.CalculateCoverageCallback): void; + + /** + * Calls CalculateCoverage. + * @param request CalculateCoverageRequest message or plain object + * @returns Promise + */ + public calculateCoverage(request: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest): Promise; + + /** + * Calls ImportTestCases. + * @param request ImportTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importTestCases(request: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCasesCallback): void; + + /** + * Calls ImportTestCases. + * @param request ImportTestCasesRequest message or plain object + * @returns Promise + */ + public importTestCases(request: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest): Promise; + + /** + * Calls ExportTestCases. + * @param request ExportTestCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportTestCases(request: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.ExportTestCasesCallback): void; + + /** + * Calls ExportTestCases. + * @param request ExportTestCasesRequest message or plain object + * @returns Promise + */ + public exportTestCases(request: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest): Promise; + + /** + * Calls ListTestCaseResults. + * @param request ListTestCaseResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTestCaseResultsResponse + */ + public listTestCaseResults(request: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCaseResultsCallback): void; + + /** + * Calls ListTestCaseResults. + * @param request ListTestCaseResultsRequest message or plain object + * @returns Promise + */ + public listTestCaseResults(request: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest): Promise; + + /** + * Calls GetTestCaseResult. + * @param request GetTestCaseResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestCaseResult + */ + public getTestCaseResult(request: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest, callback: google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCaseResultCallback): void; + + /** + * Calls GetTestCaseResult. + * @param request GetTestCaseResultRequest message or plain object + * @returns Promise + */ + public getTestCaseResult(request: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest): Promise; + } + + namespace TestCases { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|listTestCases}. + * @param error Error, if any + * @param [response] ListTestCasesResponse + */ + type ListTestCasesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|batchDeleteTestCases}. + * @param error Error, if any + * @param [response] Empty + */ + type BatchDeleteTestCasesCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|getTestCase}. + * @param error Error, if any + * @param [response] TestCase + */ + type GetTestCaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.TestCase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|createTestCase}. + * @param error Error, if any + * @param [response] TestCase + */ + type CreateTestCaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.TestCase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|updateTestCase}. + * @param error Error, if any + * @param [response] TestCase + */ + type UpdateTestCaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.TestCase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|runTestCase}. + * @param error Error, if any + * @param [response] Operation + */ + type RunTestCaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|batchRunTestCases}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchRunTestCasesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|calculateCoverage}. + * @param error Error, if any + * @param [response] CalculateCoverageResponse + */ + type CalculateCoverageCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|importTestCases}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportTestCasesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|exportTestCases}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportTestCasesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|listTestCaseResults}. + * @param error Error, if any + * @param [response] ListTestCaseResultsResponse + */ + type ListTestCaseResultsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|getTestCaseResult}. + * @param error Error, if any + * @param [response] TestCaseResult + */ + type GetTestCaseResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.TestCaseResult) => void; + } + + /** Properties of a TestCase. */ + interface ITestCase { + + /** TestCase name */ + name?: (string|null); + + /** TestCase tags */ + tags?: (string[]|null); + + /** TestCase displayName */ + displayName?: (string|null); + + /** TestCase notes */ + notes?: (string|null); + + /** TestCase testConfig */ + testConfig?: (google.cloud.dialogflow.cx.v3beta1.ITestConfig|null); + + /** TestCase testCaseConversationTurns */ + testCaseConversationTurns?: (google.cloud.dialogflow.cx.v3beta1.IConversationTurn[]|null); + + /** TestCase creationTime */ + creationTime?: (google.protobuf.ITimestamp|null); + + /** TestCase lastTestResult */ + lastTestResult?: (google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null); + } + + /** Represents a TestCase. */ + class TestCase implements ITestCase { + + /** + * Constructs a new TestCase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITestCase); + + /** TestCase name. */ + public name: string; + + /** TestCase tags. */ + public tags: string[]; + + /** TestCase displayName. */ + public displayName: string; + + /** TestCase notes. */ + public notes: string; + + /** TestCase testConfig. */ + public testConfig?: (google.cloud.dialogflow.cx.v3beta1.ITestConfig|null); + + /** TestCase testCaseConversationTurns. */ + public testCaseConversationTurns: google.cloud.dialogflow.cx.v3beta1.IConversationTurn[]; + + /** TestCase creationTime. */ + public creationTime?: (google.protobuf.ITimestamp|null); + + /** TestCase lastTestResult. */ + public lastTestResult?: (google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null); + + /** + * Creates a new TestCase instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITestCase): google.cloud.dialogflow.cx.v3beta1.TestCase; + + /** + * Encodes the specified TestCase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCase.verify|verify} messages. + * @param message TestCase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITestCase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCase.verify|verify} messages. + * @param message TestCase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITestCase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCase + * @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.dialogflow.cx.v3beta1.TestCase; + + /** + * Decodes a TestCase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCase + * @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.dialogflow.cx.v3beta1.TestCase; + + /** + * Verifies a TestCase 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 TestCase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TestCase; + + /** + * Creates a plain object from a TestCase message. Also converts values to other types if specified. + * @param message TestCase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TestCase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestCaseResult. */ + interface ITestCaseResult { + + /** TestCaseResult name */ + name?: (string|null); + + /** TestCaseResult environment */ + environment?: (string|null); + + /** TestCaseResult conversationTurns */ + conversationTurns?: (google.cloud.dialogflow.cx.v3beta1.IConversationTurn[]|null); + + /** TestCaseResult testResult */ + testResult?: (google.cloud.dialogflow.cx.v3beta1.TestResult|keyof typeof google.cloud.dialogflow.cx.v3beta1.TestResult|null); + + /** TestCaseResult testTime */ + testTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TestCaseResult. */ + class TestCaseResult implements ITestCaseResult { + + /** + * Constructs a new TestCaseResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITestCaseResult); + + /** TestCaseResult name. */ + public name: string; + + /** TestCaseResult environment. */ + public environment: string; + + /** TestCaseResult conversationTurns. */ + public conversationTurns: google.cloud.dialogflow.cx.v3beta1.IConversationTurn[]; + + /** TestCaseResult testResult. */ + public testResult: (google.cloud.dialogflow.cx.v3beta1.TestResult|keyof typeof google.cloud.dialogflow.cx.v3beta1.TestResult); + + /** TestCaseResult testTime. */ + public testTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TestCaseResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCaseResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITestCaseResult): google.cloud.dialogflow.cx.v3beta1.TestCaseResult; + + /** + * Encodes the specified TestCaseResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify|verify} messages. + * @param message TestCaseResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCaseResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify|verify} messages. + * @param message TestCaseResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCaseResult + * @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.dialogflow.cx.v3beta1.TestCaseResult; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCaseResult + * @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.dialogflow.cx.v3beta1.TestCaseResult; + + /** + * Verifies a TestCaseResult 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 TestCaseResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCaseResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TestCaseResult; + + /** + * Creates a plain object from a TestCaseResult message. Also converts values to other types if specified. + * @param message TestCaseResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TestCaseResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCaseResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCaseResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestConfig. */ + interface ITestConfig { + + /** TestConfig trackingParameters */ + trackingParameters?: (string[]|null); + + /** TestConfig flow */ + flow?: (string|null); + + /** TestConfig page */ + page?: (string|null); + } + + /** Represents a TestConfig. */ + class TestConfig implements ITestConfig { + + /** + * Constructs a new TestConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITestConfig); + + /** TestConfig trackingParameters. */ + public trackingParameters: string[]; + + /** TestConfig flow. */ + public flow: string; + + /** TestConfig page. */ + public page: string; + + /** + * Creates a new TestConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TestConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITestConfig): google.cloud.dialogflow.cx.v3beta1.TestConfig; + + /** + * Encodes the specified TestConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestConfig.verify|verify} messages. + * @param message TestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestConfig.verify|verify} messages. + * @param message TestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestConfig + * @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.dialogflow.cx.v3beta1.TestConfig; + + /** + * Decodes a TestConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestConfig + * @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.dialogflow.cx.v3beta1.TestConfig; + + /** + * Verifies a TestConfig 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 TestConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TestConfig; + + /** + * Creates a plain object from a TestConfig message. Also converts values to other types if specified. + * @param message TestConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TestConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationTurn. */ + interface IConversationTurn { + + /** ConversationTurn userInput */ + userInput?: (google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput|null); + + /** ConversationTurn virtualAgentOutput */ + virtualAgentOutput?: (google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput|null); + } + + /** Represents a ConversationTurn. */ + class ConversationTurn implements IConversationTurn { + + /** + * Constructs a new ConversationTurn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IConversationTurn); + + /** ConversationTurn userInput. */ + public userInput?: (google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput|null); + + /** ConversationTurn virtualAgentOutput. */ + public virtualAgentOutput?: (google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput|null); + + /** + * Creates a new ConversationTurn instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationTurn instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IConversationTurn): google.cloud.dialogflow.cx.v3beta1.ConversationTurn; + + /** + * Encodes the specified ConversationTurn message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.verify|verify} messages. + * @param message ConversationTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IConversationTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationTurn message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.verify|verify} messages. + * @param message ConversationTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IConversationTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationTurn + * @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.dialogflow.cx.v3beta1.ConversationTurn; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationTurn + * @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.dialogflow.cx.v3beta1.ConversationTurn; + + /** + * Verifies a ConversationTurn 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 ConversationTurn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationTurn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ConversationTurn; + + /** + * Creates a plain object from a ConversationTurn message. Also converts values to other types if specified. + * @param message ConversationTurn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ConversationTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationTurn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationTurn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConversationTurn { + + /** Properties of a UserInput. */ + interface IUserInput { + + /** UserInput input */ + input?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** UserInput injectedParameters */ + injectedParameters?: (google.protobuf.IStruct|null); + + /** UserInput isWebhookEnabled */ + isWebhookEnabled?: (boolean|null); + + /** UserInput enableSentimentAnalysis */ + enableSentimentAnalysis?: (boolean|null); + } + + /** Represents a UserInput. */ + class UserInput implements IUserInput { + + /** + * Constructs a new UserInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput); + + /** UserInput input. */ + public input?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** UserInput injectedParameters. */ + public injectedParameters?: (google.protobuf.IStruct|null); + + /** UserInput isWebhookEnabled. */ + public isWebhookEnabled: boolean; + + /** UserInput enableSentimentAnalysis. */ + public enableSentimentAnalysis: boolean; + + /** + * Creates a new UserInput instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput): google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput; + + /** + * Encodes the specified UserInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.verify|verify} messages. + * @param message UserInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.verify|verify} messages. + * @param message UserInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInput + * @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.dialogflow.cx.v3beta1.ConversationTurn.UserInput; + + /** + * Decodes a UserInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInput + * @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.dialogflow.cx.v3beta1.ConversationTurn.UserInput; + + /** + * Verifies a UserInput 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 UserInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput; + + /** + * Creates a plain object from a UserInput message. Also converts values to other types if specified. + * @param message UserInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VirtualAgentOutput. */ + interface IVirtualAgentOutput { + + /** VirtualAgentOutput sessionParameters */ + sessionParameters?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput differences */ + differences?: (google.cloud.dialogflow.cx.v3beta1.ITestRunDifference[]|null); + + /** VirtualAgentOutput diagnosticInfo */ + diagnosticInfo?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput triggeredIntent */ + triggeredIntent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** VirtualAgentOutput currentPage */ + currentPage?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** VirtualAgentOutput textResponses */ + textResponses?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText[]|null); + + /** VirtualAgentOutput status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a VirtualAgentOutput. */ + class VirtualAgentOutput implements IVirtualAgentOutput { + + /** + * Constructs a new VirtualAgentOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput); + + /** VirtualAgentOutput sessionParameters. */ + public sessionParameters?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput differences. */ + public differences: google.cloud.dialogflow.cx.v3beta1.ITestRunDifference[]; + + /** VirtualAgentOutput diagnosticInfo. */ + public diagnosticInfo?: (google.protobuf.IStruct|null); + + /** VirtualAgentOutput triggeredIntent. */ + public triggeredIntent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** VirtualAgentOutput currentPage. */ + public currentPage?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** VirtualAgentOutput textResponses. */ + public textResponses: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText[]; + + /** VirtualAgentOutput status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new VirtualAgentOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns VirtualAgentOutput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput): google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput; + + /** + * Encodes the specified VirtualAgentOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @param message VirtualAgentOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VirtualAgentOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @param message VirtualAgentOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VirtualAgentOutput + * @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.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VirtualAgentOutput + * @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.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput; + + /** + * Verifies a VirtualAgentOutput 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 VirtualAgentOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VirtualAgentOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput; + + /** + * Creates a plain object from a VirtualAgentOutput message. Also converts values to other types if specified. + * @param message VirtualAgentOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VirtualAgentOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VirtualAgentOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TestRunDifference. */ + interface ITestRunDifference { + + /** TestRunDifference type */ + type?: (google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType|keyof typeof google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType|null); + + /** TestRunDifference description */ + description?: (string|null); + } + + /** Represents a TestRunDifference. */ + class TestRunDifference implements ITestRunDifference { + + /** + * Constructs a new TestRunDifference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITestRunDifference); + + /** TestRunDifference type. */ + public type: (google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType|keyof typeof google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType); + + /** TestRunDifference description. */ + public description: string; + + /** + * Creates a new TestRunDifference instance using the specified properties. + * @param [properties] Properties to set + * @returns TestRunDifference instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITestRunDifference): google.cloud.dialogflow.cx.v3beta1.TestRunDifference; + + /** + * Encodes the specified TestRunDifference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestRunDifference.verify|verify} messages. + * @param message TestRunDifference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITestRunDifference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestRunDifference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestRunDifference.verify|verify} messages. + * @param message TestRunDifference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITestRunDifference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestRunDifference + * @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.dialogflow.cx.v3beta1.TestRunDifference; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestRunDifference + * @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.dialogflow.cx.v3beta1.TestRunDifference; + + /** + * Verifies a TestRunDifference 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 TestRunDifference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestRunDifference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TestRunDifference; + + /** + * Creates a plain object from a TestRunDifference message. Also converts values to other types if specified. + * @param message TestRunDifference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TestRunDifference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestRunDifference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestRunDifference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TestRunDifference { + + /** DiffType enum. */ + enum DiffType { + DIFF_TYPE_UNSPECIFIED = 0, + INTENT = 1, + PAGE = 2, + PARAMETERS = 3, + UTTERANCE = 4, + FLOW = 5 + } + } + + /** Properties of a TransitionCoverage. */ + interface ITransitionCoverage { + + /** TransitionCoverage transitions */ + transitions?: (google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition[]|null); + + /** TransitionCoverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents a TransitionCoverage. */ + class TransitionCoverage implements ITransitionCoverage { + + /** + * Constructs a new TransitionCoverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage); + + /** TransitionCoverage transitions. */ + public transitions: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition[]; + + /** TransitionCoverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new TransitionCoverage instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionCoverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage): google.cloud.dialogflow.cx.v3beta1.TransitionCoverage; + + /** + * Encodes the specified TransitionCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.verify|verify} messages. + * @param message TransitionCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.verify|verify} messages. + * @param message TransitionCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionCoverage + * @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.dialogflow.cx.v3beta1.TransitionCoverage; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionCoverage + * @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.dialogflow.cx.v3beta1.TransitionCoverage; + + /** + * Verifies a TransitionCoverage 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 TransitionCoverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionCoverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionCoverage; + + /** + * Creates a plain object from a TransitionCoverage message. Also converts values to other types if specified. + * @param message TransitionCoverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionCoverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionCoverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitionCoverage { + + /** Properties of a TransitionNode. */ + interface ITransitionNode { + + /** TransitionNode page */ + page?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** TransitionNode flow */ + flow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + } + + /** Represents a TransitionNode. */ + class TransitionNode implements ITransitionNode { + + /** + * Constructs a new TransitionNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode); + + /** TransitionNode page. */ + public page?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** TransitionNode flow. */ + public flow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + + /** TransitionNode kind. */ + public kind?: ("page"|"flow"); + + /** + * Creates a new TransitionNode instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionNode instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode): google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode; + + /** + * Encodes the specified TransitionNode message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.verify|verify} messages. + * @param message TransitionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionNode message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.verify|verify} messages. + * @param message TransitionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionNode + * @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.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode; + + /** + * Decodes a TransitionNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionNode + * @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.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode; + + /** + * Verifies a TransitionNode 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 TransitionNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode; + + /** + * Creates a plain object from a TransitionNode message. Also converts values to other types if specified. + * @param message TransitionNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Transition. */ + interface ITransition { + + /** Transition source */ + source?: (google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null); + + /** Transition index */ + index?: (number|null); + + /** Transition target */ + target?: (google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null); + + /** Transition covered */ + covered?: (boolean|null); + + /** Transition transitionRoute */ + transitionRoute?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null); + + /** Transition eventHandler */ + eventHandler?: (google.cloud.dialogflow.cx.v3beta1.IEventHandler|null); + } + + /** Represents a Transition. */ + class Transition implements ITransition { + + /** + * Constructs a new Transition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition); + + /** Transition source. */ + public source?: (google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null); + + /** Transition index. */ + public index: number; + + /** Transition target. */ + public target?: (google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null); + + /** Transition covered. */ + public covered: boolean; + + /** Transition transitionRoute. */ + public transitionRoute?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null); + + /** Transition eventHandler. */ + public eventHandler?: (google.cloud.dialogflow.cx.v3beta1.IEventHandler|null); + + /** Transition detail. */ + public detail?: ("transitionRoute"|"eventHandler"); + + /** + * Creates a new Transition instance using the specified properties. + * @param [properties] Properties to set + * @returns Transition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition): google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transition + * @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.dialogflow.cx.v3beta1.TransitionCoverage.Transition; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transition + * @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.dialogflow.cx.v3beta1.TransitionCoverage.Transition; + + /** + * Verifies a Transition 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 Transition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @param message Transition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Transition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Transition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TransitionRouteGroupCoverage. */ + interface ITransitionRouteGroupCoverage { + + /** TransitionRouteGroupCoverage coverages */ + coverages?: (google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage[]|null); + + /** TransitionRouteGroupCoverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents a TransitionRouteGroupCoverage. */ + class TransitionRouteGroupCoverage implements ITransitionRouteGroupCoverage { + + /** + * Constructs a new TransitionRouteGroupCoverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage); + + /** TransitionRouteGroupCoverage coverages. */ + public coverages: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage[]; + + /** TransitionRouteGroupCoverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new TransitionRouteGroupCoverage instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionRouteGroupCoverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage; + + /** + * Encodes the specified TransitionRouteGroupCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.verify|verify} messages. + * @param message TransitionRouteGroupCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionRouteGroupCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.verify|verify} messages. + * @param message TransitionRouteGroupCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionRouteGroupCoverage + * @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.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionRouteGroupCoverage + * @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.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage; + + /** + * Verifies a TransitionRouteGroupCoverage 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 TransitionRouteGroupCoverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionRouteGroupCoverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage; + + /** + * Creates a plain object from a TransitionRouteGroupCoverage message. Also converts values to other types if specified. + * @param message TransitionRouteGroupCoverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionRouteGroupCoverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionRouteGroupCoverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitionRouteGroupCoverage { + + /** Properties of a Coverage. */ + interface ICoverage { + + /** Coverage routeGroup */ + routeGroup?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null); + + /** Coverage transitions */ + transitions?: (google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition[]|null); + + /** Coverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents a Coverage. */ + class Coverage implements ICoverage { + + /** + * Constructs a new Coverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage); + + /** Coverage routeGroup. */ + public routeGroup?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null); + + /** Coverage transitions. */ + public transitions: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition[]; + + /** Coverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new Coverage instance using the specified properties. + * @param [properties] Properties to set + * @returns Coverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage; + + /** + * Encodes the specified Coverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @param message Coverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Coverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @param message Coverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Coverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coverage + * @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.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage; + + /** + * Decodes a Coverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coverage + * @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.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage; + + /** + * Verifies a Coverage 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 Coverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage; + + /** + * Creates a plain object from a Coverage message. Also converts values to other types if specified. + * @param message Coverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Coverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Coverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Coverage { + + /** Properties of a Transition. */ + interface ITransition { + + /** Transition transitionRoute */ + transitionRoute?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null); + + /** Transition covered */ + covered?: (boolean|null); + } + + /** Represents a Transition. */ + class Transition implements ITransition { + + /** + * Constructs a new Transition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition); + + /** Transition transitionRoute. */ + public transitionRoute?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null); + + /** Transition covered. */ + public covered: boolean; + + /** + * Creates a new Transition instance using the specified properties. + * @param [properties] Properties to set + * @returns Transition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transition + * @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.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transition + * @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.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Verifies a Transition 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 Transition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @param message Transition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Transition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Transition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an IntentCoverage. */ + interface IIntentCoverage { + + /** IntentCoverage intents */ + intents?: (google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent[]|null); + + /** IntentCoverage coverageScore */ + coverageScore?: (number|null); + } + + /** Represents an IntentCoverage. */ + class IntentCoverage implements IIntentCoverage { + + /** + * Constructs a new IntentCoverage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IIntentCoverage); + + /** IntentCoverage intents. */ + public intents: google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent[]; + + /** IntentCoverage coverageScore. */ + public coverageScore: number; + + /** + * Creates a new IntentCoverage instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentCoverage instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IIntentCoverage): google.cloud.dialogflow.cx.v3beta1.IntentCoverage; + + /** + * Encodes the specified IntentCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.verify|verify} messages. + * @param message IntentCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IIntentCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.verify|verify} messages. + * @param message IntentCoverage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IIntentCoverage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentCoverage + * @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.dialogflow.cx.v3beta1.IntentCoverage; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentCoverage + * @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.dialogflow.cx.v3beta1.IntentCoverage; + + /** + * Verifies an IntentCoverage 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 IntentCoverage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentCoverage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.IntentCoverage; + + /** + * Creates a plain object from an IntentCoverage message. Also converts values to other types if specified. + * @param message IntentCoverage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.IntentCoverage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentCoverage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentCoverage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntentCoverage { + + /** Properties of an Intent. */ + interface IIntent { + + /** Intent intent */ + intent?: (string|null); + + /** Intent covered */ + covered?: (boolean|null); + } + + /** Represents an Intent. */ + class Intent implements IIntent { + + /** + * Constructs a new Intent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent); + + /** Intent intent. */ + public intent: string; + + /** Intent covered. */ + public covered: boolean; + + /** + * Creates a new Intent instance using the specified properties. + * @param [properties] Properties to set + * @returns Intent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent): google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intent + * @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.dialogflow.cx.v3beta1.IntentCoverage.Intent; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intent + * @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.dialogflow.cx.v3beta1.IntentCoverage.Intent; + + /** + * Verifies an Intent 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 Intent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @param message Intent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Intent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Intent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CalculateCoverageRequest. */ + interface ICalculateCoverageRequest { + + /** CalculateCoverageRequest agent */ + agent?: (string|null); + + /** CalculateCoverageRequest type */ + type?: (google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType|keyof typeof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType|null); + } + + /** Represents a CalculateCoverageRequest. */ + class CalculateCoverageRequest implements ICalculateCoverageRequest { + + /** + * Constructs a new CalculateCoverageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest); + + /** CalculateCoverageRequest agent. */ + public agent: string; + + /** CalculateCoverageRequest type. */ + public type: (google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType|keyof typeof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType); + + /** + * Creates a new CalculateCoverageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CalculateCoverageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest): google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest; + + /** + * Encodes the specified CalculateCoverageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.verify|verify} messages. + * @param message CalculateCoverageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CalculateCoverageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.verify|verify} messages. + * @param message CalculateCoverageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CalculateCoverageRequest + * @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.dialogflow.cx.v3beta1.CalculateCoverageRequest; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CalculateCoverageRequest + * @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.dialogflow.cx.v3beta1.CalculateCoverageRequest; + + /** + * Verifies a CalculateCoverageRequest 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 CalculateCoverageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CalculateCoverageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest; + + /** + * Creates a plain object from a CalculateCoverageRequest message. Also converts values to other types if specified. + * @param message CalculateCoverageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CalculateCoverageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CalculateCoverageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CalculateCoverageRequest { + + /** CoverageType enum. */ + enum CoverageType { + COVERAGE_TYPE_UNSPECIFIED = 0, + INTENT = 1, + PAGE_TRANSITION = 2, + TRANSITION_ROUTE_GROUP = 3 + } + } + + /** Properties of a CalculateCoverageResponse. */ + interface ICalculateCoverageResponse { + + /** CalculateCoverageResponse agent */ + agent?: (string|null); + + /** CalculateCoverageResponse intentCoverage */ + intentCoverage?: (google.cloud.dialogflow.cx.v3beta1.IIntentCoverage|null); + + /** CalculateCoverageResponse transitionCoverage */ + transitionCoverage?: (google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage|null); + + /** CalculateCoverageResponse routeGroupCoverage */ + routeGroupCoverage?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage|null); + } + + /** Represents a CalculateCoverageResponse. */ + class CalculateCoverageResponse implements ICalculateCoverageResponse { + + /** + * Constructs a new CalculateCoverageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse); + + /** CalculateCoverageResponse agent. */ + public agent: string; + + /** CalculateCoverageResponse intentCoverage. */ + public intentCoverage?: (google.cloud.dialogflow.cx.v3beta1.IIntentCoverage|null); + + /** CalculateCoverageResponse transitionCoverage. */ + public transitionCoverage?: (google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage|null); + + /** CalculateCoverageResponse routeGroupCoverage. */ + public routeGroupCoverage?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage|null); + + /** CalculateCoverageResponse coverageType. */ + public coverageType?: ("intentCoverage"|"transitionCoverage"|"routeGroupCoverage"); + + /** + * Creates a new CalculateCoverageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CalculateCoverageResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse): google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse; + + /** + * Encodes the specified CalculateCoverageResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse.verify|verify} messages. + * @param message CalculateCoverageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CalculateCoverageResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse.verify|verify} messages. + * @param message CalculateCoverageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CalculateCoverageResponse + * @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.dialogflow.cx.v3beta1.CalculateCoverageResponse; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CalculateCoverageResponse + * @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.dialogflow.cx.v3beta1.CalculateCoverageResponse; + + /** + * Verifies a CalculateCoverageResponse 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 CalculateCoverageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CalculateCoverageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse; + + /** + * Creates a plain object from a CalculateCoverageResponse message. Also converts values to other types if specified. + * @param message CalculateCoverageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CalculateCoverageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CalculateCoverageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTestCasesRequest. */ + interface IListTestCasesRequest { + + /** ListTestCasesRequest parent */ + parent?: (string|null); + + /** ListTestCasesRequest pageSize */ + pageSize?: (number|null); + + /** ListTestCasesRequest pageToken */ + pageToken?: (string|null); + + /** ListTestCasesRequest view */ + view?: (google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView|keyof typeof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView|null); + } + + /** Represents a ListTestCasesRequest. */ + class ListTestCasesRequest implements IListTestCasesRequest { + + /** + * Constructs a new ListTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest); + + /** ListTestCasesRequest parent. */ + public parent: string; + + /** ListTestCasesRequest pageSize. */ + public pageSize: number; + + /** ListTestCasesRequest pageToken. */ + public pageToken: string; + + /** ListTestCasesRequest view. */ + public view: (google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView|keyof typeof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView); + + /** + * Creates a new ListTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest): google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest; + + /** + * Encodes the specified ListTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.verify|verify} messages. + * @param message ListTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.verify|verify} messages. + * @param message ListTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCasesRequest + * @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.dialogflow.cx.v3beta1.ListTestCasesRequest; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCasesRequest + * @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.dialogflow.cx.v3beta1.ListTestCasesRequest; + + /** + * Verifies a ListTestCasesRequest 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 ListTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest; + + /** + * Creates a plain object from a ListTestCasesRequest message. Also converts values to other types if specified. + * @param message ListTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListTestCasesRequest { + + /** TestCaseView enum. */ + enum TestCaseView { + TEST_CASE_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + } + + /** Properties of a ListTestCasesResponse. */ + interface IListTestCasesResponse { + + /** ListTestCasesResponse testCases */ + testCases?: (google.cloud.dialogflow.cx.v3beta1.ITestCase[]|null); + + /** ListTestCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTestCasesResponse. */ + class ListTestCasesResponse implements IListTestCasesResponse { + + /** + * Constructs a new ListTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse); + + /** ListTestCasesResponse testCases. */ + public testCases: google.cloud.dialogflow.cx.v3beta1.ITestCase[]; + + /** ListTestCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse): google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse; + + /** + * Encodes the specified ListTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse.verify|verify} messages. + * @param message ListTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse.verify|verify} messages. + * @param message ListTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCasesResponse + * @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.dialogflow.cx.v3beta1.ListTestCasesResponse; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCasesResponse + * @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.dialogflow.cx.v3beta1.ListTestCasesResponse; + + /** + * Verifies a ListTestCasesResponse 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 ListTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse; + + /** + * Creates a plain object from a ListTestCasesResponse message. Also converts values to other types if specified. + * @param message ListTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteTestCasesRequest. */ + interface IBatchDeleteTestCasesRequest { + + /** BatchDeleteTestCasesRequest parent */ + parent?: (string|null); + + /** BatchDeleteTestCasesRequest names */ + names?: (string[]|null); + } + + /** Represents a BatchDeleteTestCasesRequest. */ + class BatchDeleteTestCasesRequest implements IBatchDeleteTestCasesRequest { + + /** + * Constructs a new BatchDeleteTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest); + + /** BatchDeleteTestCasesRequest parent. */ + public parent: string; + + /** BatchDeleteTestCasesRequest names. */ + public names: string[]; + + /** + * Creates a new BatchDeleteTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest): google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest.verify|verify} messages. + * @param message BatchDeleteTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest.verify|verify} messages. + * @param message BatchDeleteTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteTestCasesRequest + * @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.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteTestCasesRequest + * @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.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest; + + /** + * Verifies a BatchDeleteTestCasesRequest 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 BatchDeleteTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest; + + /** + * Creates a plain object from a BatchDeleteTestCasesRequest message. Also converts values to other types if specified. + * @param message BatchDeleteTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTestCaseRequest. */ + interface ICreateTestCaseRequest { + + /** CreateTestCaseRequest parent */ + parent?: (string|null); + + /** CreateTestCaseRequest testCase */ + testCase?: (google.cloud.dialogflow.cx.v3beta1.ITestCase|null); + } + + /** Represents a CreateTestCaseRequest. */ + class CreateTestCaseRequest implements ICreateTestCaseRequest { + + /** + * Constructs a new CreateTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest); + + /** CreateTestCaseRequest parent. */ + public parent: string; + + /** CreateTestCaseRequest testCase. */ + public testCase?: (google.cloud.dialogflow.cx.v3beta1.ITestCase|null); + + /** + * Creates a new CreateTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest): google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest; + + /** + * Encodes the specified CreateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest.verify|verify} messages. + * @param message CreateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest.verify|verify} messages. + * @param message CreateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTestCaseRequest + * @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.dialogflow.cx.v3beta1.CreateTestCaseRequest; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTestCaseRequest + * @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.dialogflow.cx.v3beta1.CreateTestCaseRequest; + + /** + * Verifies a CreateTestCaseRequest 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 CreateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest; + + /** + * Creates a plain object from a CreateTestCaseRequest message. Also converts values to other types if specified. + * @param message CreateTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTestCaseRequest. */ + interface IUpdateTestCaseRequest { + + /** UpdateTestCaseRequest testCase */ + testCase?: (google.cloud.dialogflow.cx.v3beta1.ITestCase|null); + + /** UpdateTestCaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTestCaseRequest. */ + class UpdateTestCaseRequest implements IUpdateTestCaseRequest { + + /** + * Constructs a new UpdateTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest); + + /** UpdateTestCaseRequest testCase. */ + public testCase?: (google.cloud.dialogflow.cx.v3beta1.ITestCase|null); + + /** UpdateTestCaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest): google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest; + + /** + * Encodes the specified UpdateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest.verify|verify} messages. + * @param message UpdateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest.verify|verify} messages. + * @param message UpdateTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTestCaseRequest + * @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.dialogflow.cx.v3beta1.UpdateTestCaseRequest; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTestCaseRequest + * @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.dialogflow.cx.v3beta1.UpdateTestCaseRequest; + + /** + * Verifies an UpdateTestCaseRequest 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 UpdateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest; + + /** + * Creates a plain object from an UpdateTestCaseRequest message. Also converts values to other types if specified. + * @param message UpdateTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTestCaseRequest. */ + interface IGetTestCaseRequest { + + /** GetTestCaseRequest name */ + name?: (string|null); + } + + /** Represents a GetTestCaseRequest. */ + class GetTestCaseRequest implements IGetTestCaseRequest { + + /** + * Constructs a new GetTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest); + + /** GetTestCaseRequest name. */ + public name: string; + + /** + * Creates a new GetTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest): google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest; + + /** + * Encodes the specified GetTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest.verify|verify} messages. + * @param message GetTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest.verify|verify} messages. + * @param message GetTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTestCaseRequest + * @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.dialogflow.cx.v3beta1.GetTestCaseRequest; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTestCaseRequest + * @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.dialogflow.cx.v3beta1.GetTestCaseRequest; + + /** + * Verifies a GetTestCaseRequest 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 GetTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest; + + /** + * Creates a plain object from a GetTestCaseRequest message. Also converts values to other types if specified. + * @param message GetTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunTestCaseRequest. */ + interface IRunTestCaseRequest { + + /** RunTestCaseRequest name */ + name?: (string|null); + + /** RunTestCaseRequest environment */ + environment?: (string|null); + } + + /** Represents a RunTestCaseRequest. */ + class RunTestCaseRequest implements IRunTestCaseRequest { + + /** + * Constructs a new RunTestCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest); + + /** RunTestCaseRequest name. */ + public name: string; + + /** RunTestCaseRequest environment. */ + public environment: string; + + /** + * Creates a new RunTestCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunTestCaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest): google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest; + + /** + * Encodes the specified RunTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest.verify|verify} messages. + * @param message RunTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest.verify|verify} messages. + * @param message RunTestCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunTestCaseRequest + * @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.dialogflow.cx.v3beta1.RunTestCaseRequest; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunTestCaseRequest + * @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.dialogflow.cx.v3beta1.RunTestCaseRequest; + + /** + * Verifies a RunTestCaseRequest 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 RunTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunTestCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest; + + /** + * Creates a plain object from a RunTestCaseRequest message. Also converts values to other types if specified. + * @param message RunTestCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunTestCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunTestCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunTestCaseResponse. */ + interface IRunTestCaseResponse { + + /** RunTestCaseResponse result */ + result?: (google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null); + } + + /** Represents a RunTestCaseResponse. */ + class RunTestCaseResponse implements IRunTestCaseResponse { + + /** + * Constructs a new RunTestCaseResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse); + + /** RunTestCaseResponse result. */ + public result?: (google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null); + + /** + * Creates a new RunTestCaseResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunTestCaseResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse): google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse; + + /** + * Encodes the specified RunTestCaseResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse.verify|verify} messages. + * @param message RunTestCaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunTestCaseResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse.verify|verify} messages. + * @param message RunTestCaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunTestCaseResponse + * @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.dialogflow.cx.v3beta1.RunTestCaseResponse; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunTestCaseResponse + * @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.dialogflow.cx.v3beta1.RunTestCaseResponse; + + /** + * Verifies a RunTestCaseResponse 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 RunTestCaseResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunTestCaseResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse; + + /** + * Creates a plain object from a RunTestCaseResponse message. Also converts values to other types if specified. + * @param message RunTestCaseResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunTestCaseResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunTestCaseResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunTestCaseMetadata. */ + interface IRunTestCaseMetadata { + } + + /** Represents a RunTestCaseMetadata. */ + class RunTestCaseMetadata implements IRunTestCaseMetadata { + + /** + * Constructs a new RunTestCaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata); + + /** + * Creates a new RunTestCaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunTestCaseMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata): google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata; + + /** + * Encodes the specified RunTestCaseMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata.verify|verify} messages. + * @param message RunTestCaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunTestCaseMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata.verify|verify} messages. + * @param message RunTestCaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunTestCaseMetadata + * @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.dialogflow.cx.v3beta1.RunTestCaseMetadata; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunTestCaseMetadata + * @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.dialogflow.cx.v3beta1.RunTestCaseMetadata; + + /** + * Verifies a RunTestCaseMetadata 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 RunTestCaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunTestCaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata; + + /** + * Creates a plain object from a RunTestCaseMetadata message. Also converts values to other types if specified. + * @param message RunTestCaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunTestCaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunTestCaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunTestCasesRequest. */ + interface IBatchRunTestCasesRequest { + + /** BatchRunTestCasesRequest parent */ + parent?: (string|null); + + /** BatchRunTestCasesRequest environment */ + environment?: (string|null); + + /** BatchRunTestCasesRequest testCases */ + testCases?: (string[]|null); + } + + /** Represents a BatchRunTestCasesRequest. */ + class BatchRunTestCasesRequest implements IBatchRunTestCasesRequest { + + /** + * Constructs a new BatchRunTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest); + + /** BatchRunTestCasesRequest parent. */ + public parent: string; + + /** BatchRunTestCasesRequest environment. */ + public environment: string; + + /** BatchRunTestCasesRequest testCases. */ + public testCases: string[]; + + /** + * Creates a new BatchRunTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest): google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest; + + /** + * Encodes the specified BatchRunTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest.verify|verify} messages. + * @param message BatchRunTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest.verify|verify} messages. + * @param message BatchRunTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunTestCasesRequest + * @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.dialogflow.cx.v3beta1.BatchRunTestCasesRequest; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunTestCasesRequest + * @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.dialogflow.cx.v3beta1.BatchRunTestCasesRequest; + + /** + * Verifies a BatchRunTestCasesRequest 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 BatchRunTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest; + + /** + * Creates a plain object from a BatchRunTestCasesRequest message. Also converts values to other types if specified. + * @param message BatchRunTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunTestCasesResponse. */ + interface IBatchRunTestCasesResponse { + + /** BatchRunTestCasesResponse results */ + results?: (google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[]|null); + } + + /** Represents a BatchRunTestCasesResponse. */ + class BatchRunTestCasesResponse implements IBatchRunTestCasesResponse { + + /** + * Constructs a new BatchRunTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse); + + /** BatchRunTestCasesResponse results. */ + public results: google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[]; + + /** + * Creates a new BatchRunTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse): google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse; + + /** + * Encodes the specified BatchRunTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse.verify|verify} messages. + * @param message BatchRunTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse.verify|verify} messages. + * @param message BatchRunTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunTestCasesResponse + * @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.dialogflow.cx.v3beta1.BatchRunTestCasesResponse; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunTestCasesResponse + * @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.dialogflow.cx.v3beta1.BatchRunTestCasesResponse; + + /** + * Verifies a BatchRunTestCasesResponse 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 BatchRunTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse; + + /** + * Creates a plain object from a BatchRunTestCasesResponse message. Also converts values to other types if specified. + * @param message BatchRunTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunTestCasesMetadata. */ + interface IBatchRunTestCasesMetadata { + + /** BatchRunTestCasesMetadata errors */ + errors?: (google.cloud.dialogflow.cx.v3beta1.ITestError[]|null); + } + + /** Represents a BatchRunTestCasesMetadata. */ + class BatchRunTestCasesMetadata implements IBatchRunTestCasesMetadata { + + /** + * Constructs a new BatchRunTestCasesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata); + + /** BatchRunTestCasesMetadata errors. */ + public errors: google.cloud.dialogflow.cx.v3beta1.ITestError[]; + + /** + * Creates a new BatchRunTestCasesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunTestCasesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata): google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata; + + /** + * Encodes the specified BatchRunTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata.verify|verify} messages. + * @param message BatchRunTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata.verify|verify} messages. + * @param message BatchRunTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunTestCasesMetadata + * @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.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunTestCasesMetadata + * @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.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata; + + /** + * Verifies a BatchRunTestCasesMetadata 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 BatchRunTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunTestCasesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata; + + /** + * Creates a plain object from a BatchRunTestCasesMetadata message. Also converts values to other types if specified. + * @param message BatchRunTestCasesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunTestCasesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunTestCasesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestError. */ + interface ITestError { + + /** TestError testCase */ + testCase?: (string|null); + + /** TestError status */ + status?: (google.rpc.IStatus|null); + + /** TestError testTime */ + testTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TestError. */ + class TestError implements ITestError { + + /** + * Constructs a new TestError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITestError); + + /** TestError testCase. */ + public testCase: string; + + /** TestError status. */ + public status?: (google.rpc.IStatus|null); + + /** TestError testTime. */ + public testTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TestError instance using the specified properties. + * @param [properties] Properties to set + * @returns TestError instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITestError): google.cloud.dialogflow.cx.v3beta1.TestError; + + /** + * Encodes the specified TestError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestError.verify|verify} messages. + * @param message TestError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITestError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestError.verify|verify} messages. + * @param message TestError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITestError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestError + * @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.dialogflow.cx.v3beta1.TestError; + + /** + * Decodes a TestError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestError + * @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.dialogflow.cx.v3beta1.TestError; + + /** + * Verifies a TestError 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 TestError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TestError; + + /** + * Creates a plain object from a TestError message. Also converts values to other types if specified. + * @param message TestError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TestError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportTestCasesRequest. */ + interface IImportTestCasesRequest { + + /** ImportTestCasesRequest parent */ + parent?: (string|null); + + /** ImportTestCasesRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportTestCasesRequest content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ImportTestCasesRequest. */ + class ImportTestCasesRequest implements IImportTestCasesRequest { + + /** + * Constructs a new ImportTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest); + + /** ImportTestCasesRequest parent. */ + public parent: string; + + /** ImportTestCasesRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ImportTestCasesRequest content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** ImportTestCasesRequest source. */ + public source?: ("gcsUri"|"content"); + + /** + * Creates a new ImportTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest): google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest; + + /** + * Encodes the specified ImportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest.verify|verify} messages. + * @param message ImportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest.verify|verify} messages. + * @param message ImportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTestCasesRequest + * @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.dialogflow.cx.v3beta1.ImportTestCasesRequest; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTestCasesRequest + * @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.dialogflow.cx.v3beta1.ImportTestCasesRequest; + + /** + * Verifies an ImportTestCasesRequest 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 ImportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest; + + /** + * Creates a plain object from an ImportTestCasesRequest message. Also converts values to other types if specified. + * @param message ImportTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportTestCasesResponse. */ + interface IImportTestCasesResponse { + + /** ImportTestCasesResponse names */ + names?: (string[]|null); + } + + /** Represents an ImportTestCasesResponse. */ + class ImportTestCasesResponse implements IImportTestCasesResponse { + + /** + * Constructs a new ImportTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse); + + /** ImportTestCasesResponse names. */ + public names: string[]; + + /** + * Creates a new ImportTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse): google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse; + + /** + * Encodes the specified ImportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse.verify|verify} messages. + * @param message ImportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse.verify|verify} messages. + * @param message ImportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTestCasesResponse + * @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.dialogflow.cx.v3beta1.ImportTestCasesResponse; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTestCasesResponse + * @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.dialogflow.cx.v3beta1.ImportTestCasesResponse; + + /** + * Verifies an ImportTestCasesResponse 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 ImportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse; + + /** + * Creates a plain object from an ImportTestCasesResponse message. Also converts values to other types if specified. + * @param message ImportTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportTestCasesMetadata. */ + interface IImportTestCasesMetadata { + + /** ImportTestCasesMetadata errors */ + errors?: (google.cloud.dialogflow.cx.v3beta1.ITestCaseError[]|null); + } + + /** Represents an ImportTestCasesMetadata. */ + class ImportTestCasesMetadata implements IImportTestCasesMetadata { + + /** + * Constructs a new ImportTestCasesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata); + + /** ImportTestCasesMetadata errors. */ + public errors: google.cloud.dialogflow.cx.v3beta1.ITestCaseError[]; + + /** + * Creates a new ImportTestCasesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTestCasesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata): google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata; + + /** + * Encodes the specified ImportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata.verify|verify} messages. + * @param message ImportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata.verify|verify} messages. + * @param message ImportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTestCasesMetadata + * @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.dialogflow.cx.v3beta1.ImportTestCasesMetadata; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTestCasesMetadata + * @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.dialogflow.cx.v3beta1.ImportTestCasesMetadata; + + /** + * Verifies an ImportTestCasesMetadata 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 ImportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTestCasesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata; + + /** + * Creates a plain object from an ImportTestCasesMetadata message. Also converts values to other types if specified. + * @param message ImportTestCasesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTestCasesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportTestCasesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestCaseError. */ + interface ITestCaseError { + + /** TestCaseError testCase */ + testCase?: (google.cloud.dialogflow.cx.v3beta1.ITestCase|null); + + /** TestCaseError status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a TestCaseError. */ + class TestCaseError implements ITestCaseError { + + /** + * Constructs a new TestCaseError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITestCaseError); + + /** TestCaseError testCase. */ + public testCase?: (google.cloud.dialogflow.cx.v3beta1.ITestCase|null); + + /** TestCaseError status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new TestCaseError instance using the specified properties. + * @param [properties] Properties to set + * @returns TestCaseError instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITestCaseError): google.cloud.dialogflow.cx.v3beta1.TestCaseError; + + /** + * Encodes the specified TestCaseError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseError.verify|verify} messages. + * @param message TestCaseError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITestCaseError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestCaseError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseError.verify|verify} messages. + * @param message TestCaseError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITestCaseError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestCaseError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestCaseError + * @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.dialogflow.cx.v3beta1.TestCaseError; + + /** + * Decodes a TestCaseError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestCaseError + * @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.dialogflow.cx.v3beta1.TestCaseError; + + /** + * Verifies a TestCaseError 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 TestCaseError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestCaseError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TestCaseError; + + /** + * Creates a plain object from a TestCaseError message. Also converts values to other types if specified. + * @param message TestCaseError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TestCaseError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestCaseError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestCaseError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportTestCasesRequest. */ + interface IExportTestCasesRequest { + + /** ExportTestCasesRequest parent */ + parent?: (string|null); + + /** ExportTestCasesRequest gcsUri */ + gcsUri?: (string|null); + + /** ExportTestCasesRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat|null); + + /** ExportTestCasesRequest filter */ + filter?: (string|null); + } + + /** Represents an ExportTestCasesRequest. */ + class ExportTestCasesRequest implements IExportTestCasesRequest { + + /** + * Constructs a new ExportTestCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest); + + /** ExportTestCasesRequest parent. */ + public parent: string; + + /** ExportTestCasesRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ExportTestCasesRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat); + + /** ExportTestCasesRequest filter. */ + public filter: string; + + /** ExportTestCasesRequest destination. */ + public destination?: "gcsUri"; + + /** + * Creates a new ExportTestCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportTestCasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest): google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest; + + /** + * Encodes the specified ExportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.verify|verify} messages. + * @param message ExportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.verify|verify} messages. + * @param message ExportTestCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportTestCasesRequest + * @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.dialogflow.cx.v3beta1.ExportTestCasesRequest; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportTestCasesRequest + * @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.dialogflow.cx.v3beta1.ExportTestCasesRequest; + + /** + * Verifies an ExportTestCasesRequest 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 ExportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportTestCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest; + + /** + * Creates a plain object from an ExportTestCasesRequest message. Also converts values to other types if specified. + * @param message ExportTestCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportTestCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportTestCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportTestCasesRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON = 2 + } + } + + /** Properties of an ExportTestCasesResponse. */ + interface IExportTestCasesResponse { + + /** ExportTestCasesResponse gcsUri */ + gcsUri?: (string|null); + + /** ExportTestCasesResponse content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ExportTestCasesResponse. */ + class ExportTestCasesResponse implements IExportTestCasesResponse { + + /** + * Constructs a new ExportTestCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse); + + /** ExportTestCasesResponse gcsUri. */ + public gcsUri?: (string|null); + + /** ExportTestCasesResponse content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** ExportTestCasesResponse destination. */ + public destination?: ("gcsUri"|"content"); + + /** + * Creates a new ExportTestCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportTestCasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse): google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse; + + /** + * Encodes the specified ExportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse.verify|verify} messages. + * @param message ExportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse.verify|verify} messages. + * @param message ExportTestCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportTestCasesResponse + * @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.dialogflow.cx.v3beta1.ExportTestCasesResponse; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportTestCasesResponse + * @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.dialogflow.cx.v3beta1.ExportTestCasesResponse; + + /** + * Verifies an ExportTestCasesResponse 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 ExportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportTestCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse; + + /** + * Creates a plain object from an ExportTestCasesResponse message. Also converts values to other types if specified. + * @param message ExportTestCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportTestCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportTestCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportTestCasesMetadata. */ + interface IExportTestCasesMetadata { + } + + /** Represents an ExportTestCasesMetadata. */ + class ExportTestCasesMetadata implements IExportTestCasesMetadata { + + /** + * Constructs a new ExportTestCasesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata); + + /** + * Creates a new ExportTestCasesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportTestCasesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata): google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata; + + /** + * Encodes the specified ExportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata.verify|verify} messages. + * @param message ExportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata.verify|verify} messages. + * @param message ExportTestCasesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportTestCasesMetadata + * @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.dialogflow.cx.v3beta1.ExportTestCasesMetadata; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportTestCasesMetadata + * @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.dialogflow.cx.v3beta1.ExportTestCasesMetadata; + + /** + * Verifies an ExportTestCasesMetadata 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 ExportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportTestCasesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata; + + /** + * Creates a plain object from an ExportTestCasesMetadata message. Also converts values to other types if specified. + * @param message ExportTestCasesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportTestCasesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportTestCasesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTestCaseResultsRequest. */ + interface IListTestCaseResultsRequest { + + /** ListTestCaseResultsRequest parent */ + parent?: (string|null); + + /** ListTestCaseResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListTestCaseResultsRequest pageToken */ + pageToken?: (string|null); + + /** ListTestCaseResultsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListTestCaseResultsRequest. */ + class ListTestCaseResultsRequest implements IListTestCaseResultsRequest { + + /** + * Constructs a new ListTestCaseResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest); + + /** ListTestCaseResultsRequest parent. */ + public parent: string; + + /** ListTestCaseResultsRequest pageSize. */ + public pageSize: number; + + /** ListTestCaseResultsRequest pageToken. */ + public pageToken: string; + + /** ListTestCaseResultsRequest filter. */ + public filter: string; + + /** + * Creates a new ListTestCaseResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCaseResultsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest): google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest; + + /** + * Encodes the specified ListTestCaseResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest.verify|verify} messages. + * @param message ListTestCaseResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCaseResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest.verify|verify} messages. + * @param message ListTestCaseResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCaseResultsRequest + * @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.dialogflow.cx.v3beta1.ListTestCaseResultsRequest; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCaseResultsRequest + * @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.dialogflow.cx.v3beta1.ListTestCaseResultsRequest; + + /** + * Verifies a ListTestCaseResultsRequest 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 ListTestCaseResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCaseResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest; + + /** + * Creates a plain object from a ListTestCaseResultsRequest message. Also converts values to other types if specified. + * @param message ListTestCaseResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCaseResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCaseResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTestCaseResultsResponse. */ + interface IListTestCaseResultsResponse { + + /** ListTestCaseResultsResponse testCaseResults */ + testCaseResults?: (google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[]|null); + + /** ListTestCaseResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTestCaseResultsResponse. */ + class ListTestCaseResultsResponse implements IListTestCaseResultsResponse { + + /** + * Constructs a new ListTestCaseResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse); + + /** ListTestCaseResultsResponse testCaseResults. */ + public testCaseResults: google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[]; + + /** ListTestCaseResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTestCaseResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTestCaseResultsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse): google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse; + + /** + * Encodes the specified ListTestCaseResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse.verify|verify} messages. + * @param message ListTestCaseResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTestCaseResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse.verify|verify} messages. + * @param message ListTestCaseResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTestCaseResultsResponse + * @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.dialogflow.cx.v3beta1.ListTestCaseResultsResponse; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTestCaseResultsResponse + * @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.dialogflow.cx.v3beta1.ListTestCaseResultsResponse; + + /** + * Verifies a ListTestCaseResultsResponse 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 ListTestCaseResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTestCaseResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse; + + /** + * Creates a plain object from a ListTestCaseResultsResponse message. Also converts values to other types if specified. + * @param message ListTestCaseResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTestCaseResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTestCaseResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTestCaseResultRequest. */ + interface IGetTestCaseResultRequest { + + /** GetTestCaseResultRequest name */ + name?: (string|null); + } + + /** Represents a GetTestCaseResultRequest. */ + class GetTestCaseResultRequest implements IGetTestCaseResultRequest { + + /** + * Constructs a new GetTestCaseResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest); + + /** GetTestCaseResultRequest name. */ + public name: string; + + /** + * Creates a new GetTestCaseResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTestCaseResultRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest): google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest; + + /** + * Encodes the specified GetTestCaseResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest.verify|verify} messages. + * @param message GetTestCaseResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTestCaseResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest.verify|verify} messages. + * @param message GetTestCaseResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTestCaseResultRequest + * @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.dialogflow.cx.v3beta1.GetTestCaseResultRequest; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTestCaseResultRequest + * @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.dialogflow.cx.v3beta1.GetTestCaseResultRequest; + + /** + * Verifies a GetTestCaseResultRequest 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 GetTestCaseResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTestCaseResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest; + + /** + * Creates a plain object from a GetTestCaseResultRequest message. Also converts values to other types if specified. + * @param message GetTestCaseResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTestCaseResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTestCaseResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TestResult enum. */ + enum TestResult { + TEST_RESULT_UNSPECIFIED = 0, + PASSED = 1, + FAILED = 2 + } + + /** Represents an Intents */ + class Intents extends $protobuf.rpc.Service { + + /** + * Constructs a new Intents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Intents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Intents; + + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListIntentsResponse + */ + public listIntents(request: google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Intents.ListIntentsCallback): void; + + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @returns Promise + */ + public listIntents(request: google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest): Promise; + + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public getIntent(request: google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Intents.GetIntentCallback): void; + + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @returns Promise + */ + public getIntent(request: google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest): Promise; + + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public createIntent(request: google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntentCallback): void; + + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @returns Promise + */ + public createIntent(request: google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest): Promise; + + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public updateIntent(request: google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntentCallback): void; + + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @returns Promise + */ + public updateIntent(request: google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest): Promise; + + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteIntent(request: google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntentCallback): void; + + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @returns Promise + */ + public deleteIntent(request: google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest): Promise; + + /** + * Calls ImportIntents. + * @param request ImportIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importIntents(request: google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Intents.ImportIntentsCallback): void; + + /** + * Calls ImportIntents. + * @param request ImportIntentsRequest message or plain object + * @returns Promise + */ + public importIntents(request: google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest): Promise; + + /** + * Calls ExportIntents. + * @param request ExportIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportIntents(request: google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Intents.ExportIntentsCallback): void; + + /** + * Calls ExportIntents. + * @param request ExportIntentsRequest message or plain object + * @returns Promise + */ + public exportIntents(request: google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest): Promise; + } + + namespace Intents { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|listIntents}. + * @param error Error, if any + * @param [response] ListIntentsResponse + */ + type ListIntentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|getIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type GetIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|createIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type CreateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|updateIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type UpdateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|deleteIntent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteIntentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|importIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|exportIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Intent. */ + interface IIntent { + + /** Intent name */ + name?: (string|null); + + /** Intent displayName */ + displayName?: (string|null); + + /** Intent trainingPhrases */ + trainingPhrases?: (google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase[]|null); + + /** Intent parameters */ + parameters?: (google.cloud.dialogflow.cx.v3beta1.Intent.IParameter[]|null); + + /** Intent priority */ + priority?: (number|null); + + /** Intent isFallback */ + isFallback?: (boolean|null); + + /** Intent labels */ + labels?: ({ [k: string]: string }|null); + + /** Intent description */ + description?: (string|null); + + /** Intent dtmfPattern */ + dtmfPattern?: (string|null); + } + + /** Represents an Intent. */ + class Intent implements IIntent { + + /** + * Constructs a new Intent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IIntent); + + /** Intent name. */ + public name: string; + + /** Intent displayName. */ + public displayName: string; + + /** Intent trainingPhrases. */ + public trainingPhrases: google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase[]; + + /** Intent parameters. */ + public parameters: google.cloud.dialogflow.cx.v3beta1.Intent.IParameter[]; + + /** Intent priority. */ + public priority: number; + + /** Intent isFallback. */ + public isFallback: boolean; + + /** Intent labels. */ + public labels: { [k: string]: string }; + + /** Intent description. */ + public description: string; + + /** Intent dtmfPattern. */ + public dtmfPattern: string; + + /** + * Creates a new Intent instance using the specified properties. + * @param [properties] Properties to set + * @returns Intent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IIntent): google.cloud.dialogflow.cx.v3beta1.Intent; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intent + * @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.dialogflow.cx.v3beta1.Intent; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intent + * @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.dialogflow.cx.v3beta1.Intent; + + /** + * Verifies an Intent 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 Intent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Intent; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @param message Intent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Intent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Intent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Intent { + + /** Properties of a TrainingPhrase. */ + interface ITrainingPhrase { + + /** TrainingPhrase id */ + id?: (string|null); + + /** TrainingPhrase parts */ + parts?: (google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart[]|null); + + /** TrainingPhrase repeatCount */ + repeatCount?: (number|null); + } + + /** Represents a TrainingPhrase. */ + class TrainingPhrase implements ITrainingPhrase { + + /** + * Constructs a new TrainingPhrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase); + + /** TrainingPhrase id. */ + public id: string; + + /** TrainingPhrase parts. */ + public parts: google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart[]; + + /** TrainingPhrase repeatCount. */ + public repeatCount: number; + + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainingPhrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase): google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase; + + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainingPhrase + * @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.dialogflow.cx.v3beta1.Intent.TrainingPhrase; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainingPhrase + * @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.dialogflow.cx.v3beta1.Intent.TrainingPhrase; + + /** + * Verifies a TrainingPhrase 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 TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainingPhrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase; + + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @param message TrainingPhrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainingPhrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainingPhrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainingPhrase { + + /** Properties of a Part. */ + interface IPart { + + /** Part text */ + text?: (string|null); + + /** Part parameterId */ + parameterId?: (string|null); + } + + /** Represents a Part. */ + class Part implements IPart { + + /** + * Constructs a new Part. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart); + + /** Part text. */ + public text: string; + + /** Part parameterId. */ + public parameterId: string; + + /** + * Creates a new Part instance using the specified properties. + * @param [properties] Properties to set + * @returns Part instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart): google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Part message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Part + * @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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Part + * @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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part; + + /** + * Verifies a Part 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 Part message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Part + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @param message Part + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Part to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Part + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter id */ + id?: (string|null); + + /** Parameter entityType */ + entityType?: (string|null); + + /** Parameter isList */ + isList?: (boolean|null); + + /** Parameter redact */ + redact?: (boolean|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Intent.IParameter); + + /** Parameter id. */ + public id: string; + + /** Parameter entityType. */ + public entityType: string; + + /** Parameter isList. */ + public isList: boolean; + + /** Parameter redact. */ + public redact: boolean; + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Intent.IParameter): google.cloud.dialogflow.cx.v3beta1.Intent.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @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.dialogflow.cx.v3beta1.Intent.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @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.dialogflow.cx.v3beta1.Intent.Parameter; + + /** + * Verifies a Parameter 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 Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Intent.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Intent.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListIntentsRequest. */ + interface IListIntentsRequest { + + /** ListIntentsRequest parent */ + parent?: (string|null); + + /** ListIntentsRequest languageCode */ + languageCode?: (string|null); + + /** ListIntentsRequest intentView */ + intentView?: (google.cloud.dialogflow.cx.v3beta1.IntentView|keyof typeof google.cloud.dialogflow.cx.v3beta1.IntentView|null); + + /** ListIntentsRequest pageSize */ + pageSize?: (number|null); + + /** ListIntentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListIntentsRequest. */ + class ListIntentsRequest implements IListIntentsRequest { + + /** + * Constructs a new ListIntentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest); + + /** ListIntentsRequest parent. */ + public parent: string; + + /** ListIntentsRequest languageCode. */ + public languageCode: string; + + /** ListIntentsRequest intentView. */ + public intentView: (google.cloud.dialogflow.cx.v3beta1.IntentView|keyof typeof google.cloud.dialogflow.cx.v3beta1.IntentView); + + /** ListIntentsRequest pageSize. */ + public pageSize: number; + + /** ListIntentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIntentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest): google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest; + + /** + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIntentsRequest + * @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.dialogflow.cx.v3beta1.ListIntentsRequest; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIntentsRequest + * @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.dialogflow.cx.v3beta1.ListIntentsRequest; + + /** + * Verifies a ListIntentsRequest 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 ListIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIntentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest; + + /** + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. + * @param message ListIntentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListIntentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListIntentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListIntentsResponse. */ + interface IListIntentsResponse { + + /** ListIntentsResponse intents */ + intents?: (google.cloud.dialogflow.cx.v3beta1.IIntent[]|null); + + /** ListIntentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListIntentsResponse. */ + class ListIntentsResponse implements IListIntentsResponse { + + /** + * Constructs a new ListIntentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse); + + /** ListIntentsResponse intents. */ + public intents: google.cloud.dialogflow.cx.v3beta1.IIntent[]; + + /** ListIntentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListIntentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIntentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse): google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse; + + /** + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIntentsResponse + * @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.dialogflow.cx.v3beta1.ListIntentsResponse; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIntentsResponse + * @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.dialogflow.cx.v3beta1.ListIntentsResponse; + + /** + * Verifies a ListIntentsResponse 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 ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIntentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse; + + /** + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * @param message ListIntentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListIntentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListIntentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIntentRequest. */ + interface IGetIntentRequest { + + /** GetIntentRequest name */ + name?: (string|null); + + /** GetIntentRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetIntentRequest. */ + class GetIntentRequest implements IGetIntentRequest { + + /** + * Constructs a new GetIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest); + + /** GetIntentRequest name. */ + public name: string; + + /** GetIntentRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest): google.cloud.dialogflow.cx.v3beta1.GetIntentRequest; + + /** + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIntentRequest + * @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.dialogflow.cx.v3beta1.GetIntentRequest; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIntentRequest + * @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.dialogflow.cx.v3beta1.GetIntentRequest; + + /** + * Verifies a GetIntentRequest 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 GetIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetIntentRequest; + + /** + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @param message GetIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateIntentRequest. */ + interface ICreateIntentRequest { + + /** CreateIntentRequest parent */ + parent?: (string|null); + + /** CreateIntentRequest intent */ + intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** CreateIntentRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateIntentRequest. */ + class CreateIntentRequest implements ICreateIntentRequest { + + /** + * Constructs a new CreateIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest); + + /** CreateIntentRequest parent. */ + public parent: string; + + /** CreateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** CreateIntentRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest): google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest; + + /** + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateIntentRequest + * @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.dialogflow.cx.v3beta1.CreateIntentRequest; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateIntentRequest + * @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.dialogflow.cx.v3beta1.CreateIntentRequest; + + /** + * Verifies a CreateIntentRequest 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 CreateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest; + + /** + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * @param message CreateIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateIntentRequest. */ + interface IUpdateIntentRequest { + + /** UpdateIntentRequest intent */ + intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** UpdateIntentRequest languageCode */ + languageCode?: (string|null); + + /** UpdateIntentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateIntentRequest. */ + class UpdateIntentRequest implements IUpdateIntentRequest { + + /** + * Constructs a new UpdateIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest); + + /** UpdateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** UpdateIntentRequest languageCode. */ + public languageCode: string; + + /** UpdateIntentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest): google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest; + + /** + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateIntentRequest + * @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.dialogflow.cx.v3beta1.UpdateIntentRequest; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateIntentRequest + * @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.dialogflow.cx.v3beta1.UpdateIntentRequest; + + /** + * Verifies an UpdateIntentRequest 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 UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest; + + /** + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. + * @param message UpdateIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteIntentRequest. */ + interface IDeleteIntentRequest { + + /** DeleteIntentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteIntentRequest. */ + class DeleteIntentRequest implements IDeleteIntentRequest { + + /** + * Constructs a new DeleteIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest); + + /** DeleteIntentRequest name. */ + public name: string; + + /** + * Creates a new DeleteIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest): google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest; + + /** + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteIntentRequest + * @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.dialogflow.cx.v3beta1.DeleteIntentRequest; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteIntentRequest + * @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.dialogflow.cx.v3beta1.DeleteIntentRequest; + + /** + * Verifies a DeleteIntentRequest 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 DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest; + + /** + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. + * @param message DeleteIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IntentView enum. */ + enum IntentView { + INTENT_VIEW_UNSPECIFIED = 0, + INTENT_VIEW_PARTIAL = 1, + INTENT_VIEW_FULL = 2 + } + + /** Properties of an ImportIntentsRequest. */ + interface IImportIntentsRequest { + + /** ImportIntentsRequest parent */ + parent?: (string|null); + + /** ImportIntentsRequest intentsUri */ + intentsUri?: (string|null); + + /** ImportIntentsRequest intentsContent */ + intentsContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineSource|null); + + /** ImportIntentsRequest mergeOption */ + mergeOption?: (google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption|null); + } + + /** Represents an ImportIntentsRequest. */ + class ImportIntentsRequest implements IImportIntentsRequest { + + /** + * Constructs a new ImportIntentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest); + + /** ImportIntentsRequest parent. */ + public parent: string; + + /** ImportIntentsRequest intentsUri. */ + public intentsUri?: (string|null); + + /** ImportIntentsRequest intentsContent. */ + public intentsContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineSource|null); + + /** ImportIntentsRequest mergeOption. */ + public mergeOption: (google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption); + + /** ImportIntentsRequest intents. */ + public intents?: ("intentsUri"|"intentsContent"); + + /** + * Creates a new ImportIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportIntentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest): google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest; + + /** + * Encodes the specified ImportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.verify|verify} messages. + * @param message ImportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.verify|verify} messages. + * @param message ImportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportIntentsRequest + * @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.dialogflow.cx.v3beta1.ImportIntentsRequest; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportIntentsRequest + * @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.dialogflow.cx.v3beta1.ImportIntentsRequest; + + /** + * Verifies an ImportIntentsRequest 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 ImportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportIntentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest; + + /** + * Creates a plain object from an ImportIntentsRequest message. Also converts values to other types if specified. + * @param message ImportIntentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportIntentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportIntentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportIntentsRequest { + + /** MergeOption enum. */ + enum MergeOption { + MERGE_OPTION_UNSPECIFIED = 0, + REJECT = 1, + REPLACE = 2, + MERGE = 3, + RENAME = 4, + REPORT_CONFLICT = 5, + KEEP = 6 + } + } + + /** Properties of an ImportIntentsResponse. */ + interface IImportIntentsResponse { + + /** ImportIntentsResponse intents */ + intents?: (string[]|null); + + /** ImportIntentsResponse conflictingResources */ + conflictingResources?: (google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources|null); + } + + /** Represents an ImportIntentsResponse. */ + class ImportIntentsResponse implements IImportIntentsResponse { + + /** + * Constructs a new ImportIntentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse); + + /** ImportIntentsResponse intents. */ + public intents: string[]; + + /** ImportIntentsResponse conflictingResources. */ + public conflictingResources?: (google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources|null); + + /** + * Creates a new ImportIntentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportIntentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse): google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse; + + /** + * Encodes the specified ImportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.verify|verify} messages. + * @param message ImportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.verify|verify} messages. + * @param message ImportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportIntentsResponse + * @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.dialogflow.cx.v3beta1.ImportIntentsResponse; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportIntentsResponse + * @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.dialogflow.cx.v3beta1.ImportIntentsResponse; + + /** + * Verifies an ImportIntentsResponse 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 ImportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportIntentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse; + + /** + * Creates a plain object from an ImportIntentsResponse message. Also converts values to other types if specified. + * @param message ImportIntentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportIntentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportIntentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportIntentsResponse { + + /** Properties of a ConflictingResources. */ + interface IConflictingResources { + + /** ConflictingResources intentDisplayNames */ + intentDisplayNames?: (string[]|null); + + /** ConflictingResources entityDisplayNames */ + entityDisplayNames?: (string[]|null); + } + + /** Represents a ConflictingResources. */ + class ConflictingResources implements IConflictingResources { + + /** + * Constructs a new ConflictingResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources); + + /** ConflictingResources intentDisplayNames. */ + public intentDisplayNames: string[]; + + /** ConflictingResources entityDisplayNames. */ + public entityDisplayNames: string[]; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ConflictingResources instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources): google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConflictingResources + * @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.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConflictingResources + * @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.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources; + + /** + * Verifies a ConflictingResources 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 ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConflictingResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @param message ConflictingResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConflictingResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConflictingResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportIntentsMetadata. */ + interface IImportIntentsMetadata { + } + + /** Represents an ImportIntentsMetadata. */ + class ImportIntentsMetadata implements IImportIntentsMetadata { + + /** + * Constructs a new ImportIntentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata); + + /** + * Creates a new ImportIntentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportIntentsMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata): google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata; + + /** + * Encodes the specified ImportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata.verify|verify} messages. + * @param message ImportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata.verify|verify} messages. + * @param message ImportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportIntentsMetadata + * @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.dialogflow.cx.v3beta1.ImportIntentsMetadata; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportIntentsMetadata + * @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.dialogflow.cx.v3beta1.ImportIntentsMetadata; + + /** + * Verifies an ImportIntentsMetadata 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 ImportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportIntentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata; + + /** + * Creates a plain object from an ImportIntentsMetadata message. Also converts values to other types if specified. + * @param message ImportIntentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportIntentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportIntentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportIntentsRequest. */ + interface IExportIntentsRequest { + + /** ExportIntentsRequest parent */ + parent?: (string|null); + + /** ExportIntentsRequest intents */ + intents?: (string[]|null); + + /** ExportIntentsRequest intentsUri */ + intentsUri?: (string|null); + + /** ExportIntentsRequest intentsContentInline */ + intentsContentInline?: (boolean|null); + + /** ExportIntentsRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat|null); + } + + /** Represents an ExportIntentsRequest. */ + class ExportIntentsRequest implements IExportIntentsRequest { + + /** + * Constructs a new ExportIntentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest); + + /** ExportIntentsRequest parent. */ + public parent: string; + + /** ExportIntentsRequest intents. */ + public intents: string[]; + + /** ExportIntentsRequest intentsUri. */ + public intentsUri?: (string|null); + + /** ExportIntentsRequest intentsContentInline. */ + public intentsContentInline?: (boolean|null); + + /** ExportIntentsRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat); + + /** ExportIntentsRequest destination. */ + public destination?: ("intentsUri"|"intentsContentInline"); + + /** + * Creates a new ExportIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIntentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest): google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest; + + /** + * Encodes the specified ExportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.verify|verify} messages. + * @param message ExportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.verify|verify} messages. + * @param message ExportIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIntentsRequest + * @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.dialogflow.cx.v3beta1.ExportIntentsRequest; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIntentsRequest + * @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.dialogflow.cx.v3beta1.ExportIntentsRequest; + + /** + * Verifies an ExportIntentsRequest 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 ExportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIntentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest; + + /** + * Creates a plain object from an ExportIntentsRequest message. Also converts values to other types if specified. + * @param message ExportIntentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIntentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIntentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportIntentsRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON = 2, + CSV = 3 + } + } + + /** Properties of an ExportIntentsResponse. */ + interface IExportIntentsResponse { + + /** ExportIntentsResponse intentsUri */ + intentsUri?: (string|null); + + /** ExportIntentsResponse intentsContent */ + intentsContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null); + } + + /** Represents an ExportIntentsResponse. */ + class ExportIntentsResponse implements IExportIntentsResponse { + + /** + * Constructs a new ExportIntentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse); + + /** ExportIntentsResponse intentsUri. */ + public intentsUri?: (string|null); + + /** ExportIntentsResponse intentsContent. */ + public intentsContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null); + + /** ExportIntentsResponse intents. */ + public intents?: ("intentsUri"|"intentsContent"); + + /** + * Creates a new ExportIntentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIntentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse): google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse; + + /** + * Encodes the specified ExportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse.verify|verify} messages. + * @param message ExportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse.verify|verify} messages. + * @param message ExportIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIntentsResponse + * @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.dialogflow.cx.v3beta1.ExportIntentsResponse; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIntentsResponse + * @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.dialogflow.cx.v3beta1.ExportIntentsResponse; + + /** + * Verifies an ExportIntentsResponse 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 ExportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIntentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse; + + /** + * Creates a plain object from an ExportIntentsResponse message. Also converts values to other types if specified. + * @param message ExportIntentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIntentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIntentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportIntentsMetadata. */ + interface IExportIntentsMetadata { + } + + /** Represents an ExportIntentsMetadata. */ + class ExportIntentsMetadata implements IExportIntentsMetadata { + + /** + * Constructs a new ExportIntentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata); + + /** + * Creates a new ExportIntentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIntentsMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata): google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata; + + /** + * Encodes the specified ExportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata.verify|verify} messages. + * @param message ExportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata.verify|verify} messages. + * @param message ExportIntentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIntentsMetadata + * @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.dialogflow.cx.v3beta1.ExportIntentsMetadata; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIntentsMetadata + * @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.dialogflow.cx.v3beta1.ExportIntentsMetadata; + + /** + * Verifies an ExportIntentsMetadata 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 ExportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIntentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata; + + /** + * Creates a plain object from an ExportIntentsMetadata message. Also converts values to other types if specified. + * @param message ExportIntentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIntentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIntentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InlineDestination. */ + interface IInlineDestination { + + /** InlineDestination content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an InlineDestination. */ + class InlineDestination implements IInlineDestination { + + /** + * Constructs a new InlineDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IInlineDestination); + + /** InlineDestination content. */ + public content: (Uint8Array|Buffer|string); + + /** + * Creates a new InlineDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineDestination instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IInlineDestination): google.cloud.dialogflow.cx.v3beta1.InlineDestination; + + /** + * Encodes the specified InlineDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineDestination.verify|verify} messages. + * @param message InlineDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IInlineDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineDestination.verify|verify} messages. + * @param message InlineDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IInlineDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineDestination + * @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.dialogflow.cx.v3beta1.InlineDestination; + + /** + * Decodes an InlineDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineDestination + * @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.dialogflow.cx.v3beta1.InlineDestination; + + /** + * Verifies an InlineDestination 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 InlineDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.InlineDestination; + + /** + * Creates a plain object from an InlineDestination message. Also converts values to other types if specified. + * @param message InlineDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.InlineDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InlineSource. */ + interface IInlineSource { + + /** InlineSource content */ + content?: (Uint8Array|Buffer|string|null); + } + + /** Represents an InlineSource. */ + class InlineSource implements IInlineSource { + + /** + * Constructs a new InlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IInlineSource); + + /** InlineSource content. */ + public content: (Uint8Array|Buffer|string); + + /** + * Creates a new InlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSource instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IInlineSource): google.cloud.dialogflow.cx.v3beta1.InlineSource; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSource + * @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.dialogflow.cx.v3beta1.InlineSource; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSource + * @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.dialogflow.cx.v3beta1.InlineSource; + + /** + * Verifies an InlineSource 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 InlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.InlineSource; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @param message InlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.InlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Sessions */ + class Sessions extends $protobuf.rpc.Service { + + /** + * Constructs a new Sessions service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Sessions service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Sessions; + + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectIntentResponse + */ + public detectIntent(request: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntentCallback): void; + + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @returns Promise + */ + public detectIntent(request: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest): Promise; + + /** + * Calls ServerStreamingDetectIntent. + * @param request DetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectIntentResponse + */ + public serverStreamingDetectIntent(request: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Sessions.ServerStreamingDetectIntentCallback): void; + + /** + * Calls ServerStreamingDetectIntent. + * @param request DetectIntentRequest message or plain object + * @returns Promise + */ + public serverStreamingDetectIntent(request: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest): Promise; + + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + */ + public streamingDetectIntent(request: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntentCallback): void; + + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @returns Promise + */ + public streamingDetectIntent(request: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest): Promise; + + /** + * Calls MatchIntent. + * @param request MatchIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MatchIntentResponse + */ + public matchIntent(request: google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntentCallback): void; + + /** + * Calls MatchIntent. + * @param request MatchIntentRequest message or plain object + * @returns Promise + */ + public matchIntent(request: google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest): Promise; + + /** + * Calls FulfillIntent. + * @param request FulfillIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FulfillIntentResponse + */ + public fulfillIntent(request: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Sessions.FulfillIntentCallback): void; + + /** + * Calls FulfillIntent. + * @param request FulfillIntentRequest message or plain object + * @returns Promise + */ + public fulfillIntent(request: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest): Promise; + + /** + * Calls SubmitAnswerFeedback. + * @param request SubmitAnswerFeedbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnswerFeedback + */ + public submitAnswerFeedback(request: google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest, callback: google.cloud.dialogflow.cx.v3beta1.Sessions.SubmitAnswerFeedbackCallback): void; + + /** + * Calls SubmitAnswerFeedback. + * @param request SubmitAnswerFeedbackRequest message or plain object + * @returns Promise + */ + public submitAnswerFeedback(request: google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest): Promise; + } + + namespace Sessions { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|detectIntent}. + * @param error Error, if any + * @param [response] DetectIntentResponse + */ + type DetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|serverStreamingDetectIntent}. + * @param error Error, if any + * @param [response] DetectIntentResponse + */ + type ServerStreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|streamingDetectIntent}. + * @param error Error, if any + * @param [response] StreamingDetectIntentResponse + */ + type StreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|matchIntent}. + * @param error Error, if any + * @param [response] MatchIntentResponse + */ + type MatchIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|fulfillIntent}. + * @param error Error, if any + * @param [response] FulfillIntentResponse + */ + type FulfillIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|submitAnswerFeedback}. + * @param error Error, if any + * @param [response] AnswerFeedback + */ + type SubmitAnswerFeedbackCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.AnswerFeedback) => void; + } + + /** Properties of an AnswerFeedback. */ + interface IAnswerFeedback { + + /** AnswerFeedback rating */ + rating?: (google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating|keyof typeof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating|null); + + /** AnswerFeedback ratingReason */ + ratingReason?: (google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason|null); + + /** AnswerFeedback customRating */ + customRating?: (string|null); + } + + /** Represents an AnswerFeedback. */ + class AnswerFeedback implements IAnswerFeedback { + + /** + * Constructs a new AnswerFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback); + + /** AnswerFeedback rating. */ + public rating: (google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating|keyof typeof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating); + + /** AnswerFeedback ratingReason. */ + public ratingReason?: (google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason|null); + + /** AnswerFeedback customRating. */ + public customRating: string; + + /** + * Creates a new AnswerFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerFeedback instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback): google.cloud.dialogflow.cx.v3beta1.AnswerFeedback; + + /** + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerFeedback + * @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.dialogflow.cx.v3beta1.AnswerFeedback; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerFeedback + * @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.dialogflow.cx.v3beta1.AnswerFeedback; + + /** + * Verifies an AnswerFeedback 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 AnswerFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerFeedback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AnswerFeedback; + + /** + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. + * @param message AnswerFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AnswerFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnswerFeedback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnswerFeedback { + + /** Rating enum. */ + enum Rating { + RATING_UNSPECIFIED = 0, + THUMBS_UP = 1, + THUMBS_DOWN = 2 + } + + /** Properties of a RatingReason. */ + interface IRatingReason { + + /** RatingReason reasonLabels */ + reasonLabels?: (string[]|null); + + /** RatingReason feedback */ + feedback?: (string|null); + } + + /** Represents a RatingReason. */ + class RatingReason implements IRatingReason { + + /** + * Constructs a new RatingReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason); + + /** RatingReason reasonLabels. */ + public reasonLabels: string[]; + + /** RatingReason feedback. */ + public feedback: string; + + /** + * Creates a new RatingReason instance using the specified properties. + * @param [properties] Properties to set + * @returns RatingReason instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason): google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason; + + /** + * Encodes the specified RatingReason message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.verify|verify} messages. + * @param message RatingReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RatingReason message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.verify|verify} messages. + * @param message RatingReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RatingReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RatingReason + * @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.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason; + + /** + * Decodes a RatingReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RatingReason + * @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.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason; + + /** + * Verifies a RatingReason 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 RatingReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RatingReason + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason; + + /** + * Creates a plain object from a RatingReason message. Also converts values to other types if specified. + * @param message RatingReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RatingReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RatingReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SubmitAnswerFeedbackRequest. */ + interface ISubmitAnswerFeedbackRequest { + + /** SubmitAnswerFeedbackRequest session */ + session?: (string|null); + + /** SubmitAnswerFeedbackRequest responseId */ + responseId?: (string|null); + + /** SubmitAnswerFeedbackRequest answerFeedback */ + answerFeedback?: (google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null); + + /** SubmitAnswerFeedbackRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SubmitAnswerFeedbackRequest. */ + class SubmitAnswerFeedbackRequest implements ISubmitAnswerFeedbackRequest { + + /** + * Constructs a new SubmitAnswerFeedbackRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest); + + /** SubmitAnswerFeedbackRequest session. */ + public session: string; + + /** SubmitAnswerFeedbackRequest responseId. */ + public responseId: string; + + /** SubmitAnswerFeedbackRequest answerFeedback. */ + public answerFeedback?: (google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null); + + /** SubmitAnswerFeedbackRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SubmitAnswerFeedbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubmitAnswerFeedbackRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest): google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @param message SubmitAnswerFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @param message SubmitAnswerFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubmitAnswerFeedbackRequest + * @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.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubmitAnswerFeedbackRequest + * @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.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest; + + /** + * Verifies a SubmitAnswerFeedbackRequest 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 SubmitAnswerFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubmitAnswerFeedbackRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest; + + /** + * Creates a plain object from a SubmitAnswerFeedbackRequest message. Also converts values to other types if specified. + * @param message SubmitAnswerFeedbackRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubmitAnswerFeedbackRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubmitAnswerFeedbackRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectIntentRequest. */ + interface IDetectIntentRequest { + + /** DetectIntentRequest session */ + session?: (string|null); + + /** DetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null); + + /** DetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** DetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** DetectIntentRequest responseView */ + responseView?: (google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|null); + } + + /** Represents a DetectIntentRequest. */ + class DetectIntentRequest implements IDetectIntentRequest { + + /** + * Constructs a new DetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest); + + /** DetectIntentRequest session. */ + public session: string; + + /** DetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null); + + /** DetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** DetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** DetectIntentRequest responseView. */ + public responseView: (google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView); + + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest): google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest; + + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentRequest + * @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.dialogflow.cx.v3beta1.DetectIntentRequest; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentRequest + * @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.dialogflow.cx.v3beta1.DetectIntentRequest; + + /** + * Verifies a DetectIntentRequest 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 DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest; + + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @param message DetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectIntentResponse. */ + interface IDetectIntentResponse { + + /** DetectIntentResponse responseId */ + responseId?: (string|null); + + /** DetectIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.cx.v3beta1.IQueryResult|null); + + /** DetectIntentResponse outputAudio */ + outputAudio?: (Uint8Array|Buffer|string|null); + + /** DetectIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** DetectIntentResponse responseType */ + responseType?: (google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType|null); + + /** DetectIntentResponse allowCancellation */ + allowCancellation?: (boolean|null); + } + + /** Represents a DetectIntentResponse. */ + class DetectIntentResponse implements IDetectIntentResponse { + + /** + * Constructs a new DetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse); + + /** DetectIntentResponse responseId. */ + public responseId: string; + + /** DetectIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.cx.v3beta1.IQueryResult|null); + + /** DetectIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|Buffer|string); + + /** DetectIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** DetectIntentResponse responseType. */ + public responseType: (google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType); + + /** DetectIntentResponse allowCancellation. */ + public allowCancellation: boolean; + + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse): google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse; + + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentResponse + * @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.dialogflow.cx.v3beta1.DetectIntentResponse; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentResponse + * @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.dialogflow.cx.v3beta1.DetectIntentResponse; + + /** + * Verifies a DetectIntentResponse 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 DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse; + + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @param message DetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DetectIntentResponse { + + /** ResponseType enum. */ + enum ResponseType { + RESPONSE_TYPE_UNSPECIFIED = 0, + PARTIAL = 1, + FINAL = 2 + } + } + + /** Properties of a StreamingDetectIntentRequest. */ + interface IStreamingDetectIntentRequest { + + /** StreamingDetectIntentRequest session */ + session?: (string|null); + + /** StreamingDetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null); + + /** StreamingDetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** StreamingDetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** StreamingDetectIntentRequest enablePartialResponse */ + enablePartialResponse?: (boolean|null); + + /** StreamingDetectIntentRequest enableDebuggingInfo */ + enableDebuggingInfo?: (boolean|null); + + /** StreamingDetectIntentRequest responseView */ + responseView?: (google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|null); + } + + /** Represents a StreamingDetectIntentRequest. */ + class StreamingDetectIntentRequest implements IStreamingDetectIntentRequest { + + /** + * Constructs a new StreamingDetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest); + + /** StreamingDetectIntentRequest session. */ + public session: string; + + /** StreamingDetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null); + + /** StreamingDetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** StreamingDetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** StreamingDetectIntentRequest enablePartialResponse. */ + public enablePartialResponse: boolean; + + /** StreamingDetectIntentRequest enableDebuggingInfo. */ + public enableDebuggingInfo: boolean; + + /** StreamingDetectIntentRequest responseView. */ + public responseView: (google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|keyof typeof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView); + + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest): google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; + + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentRequest + * @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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentRequest + * @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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; + + /** + * Verifies a StreamingDetectIntentRequest 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 StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; + + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @param message StreamingDetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingDetectIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudConversationDebuggingInfo. */ + interface ICloudConversationDebuggingInfo { + + /** CloudConversationDebuggingInfo audioDataChunks */ + audioDataChunks?: (number|null); + + /** CloudConversationDebuggingInfo resultEndTimeOffset */ + resultEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo firstAudioDuration */ + firstAudioDuration?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo singleUtterance */ + singleUtterance?: (boolean|null); + + /** CloudConversationDebuggingInfo speechPartialResultsEndTimes */ + speechPartialResultsEndTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo speechFinalResultsEndTimes */ + speechFinalResultsEndTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo partialResponses */ + partialResponses?: (number|null); + + /** CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset */ + speakerIdPassiveLatencyMsOffset?: (number|null); + + /** CloudConversationDebuggingInfo bargeinEventTriggered */ + bargeinEventTriggered?: (boolean|null); + + /** CloudConversationDebuggingInfo speechSingleUtterance */ + speechSingleUtterance?: (boolean|null); + + /** CloudConversationDebuggingInfo dtmfPartialResultsTimes */ + dtmfPartialResultsTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo dtmfFinalResultsTimes */ + dtmfFinalResultsTimes?: (google.protobuf.IDuration[]|null); + + /** CloudConversationDebuggingInfo singleUtteranceEndTimeOffset */ + singleUtteranceEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo noSpeechTimeout */ + noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo endpointingTimeout */ + endpointingTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo isInputText */ + isInputText?: (boolean|null); + + /** CloudConversationDebuggingInfo clientHalfCloseTimeOffset */ + clientHalfCloseTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset */ + clientHalfCloseStreamingTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a CloudConversationDebuggingInfo. */ + class CloudConversationDebuggingInfo implements ICloudConversationDebuggingInfo { + + /** + * Constructs a new CloudConversationDebuggingInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo); + + /** CloudConversationDebuggingInfo audioDataChunks. */ + public audioDataChunks: number; + + /** CloudConversationDebuggingInfo resultEndTimeOffset. */ + public resultEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo firstAudioDuration. */ + public firstAudioDuration?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo singleUtterance. */ + public singleUtterance: boolean; + + /** CloudConversationDebuggingInfo speechPartialResultsEndTimes. */ + public speechPartialResultsEndTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo speechFinalResultsEndTimes. */ + public speechFinalResultsEndTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo partialResponses. */ + public partialResponses: number; + + /** CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset. */ + public speakerIdPassiveLatencyMsOffset: number; + + /** CloudConversationDebuggingInfo bargeinEventTriggered. */ + public bargeinEventTriggered: boolean; + + /** CloudConversationDebuggingInfo speechSingleUtterance. */ + public speechSingleUtterance: boolean; + + /** CloudConversationDebuggingInfo dtmfPartialResultsTimes. */ + public dtmfPartialResultsTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo dtmfFinalResultsTimes. */ + public dtmfFinalResultsTimes: google.protobuf.IDuration[]; + + /** CloudConversationDebuggingInfo singleUtteranceEndTimeOffset. */ + public singleUtteranceEndTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo noSpeechTimeout. */ + public noSpeechTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo endpointingTimeout. */ + public endpointingTimeout?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo isInputText. */ + public isInputText: boolean; + + /** CloudConversationDebuggingInfo clientHalfCloseTimeOffset. */ + public clientHalfCloseTimeOffset?: (google.protobuf.IDuration|null); + + /** CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset. */ + public clientHalfCloseStreamingTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new CloudConversationDebuggingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudConversationDebuggingInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo): google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo; + + /** + * Encodes the specified CloudConversationDebuggingInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.verify|verify} messages. + * @param message CloudConversationDebuggingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudConversationDebuggingInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.verify|verify} messages. + * @param message CloudConversationDebuggingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudConversationDebuggingInfo + * @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.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudConversationDebuggingInfo + * @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.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo; + + /** + * Verifies a CloudConversationDebuggingInfo 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 CloudConversationDebuggingInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudConversationDebuggingInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo; + + /** + * Creates a plain object from a CloudConversationDebuggingInfo message. Also converts values to other types if specified. + * @param message CloudConversationDebuggingInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudConversationDebuggingInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudConversationDebuggingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingDetectIntentResponse. */ + interface IStreamingDetectIntentResponse { + + /** StreamingDetectIntentResponse recognitionResult */ + recognitionResult?: (google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult|null); + + /** StreamingDetectIntentResponse detectIntentResponse */ + detectIntentResponse?: (google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null); + + /** StreamingDetectIntentResponse debuggingInfo */ + debuggingInfo?: (google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo|null); + } + + /** Represents a StreamingDetectIntentResponse. */ + class StreamingDetectIntentResponse implements IStreamingDetectIntentResponse { + + /** + * Constructs a new StreamingDetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse); + + /** StreamingDetectIntentResponse recognitionResult. */ + public recognitionResult?: (google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult|null); + + /** StreamingDetectIntentResponse detectIntentResponse. */ + public detectIntentResponse?: (google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null); + + /** StreamingDetectIntentResponse debuggingInfo. */ + public debuggingInfo?: (google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo|null); + + /** StreamingDetectIntentResponse response. */ + public response?: ("recognitionResult"|"detectIntentResponse"); + + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse): google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; + + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentResponse + * @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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentResponse + * @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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; + + /** + * Verifies a StreamingDetectIntentResponse 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 StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; + + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @param message StreamingDetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingDetectIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { + + /** StreamingRecognitionResult messageType */ + messageType?: (google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType|null); + + /** StreamingRecognitionResult transcript */ + transcript?: (string|null); + + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); + + /** StreamingRecognitionResult confidence */ + confidence?: (number|null); + + /** StreamingRecognitionResult stability */ + stability?: (number|null); + + /** StreamingRecognitionResult speechWordInfo */ + speechWordInfo?: (google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo[]|null); + + /** StreamingRecognitionResult speechEndOffset */ + speechEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { + + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult); + + /** StreamingRecognitionResult messageType. */ + public messageType: (google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType); + + /** StreamingRecognitionResult transcript. */ + public transcript: string; + + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; + + /** StreamingRecognitionResult confidence. */ + public confidence: number; + + /** StreamingRecognitionResult stability. */ + public stability: number; + + /** StreamingRecognitionResult speechWordInfo. */ + public speechWordInfo: google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo[]; + + /** StreamingRecognitionResult speechEndOffset. */ + public speechEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult): google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @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.dialogflow.cx.v3beta1.StreamingRecognitionResult; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @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.dialogflow.cx.v3beta1.StreamingRecognitionResult; + + /** + * Verifies a StreamingRecognitionResult 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 StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognitionResult { + + /** MessageType enum. */ + enum MessageType { + MESSAGE_TYPE_UNSPECIFIED = 0, + TRANSCRIPT = 1, + END_OF_SINGLE_UTTERANCE = 2 + } + } + + /** Properties of a QueryParameters. */ + interface IQueryParameters { + + /** QueryParameters timeZone */ + timeZone?: (string|null); + + /** QueryParameters geoLocation */ + geoLocation?: (google.type.ILatLng|null); + + /** QueryParameters sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[]|null); + + /** QueryParameters payload */ + payload?: (google.protobuf.IStruct|null); + + /** QueryParameters parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** QueryParameters parameterScope */ + parameterScope?: (string|null); + + /** QueryParameters currentPage */ + currentPage?: (string|null); + + /** QueryParameters disableWebhook */ + disableWebhook?: (boolean|null); + + /** QueryParameters analyzeQueryTextSentiment */ + analyzeQueryTextSentiment?: (boolean|null); + + /** QueryParameters webhookHeaders */ + webhookHeaders?: ({ [k: string]: string }|null); + + /** QueryParameters flowVersions */ + flowVersions?: (string[]|null); + + /** QueryParameters currentPlaybook */ + currentPlaybook?: (string|null); + + /** QueryParameters llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + + /** QueryParameters channel */ + channel?: (string|null); + + /** QueryParameters sessionTtl */ + sessionTtl?: (google.protobuf.IDuration|null); + + /** QueryParameters endUserMetadata */ + endUserMetadata?: (google.protobuf.IStruct|null); + + /** QueryParameters searchConfig */ + searchConfig?: (google.cloud.dialogflow.cx.v3beta1.ISearchConfig|null); + + /** QueryParameters populateDataStoreConnectionSignals */ + populateDataStoreConnectionSignals?: (boolean|null); + } + + /** Represents a QueryParameters. */ + class QueryParameters implements IQueryParameters { + + /** + * Constructs a new QueryParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IQueryParameters); + + /** QueryParameters timeZone. */ + public timeZone: string; + + /** QueryParameters geoLocation. */ + public geoLocation?: (google.type.ILatLng|null); + + /** QueryParameters sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[]; + + /** QueryParameters payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** QueryParameters parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** QueryParameters parameterScope. */ + public parameterScope: string; + + /** QueryParameters currentPage. */ + public currentPage: string; + + /** QueryParameters disableWebhook. */ + public disableWebhook: boolean; + + /** QueryParameters analyzeQueryTextSentiment. */ + public analyzeQueryTextSentiment: boolean; + + /** QueryParameters webhookHeaders. */ + public webhookHeaders: { [k: string]: string }; + + /** QueryParameters flowVersions. */ + public flowVersions: string[]; + + /** QueryParameters currentPlaybook. */ + public currentPlaybook: string; + + /** QueryParameters llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + + /** QueryParameters channel. */ + public channel: string; + + /** QueryParameters sessionTtl. */ + public sessionTtl?: (google.protobuf.IDuration|null); + + /** QueryParameters endUserMetadata. */ + public endUserMetadata?: (google.protobuf.IStruct|null); + + /** QueryParameters searchConfig. */ + public searchConfig?: (google.cloud.dialogflow.cx.v3beta1.ISearchConfig|null); + + /** QueryParameters populateDataStoreConnectionSignals. */ + public populateDataStoreConnectionSignals: boolean; + + /** + * Creates a new QueryParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameters instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IQueryParameters): google.cloud.dialogflow.cx.v3beta1.QueryParameters; + + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameters + * @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.dialogflow.cx.v3beta1.QueryParameters; + + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameters + * @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.dialogflow.cx.v3beta1.QueryParameters; + + /** + * Verifies a QueryParameters 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 QueryParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.QueryParameters; + + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @param message QueryParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.QueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchConfig. */ + interface ISearchConfig { + + /** SearchConfig boostSpecs */ + boostSpecs?: (google.cloud.dialogflow.cx.v3beta1.IBoostSpecs[]|null); + + /** SearchConfig filterSpecs */ + filterSpecs?: (google.cloud.dialogflow.cx.v3beta1.IFilterSpecs[]|null); + } + + /** Represents a SearchConfig. */ + class SearchConfig implements ISearchConfig { + + /** + * Constructs a new SearchConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISearchConfig); + + /** SearchConfig boostSpecs. */ + public boostSpecs: google.cloud.dialogflow.cx.v3beta1.IBoostSpecs[]; + + /** SearchConfig filterSpecs. */ + public filterSpecs: google.cloud.dialogflow.cx.v3beta1.IFilterSpecs[]; + + /** + * Creates a new SearchConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISearchConfig): google.cloud.dialogflow.cx.v3beta1.SearchConfig; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchConfig + * @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.dialogflow.cx.v3beta1.SearchConfig; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchConfig + * @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.dialogflow.cx.v3beta1.SearchConfig; + + /** + * Verifies a SearchConfig 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 SearchConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SearchConfig; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @param message SearchConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SearchConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec[]|null); + } + + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { + + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBoostSpec); + + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec[]; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBoostSpec): google.cloud.dialogflow.cx.v3beta1.BoostSpec; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @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.dialogflow.cx.v3beta1.BoostSpec; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @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.dialogflow.cx.v3beta1.BoostSpec; + + /** + * Verifies a BoostSpec 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 BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BoostSpec; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostSpec { + + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { + + /** ConditionBoostSpec condition */ + condition?: (string|null); + + /** ConditionBoostSpec boost */ + boost?: (number|null); + + /** ConditionBoostSpec boostControlSpec */ + boostControlSpec?: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + } + + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { + + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec); + + /** ConditionBoostSpec condition. */ + public condition: string; + + /** ConditionBoostSpec boost. */ + public boost: number; + + /** ConditionBoostSpec boostControlSpec. */ + public boostControlSpec?: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec): google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @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.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @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.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec; + + /** + * Verifies a ConditionBoostSpec 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 ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionBoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionBoostSpec { + + /** Properties of a BoostControlSpec. */ + interface IBoostControlSpec { + + /** BoostControlSpec fieldName */ + fieldName?: (string|null); + + /** BoostControlSpec attributeType */ + attributeType?: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); + + /** BoostControlSpec interpolationType */ + interpolationType?: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); + + /** BoostControlSpec controlPoints */ + controlPoints?: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); + } + + /** Represents a BoostControlSpec. */ + class BoostControlSpec implements IBoostControlSpec { + + /** + * Constructs a new BoostControlSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec); + + /** BoostControlSpec fieldName. */ + public fieldName: string; + + /** BoostControlSpec attributeType. */ + public attributeType: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); + + /** BoostControlSpec interpolationType. */ + public interpolationType: (google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); + + /** BoostControlSpec controlPoints. */ + public controlPoints: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostControlSpec instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostControlSpec + * @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.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostControlSpec + * @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.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Verifies a BoostControlSpec 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 BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostControlSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @param message BoostControlSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostControlSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostControlSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostControlSpec { + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + NUMERICAL = 1, + FRESHNESS = 2 + } + + /** InterpolationType enum. */ + enum InterpolationType { + INTERPOLATION_TYPE_UNSPECIFIED = 0, + LINEAR = 1 + } + + /** Properties of a ControlPoint. */ + interface IControlPoint { + + /** ControlPoint attributeValue */ + attributeValue?: (string|null); + + /** ControlPoint boostAmount */ + boostAmount?: (number|null); + } + + /** Represents a ControlPoint. */ + class ControlPoint implements IControlPoint { + + /** + * Constructs a new ControlPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); + + /** ControlPoint attributeValue. */ + public attributeValue: string; + + /** ControlPoint boostAmount. */ + public boostAmount: number; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlPoint instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ControlPoint + * @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.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ControlPoint + * @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.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Verifies a ControlPoint 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 ControlPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ControlPoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @param message ControlPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ControlPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ControlPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Properties of a BoostSpecs. */ + interface IBoostSpecs { + + /** BoostSpecs dataStores */ + dataStores?: (string[]|null); + + /** BoostSpecs spec */ + spec?: (google.cloud.dialogflow.cx.v3beta1.IBoostSpec[]|null); + } + + /** Represents a BoostSpecs. */ + class BoostSpecs implements IBoostSpecs { + + /** + * Constructs a new BoostSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IBoostSpecs); + + /** BoostSpecs dataStores. */ + public dataStores: string[]; + + /** BoostSpecs spec. */ + public spec: google.cloud.dialogflow.cx.v3beta1.IBoostSpec[]; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpecs instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IBoostSpecs): google.cloud.dialogflow.cx.v3beta1.BoostSpecs; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpecs + * @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.dialogflow.cx.v3beta1.BoostSpecs; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpecs + * @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.dialogflow.cx.v3beta1.BoostSpecs; + + /** + * Verifies a BoostSpecs 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 BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.BoostSpecs; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @param message BoostSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FilterSpecs. */ + interface IFilterSpecs { + + /** FilterSpecs dataStores */ + dataStores?: (string[]|null); + + /** FilterSpecs filter */ + filter?: (string|null); + } + + /** Represents a FilterSpecs. */ + class FilterSpecs implements IFilterSpecs { + + /** + * Constructs a new FilterSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFilterSpecs); + + /** FilterSpecs dataStores. */ + public dataStores: string[]; + + /** FilterSpecs filter. */ + public filter: string; + + /** + * Creates a new FilterSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterSpecs instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFilterSpecs): google.cloud.dialogflow.cx.v3beta1.FilterSpecs; + + /** + * Encodes the specified FilterSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FilterSpecs.verify|verify} messages. + * @param message FilterSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFilterSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FilterSpecs.verify|verify} messages. + * @param message FilterSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFilterSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterSpecs + * @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.dialogflow.cx.v3beta1.FilterSpecs; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterSpecs + * @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.dialogflow.cx.v3beta1.FilterSpecs; + + /** + * Verifies a FilterSpecs 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 FilterSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FilterSpecs; + + /** + * Creates a plain object from a FilterSpecs message. Also converts values to other types if specified. + * @param message FilterSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FilterSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryInput. */ + interface IQueryInput { + + /** QueryInput text */ + text?: (google.cloud.dialogflow.cx.v3beta1.ITextInput|null); + + /** QueryInput intent */ + intent?: (google.cloud.dialogflow.cx.v3beta1.IIntentInput|null); + + /** QueryInput audio */ + audio?: (google.cloud.dialogflow.cx.v3beta1.IAudioInput|null); + + /** QueryInput event */ + event?: (google.cloud.dialogflow.cx.v3beta1.IEventInput|null); + + /** QueryInput dtmf */ + dtmf?: (google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null); + + /** QueryInput toolCallResult */ + toolCallResult?: (google.cloud.dialogflow.cx.v3beta1.IToolCallResult|null); + + /** QueryInput languageCode */ + languageCode?: (string|null); + } + + /** Represents a QueryInput. */ + class QueryInput implements IQueryInput { + + /** + * Constructs a new QueryInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IQueryInput); + + /** QueryInput text. */ + public text?: (google.cloud.dialogflow.cx.v3beta1.ITextInput|null); + + /** QueryInput intent. */ + public intent?: (google.cloud.dialogflow.cx.v3beta1.IIntentInput|null); + + /** QueryInput audio. */ + public audio?: (google.cloud.dialogflow.cx.v3beta1.IAudioInput|null); + + /** QueryInput event. */ + public event?: (google.cloud.dialogflow.cx.v3beta1.IEventInput|null); + + /** QueryInput dtmf. */ + public dtmf?: (google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null); + + /** QueryInput toolCallResult. */ + public toolCallResult?: (google.cloud.dialogflow.cx.v3beta1.IToolCallResult|null); + + /** QueryInput languageCode. */ + public languageCode: string; + + /** QueryInput input. */ + public input?: ("text"|"intent"|"audio"|"event"|"dtmf"|"toolCallResult"); + + /** + * Creates a new QueryInput instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IQueryInput): google.cloud.dialogflow.cx.v3beta1.QueryInput; + + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInput + * @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.dialogflow.cx.v3beta1.QueryInput; + + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInput + * @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.dialogflow.cx.v3beta1.QueryInput; + + /** + * Verifies a QueryInput 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 QueryInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.QueryInput; + + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @param message QueryInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.QueryInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerativeInfo. */ + interface IGenerativeInfo { + + /** GenerativeInfo currentPlaybooks */ + currentPlaybooks?: (string[]|null); + + /** GenerativeInfo actionTracingInfo */ + actionTracingInfo?: (google.cloud.dialogflow.cx.v3beta1.IExample|null); + } + + /** Represents a GenerativeInfo. */ + class GenerativeInfo implements IGenerativeInfo { + + /** + * Constructs a new GenerativeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo); + + /** GenerativeInfo currentPlaybooks. */ + public currentPlaybooks: string[]; + + /** GenerativeInfo actionTracingInfo. */ + public actionTracingInfo?: (google.cloud.dialogflow.cx.v3beta1.IExample|null); + + /** + * Creates a new GenerativeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerativeInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo): google.cloud.dialogflow.cx.v3beta1.GenerativeInfo; + + /** + * Encodes the specified GenerativeInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.verify|verify} messages. + * @param message GenerativeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerativeInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.verify|verify} messages. + * @param message GenerativeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerativeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerativeInfo + * @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.dialogflow.cx.v3beta1.GenerativeInfo; + + /** + * Decodes a GenerativeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerativeInfo + * @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.dialogflow.cx.v3beta1.GenerativeInfo; + + /** + * Verifies a GenerativeInfo 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 GenerativeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerativeInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GenerativeInfo; + + /** + * Creates a plain object from a GenerativeInfo message. Also converts values to other types if specified. + * @param message GenerativeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GenerativeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerativeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerativeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryResult. */ + interface IQueryResult { + + /** QueryResult text */ + text?: (string|null); + + /** QueryResult triggerIntent */ + triggerIntent?: (string|null); + + /** QueryResult transcript */ + transcript?: (string|null); + + /** QueryResult triggerEvent */ + triggerEvent?: (string|null); + + /** QueryResult dtmf */ + dtmf?: (google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null); + + /** QueryResult languageCode */ + languageCode?: (string|null); + + /** QueryResult parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** QueryResult responseMessages */ + responseMessages?: (google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]|null); + + /** QueryResult webhookIds */ + webhookIds?: (string[]|null); + + /** QueryResult webhookDisplayNames */ + webhookDisplayNames?: (string[]|null); + + /** QueryResult webhookLatencies */ + webhookLatencies?: (google.protobuf.IDuration[]|null); + + /** QueryResult webhookTags */ + webhookTags?: (string[]|null); + + /** QueryResult webhookStatuses */ + webhookStatuses?: (google.rpc.IStatus[]|null); + + /** QueryResult webhookPayloads */ + webhookPayloads?: (google.protobuf.IStruct[]|null); + + /** QueryResult currentPage */ + currentPage?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** QueryResult currentFlow */ + currentFlow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + + /** QueryResult intent */ + intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** QueryResult intentDetectionConfidence */ + intentDetectionConfidence?: (number|null); + + /** QueryResult match */ + match?: (google.cloud.dialogflow.cx.v3beta1.IMatch|null); + + /** QueryResult diagnosticInfo */ + diagnosticInfo?: (google.protobuf.IStruct|null); + + /** QueryResult generativeInfo */ + generativeInfo?: (google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo|null); + + /** QueryResult sentimentAnalysisResult */ + sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult|null); + + /** QueryResult advancedSettings */ + advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** QueryResult allowAnswerFeedback */ + allowAnswerFeedback?: (boolean|null); + + /** QueryResult dataStoreConnectionSignals */ + dataStoreConnectionSignals?: (google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null); + + /** QueryResult traceBlocks */ + traceBlocks?: (google.cloud.dialogflow.cx.v3beta1.ITraceBlock[]|null); + } + + /** Represents a QueryResult. */ + class QueryResult implements IQueryResult { + + /** + * Constructs a new QueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IQueryResult); + + /** QueryResult text. */ + public text?: (string|null); + + /** QueryResult triggerIntent. */ + public triggerIntent?: (string|null); + + /** QueryResult transcript. */ + public transcript?: (string|null); + + /** QueryResult triggerEvent. */ + public triggerEvent?: (string|null); + + /** QueryResult dtmf. */ + public dtmf?: (google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null); + + /** QueryResult languageCode. */ + public languageCode: string; + + /** QueryResult parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** QueryResult responseMessages. */ + public responseMessages: google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]; + + /** QueryResult webhookIds. */ + public webhookIds: string[]; + + /** QueryResult webhookDisplayNames. */ + public webhookDisplayNames: string[]; + + /** QueryResult webhookLatencies. */ + public webhookLatencies: google.protobuf.IDuration[]; + + /** QueryResult webhookTags. */ + public webhookTags: string[]; + + /** QueryResult webhookStatuses. */ + public webhookStatuses: google.rpc.IStatus[]; + + /** QueryResult webhookPayloads. */ + public webhookPayloads: google.protobuf.IStruct[]; + + /** QueryResult currentPage. */ + public currentPage?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** QueryResult currentFlow. */ + public currentFlow?: (google.cloud.dialogflow.cx.v3beta1.IFlow|null); + + /** QueryResult intent. */ + public intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** QueryResult intentDetectionConfidence. */ + public intentDetectionConfidence: number; + + /** QueryResult match. */ + public match?: (google.cloud.dialogflow.cx.v3beta1.IMatch|null); + + /** QueryResult diagnosticInfo. */ + public diagnosticInfo?: (google.protobuf.IStruct|null); + + /** QueryResult generativeInfo. */ + public generativeInfo?: (google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo|null); + + /** QueryResult sentimentAnalysisResult. */ + public sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult|null); + + /** QueryResult advancedSettings. */ + public advancedSettings?: (google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null); + + /** QueryResult allowAnswerFeedback. */ + public allowAnswerFeedback: boolean; + + /** QueryResult dataStoreConnectionSignals. */ + public dataStoreConnectionSignals?: (google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null); + + /** QueryResult traceBlocks. */ + public traceBlocks: google.cloud.dialogflow.cx.v3beta1.ITraceBlock[]; + + /** QueryResult query. */ + public query?: ("text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmf"); + + /** + * Creates a new QueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IQueryResult): google.cloud.dialogflow.cx.v3beta1.QueryResult; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResult + * @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.dialogflow.cx.v3beta1.QueryResult; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResult + * @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.dialogflow.cx.v3beta1.QueryResult; + + /** + * Verifies a QueryResult 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 QueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.QueryResult; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @param message QueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextInput. */ + interface ITextInput { + + /** TextInput text */ + text?: (string|null); + } + + /** Represents a TextInput. */ + class TextInput implements ITextInput { + + /** + * Constructs a new TextInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITextInput); + + /** TextInput text. */ + public text: string; + + /** + * Creates a new TextInput instance using the specified properties. + * @param [properties] Properties to set + * @returns TextInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITextInput): google.cloud.dialogflow.cx.v3beta1.TextInput; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextInput + * @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.dialogflow.cx.v3beta1.TextInput; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextInput + * @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.dialogflow.cx.v3beta1.TextInput; + + /** + * Verifies a TextInput 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 TextInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TextInput; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @param message TextInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TextInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntentInput. */ + interface IIntentInput { + + /** IntentInput intent */ + intent?: (string|null); + } + + /** Represents an IntentInput. */ + class IntentInput implements IIntentInput { + + /** + * Constructs a new IntentInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IIntentInput); + + /** IntentInput intent. */ + public intent: string; + + /** + * Creates a new IntentInput instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IIntentInput): google.cloud.dialogflow.cx.v3beta1.IntentInput; + + /** + * Encodes the specified IntentInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentInput.verify|verify} messages. + * @param message IntentInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IIntentInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentInput.verify|verify} messages. + * @param message IntentInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IIntentInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentInput + * @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.dialogflow.cx.v3beta1.IntentInput; + + /** + * Decodes an IntentInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentInput + * @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.dialogflow.cx.v3beta1.IntentInput; + + /** + * Verifies an IntentInput 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 IntentInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.IntentInput; + + /** + * Creates a plain object from an IntentInput message. Also converts values to other types if specified. + * @param message IntentInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.IntentInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioInput. */ + interface IAudioInput { + + /** AudioInput config */ + config?: (google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig|null); + + /** AudioInput audio */ + audio?: (Uint8Array|Buffer|string|null); + } + + /** Represents an AudioInput. */ + class AudioInput implements IAudioInput { + + /** + * Constructs a new AudioInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IAudioInput); + + /** AudioInput config. */ + public config?: (google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig|null); + + /** AudioInput audio. */ + public audio: (Uint8Array|Buffer|string); + + /** + * Creates a new AudioInput instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IAudioInput): google.cloud.dialogflow.cx.v3beta1.AudioInput; + + /** + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioInput + * @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.dialogflow.cx.v3beta1.AudioInput; + + /** + * Decodes an AudioInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioInput + * @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.dialogflow.cx.v3beta1.AudioInput; + + /** + * Verifies an AudioInput 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 AudioInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AudioInput; + + /** + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. + * @param message AudioInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AudioInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EventInput. */ + interface IEventInput { + + /** EventInput event */ + event?: (string|null); + } + + /** Represents an EventInput. */ + class EventInput implements IEventInput { + + /** + * Constructs a new EventInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IEventInput); + + /** EventInput event. */ + public event: string; + + /** + * Creates a new EventInput instance using the specified properties. + * @param [properties] Properties to set + * @returns EventInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IEventInput): google.cloud.dialogflow.cx.v3beta1.EventInput; + + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventInput + * @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.dialogflow.cx.v3beta1.EventInput; + + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventInput + * @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.dialogflow.cx.v3beta1.EventInput; + + /** + * Verifies an EventInput 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 EventInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.EventInput; + + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @param message EventInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.EventInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DtmfInput. */ + interface IDtmfInput { + + /** DtmfInput digits */ + digits?: (string|null); + + /** DtmfInput finishDigit */ + finishDigit?: (string|null); + } + + /** Represents a DtmfInput. */ + class DtmfInput implements IDtmfInput { + + /** + * Constructs a new DtmfInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDtmfInput); + + /** DtmfInput digits. */ + public digits: string; + + /** DtmfInput finishDigit. */ + public finishDigit: string; + + /** + * Creates a new DtmfInput instance using the specified properties. + * @param [properties] Properties to set + * @returns DtmfInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDtmfInput): google.cloud.dialogflow.cx.v3beta1.DtmfInput; + + /** + * Encodes the specified DtmfInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DtmfInput.verify|verify} messages. + * @param message DtmfInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDtmfInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DtmfInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DtmfInput.verify|verify} messages. + * @param message DtmfInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDtmfInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DtmfInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DtmfInput + * @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.dialogflow.cx.v3beta1.DtmfInput; + + /** + * Decodes a DtmfInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DtmfInput + * @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.dialogflow.cx.v3beta1.DtmfInput; + + /** + * Verifies a DtmfInput 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 DtmfInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DtmfInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DtmfInput; + + /** + * Creates a plain object from a DtmfInput message. Also converts values to other types if specified. + * @param message DtmfInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DtmfInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DtmfInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DtmfInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Match. */ + interface IMatch { + + /** Match intent */ + intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** Match event */ + event?: (string|null); + + /** Match parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** Match resolvedInput */ + resolvedInput?: (string|null); + + /** Match matchType */ + matchType?: (google.cloud.dialogflow.cx.v3beta1.Match.MatchType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Match.MatchType|null); + + /** Match confidence */ + confidence?: (number|null); + } + + /** Represents a Match. */ + class Match implements IMatch { + + /** + * Constructs a new Match. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IMatch); + + /** Match intent. */ + public intent?: (google.cloud.dialogflow.cx.v3beta1.IIntent|null); + + /** Match event. */ + public event: string; + + /** Match parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** Match resolvedInput. */ + public resolvedInput: string; + + /** Match matchType. */ + public matchType: (google.cloud.dialogflow.cx.v3beta1.Match.MatchType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Match.MatchType); + + /** Match confidence. */ + public confidence: number; + + /** + * Creates a new Match instance using the specified properties. + * @param [properties] Properties to set + * @returns Match instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IMatch): google.cloud.dialogflow.cx.v3beta1.Match; + + /** + * Encodes the specified Match message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Match.verify|verify} messages. + * @param message Match message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Match message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Match.verify|verify} messages. + * @param message Match message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Match message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Match + * @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.dialogflow.cx.v3beta1.Match; + + /** + * Decodes a Match message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Match + * @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.dialogflow.cx.v3beta1.Match; + + /** + * Verifies a Match 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 Match message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Match + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Match; + + /** + * Creates a plain object from a Match message. Also converts values to other types if specified. + * @param message Match + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Match, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Match to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Match + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Match { + + /** MatchType enum. */ + enum MatchType { + MATCH_TYPE_UNSPECIFIED = 0, + INTENT = 1, + DIRECT_INTENT = 2, + PARAMETER_FILLING = 3, + NO_MATCH = 4, + NO_INPUT = 5, + EVENT = 6, + KNOWLEDGE_CONNECTOR = 8, + PLAYBOOK = 9 + } + } + + /** Properties of a MatchIntentRequest. */ + interface IMatchIntentRequest { + + /** MatchIntentRequest session */ + session?: (string|null); + + /** MatchIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null); + + /** MatchIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** MatchIntentRequest persistParameterChanges */ + persistParameterChanges?: (boolean|null); + } + + /** Represents a MatchIntentRequest. */ + class MatchIntentRequest implements IMatchIntentRequest { + + /** + * Constructs a new MatchIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest); + + /** MatchIntentRequest session. */ + public session: string; + + /** MatchIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null); + + /** MatchIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.cx.v3beta1.IQueryInput|null); + + /** MatchIntentRequest persistParameterChanges. */ + public persistParameterChanges: boolean; + + /** + * Creates a new MatchIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest): google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest; + + /** + * Encodes the specified MatchIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.verify|verify} messages. + * @param message MatchIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.verify|verify} messages. + * @param message MatchIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchIntentRequest + * @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.dialogflow.cx.v3beta1.MatchIntentRequest; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchIntentRequest + * @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.dialogflow.cx.v3beta1.MatchIntentRequest; + + /** + * Verifies a MatchIntentRequest 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 MatchIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest; + + /** + * Creates a plain object from a MatchIntentRequest message. Also converts values to other types if specified. + * @param message MatchIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MatchIntentResponse. */ + interface IMatchIntentResponse { + + /** MatchIntentResponse text */ + text?: (string|null); + + /** MatchIntentResponse triggerIntent */ + triggerIntent?: (string|null); + + /** MatchIntentResponse transcript */ + transcript?: (string|null); + + /** MatchIntentResponse triggerEvent */ + triggerEvent?: (string|null); + + /** MatchIntentResponse matches */ + matches?: (google.cloud.dialogflow.cx.v3beta1.IMatch[]|null); + + /** MatchIntentResponse currentPage */ + currentPage?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + } + + /** Represents a MatchIntentResponse. */ + class MatchIntentResponse implements IMatchIntentResponse { + + /** + * Constructs a new MatchIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse); + + /** MatchIntentResponse text. */ + public text?: (string|null); + + /** MatchIntentResponse triggerIntent. */ + public triggerIntent?: (string|null); + + /** MatchIntentResponse transcript. */ + public transcript?: (string|null); + + /** MatchIntentResponse triggerEvent. */ + public triggerEvent?: (string|null); + + /** MatchIntentResponse matches. */ + public matches: google.cloud.dialogflow.cx.v3beta1.IMatch[]; + + /** MatchIntentResponse currentPage. */ + public currentPage?: (google.cloud.dialogflow.cx.v3beta1.IPage|null); + + /** MatchIntentResponse query. */ + public query?: ("text"|"triggerIntent"|"transcript"|"triggerEvent"); + + /** + * Creates a new MatchIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse): google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse; + + /** + * Encodes the specified MatchIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.verify|verify} messages. + * @param message MatchIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.verify|verify} messages. + * @param message MatchIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchIntentResponse + * @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.dialogflow.cx.v3beta1.MatchIntentResponse; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchIntentResponse + * @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.dialogflow.cx.v3beta1.MatchIntentResponse; + + /** + * Verifies a MatchIntentResponse 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 MatchIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse; + + /** + * Creates a plain object from a MatchIntentResponse message. Also converts values to other types if specified. + * @param message MatchIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FulfillIntentRequest. */ + interface IFulfillIntentRequest { + + /** FulfillIntentRequest matchIntentRequest */ + matchIntentRequest?: (google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest|null); + + /** FulfillIntentRequest match */ + match?: (google.cloud.dialogflow.cx.v3beta1.IMatch|null); + + /** FulfillIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + } + + /** Represents a FulfillIntentRequest. */ + class FulfillIntentRequest implements IFulfillIntentRequest { + + /** + * Constructs a new FulfillIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest); + + /** FulfillIntentRequest matchIntentRequest. */ + public matchIntentRequest?: (google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest|null); + + /** FulfillIntentRequest match. */ + public match?: (google.cloud.dialogflow.cx.v3beta1.IMatch|null); + + /** FulfillIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** + * Creates a new FulfillIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest): google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest; + + /** + * Encodes the specified FulfillIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.verify|verify} messages. + * @param message FulfillIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.verify|verify} messages. + * @param message FulfillIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillIntentRequest + * @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.dialogflow.cx.v3beta1.FulfillIntentRequest; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillIntentRequest + * @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.dialogflow.cx.v3beta1.FulfillIntentRequest; + + /** + * Verifies a FulfillIntentRequest 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 FulfillIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest; + + /** + * Creates a plain object from a FulfillIntentRequest message. Also converts values to other types if specified. + * @param message FulfillIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillIntentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FulfillIntentResponse. */ + interface IFulfillIntentResponse { + + /** FulfillIntentResponse responseId */ + responseId?: (string|null); + + /** FulfillIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.cx.v3beta1.IQueryResult|null); + + /** FulfillIntentResponse outputAudio */ + outputAudio?: (Uint8Array|Buffer|string|null); + + /** FulfillIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + } + + /** Represents a FulfillIntentResponse. */ + class FulfillIntentResponse implements IFulfillIntentResponse { + + /** + * Constructs a new FulfillIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse); + + /** FulfillIntentResponse responseId. */ + public responseId: string; + + /** FulfillIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.cx.v3beta1.IQueryResult|null); + + /** FulfillIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|Buffer|string); + + /** FulfillIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null); + + /** + * Creates a new FulfillIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse): google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse; + + /** + * Encodes the specified FulfillIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.verify|verify} messages. + * @param message FulfillIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.verify|verify} messages. + * @param message FulfillIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillIntentResponse + * @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.dialogflow.cx.v3beta1.FulfillIntentResponse; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillIntentResponse + * @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.dialogflow.cx.v3beta1.FulfillIntentResponse; + + /** + * Verifies a FulfillIntentResponse 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 FulfillIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse; + + /** + * Creates a plain object from a FulfillIntentResponse message. Also converts values to other types if specified. + * @param message FulfillIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillIntentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SentimentAnalysisResult. */ + interface ISentimentAnalysisResult { + + /** SentimentAnalysisResult score */ + score?: (number|null); + + /** SentimentAnalysisResult magnitude */ + magnitude?: (number|null); + } + + /** Represents a SentimentAnalysisResult. */ + class SentimentAnalysisResult implements ISentimentAnalysisResult { + + /** + * Constructs a new SentimentAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult); + + /** SentimentAnalysisResult score. */ + public score: number; + + /** SentimentAnalysisResult magnitude. */ + public magnitude: number; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult): google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3beta1.SentimentAnalysisResult; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3beta1.SentimentAnalysisResult; + + /** + * Verifies a SentimentAnalysisResult 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 SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @param message SentimentAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DetectIntentResponseView enum. */ + enum DetectIntentResponseView { + DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED = 0, + DETECT_INTENT_RESPONSE_VIEW_FULL = 1, + DETECT_INTENT_RESPONSE_VIEW_BASIC = 2, + DETECT_INTENT_RESPONSE_VIEW_DEFAULT = 3 + } + + /** Represents an Examples */ + class Examples extends $protobuf.rpc.Service { + + /** + * Constructs a new Examples service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Examples service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Examples; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public createExample(request: google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest, callback: google.cloud.dialogflow.cx.v3beta1.Examples.CreateExampleCallback): void; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @returns Promise + */ + public createExample(request: google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest): Promise; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExample(request: google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest, callback: google.cloud.dialogflow.cx.v3beta1.Examples.DeleteExampleCallback): void; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @returns Promise + */ + public deleteExample(request: google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest): Promise; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExamplesResponse + */ + public listExamples(request: google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, callback: google.cloud.dialogflow.cx.v3beta1.Examples.ListExamplesCallback): void; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @returns Promise + */ + public listExamples(request: google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest): Promise; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public getExample(request: google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest, callback: google.cloud.dialogflow.cx.v3beta1.Examples.GetExampleCallback): void; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @returns Promise + */ + public getExample(request: google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest): Promise; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public updateExample(request: google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest, callback: google.cloud.dialogflow.cx.v3beta1.Examples.UpdateExampleCallback): void; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @returns Promise + */ + public updateExample(request: google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest): Promise; + } + + namespace Examples { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|createExample}. + * @param error Error, if any + * @param [response] Example + */ + type CreateExampleCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Example) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|deleteExample}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExampleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|listExamples}. + * @param error Error, if any + * @param [response] ListExamplesResponse + */ + type ListExamplesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|getExample}. + * @param error Error, if any + * @param [response] Example + */ + type GetExampleCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Example) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|updateExample}. + * @param error Error, if any + * @param [response] Example + */ + type UpdateExampleCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Example) => void; + } + + /** Properties of a CreateExampleRequest. */ + interface ICreateExampleRequest { + + /** CreateExampleRequest parent */ + parent?: (string|null); + + /** CreateExampleRequest example */ + example?: (google.cloud.dialogflow.cx.v3beta1.IExample|null); + } + + /** Represents a CreateExampleRequest. */ + class CreateExampleRequest implements ICreateExampleRequest { + + /** + * Constructs a new CreateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest); + + /** CreateExampleRequest parent. */ + public parent: string; + + /** CreateExampleRequest example. */ + public example?: (google.cloud.dialogflow.cx.v3beta1.IExample|null); + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest): google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExampleRequest + * @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.dialogflow.cx.v3beta1.CreateExampleRequest; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExampleRequest + * @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.dialogflow.cx.v3beta1.CreateExampleRequest; + + /** + * Verifies a CreateExampleRequest 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 CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @param message CreateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExampleRequest. */ + interface IDeleteExampleRequest { + + /** DeleteExampleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteExampleRequest. */ + class DeleteExampleRequest implements IDeleteExampleRequest { + + /** + * Constructs a new DeleteExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest); + + /** DeleteExampleRequest name. */ + public name: string; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest): google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExampleRequest + * @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.dialogflow.cx.v3beta1.DeleteExampleRequest; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExampleRequest + * @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.dialogflow.cx.v3beta1.DeleteExampleRequest; + + /** + * Verifies a DeleteExampleRequest 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 DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @param message DeleteExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesRequest. */ + interface IListExamplesRequest { + + /** ListExamplesRequest parent */ + parent?: (string|null); + + /** ListExamplesRequest pageSize */ + pageSize?: (number|null); + + /** ListExamplesRequest pageToken */ + pageToken?: (string|null); + + /** ListExamplesRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListExamplesRequest. */ + class ListExamplesRequest implements IListExamplesRequest { + + /** + * Constructs a new ListExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest); + + /** ListExamplesRequest parent. */ + public parent: string; + + /** ListExamplesRequest pageSize. */ + public pageSize: number; + + /** ListExamplesRequest pageToken. */ + public pageToken: string; + + /** ListExamplesRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest): google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesRequest + * @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.dialogflow.cx.v3beta1.ListExamplesRequest; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesRequest + * @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.dialogflow.cx.v3beta1.ListExamplesRequest; + + /** + * Verifies a ListExamplesRequest 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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @param message ListExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesResponse. */ + interface IListExamplesResponse { + + /** ListExamplesResponse examples */ + examples?: (google.cloud.dialogflow.cx.v3beta1.IExample[]|null); + + /** ListExamplesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExamplesResponse. */ + class ListExamplesResponse implements IListExamplesResponse { + + /** + * Constructs a new ListExamplesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse); + + /** ListExamplesResponse examples. */ + public examples: google.cloud.dialogflow.cx.v3beta1.IExample[]; + + /** ListExamplesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse): google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesResponse + * @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.dialogflow.cx.v3beta1.ListExamplesResponse; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesResponse + * @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.dialogflow.cx.v3beta1.ListExamplesResponse; + + /** + * Verifies a ListExamplesResponse 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 ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @param message ListExamplesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExampleRequest. */ + interface IGetExampleRequest { + + /** GetExampleRequest name */ + name?: (string|null); + } + + /** Represents a GetExampleRequest. */ + class GetExampleRequest implements IGetExampleRequest { + + /** + * Constructs a new GetExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest); + + /** GetExampleRequest name. */ + public name: string; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest): google.cloud.dialogflow.cx.v3beta1.GetExampleRequest; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExampleRequest + * @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.dialogflow.cx.v3beta1.GetExampleRequest; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExampleRequest + * @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.dialogflow.cx.v3beta1.GetExampleRequest; + + /** + * Verifies a GetExampleRequest 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 GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetExampleRequest; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @param message GetExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExampleRequest. */ + interface IUpdateExampleRequest { + + /** UpdateExampleRequest example */ + example?: (google.cloud.dialogflow.cx.v3beta1.IExample|null); + + /** UpdateExampleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExampleRequest. */ + class UpdateExampleRequest implements IUpdateExampleRequest { + + /** + * Constructs a new UpdateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest); + + /** UpdateExampleRequest example. */ + public example?: (google.cloud.dialogflow.cx.v3beta1.IExample|null); + + /** UpdateExampleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExampleRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest): google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExampleRequest + * @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.dialogflow.cx.v3beta1.UpdateExampleRequest; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExampleRequest + * @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.dialogflow.cx.v3beta1.UpdateExampleRequest; + + /** + * Verifies an UpdateExampleRequest 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 UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @param message UpdateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example name */ + name?: (string|null); + + /** Example playbookInput */ + playbookInput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null); + + /** Example playbookOutput */ + playbookOutput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null); + + /** Example actions */ + actions?: (google.cloud.dialogflow.cx.v3beta1.IAction[]|null); + + /** Example displayName */ + displayName?: (string|null); + + /** Example description */ + description?: (string|null); + + /** Example tokenCount */ + tokenCount?: (number|Long|string|null); + + /** Example createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Example conversationState */ + conversationState?: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState|null); + + /** Example languageCode */ + languageCode?: (string|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExample); + + /** Example name. */ + public name: string; + + /** Example playbookInput. */ + public playbookInput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null); + + /** Example playbookOutput. */ + public playbookOutput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null); + + /** Example actions. */ + public actions: google.cloud.dialogflow.cx.v3beta1.IAction[]; + + /** Example displayName. */ + public displayName: string; + + /** Example description. */ + public description: string; + + /** Example tokenCount. */ + public tokenCount: (number|Long|string); + + /** Example createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Example conversationState. */ + public conversationState: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState); + + /** Example languageCode. */ + public languageCode: string; + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExample): google.cloud.dialogflow.cx.v3beta1.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @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.dialogflow.cx.v3beta1.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @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.dialogflow.cx.v3beta1.Example; + + /** + * Verifies an Example 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 Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TraceBlock. */ + interface ITraceBlock { + + /** TraceBlock playbookTraceMetadata */ + playbookTraceMetadata?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata|null); + + /** TraceBlock flowTraceMetadata */ + flowTraceMetadata?: (google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata|null); + + /** TraceBlock speechProcessingMetadata */ + speechProcessingMetadata?: (google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata|null); + + /** TraceBlock actions */ + actions?: (google.cloud.dialogflow.cx.v3beta1.IAction[]|null); + + /** TraceBlock startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock inputParameters */ + inputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock outputParameters */ + outputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock endState */ + endState?: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState|null); + } + + /** Represents a TraceBlock. */ + class TraceBlock implements ITraceBlock { + + /** + * Constructs a new TraceBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITraceBlock); + + /** TraceBlock playbookTraceMetadata. */ + public playbookTraceMetadata?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata|null); + + /** TraceBlock flowTraceMetadata. */ + public flowTraceMetadata?: (google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata|null); + + /** TraceBlock speechProcessingMetadata. */ + public speechProcessingMetadata?: (google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata|null); + + /** TraceBlock actions. */ + public actions: google.cloud.dialogflow.cx.v3beta1.IAction[]; + + /** TraceBlock startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** TraceBlock inputParameters. */ + public inputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock outputParameters. */ + public outputParameters?: (google.protobuf.IStruct|null); + + /** TraceBlock endState. */ + public endState: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState); + + /** TraceBlock traceMetadata. */ + public traceMetadata?: ("playbookTraceMetadata"|"flowTraceMetadata"|"speechProcessingMetadata"); + + /** + * Creates a new TraceBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns TraceBlock instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITraceBlock): google.cloud.dialogflow.cx.v3beta1.TraceBlock; + + /** + * Encodes the specified TraceBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TraceBlock.verify|verify} messages. + * @param message TraceBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITraceBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TraceBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TraceBlock.verify|verify} messages. + * @param message TraceBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITraceBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TraceBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TraceBlock + * @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.dialogflow.cx.v3beta1.TraceBlock; + + /** + * Decodes a TraceBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TraceBlock + * @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.dialogflow.cx.v3beta1.TraceBlock; + + /** + * Verifies a TraceBlock 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 TraceBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TraceBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TraceBlock; + + /** + * Creates a plain object from a TraceBlock message. Also converts values to other types if specified. + * @param message TraceBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TraceBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TraceBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TraceBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechProcessingMetadata. */ + interface ISpeechProcessingMetadata { + + /** SpeechProcessingMetadata displayName */ + displayName?: (string|null); + } + + /** Represents a SpeechProcessingMetadata. */ + class SpeechProcessingMetadata implements ISpeechProcessingMetadata { + + /** + * Constructs a new SpeechProcessingMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata); + + /** SpeechProcessingMetadata displayName. */ + public displayName: string; + + /** + * Creates a new SpeechProcessingMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechProcessingMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata): google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata; + + /** + * Encodes the specified SpeechProcessingMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.verify|verify} messages. + * @param message SpeechProcessingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechProcessingMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.verify|verify} messages. + * @param message SpeechProcessingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechProcessingMetadata + * @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.dialogflow.cx.v3beta1.SpeechProcessingMetadata; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechProcessingMetadata + * @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.dialogflow.cx.v3beta1.SpeechProcessingMetadata; + + /** + * Verifies a SpeechProcessingMetadata 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 SpeechProcessingMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechProcessingMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata; + + /** + * Creates a plain object from a SpeechProcessingMetadata message. Also converts values to other types if specified. + * @param message SpeechProcessingMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechProcessingMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechProcessingMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookTraceMetadata. */ + interface IPlaybookTraceMetadata { + + /** PlaybookTraceMetadata playbook */ + playbook?: (string|null); + + /** PlaybookTraceMetadata displayName */ + displayName?: (string|null); + } + + /** Represents a PlaybookTraceMetadata. */ + class PlaybookTraceMetadata implements IPlaybookTraceMetadata { + + /** + * Constructs a new PlaybookTraceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata); + + /** PlaybookTraceMetadata playbook. */ + public playbook: string; + + /** PlaybookTraceMetadata displayName. */ + public displayName: string; + + /** + * Creates a new PlaybookTraceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookTraceMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata): google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata; + + /** + * Encodes the specified PlaybookTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.verify|verify} messages. + * @param message PlaybookTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.verify|verify} messages. + * @param message PlaybookTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookTraceMetadata + * @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.dialogflow.cx.v3beta1.PlaybookTraceMetadata; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookTraceMetadata + * @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.dialogflow.cx.v3beta1.PlaybookTraceMetadata; + + /** + * Verifies a PlaybookTraceMetadata 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 PlaybookTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookTraceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata; + + /** + * Creates a plain object from a PlaybookTraceMetadata message. Also converts values to other types if specified. + * @param message PlaybookTraceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookTraceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookTraceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowTraceMetadata. */ + interface IFlowTraceMetadata { + + /** FlowTraceMetadata flow */ + flow?: (string|null); + + /** FlowTraceMetadata displayName */ + displayName?: (string|null); + } + + /** Represents a FlowTraceMetadata. */ + class FlowTraceMetadata implements IFlowTraceMetadata { + + /** + * Constructs a new FlowTraceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata); + + /** FlowTraceMetadata flow. */ + public flow: string; + + /** FlowTraceMetadata displayName. */ + public displayName: string; + + /** + * Creates a new FlowTraceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowTraceMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata): google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata; + + /** + * Encodes the specified FlowTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.verify|verify} messages. + * @param message FlowTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.verify|verify} messages. + * @param message FlowTraceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowTraceMetadata + * @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.dialogflow.cx.v3beta1.FlowTraceMetadata; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowTraceMetadata + * @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.dialogflow.cx.v3beta1.FlowTraceMetadata; + + /** + * Verifies a FlowTraceMetadata 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 FlowTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowTraceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata; + + /** + * Creates a plain object from a FlowTraceMetadata message. Also converts values to other types if specified. + * @param message FlowTraceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowTraceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowTraceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Action. */ + interface IAction { + + /** Action userUtterance */ + userUtterance?: (google.cloud.dialogflow.cx.v3beta1.IUserUtterance|null); + + /** Action event */ + event?: (google.cloud.dialogflow.cx.v3beta1.IEvent|null); + + /** Action agentUtterance */ + agentUtterance?: (google.cloud.dialogflow.cx.v3beta1.IAgentUtterance|null); + + /** Action toolUse */ + toolUse?: (google.cloud.dialogflow.cx.v3beta1.IToolUse|null); + + /** Action llmCall */ + llmCall?: (google.cloud.dialogflow.cx.v3beta1.ILlmCall|null); + + /** Action intentMatch */ + intentMatch?: (google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch|null); + + /** Action flowStateUpdate */ + flowStateUpdate?: (google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate|null); + + /** Action playbookInvocation */ + playbookInvocation?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation|null); + + /** Action flowInvocation */ + flowInvocation?: (google.cloud.dialogflow.cx.v3beta1.IFlowInvocation|null); + + /** Action playbookTransition */ + playbookTransition?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition|null); + + /** Action flowTransition */ + flowTransition?: (google.cloud.dialogflow.cx.v3beta1.IFlowTransition|null); + + /** Action tts */ + tts?: (google.cloud.dialogflow.cx.v3beta1.Action.ITTS|null); + + /** Action stt */ + stt?: (google.cloud.dialogflow.cx.v3beta1.Action.ISTT|null); + + /** Action displayName */ + displayName?: (string|null); + + /** Action startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Action completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** Action subExecutionSteps */ + subExecutionSteps?: (google.cloud.dialogflow.cx.v3beta1.ISpan[]|null); + + /** Action status */ + status?: (google.cloud.dialogflow.cx.v3beta1.IStatus|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IAction); + + /** Action userUtterance. */ + public userUtterance?: (google.cloud.dialogflow.cx.v3beta1.IUserUtterance|null); + + /** Action event. */ + public event?: (google.cloud.dialogflow.cx.v3beta1.IEvent|null); + + /** Action agentUtterance. */ + public agentUtterance?: (google.cloud.dialogflow.cx.v3beta1.IAgentUtterance|null); + + /** Action toolUse. */ + public toolUse?: (google.cloud.dialogflow.cx.v3beta1.IToolUse|null); + + /** Action llmCall. */ + public llmCall?: (google.cloud.dialogflow.cx.v3beta1.ILlmCall|null); + + /** Action intentMatch. */ + public intentMatch?: (google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch|null); + + /** Action flowStateUpdate. */ + public flowStateUpdate?: (google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate|null); + + /** Action playbookInvocation. */ + public playbookInvocation?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation|null); + + /** Action flowInvocation. */ + public flowInvocation?: (google.cloud.dialogflow.cx.v3beta1.IFlowInvocation|null); + + /** Action playbookTransition. */ + public playbookTransition?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition|null); + + /** Action flowTransition. */ + public flowTransition?: (google.cloud.dialogflow.cx.v3beta1.IFlowTransition|null); + + /** Action tts. */ + public tts?: (google.cloud.dialogflow.cx.v3beta1.Action.ITTS|null); + + /** Action stt. */ + public stt?: (google.cloud.dialogflow.cx.v3beta1.Action.ISTT|null); + + /** Action displayName. */ + public displayName: string; + + /** Action startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Action completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** Action subExecutionSteps. */ + public subExecutionSteps: google.cloud.dialogflow.cx.v3beta1.ISpan[]; + + /** Action status. */ + public status?: (google.cloud.dialogflow.cx.v3beta1.IStatus|null); + + /** Action action. */ + public action?: ("userUtterance"|"event"|"agentUtterance"|"toolUse"|"llmCall"|"intentMatch"|"flowStateUpdate"|"playbookInvocation"|"flowInvocation"|"playbookTransition"|"flowTransition"|"tts"|"stt"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IAction): google.cloud.dialogflow.cx.v3beta1.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @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.dialogflow.cx.v3beta1.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @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.dialogflow.cx.v3beta1.Action; + + /** + * Verifies an Action 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 Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Action { + + /** Properties of an IntentMatch. */ + interface IIntentMatch { + + /** IntentMatch matchedIntents */ + matchedIntents?: (google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent[]|null); + } + + /** Represents an IntentMatch. */ + class IntentMatch implements IIntentMatch { + + /** + * Constructs a new IntentMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch); + + /** IntentMatch matchedIntents. */ + public matchedIntents: google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent[]; + + /** + * Creates a new IntentMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentMatch instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch): google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch; + + /** + * Encodes the specified IntentMatch message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.verify|verify} messages. + * @param message IntentMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentMatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.verify|verify} messages. + * @param message IntentMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentMatch + * @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.dialogflow.cx.v3beta1.Action.IntentMatch; + + /** + * Decodes an IntentMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentMatch + * @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.dialogflow.cx.v3beta1.Action.IntentMatch; + + /** + * Verifies an IntentMatch 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 IntentMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch; + + /** + * Creates a plain object from an IntentMatch message. Also converts values to other types if specified. + * @param message IntentMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntentMatch { + + /** Properties of a MatchedIntent. */ + interface IMatchedIntent { + + /** MatchedIntent intentId */ + intentId?: (string|null); + + /** MatchedIntent displayName */ + displayName?: (string|null); + + /** MatchedIntent score */ + score?: (number|null); + + /** MatchedIntent generativeFallback */ + generativeFallback?: (google.protobuf.IStruct|null); + } + + /** Represents a MatchedIntent. */ + class MatchedIntent implements IMatchedIntent { + + /** + * Constructs a new MatchedIntent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent); + + /** MatchedIntent intentId. */ + public intentId: string; + + /** MatchedIntent displayName. */ + public displayName: string; + + /** MatchedIntent score. */ + public score: number; + + /** MatchedIntent generativeFallback. */ + public generativeFallback?: (google.protobuf.IStruct|null); + + /** + * Creates a new MatchedIntent instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchedIntent instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent): google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent; + + /** + * Encodes the specified MatchedIntent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.verify|verify} messages. + * @param message MatchedIntent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchedIntent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.verify|verify} messages. + * @param message MatchedIntent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchedIntent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchedIntent + * @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.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent; + + /** + * Decodes a MatchedIntent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchedIntent + * @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.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent; + + /** + * Verifies a MatchedIntent 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 MatchedIntent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchedIntent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent; + + /** + * Creates a plain object from a MatchedIntent message. Also converts values to other types if specified. + * @param message MatchedIntent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchedIntent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchedIntent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FlowStateUpdate. */ + interface IFlowStateUpdate { + + /** FlowStateUpdate eventType */ + eventType?: (string|null); + + /** FlowStateUpdate pageState */ + pageState?: (google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState|null); + + /** FlowStateUpdate updatedParameters */ + updatedParameters?: (google.protobuf.IStruct|null); + + /** FlowStateUpdate destination */ + destination?: (string|null); + + /** FlowStateUpdate functionCall */ + functionCall?: (google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall|null); + } + + /** Represents a FlowStateUpdate. */ + class FlowStateUpdate implements IFlowStateUpdate { + + /** + * Constructs a new FlowStateUpdate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate); + + /** FlowStateUpdate eventType. */ + public eventType: string; + + /** FlowStateUpdate pageState. */ + public pageState?: (google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState|null); + + /** FlowStateUpdate updatedParameters. */ + public updatedParameters?: (google.protobuf.IStruct|null); + + /** FlowStateUpdate destination. */ + public destination: string; + + /** FlowStateUpdate functionCall. */ + public functionCall?: (google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall|null); + + /** + * Creates a new FlowStateUpdate instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowStateUpdate instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate): google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate; + + /** + * Encodes the specified FlowStateUpdate message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.verify|verify} messages. + * @param message FlowStateUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowStateUpdate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.verify|verify} messages. + * @param message FlowStateUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowStateUpdate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowStateUpdate + * @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.dialogflow.cx.v3beta1.Action.FlowStateUpdate; + + /** + * Decodes a FlowStateUpdate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowStateUpdate + * @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.dialogflow.cx.v3beta1.Action.FlowStateUpdate; + + /** + * Verifies a FlowStateUpdate 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 FlowStateUpdate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowStateUpdate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate; + + /** + * Creates a plain object from a FlowStateUpdate message. Also converts values to other types if specified. + * @param message FlowStateUpdate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowStateUpdate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowStateUpdate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FlowStateUpdate { + + /** Properties of a PageState. */ + interface IPageState { + + /** PageState page */ + page?: (string|null); + + /** PageState displayName */ + displayName?: (string|null); + + /** PageState status */ + status?: (string|null); + } + + /** Represents a PageState. */ + class PageState implements IPageState { + + /** + * Constructs a new PageState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState); + + /** PageState page. */ + public page: string; + + /** PageState displayName. */ + public displayName: string; + + /** PageState status. */ + public status: string; + + /** + * Creates a new PageState instance using the specified properties. + * @param [properties] Properties to set + * @returns PageState instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState): google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState; + + /** + * Encodes the specified PageState message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.verify|verify} messages. + * @param message PageState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageState message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.verify|verify} messages. + * @param message PageState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PageState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageState + * @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.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState; + + /** + * Decodes a PageState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageState + * @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.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState; + + /** + * Verifies a PageState 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 PageState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState; + + /** + * Creates a plain object from a PageState message. Also converts values to other types if specified. + * @param message PageState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PageState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunctionCall. */ + interface IFunctionCall { + + /** FunctionCall name */ + name?: (string|null); + } + + /** Represents a FunctionCall. */ + class FunctionCall implements IFunctionCall { + + /** + * Constructs a new FunctionCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall); + + /** FunctionCall name. */ + public name: string; + + /** + * Creates a new FunctionCall instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionCall instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall): google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall; + + /** + * Encodes the specified FunctionCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.verify|verify} messages. + * @param message FunctionCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.verify|verify} messages. + * @param message FunctionCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionCall + * @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.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall; + + /** + * Decodes a FunctionCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionCall + * @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.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall; + + /** + * Verifies a FunctionCall 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 FunctionCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall; + + /** + * Creates a plain object from a FunctionCall message. Also converts values to other types if specified. + * @param message FunctionCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunctionCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TTS. */ + interface ITTS { + } + + /** Represents a TTS. */ + class TTS implements ITTS { + + /** + * Constructs a new TTS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Action.ITTS); + + /** + * Creates a new TTS instance using the specified properties. + * @param [properties] Properties to set + * @returns TTS instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Action.ITTS): google.cloud.dialogflow.cx.v3beta1.Action.TTS; + + /** + * Encodes the specified TTS message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.TTS.verify|verify} messages. + * @param message TTS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Action.ITTS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TTS message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.TTS.verify|verify} messages. + * @param message TTS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Action.ITTS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TTS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TTS + * @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.dialogflow.cx.v3beta1.Action.TTS; + + /** + * Decodes a TTS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TTS + * @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.dialogflow.cx.v3beta1.Action.TTS; + + /** + * Verifies a TTS 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 TTS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TTS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action.TTS; + + /** + * Creates a plain object from a TTS message. Also converts values to other types if specified. + * @param message TTS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action.TTS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TTS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TTS + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a STT. */ + interface ISTT { + } + + /** Represents a STT. */ + class STT implements ISTT { + + /** + * Constructs a new STT. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Action.ISTT); + + /** + * Creates a new STT instance using the specified properties. + * @param [properties] Properties to set + * @returns STT instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Action.ISTT): google.cloud.dialogflow.cx.v3beta1.Action.STT; + + /** + * Encodes the specified STT message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.STT.verify|verify} messages. + * @param message STT message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Action.ISTT, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified STT message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.STT.verify|verify} messages. + * @param message STT message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Action.ISTT, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a STT message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns STT + * @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.dialogflow.cx.v3beta1.Action.STT; + + /** + * Decodes a STT message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns STT + * @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.dialogflow.cx.v3beta1.Action.STT; + + /** + * Verifies a STT 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 STT message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns STT + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Action.STT; + + /** + * Creates a plain object from a STT message. Also converts values to other types if specified. + * @param message STT + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Action.STT, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this STT to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for STT + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a UserUtterance. */ + interface IUserUtterance { + + /** UserUtterance text */ + text?: (string|null); + + /** UserUtterance audioTokens */ + audioTokens?: (number[]|null); + + /** UserUtterance audio */ + audio?: (Uint8Array|Buffer|string|null); + } + + /** Represents a UserUtterance. */ + class UserUtterance implements IUserUtterance { + + /** + * Constructs a new UserUtterance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUserUtterance); + + /** UserUtterance text. */ + public text: string; + + /** UserUtterance audioTokens. */ + public audioTokens: number[]; + + /** UserUtterance audio. */ + public audio: (Uint8Array|Buffer|string); + + /** + * Creates a new UserUtterance instance using the specified properties. + * @param [properties] Properties to set + * @returns UserUtterance instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUserUtterance): google.cloud.dialogflow.cx.v3beta1.UserUtterance; + + /** + * Encodes the specified UserUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UserUtterance.verify|verify} messages. + * @param message UserUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUserUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UserUtterance.verify|verify} messages. + * @param message UserUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUserUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserUtterance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserUtterance + * @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.dialogflow.cx.v3beta1.UserUtterance; + + /** + * Decodes a UserUtterance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserUtterance + * @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.dialogflow.cx.v3beta1.UserUtterance; + + /** + * Verifies a UserUtterance 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 UserUtterance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserUtterance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UserUtterance; + + /** + * Creates a plain object from a UserUtterance message. Also converts values to other types if specified. + * @param message UserUtterance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UserUtterance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserUtterance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserUtterance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event event */ + event?: (string|null); + + /** Event text */ + text?: (string|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IEvent); + + /** Event event. */ + public event: string; + + /** Event text. */ + public text?: (string|null); + + /** Event payload. */ + public payload?: "text"; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IEvent): google.cloud.dialogflow.cx.v3beta1.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @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.dialogflow.cx.v3beta1.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @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.dialogflow.cx.v3beta1.Event; + + /** + * Verifies an Event 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 Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentUtterance. */ + interface IAgentUtterance { + + /** AgentUtterance text */ + text?: (string|null); + + /** AgentUtterance requireGeneration */ + requireGeneration?: (boolean|null); + } + + /** Represents an AgentUtterance. */ + class AgentUtterance implements IAgentUtterance { + + /** + * Constructs a new AgentUtterance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IAgentUtterance); + + /** AgentUtterance text. */ + public text: string; + + /** AgentUtterance requireGeneration. */ + public requireGeneration: boolean; + + /** + * Creates a new AgentUtterance instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentUtterance instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IAgentUtterance): google.cloud.dialogflow.cx.v3beta1.AgentUtterance; + + /** + * Encodes the specified AgentUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentUtterance.verify|verify} messages. + * @param message AgentUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IAgentUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentUtterance.verify|verify} messages. + * @param message AgentUtterance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IAgentUtterance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentUtterance + * @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.dialogflow.cx.v3beta1.AgentUtterance; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentUtterance + * @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.dialogflow.cx.v3beta1.AgentUtterance; + + /** + * Verifies an AgentUtterance 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 AgentUtterance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentUtterance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.AgentUtterance; + + /** + * Creates a plain object from an AgentUtterance message. Also converts values to other types if specified. + * @param message AgentUtterance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.AgentUtterance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentUtterance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentUtterance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolUse. */ + interface IToolUse { + + /** ToolUse tool */ + tool?: (string|null); + + /** ToolUse displayName */ + displayName?: (string|null); + + /** ToolUse action */ + action?: (string|null); + + /** ToolUse inputActionParameters */ + inputActionParameters?: (google.protobuf.IStruct|null); + + /** ToolUse outputActionParameters */ + outputActionParameters?: (google.protobuf.IStruct|null); + + /** ToolUse dataStoreToolTrace */ + dataStoreToolTrace?: (google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace|null); + + /** ToolUse webhookToolTrace */ + webhookToolTrace?: (google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace|null); + } + + /** Represents a ToolUse. */ + class ToolUse implements IToolUse { + + /** + * Constructs a new ToolUse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IToolUse); + + /** ToolUse tool. */ + public tool: string; + + /** ToolUse displayName. */ + public displayName: string; + + /** ToolUse action. */ + public action: string; + + /** ToolUse inputActionParameters. */ + public inputActionParameters?: (google.protobuf.IStruct|null); + + /** ToolUse outputActionParameters. */ + public outputActionParameters?: (google.protobuf.IStruct|null); + + /** ToolUse dataStoreToolTrace. */ + public dataStoreToolTrace?: (google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace|null); + + /** ToolUse webhookToolTrace. */ + public webhookToolTrace?: (google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace|null); + + /** ToolUse ToolTrace. */ + public ToolTrace?: ("dataStoreToolTrace"|"webhookToolTrace"); + + /** + * Creates a new ToolUse instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolUse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IToolUse): google.cloud.dialogflow.cx.v3beta1.ToolUse; + + /** + * Encodes the specified ToolUse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.verify|verify} messages. + * @param message ToolUse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IToolUse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolUse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.verify|verify} messages. + * @param message ToolUse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IToolUse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolUse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolUse + * @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.dialogflow.cx.v3beta1.ToolUse; + + /** + * Decodes a ToolUse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolUse + * @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.dialogflow.cx.v3beta1.ToolUse; + + /** + * Verifies a ToolUse 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 ToolUse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolUse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolUse; + + /** + * Creates a plain object from a ToolUse message. Also converts values to other types if specified. + * @param message ToolUse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolUse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolUse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolUse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolUse { + + /** Properties of a DataStoreToolTrace. */ + interface IDataStoreToolTrace { + + /** DataStoreToolTrace dataStoreConnectionSignals */ + dataStoreConnectionSignals?: (google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null); + } + + /** Represents a DataStoreToolTrace. */ + class DataStoreToolTrace implements IDataStoreToolTrace { + + /** + * Constructs a new DataStoreToolTrace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace); + + /** DataStoreToolTrace dataStoreConnectionSignals. */ + public dataStoreConnectionSignals?: (google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null); + + /** + * Creates a new DataStoreToolTrace instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreToolTrace instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace): google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace; + + /** + * Encodes the specified DataStoreToolTrace message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.verify|verify} messages. + * @param message DataStoreToolTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreToolTrace message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.verify|verify} messages. + * @param message DataStoreToolTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreToolTrace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreToolTrace + * @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.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace; + + /** + * Decodes a DataStoreToolTrace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreToolTrace + * @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.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace; + + /** + * Verifies a DataStoreToolTrace 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 DataStoreToolTrace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreToolTrace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace; + + /** + * Creates a plain object from a DataStoreToolTrace message. Also converts values to other types if specified. + * @param message DataStoreToolTrace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreToolTrace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreToolTrace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebhookToolTrace. */ + interface IWebhookToolTrace { + + /** WebhookToolTrace webhookTag */ + webhookTag?: (string|null); + + /** WebhookToolTrace webhookUri */ + webhookUri?: (string|null); + } + + /** Represents a WebhookToolTrace. */ + class WebhookToolTrace implements IWebhookToolTrace { + + /** + * Constructs a new WebhookToolTrace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace); + + /** WebhookToolTrace webhookTag. */ + public webhookTag: string; + + /** WebhookToolTrace webhookUri. */ + public webhookUri: string; + + /** + * Creates a new WebhookToolTrace instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookToolTrace instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace): google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace; + + /** + * Encodes the specified WebhookToolTrace message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.verify|verify} messages. + * @param message WebhookToolTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookToolTrace message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.verify|verify} messages. + * @param message WebhookToolTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookToolTrace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookToolTrace + * @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.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace; + + /** + * Decodes a WebhookToolTrace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookToolTrace + * @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.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace; + + /** + * Verifies a WebhookToolTrace 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 WebhookToolTrace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookToolTrace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace; + + /** + * Creates a plain object from a WebhookToolTrace message. Also converts values to other types if specified. + * @param message WebhookToolTrace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookToolTrace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookToolTrace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LlmCall. */ + interface ILlmCall { + + /** LlmCall retrievedExamples */ + retrievedExamples?: (google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample[]|null); + + /** LlmCall tokenCount */ + tokenCount?: (google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount|null); + + /** LlmCall model */ + model?: (string|null); + + /** LlmCall temperature */ + temperature?: (number|null); + } + + /** Represents a LlmCall. */ + class LlmCall implements ILlmCall { + + /** + * Constructs a new LlmCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ILlmCall); + + /** LlmCall retrievedExamples. */ + public retrievedExamples: google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample[]; + + /** LlmCall tokenCount. */ + public tokenCount?: (google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount|null); + + /** LlmCall model. */ + public model: string; + + /** LlmCall temperature. */ + public temperature: number; + + /** + * Creates a new LlmCall instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmCall instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ILlmCall): google.cloud.dialogflow.cx.v3beta1.LlmCall; + + /** + * Encodes the specified LlmCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.verify|verify} messages. + * @param message LlmCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ILlmCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.verify|verify} messages. + * @param message LlmCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ILlmCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmCall + * @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.dialogflow.cx.v3beta1.LlmCall; + + /** + * Decodes a LlmCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmCall + * @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.dialogflow.cx.v3beta1.LlmCall; + + /** + * Verifies a LlmCall 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 LlmCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LlmCall; + + /** + * Creates a plain object from a LlmCall message. Also converts values to other types if specified. + * @param message LlmCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LlmCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmCall { + + /** Properties of a RetrievedExample. */ + interface IRetrievedExample { + + /** RetrievedExample exampleId */ + exampleId?: (string|null); + + /** RetrievedExample exampleDisplayName */ + exampleDisplayName?: (string|null); + + /** RetrievedExample retrievalStrategy */ + retrievalStrategy?: (google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy|null); + + /** RetrievedExample matchedRetrievalLabel */ + matchedRetrievalLabel?: (string|null); + } + + /** Represents a RetrievedExample. */ + class RetrievedExample implements IRetrievedExample { + + /** + * Constructs a new RetrievedExample. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample); + + /** RetrievedExample exampleId. */ + public exampleId: string; + + /** RetrievedExample exampleDisplayName. */ + public exampleDisplayName: string; + + /** RetrievedExample retrievalStrategy. */ + public retrievalStrategy: (google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy); + + /** RetrievedExample matchedRetrievalLabel. */ + public matchedRetrievalLabel: string; + + /** + * Creates a new RetrievedExample instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrievedExample instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample): google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample; + + /** + * Encodes the specified RetrievedExample message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.verify|verify} messages. + * @param message RetrievedExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrievedExample message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.verify|verify} messages. + * @param message RetrievedExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrievedExample message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrievedExample + * @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.dialogflow.cx.v3beta1.LlmCall.RetrievedExample; + + /** + * Decodes a RetrievedExample message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrievedExample + * @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.dialogflow.cx.v3beta1.LlmCall.RetrievedExample; + + /** + * Verifies a RetrievedExample 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 RetrievedExample message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrievedExample + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample; + + /** + * Creates a plain object from a RetrievedExample message. Also converts values to other types if specified. + * @param message RetrievedExample + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrievedExample to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrievedExample + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenCount. */ + interface ITokenCount { + + /** TokenCount totalInputTokenCount */ + totalInputTokenCount?: (number|Long|string|null); + + /** TokenCount conversationContextTokenCount */ + conversationContextTokenCount?: (number|Long|string|null); + + /** TokenCount exampleTokenCount */ + exampleTokenCount?: (number|Long|string|null); + + /** TokenCount totalOutputTokenCount */ + totalOutputTokenCount?: (number|Long|string|null); + } + + /** Represents a TokenCount. */ + class TokenCount implements ITokenCount { + + /** + * Constructs a new TokenCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount); + + /** TokenCount totalInputTokenCount. */ + public totalInputTokenCount: (number|Long|string); + + /** TokenCount conversationContextTokenCount. */ + public conversationContextTokenCount: (number|Long|string); + + /** TokenCount exampleTokenCount. */ + public exampleTokenCount: (number|Long|string); + + /** TokenCount totalOutputTokenCount. */ + public totalOutputTokenCount: (number|Long|string); + + /** + * Creates a new TokenCount instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenCount instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount): google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount; + + /** + * Encodes the specified TokenCount message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.verify|verify} messages. + * @param message TokenCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TokenCount message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.verify|verify} messages. + * @param message TokenCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TokenCount + * @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.dialogflow.cx.v3beta1.LlmCall.TokenCount; + + /** + * Decodes a TokenCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TokenCount + * @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.dialogflow.cx.v3beta1.LlmCall.TokenCount; + + /** + * Verifies a TokenCount 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 TokenCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TokenCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount; + + /** + * Creates a plain object from a TokenCount message. Also converts values to other types if specified. + * @param message TokenCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TokenCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TokenCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PlaybookInvocation. */ + interface IPlaybookInvocation { + + /** PlaybookInvocation playbook */ + playbook?: (string|null); + + /** PlaybookInvocation displayName */ + displayName?: (string|null); + + /** PlaybookInvocation playbookInput */ + playbookInput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null); + + /** PlaybookInvocation playbookOutput */ + playbookOutput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null); + + /** PlaybookInvocation playbookState */ + playbookState?: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState|null); + } + + /** Represents a PlaybookInvocation. */ + class PlaybookInvocation implements IPlaybookInvocation { + + /** + * Constructs a new PlaybookInvocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation); + + /** PlaybookInvocation playbook. */ + public playbook: string; + + /** PlaybookInvocation displayName. */ + public displayName: string; + + /** PlaybookInvocation playbookInput. */ + public playbookInput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null); + + /** PlaybookInvocation playbookOutput. */ + public playbookOutput?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null); + + /** PlaybookInvocation playbookState. */ + public playbookState: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState); + + /** + * Creates a new PlaybookInvocation instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookInvocation instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation): google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation; + + /** + * Encodes the specified PlaybookInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.verify|verify} messages. + * @param message PlaybookInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.verify|verify} messages. + * @param message PlaybookInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookInvocation + * @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.dialogflow.cx.v3beta1.PlaybookInvocation; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookInvocation + * @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.dialogflow.cx.v3beta1.PlaybookInvocation; + + /** + * Verifies a PlaybookInvocation 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 PlaybookInvocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookInvocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation; + + /** + * Creates a plain object from a PlaybookInvocation message. Also converts values to other types if specified. + * @param message PlaybookInvocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookInvocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookInvocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowInvocation. */ + interface IFlowInvocation { + + /** FlowInvocation flow */ + flow?: (string|null); + + /** FlowInvocation displayName */ + displayName?: (string|null); + + /** FlowInvocation inputActionParameters */ + inputActionParameters?: (google.protobuf.IStruct|null); + + /** FlowInvocation outputActionParameters */ + outputActionParameters?: (google.protobuf.IStruct|null); + + /** FlowInvocation flowState */ + flowState?: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState|null); + } + + /** Represents a FlowInvocation. */ + class FlowInvocation implements IFlowInvocation { + + /** + * Constructs a new FlowInvocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowInvocation); + + /** FlowInvocation flow. */ + public flow: string; + + /** FlowInvocation displayName. */ + public displayName: string; + + /** FlowInvocation inputActionParameters. */ + public inputActionParameters?: (google.protobuf.IStruct|null); + + /** FlowInvocation outputActionParameters. */ + public outputActionParameters?: (google.protobuf.IStruct|null); + + /** FlowInvocation flowState. */ + public flowState: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState); + + /** + * Creates a new FlowInvocation instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowInvocation instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowInvocation): google.cloud.dialogflow.cx.v3beta1.FlowInvocation; + + /** + * Encodes the specified FlowInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowInvocation.verify|verify} messages. + * @param message FlowInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFlowInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowInvocation.verify|verify} messages. + * @param message FlowInvocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFlowInvocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowInvocation + * @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.dialogflow.cx.v3beta1.FlowInvocation; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowInvocation + * @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.dialogflow.cx.v3beta1.FlowInvocation; + + /** + * Verifies a FlowInvocation 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 FlowInvocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowInvocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FlowInvocation; + + /** + * Creates a plain object from a FlowInvocation message. Also converts values to other types if specified. + * @param message FlowInvocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FlowInvocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowInvocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowInvocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookTransition. */ + interface IPlaybookTransition { + + /** PlaybookTransition playbook */ + playbook?: (string|null); + + /** PlaybookTransition displayName */ + displayName?: (string|null); + + /** PlaybookTransition inputActionParameters */ + inputActionParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a PlaybookTransition. */ + class PlaybookTransition implements IPlaybookTransition { + + /** + * Constructs a new PlaybookTransition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition); + + /** PlaybookTransition playbook. */ + public playbook: string; + + /** PlaybookTransition displayName. */ + public displayName: string; + + /** PlaybookTransition inputActionParameters. */ + public inputActionParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new PlaybookTransition instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookTransition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition): google.cloud.dialogflow.cx.v3beta1.PlaybookTransition; + + /** + * Encodes the specified PlaybookTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.verify|verify} messages. + * @param message PlaybookTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.verify|verify} messages. + * @param message PlaybookTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookTransition + * @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.dialogflow.cx.v3beta1.PlaybookTransition; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookTransition + * @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.dialogflow.cx.v3beta1.PlaybookTransition; + + /** + * Verifies a PlaybookTransition 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 PlaybookTransition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookTransition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PlaybookTransition; + + /** + * Creates a plain object from a PlaybookTransition message. Also converts values to other types if specified. + * @param message PlaybookTransition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PlaybookTransition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookTransition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookTransition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlowTransition. */ + interface IFlowTransition { + + /** FlowTransition flow */ + flow?: (string|null); + + /** FlowTransition displayName */ + displayName?: (string|null); + + /** FlowTransition inputActionParameters */ + inputActionParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a FlowTransition. */ + class FlowTransition implements IFlowTransition { + + /** + * Constructs a new FlowTransition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowTransition); + + /** FlowTransition flow. */ + public flow: string; + + /** FlowTransition displayName. */ + public displayName: string; + + /** FlowTransition inputActionParameters. */ + public inputActionParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new FlowTransition instance using the specified properties. + * @param [properties] Properties to set + * @returns FlowTransition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IFlowTransition): google.cloud.dialogflow.cx.v3beta1.FlowTransition; + + /** + * Encodes the specified FlowTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTransition.verify|verify} messages. + * @param message FlowTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IFlowTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlowTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTransition.verify|verify} messages. + * @param message FlowTransition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IFlowTransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlowTransition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlowTransition + * @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.dialogflow.cx.v3beta1.FlowTransition; + + /** + * Decodes a FlowTransition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlowTransition + * @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.dialogflow.cx.v3beta1.FlowTransition; + + /** + * Verifies a FlowTransition 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 FlowTransition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlowTransition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.FlowTransition; + + /** + * Creates a plain object from a FlowTransition message. Also converts values to other types if specified. + * @param message FlowTransition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.FlowTransition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlowTransition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlowTransition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookInput. */ + interface IPlaybookInput { + + /** PlaybookInput precedingConversationSummary */ + precedingConversationSummary?: (string|null); + + /** PlaybookInput actionParameters */ + actionParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a PlaybookInput. */ + class PlaybookInput implements IPlaybookInput { + + /** + * Constructs a new PlaybookInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookInput); + + /** PlaybookInput precedingConversationSummary. */ + public precedingConversationSummary: string; + + /** PlaybookInput actionParameters. */ + public actionParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new PlaybookInput instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookInput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookInput): google.cloud.dialogflow.cx.v3beta1.PlaybookInput; + + /** + * Encodes the specified PlaybookInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInput.verify|verify} messages. + * @param message PlaybookInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInput.verify|verify} messages. + * @param message PlaybookInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookInput + * @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.dialogflow.cx.v3beta1.PlaybookInput; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookInput + * @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.dialogflow.cx.v3beta1.PlaybookInput; + + /** + * Verifies a PlaybookInput 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 PlaybookInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PlaybookInput; + + /** + * Creates a plain object from a PlaybookInput message. Also converts values to other types if specified. + * @param message PlaybookInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PlaybookInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookOutput. */ + interface IPlaybookOutput { + + /** PlaybookOutput executionSummary */ + executionSummary?: (string|null); + + /** PlaybookOutput state */ + state?: (google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State|null); + + /** PlaybookOutput actionParameters */ + actionParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a PlaybookOutput. */ + class PlaybookOutput implements IPlaybookOutput { + + /** + * Constructs a new PlaybookOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput); + + /** PlaybookOutput executionSummary. */ + public executionSummary: string; + + /** PlaybookOutput state. */ + public state: (google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State); + + /** PlaybookOutput actionParameters. */ + public actionParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new PlaybookOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookOutput instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput): google.cloud.dialogflow.cx.v3beta1.PlaybookOutput; + + /** + * Encodes the specified PlaybookOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.verify|verify} messages. + * @param message PlaybookOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.verify|verify} messages. + * @param message PlaybookOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookOutput + * @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.dialogflow.cx.v3beta1.PlaybookOutput; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookOutput + * @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.dialogflow.cx.v3beta1.PlaybookOutput; + + /** + * Verifies a PlaybookOutput 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 PlaybookOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PlaybookOutput; + + /** + * Creates a plain object from a PlaybookOutput message. Also converts values to other types if specified. + * @param message PlaybookOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PlaybookOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PlaybookOutput { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + OK = 1, + CANCELLED = 2, + FAILED = 3, + ESCALATED = 4 + } + } + + /** Properties of a Span. */ + interface ISpan { + + /** Span name */ + name?: (string|null); + + /** Span tags */ + tags?: (string[]|null); + + /** Span metrics */ + metrics?: (google.cloud.dialogflow.cx.v3beta1.INamedMetric[]|null); + + /** Span startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Span completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Span. */ + class Span implements ISpan { + + /** + * Constructs a new Span. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISpan); + + /** Span name. */ + public name: string; + + /** Span tags. */ + public tags: string[]; + + /** Span metrics. */ + public metrics: google.cloud.dialogflow.cx.v3beta1.INamedMetric[]; + + /** Span startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Span completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Span instance using the specified properties. + * @param [properties] Properties to set + * @returns Span instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISpan): google.cloud.dialogflow.cx.v3beta1.Span; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Span message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Span + * @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.dialogflow.cx.v3beta1.Span; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Span + * @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.dialogflow.cx.v3beta1.Span; + + /** + * Verifies a Span 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 Span message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Span + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Span; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @param message Span + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Span, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Span to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Span + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NamedMetric. */ + interface INamedMetric { + + /** NamedMetric name */ + name?: (string|null); + + /** NamedMetric value */ + value?: (google.protobuf.IValue|null); + + /** NamedMetric unit */ + unit?: (string|null); + } + + /** Represents a NamedMetric. */ + class NamedMetric implements INamedMetric { + + /** + * Constructs a new NamedMetric. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.INamedMetric); + + /** NamedMetric name. */ + public name: string; + + /** NamedMetric value. */ + public value?: (google.protobuf.IValue|null); + + /** NamedMetric unit. */ + public unit: string; + + /** + * Creates a new NamedMetric instance using the specified properties. + * @param [properties] Properties to set + * @returns NamedMetric instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.INamedMetric): google.cloud.dialogflow.cx.v3beta1.NamedMetric; + + /** + * Encodes the specified NamedMetric message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NamedMetric.verify|verify} messages. + * @param message NamedMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.INamedMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamedMetric message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NamedMetric.verify|verify} messages. + * @param message NamedMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.INamedMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamedMetric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamedMetric + * @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.dialogflow.cx.v3beta1.NamedMetric; + + /** + * Decodes a NamedMetric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamedMetric + * @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.dialogflow.cx.v3beta1.NamedMetric; + + /** + * Verifies a NamedMetric 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 NamedMetric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamedMetric + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.NamedMetric; + + /** + * Creates a plain object from a NamedMetric message. Also converts values to other types if specified. + * @param message NamedMetric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.NamedMetric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamedMetric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamedMetric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Status. */ + interface IStatus { + + /** Status exception */ + exception?: (google.cloud.dialogflow.cx.v3beta1.IExceptionDetail|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IStatus); + + /** Status exception. */ + public exception?: (google.cloud.dialogflow.cx.v3beta1.IExceptionDetail|null); + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IStatus): google.cloud.dialogflow.cx.v3beta1.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.dialogflow.cx.v3beta1.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.dialogflow.cx.v3beta1.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExceptionDetail. */ + interface IExceptionDetail { + + /** ExceptionDetail errorMessage */ + errorMessage?: (string|null); + } + + /** Represents an ExceptionDetail. */ + class ExceptionDetail implements IExceptionDetail { + + /** + * Constructs a new ExceptionDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExceptionDetail); + + /** ExceptionDetail errorMessage. */ + public errorMessage: string; + + /** + * Creates a new ExceptionDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns ExceptionDetail instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExceptionDetail): google.cloud.dialogflow.cx.v3beta1.ExceptionDetail; + + /** + * Encodes the specified ExceptionDetail message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.verify|verify} messages. + * @param message ExceptionDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExceptionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExceptionDetail message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.verify|verify} messages. + * @param message ExceptionDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExceptionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExceptionDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExceptionDetail + * @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.dialogflow.cx.v3beta1.ExceptionDetail; + + /** + * Decodes an ExceptionDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExceptionDetail + * @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.dialogflow.cx.v3beta1.ExceptionDetail; + + /** + * Verifies an ExceptionDetail 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 ExceptionDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExceptionDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExceptionDetail; + + /** + * Creates a plain object from an ExceptionDetail message. Also converts values to other types if specified. + * @param message ExceptionDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExceptionDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExceptionDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExceptionDetail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** OutputState enum. */ + enum OutputState { + OUTPUT_STATE_UNSPECIFIED = 0, + OUTPUT_STATE_OK = 1, + OUTPUT_STATE_CANCELLED = 2, + OUTPUT_STATE_FAILED = 3, + OUTPUT_STATE_ESCALATED = 4, + OUTPUT_STATE_PENDING = 5 + } + + /** RetrievalStrategy enum. */ + enum RetrievalStrategy { + RETRIEVAL_STRATEGY_UNSPECIFIED = 0, + DEFAULT = 1, + STATIC = 2, + NEVER = 3 + } + + /** Represents a SessionEntityTypes */ + class SessionEntityTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new SessionEntityTypes service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SessionEntityTypes service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SessionEntityTypes; + + /** + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + */ + public listSessionEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypesCallback): void; + + /** + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object + * @returns Promise + */ + public listSessionEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest): Promise; + + /** + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public getSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityTypeCallback): void; + + /** + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public getSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest): Promise; + + /** + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public createSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityTypeCallback): void; + + /** + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public createSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest): Promise; + + /** + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public updateSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityTypeCallback): void; + + /** + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public updateSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest): Promise; + + /** + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityTypeCallback): void; + + /** + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public deleteSessionEntityType(request: google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest): Promise; + } + + namespace SessionEntityTypes { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|listSessionEntityTypes}. + * @param error Error, if any + * @param [response] ListSessionEntityTypesResponse + */ + type ListSessionEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|getSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type GetSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SessionEntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|createSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type CreateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SessionEntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|updateSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type UpdateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SessionEntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|deleteSessionEntityType}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSessionEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a SessionEntityType. */ + interface ISessionEntityType { + + /** SessionEntityType name */ + name?: (string|null); + + /** SessionEntityType entityOverrideMode */ + entityOverrideMode?: (google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode|null); + + /** SessionEntityType entities */ + entities?: (google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity[]|null); + } + + /** Represents a SessionEntityType. */ + class SessionEntityType implements ISessionEntityType { + + /** + * Constructs a new SessionEntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISessionEntityType); + + /** SessionEntityType name. */ + public name: string; + + /** SessionEntityType entityOverrideMode. */ + public entityOverrideMode: (google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode); + + /** SessionEntityType entities. */ + public entities: google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity[]; + + /** + * Creates a new SessionEntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionEntityType instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISessionEntityType): google.cloud.dialogflow.cx.v3beta1.SessionEntityType; + + /** + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionEntityType + * @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.dialogflow.cx.v3beta1.SessionEntityType; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionEntityType + * @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.dialogflow.cx.v3beta1.SessionEntityType; + + /** + * Verifies a SessionEntityType 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 SessionEntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionEntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SessionEntityType; + + /** + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * @param message SessionEntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SessionEntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionEntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionEntityType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionEntityType { + + /** EntityOverrideMode enum. */ + enum EntityOverrideMode { + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0, + ENTITY_OVERRIDE_MODE_OVERRIDE = 1, + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 + } + } + + /** Properties of a ListSessionEntityTypesRequest. */ + interface IListSessionEntityTypesRequest { + + /** ListSessionEntityTypesRequest parent */ + parent?: (string|null); + + /** ListSessionEntityTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionEntityTypesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSessionEntityTypesRequest. */ + class ListSessionEntityTypesRequest implements IListSessionEntityTypesRequest { + + /** + * Constructs a new ListSessionEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest); + + /** ListSessionEntityTypesRequest parent. */ + public parent: string; + + /** ListSessionEntityTypesRequest pageSize. */ + public pageSize: number; + + /** ListSessionEntityTypesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest): google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest; + + /** + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest; + + /** + * Verifies a ListSessionEntityTypesRequest 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 ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest; + + /** + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionEntityTypesResponse. */ + interface IListSessionEntityTypesResponse { + + /** ListSessionEntityTypesResponse sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[]|null); + + /** ListSessionEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSessionEntityTypesResponse. */ + class ListSessionEntityTypesResponse implements IListSessionEntityTypesResponse { + + /** + * Constructs a new ListSessionEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse); + + /** ListSessionEntityTypesResponse sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[]; + + /** ListSessionEntityTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse): google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse; + + /** + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse; + + /** + * Verifies a ListSessionEntityTypesResponse 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 ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse; + + /** + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSessionEntityTypeRequest. */ + interface IGetSessionEntityTypeRequest { + + /** GetSessionEntityTypeRequest name */ + name?: (string|null); + } + + /** Represents a GetSessionEntityTypeRequest. */ + class GetSessionEntityTypeRequest implements IGetSessionEntityTypeRequest { + + /** + * Constructs a new GetSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest); + + /** GetSessionEntityTypeRequest name. */ + public name: string; + + /** + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest; + + /** + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest; + + /** + * Verifies a GetSessionEntityTypeRequest 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 GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest; + + /** + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSessionEntityTypeRequest. */ + interface ICreateSessionEntityTypeRequest { + + /** CreateSessionEntityTypeRequest parent */ + parent?: (string|null); + + /** CreateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null); + } + + /** Represents a CreateSessionEntityTypeRequest. */ + class CreateSessionEntityTypeRequest implements ICreateSessionEntityTypeRequest { + + /** + * Constructs a new CreateSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest); + + /** CreateSessionEntityTypeRequest parent. */ + public parent: string; + + /** CreateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null); + + /** + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; + + /** + * Verifies a CreateSessionEntityTypeRequest 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 CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; + + /** + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSessionEntityTypeRequest. */ + interface IUpdateSessionEntityTypeRequest { + + /** UpdateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null); + + /** UpdateSessionEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSessionEntityTypeRequest. */ + class UpdateSessionEntityTypeRequest implements IUpdateSessionEntityTypeRequest { + + /** + * Constructs a new UpdateSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest); + + /** UpdateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null); + + /** UpdateSessionEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; + + /** + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; + + /** + * Verifies an UpdateSessionEntityTypeRequest 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 UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; + + /** + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSessionEntityTypeRequest. */ + interface IDeleteSessionEntityTypeRequest { + + /** DeleteSessionEntityTypeRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSessionEntityTypeRequest. */ + class DeleteSessionEntityTypeRequest implements IDeleteSessionEntityTypeRequest { + + /** + * Constructs a new DeleteSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest); + + /** DeleteSessionEntityTypeRequest name. */ + public name: string; + + /** + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest; + + /** + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSessionEntityTypeRequest + * @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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest; + + /** + * Verifies a DeleteSessionEntityTypeRequest 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 DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest; + + /** + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSessionEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an EntityTypes */ + class EntityTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new EntityTypes service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new EntityTypes service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EntityTypes; + + /** + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public getEntityType(request: google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityTypeCallback): void; + + /** + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @returns Promise + */ + public getEntityType(request: google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest): Promise; + + /** + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public createEntityType(request: google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityTypeCallback): void; + + /** + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @returns Promise + */ + public createEntityType(request: google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest): Promise; + + /** + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public updateEntityType(request: google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityTypeCallback): void; + + /** + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @returns Promise + */ + public updateEntityType(request: google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest): Promise; + + /** + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEntityType(request: google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest, callback: google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityTypeCallback): void; + + /** + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @returns Promise + */ + public deleteEntityType(request: google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest): Promise; + + /** + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEntityTypesResponse + */ + public listEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypesCallback): void; + + /** + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @returns Promise + */ + public listEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest): Promise; + + /** + * Calls ExportEntityTypes. + * @param request ExportEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3beta1.EntityTypes.ExportEntityTypesCallback): void; + + /** + * Calls ExportEntityTypes. + * @param request ExportEntityTypesRequest message or plain object + * @returns Promise + */ + public exportEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest): Promise; + + /** + * Calls ImportEntityTypes. + * @param request ImportEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest, callback: google.cloud.dialogflow.cx.v3beta1.EntityTypes.ImportEntityTypesCallback): void; + + /** + * Calls ImportEntityTypes. + * @param request ImportEntityTypesRequest message or plain object + * @returns Promise + */ + public importEntityTypes(request: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest): Promise; + } + + namespace EntityTypes { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|getEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type GetEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.EntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|createEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type CreateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.EntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|updateEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type UpdateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.EntityType) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|deleteEntityType}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|listEntityTypes}. + * @param error Error, if any + * @param [response] ListEntityTypesResponse + */ + type ListEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|exportEntityTypes}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|importEntityTypes}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an EntityType. */ + interface IEntityType { + + /** EntityType name */ + name?: (string|null); + + /** EntityType displayName */ + displayName?: (string|null); + + /** EntityType kind */ + kind?: (google.cloud.dialogflow.cx.v3beta1.EntityType.Kind|keyof typeof google.cloud.dialogflow.cx.v3beta1.EntityType.Kind|null); + + /** EntityType autoExpansionMode */ + autoExpansionMode?: (google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode|null); + + /** EntityType entities */ + entities?: (google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity[]|null); + + /** EntityType excludedPhrases */ + excludedPhrases?: (google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase[]|null); + + /** EntityType enableFuzzyExtraction */ + enableFuzzyExtraction?: (boolean|null); + + /** EntityType redact */ + redact?: (boolean|null); + } + + /** Represents an EntityType. */ + class EntityType implements IEntityType { + + /** + * Constructs a new EntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IEntityType); + + /** EntityType name. */ + public name: string; + + /** EntityType displayName. */ + public displayName: string; + + /** EntityType kind. */ + public kind: (google.cloud.dialogflow.cx.v3beta1.EntityType.Kind|keyof typeof google.cloud.dialogflow.cx.v3beta1.EntityType.Kind); + + /** EntityType autoExpansionMode. */ + public autoExpansionMode: (google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode); + + /** EntityType entities. */ + public entities: google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity[]; + + /** EntityType excludedPhrases. */ + public excludedPhrases: google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase[]; + + /** EntityType enableFuzzyExtraction. */ + public enableFuzzyExtraction: boolean; + + /** EntityType redact. */ + public redact: boolean; + + /** + * Creates a new EntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityType instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IEntityType): google.cloud.dialogflow.cx.v3beta1.EntityType; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityType + * @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.dialogflow.cx.v3beta1.EntityType; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityType + * @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.dialogflow.cx.v3beta1.EntityType; + + /** + * Verifies an EntityType 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 EntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.EntityType; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @param message EntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityType { + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + KIND_MAP = 1, + KIND_LIST = 2, + KIND_REGEXP = 3 + } + + /** AutoExpansionMode enum. */ + enum AutoExpansionMode { + AUTO_EXPANSION_MODE_UNSPECIFIED = 0, + AUTO_EXPANSION_MODE_DEFAULT = 1 + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity value */ + value?: (string|null); + + /** Entity synonyms */ + synonyms?: (string[]|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity); + + /** Entity value. */ + public value: string; + + /** Entity synonyms. */ + public synonyms: string[]; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity): google.cloud.dialogflow.cx.v3beta1.EntityType.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @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.dialogflow.cx.v3beta1.EntityType.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @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.dialogflow.cx.v3beta1.EntityType.Entity; + + /** + * Verifies an Entity 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.EntityType.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.EntityType.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExcludedPhrase. */ + interface IExcludedPhrase { + + /** ExcludedPhrase value */ + value?: (string|null); + } + + /** Represents an ExcludedPhrase. */ + class ExcludedPhrase implements IExcludedPhrase { + + /** + * Constructs a new ExcludedPhrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase); + + /** ExcludedPhrase value. */ + public value: string; + + /** + * Creates a new ExcludedPhrase instance using the specified properties. + * @param [properties] Properties to set + * @returns ExcludedPhrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase): google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase; + + /** + * Encodes the specified ExcludedPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.verify|verify} messages. + * @param message ExcludedPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExcludedPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.verify|verify} messages. + * @param message ExcludedPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExcludedPhrase + * @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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExcludedPhrase + * @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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase; + + /** + * Verifies an ExcludedPhrase 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 ExcludedPhrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExcludedPhrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase; + + /** + * Creates a plain object from an ExcludedPhrase message. Also converts values to other types if specified. + * @param message ExcludedPhrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExcludedPhrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExcludedPhrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportEntityTypesRequest. */ + interface IExportEntityTypesRequest { + + /** ExportEntityTypesRequest parent */ + parent?: (string|null); + + /** ExportEntityTypesRequest entityTypes */ + entityTypes?: (string[]|null); + + /** ExportEntityTypesRequest entityTypesUri */ + entityTypesUri?: (string|null); + + /** ExportEntityTypesRequest entityTypesContentInline */ + entityTypesContentInline?: (boolean|null); + + /** ExportEntityTypesRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat|null); + + /** ExportEntityTypesRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents an ExportEntityTypesRequest. */ + class ExportEntityTypesRequest implements IExportEntityTypesRequest { + + /** + * Constructs a new ExportEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest); + + /** ExportEntityTypesRequest parent. */ + public parent: string; + + /** ExportEntityTypesRequest entityTypes. */ + public entityTypes: string[]; + + /** ExportEntityTypesRequest entityTypesUri. */ + public entityTypesUri?: (string|null); + + /** ExportEntityTypesRequest entityTypesContentInline. */ + public entityTypesContentInline?: (boolean|null); + + /** ExportEntityTypesRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat); + + /** ExportEntityTypesRequest languageCode. */ + public languageCode: string; + + /** ExportEntityTypesRequest destination. */ + public destination?: ("entityTypesUri"|"entityTypesContentInline"); + + /** + * Creates a new ExportEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest): google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest; + + /** + * Encodes the specified ExportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.verify|verify} messages. + * @param message ExportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.verify|verify} messages. + * @param message ExportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ExportEntityTypesRequest; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ExportEntityTypesRequest; + + /** + * Verifies an ExportEntityTypesRequest 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 ExportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest; + + /** + * Creates a plain object from an ExportEntityTypesRequest message. Also converts values to other types if specified. + * @param message ExportEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportEntityTypesRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON_PACKAGE = 5 + } + } + + /** Properties of an ExportEntityTypesResponse. */ + interface IExportEntityTypesResponse { + + /** ExportEntityTypesResponse entityTypesUri */ + entityTypesUri?: (string|null); + + /** ExportEntityTypesResponse entityTypesContent */ + entityTypesContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null); + } + + /** Represents an ExportEntityTypesResponse. */ + class ExportEntityTypesResponse implements IExportEntityTypesResponse { + + /** + * Constructs a new ExportEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse); + + /** ExportEntityTypesResponse entityTypesUri. */ + public entityTypesUri?: (string|null); + + /** ExportEntityTypesResponse entityTypesContent. */ + public entityTypesContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null); + + /** ExportEntityTypesResponse exportedEntityTypes. */ + public exportedEntityTypes?: ("entityTypesUri"|"entityTypesContent"); + + /** + * Creates a new ExportEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse): google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse; + + /** + * Encodes the specified ExportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse.verify|verify} messages. + * @param message ExportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse.verify|verify} messages. + * @param message ExportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ExportEntityTypesResponse; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ExportEntityTypesResponse; + + /** + * Verifies an ExportEntityTypesResponse 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 ExportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse; + + /** + * Creates a plain object from an ExportEntityTypesResponse message. Also converts values to other types if specified. + * @param message ExportEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportEntityTypesMetadata. */ + interface IExportEntityTypesMetadata { + } + + /** Represents an ExportEntityTypesMetadata. */ + class ExportEntityTypesMetadata implements IExportEntityTypesMetadata { + + /** + * Constructs a new ExportEntityTypesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata); + + /** + * Creates a new ExportEntityTypesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntityTypesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata): google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata; + + /** + * Encodes the specified ExportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata.verify|verify} messages. + * @param message ExportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata.verify|verify} messages. + * @param message ExportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntityTypesMetadata + * @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.dialogflow.cx.v3beta1.ExportEntityTypesMetadata; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntityTypesMetadata + * @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.dialogflow.cx.v3beta1.ExportEntityTypesMetadata; + + /** + * Verifies an ExportEntityTypesMetadata 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 ExportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntityTypesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata; + + /** + * Creates a plain object from an ExportEntityTypesMetadata message. Also converts values to other types if specified. + * @param message ExportEntityTypesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEntityTypesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEntityTypesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportEntityTypesRequest. */ + interface IImportEntityTypesRequest { + + /** ImportEntityTypesRequest parent */ + parent?: (string|null); + + /** ImportEntityTypesRequest entityTypesUri */ + entityTypesUri?: (string|null); + + /** ImportEntityTypesRequest entityTypesContent */ + entityTypesContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineSource|null); + + /** ImportEntityTypesRequest mergeOption */ + mergeOption?: (google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption|null); + + /** ImportEntityTypesRequest targetEntityType */ + targetEntityType?: (string|null); + } + + /** Represents an ImportEntityTypesRequest. */ + class ImportEntityTypesRequest implements IImportEntityTypesRequest { + + /** + * Constructs a new ImportEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest); + + /** ImportEntityTypesRequest parent. */ + public parent: string; + + /** ImportEntityTypesRequest entityTypesUri. */ + public entityTypesUri?: (string|null); + + /** ImportEntityTypesRequest entityTypesContent. */ + public entityTypesContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineSource|null); + + /** ImportEntityTypesRequest mergeOption. */ + public mergeOption: (google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption); + + /** ImportEntityTypesRequest targetEntityType. */ + public targetEntityType: string; + + /** ImportEntityTypesRequest entityTypes. */ + public entityTypes?: ("entityTypesUri"|"entityTypesContent"); + + /** + * Creates a new ImportEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest; + + /** + * Encodes the specified ImportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.verify|verify} messages. + * @param message ImportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.verify|verify} messages. + * @param message ImportEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ImportEntityTypesRequest; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ImportEntityTypesRequest; + + /** + * Verifies an ImportEntityTypesRequest 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 ImportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest; + + /** + * Creates a plain object from an ImportEntityTypesRequest message. Also converts values to other types if specified. + * @param message ImportEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportEntityTypesRequest { + + /** MergeOption enum. */ + enum MergeOption { + MERGE_OPTION_UNSPECIFIED = 0, + REPLACE = 1, + MERGE = 2, + RENAME = 3, + REPORT_CONFLICT = 4, + KEEP = 5 + } + } + + /** Properties of an ImportEntityTypesResponse. */ + interface IImportEntityTypesResponse { + + /** ImportEntityTypesResponse entityTypes */ + entityTypes?: (string[]|null); + + /** ImportEntityTypesResponse conflictingResources */ + conflictingResources?: (google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources|null); + } + + /** Represents an ImportEntityTypesResponse. */ + class ImportEntityTypesResponse implements IImportEntityTypesResponse { + + /** + * Constructs a new ImportEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse); + + /** ImportEntityTypesResponse entityTypes. */ + public entityTypes: string[]; + + /** ImportEntityTypesResponse conflictingResources. */ + public conflictingResources?: (google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources|null); + + /** + * Creates a new ImportEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse; + + /** + * Encodes the specified ImportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.verify|verify} messages. + * @param message ImportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.verify|verify} messages. + * @param message ImportEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ImportEntityTypesResponse; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ImportEntityTypesResponse; + + /** + * Verifies an ImportEntityTypesResponse 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 ImportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse; + + /** + * Creates a plain object from an ImportEntityTypesResponse message. Also converts values to other types if specified. + * @param message ImportEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportEntityTypesResponse { + + /** Properties of a ConflictingResources. */ + interface IConflictingResources { + + /** ConflictingResources entityTypeDisplayNames */ + entityTypeDisplayNames?: (string[]|null); + + /** ConflictingResources entityDisplayNames */ + entityDisplayNames?: (string[]|null); + } + + /** Represents a ConflictingResources. */ + class ConflictingResources implements IConflictingResources { + + /** + * Constructs a new ConflictingResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources); + + /** ConflictingResources entityTypeDisplayNames. */ + public entityTypeDisplayNames: string[]; + + /** ConflictingResources entityDisplayNames. */ + public entityDisplayNames: string[]; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ConflictingResources instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConflictingResources + * @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.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConflictingResources + * @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.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources; + + /** + * Verifies a ConflictingResources 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 ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConflictingResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @param message ConflictingResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConflictingResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConflictingResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportEntityTypesMetadata. */ + interface IImportEntityTypesMetadata { + } + + /** Represents an ImportEntityTypesMetadata. */ + class ImportEntityTypesMetadata implements IImportEntityTypesMetadata { + + /** + * Constructs a new ImportEntityTypesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata); + + /** + * Creates a new ImportEntityTypesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntityTypesMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata; + + /** + * Encodes the specified ImportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata.verify|verify} messages. + * @param message ImportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata.verify|verify} messages. + * @param message ImportEntityTypesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntityTypesMetadata + * @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.dialogflow.cx.v3beta1.ImportEntityTypesMetadata; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntityTypesMetadata + * @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.dialogflow.cx.v3beta1.ImportEntityTypesMetadata; + + /** + * Verifies an ImportEntityTypesMetadata 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 ImportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntityTypesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata; + + /** + * Creates a plain object from an ImportEntityTypesMetadata message. Also converts values to other types if specified. + * @param message ImportEntityTypesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEntityTypesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEntityTypesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEntityTypesRequest. */ + interface IListEntityTypesRequest { + + /** ListEntityTypesRequest parent */ + parent?: (string|null); + + /** ListEntityTypesRequest languageCode */ + languageCode?: (string|null); + + /** ListEntityTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListEntityTypesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEntityTypesRequest. */ + class ListEntityTypesRequest implements IListEntityTypesRequest { + + /** + * Constructs a new ListEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest); + + /** ListEntityTypesRequest parent. */ + public parent: string; + + /** ListEntityTypesRequest languageCode. */ + public languageCode: string; + + /** ListEntityTypesRequest pageSize. */ + public pageSize: number; + + /** ListEntityTypesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest): google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest; + + /** + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ListEntityTypesRequest; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntityTypesRequest + * @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.dialogflow.cx.v3beta1.ListEntityTypesRequest; + + /** + * Verifies a ListEntityTypesRequest 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 ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest; + + /** + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntityTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEntityTypesResponse. */ + interface IListEntityTypesResponse { + + /** ListEntityTypesResponse entityTypes */ + entityTypes?: (google.cloud.dialogflow.cx.v3beta1.IEntityType[]|null); + + /** ListEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEntityTypesResponse. */ + class ListEntityTypesResponse implements IListEntityTypesResponse { + + /** + * Constructs a new ListEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse); + + /** ListEntityTypesResponse entityTypes. */ + public entityTypes: google.cloud.dialogflow.cx.v3beta1.IEntityType[]; + + /** ListEntityTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse): google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse; + + /** + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ListEntityTypesResponse; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntityTypesResponse + * @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.dialogflow.cx.v3beta1.ListEntityTypesResponse; + + /** + * Verifies a ListEntityTypesResponse 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 ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse; + + /** + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntityTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEntityTypeRequest. */ + interface IGetEntityTypeRequest { + + /** GetEntityTypeRequest name */ + name?: (string|null); + + /** GetEntityTypeRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetEntityTypeRequest. */ + class GetEntityTypeRequest implements IGetEntityTypeRequest { + + /** + * Constructs a new GetEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest); + + /** GetEntityTypeRequest name. */ + public name: string; + + /** GetEntityTypeRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest; + + /** + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEntityTypeRequest + * @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.dialogflow.cx.v3beta1.GetEntityTypeRequest; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEntityTypeRequest + * @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.dialogflow.cx.v3beta1.GetEntityTypeRequest; + + /** + * Verifies a GetEntityTypeRequest 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 GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest; + + /** + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEntityTypeRequest. */ + interface ICreateEntityTypeRequest { + + /** CreateEntityTypeRequest parent */ + parent?: (string|null); + + /** CreateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.cx.v3beta1.IEntityType|null); + + /** CreateEntityTypeRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateEntityTypeRequest. */ + class CreateEntityTypeRequest implements ICreateEntityTypeRequest { + + /** + * Constructs a new CreateEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest); + + /** CreateEntityTypeRequest parent. */ + public parent: string; + + /** CreateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.cx.v3beta1.IEntityType|null); + + /** CreateEntityTypeRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest; + + /** + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEntityTypeRequest + * @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.dialogflow.cx.v3beta1.CreateEntityTypeRequest; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEntityTypeRequest + * @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.dialogflow.cx.v3beta1.CreateEntityTypeRequest; + + /** + * Verifies a CreateEntityTypeRequest 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 CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest; + + /** + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEntityTypeRequest. */ + interface IUpdateEntityTypeRequest { + + /** UpdateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.cx.v3beta1.IEntityType|null); + + /** UpdateEntityTypeRequest languageCode */ + languageCode?: (string|null); + + /** UpdateEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEntityTypeRequest. */ + class UpdateEntityTypeRequest implements IUpdateEntityTypeRequest { + + /** + * Constructs a new UpdateEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest); + + /** UpdateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.cx.v3beta1.IEntityType|null); + + /** UpdateEntityTypeRequest languageCode. */ + public languageCode: string; + + /** UpdateEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; + + /** + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEntityTypeRequest + * @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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEntityTypeRequest + * @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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; + + /** + * Verifies an UpdateEntityTypeRequest 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 UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; + + /** + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEntityTypeRequest. */ + interface IDeleteEntityTypeRequest { + + /** DeleteEntityTypeRequest name */ + name?: (string|null); + + /** DeleteEntityTypeRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteEntityTypeRequest. */ + class DeleteEntityTypeRequest implements IDeleteEntityTypeRequest { + + /** + * Constructs a new DeleteEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest); + + /** DeleteEntityTypeRequest name. */ + public name: string; + + /** DeleteEntityTypeRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest): google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest; + + /** + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEntityTypeRequest + * @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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEntityTypeRequest + * @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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest; + + /** + * Verifies a DeleteEntityTypeRequest 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 DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest; + + /** + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEntityTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TransitionRouteGroups */ + class TransitionRouteGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new TransitionRouteGroups service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TransitionRouteGroups service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TransitionRouteGroups; + + /** + * Calls ListTransitionRouteGroups. + * @param request ListTransitionRouteGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransitionRouteGroupsResponse + */ + public listTransitionRouteGroups(request: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, callback: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroupsCallback): void; + + /** + * Calls ListTransitionRouteGroups. + * @param request ListTransitionRouteGroupsRequest message or plain object + * @returns Promise + */ + public listTransitionRouteGroups(request: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest): Promise; + + /** + * Calls GetTransitionRouteGroup. + * @param request GetTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransitionRouteGroup + */ + public getTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroupCallback): void; + + /** + * Calls GetTransitionRouteGroup. + * @param request GetTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public getTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest): Promise; + + /** + * Calls CreateTransitionRouteGroup. + * @param request CreateTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransitionRouteGroup + */ + public createTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroupCallback): void; + + /** + * Calls CreateTransitionRouteGroup. + * @param request CreateTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public createTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest): Promise; + + /** + * Calls UpdateTransitionRouteGroup. + * @param request UpdateTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransitionRouteGroup + */ + public updateTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroupCallback): void; + + /** + * Calls UpdateTransitionRouteGroup. + * @param request UpdateTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public updateTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest): Promise; + + /** + * Calls DeleteTransitionRouteGroup. + * @param request DeleteTransitionRouteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest, callback: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroupCallback): void; + + /** + * Calls DeleteTransitionRouteGroup. + * @param request DeleteTransitionRouteGroupRequest message or plain object + * @returns Promise + */ + public deleteTransitionRouteGroup(request: google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest): Promise; + } + + namespace TransitionRouteGroups { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|listTransitionRouteGroups}. + * @param error Error, if any + * @param [response] ListTransitionRouteGroupsResponse + */ + type ListTransitionRouteGroupsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|getTransitionRouteGroup}. + * @param error Error, if any + * @param [response] TransitionRouteGroup + */ + type GetTransitionRouteGroupCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|createTransitionRouteGroup}. + * @param error Error, if any + * @param [response] TransitionRouteGroup + */ + type CreateTransitionRouteGroupCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|updateTransitionRouteGroup}. + * @param error Error, if any + * @param [response] TransitionRouteGroup + */ + type UpdateTransitionRouteGroupCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|deleteTransitionRouteGroup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTransitionRouteGroupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a TransitionRouteGroup. */ + interface ITransitionRouteGroup { + + /** TransitionRouteGroup name */ + name?: (string|null); + + /** TransitionRouteGroup displayName */ + displayName?: (string|null); + + /** TransitionRouteGroup transitionRoutes */ + transitionRoutes?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRoute[]|null); + } + + /** Represents a TransitionRouteGroup. */ + class TransitionRouteGroup implements ITransitionRouteGroup { + + /** + * Constructs a new TransitionRouteGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup); + + /** TransitionRouteGroup name. */ + public name: string; + + /** TransitionRouteGroup displayName. */ + public displayName: string; + + /** TransitionRouteGroup transitionRoutes. */ + public transitionRoutes: google.cloud.dialogflow.cx.v3beta1.ITransitionRoute[]; + + /** + * Creates a new TransitionRouteGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionRouteGroup instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup; + + /** + * Encodes the specified TransitionRouteGroup message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify|verify} messages. + * @param message TransitionRouteGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionRouteGroup message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify|verify} messages. + * @param message TransitionRouteGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionRouteGroup + * @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.dialogflow.cx.v3beta1.TransitionRouteGroup; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionRouteGroup + * @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.dialogflow.cx.v3beta1.TransitionRouteGroup; + + /** + * Verifies a TransitionRouteGroup 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 TransitionRouteGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionRouteGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup; + + /** + * Creates a plain object from a TransitionRouteGroup message. Also converts values to other types if specified. + * @param message TransitionRouteGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionRouteGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionRouteGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransitionRouteGroupsRequest. */ + interface IListTransitionRouteGroupsRequest { + + /** ListTransitionRouteGroupsRequest parent */ + parent?: (string|null); + + /** ListTransitionRouteGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListTransitionRouteGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransitionRouteGroupsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListTransitionRouteGroupsRequest. */ + class ListTransitionRouteGroupsRequest implements IListTransitionRouteGroupsRequest { + + /** + * Constructs a new ListTransitionRouteGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest); + + /** ListTransitionRouteGroupsRequest parent. */ + public parent: string; + + /** ListTransitionRouteGroupsRequest pageSize. */ + public pageSize: number; + + /** ListTransitionRouteGroupsRequest pageToken. */ + public pageToken: string; + + /** ListTransitionRouteGroupsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListTransitionRouteGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransitionRouteGroupsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest): google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @param message ListTransitionRouteGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @param message ListTransitionRouteGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransitionRouteGroupsRequest + * @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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransitionRouteGroupsRequest + * @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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest; + + /** + * Verifies a ListTransitionRouteGroupsRequest 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 ListTransitionRouteGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransitionRouteGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest; + + /** + * Creates a plain object from a ListTransitionRouteGroupsRequest message. Also converts values to other types if specified. + * @param message ListTransitionRouteGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransitionRouteGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransitionRouteGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransitionRouteGroupsResponse. */ + interface IListTransitionRouteGroupsResponse { + + /** ListTransitionRouteGroupsResponse transitionRouteGroups */ + transitionRouteGroups?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[]|null); + + /** ListTransitionRouteGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransitionRouteGroupsResponse. */ + class ListTransitionRouteGroupsResponse implements IListTransitionRouteGroupsResponse { + + /** + * Constructs a new ListTransitionRouteGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse); + + /** ListTransitionRouteGroupsResponse transitionRouteGroups. */ + public transitionRouteGroups: google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[]; + + /** ListTransitionRouteGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransitionRouteGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransitionRouteGroupsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse): google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse; + + /** + * Encodes the specified ListTransitionRouteGroupsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @param message ListTransitionRouteGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransitionRouteGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @param message ListTransitionRouteGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransitionRouteGroupsResponse + * @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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransitionRouteGroupsResponse + * @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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse; + + /** + * Verifies a ListTransitionRouteGroupsResponse 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 ListTransitionRouteGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransitionRouteGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse; + + /** + * Creates a plain object from a ListTransitionRouteGroupsResponse message. Also converts values to other types if specified. + * @param message ListTransitionRouteGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransitionRouteGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransitionRouteGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTransitionRouteGroupRequest. */ + interface IGetTransitionRouteGroupRequest { + + /** GetTransitionRouteGroupRequest name */ + name?: (string|null); + + /** GetTransitionRouteGroupRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetTransitionRouteGroupRequest. */ + class GetTransitionRouteGroupRequest implements IGetTransitionRouteGroupRequest { + + /** + * Constructs a new GetTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest); + + /** GetTransitionRouteGroupRequest name. */ + public name: string; + + /** GetTransitionRouteGroupRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.verify|verify} messages. + * @param message GetTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.verify|verify} messages. + * @param message GetTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest; + + /** + * Verifies a GetTransitionRouteGroupRequest 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 GetTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest; + + /** + * Creates a plain object from a GetTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message GetTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTransitionRouteGroupRequest. */ + interface ICreateTransitionRouteGroupRequest { + + /** CreateTransitionRouteGroupRequest parent */ + parent?: (string|null); + + /** CreateTransitionRouteGroupRequest transitionRouteGroup */ + transitionRouteGroup?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null); + + /** CreateTransitionRouteGroupRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateTransitionRouteGroupRequest. */ + class CreateTransitionRouteGroupRequest implements ICreateTransitionRouteGroupRequest { + + /** + * Constructs a new CreateTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest); + + /** CreateTransitionRouteGroupRequest parent. */ + public parent: string; + + /** CreateTransitionRouteGroupRequest transitionRouteGroup. */ + public transitionRouteGroup?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null); + + /** CreateTransitionRouteGroupRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @param message CreateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @param message CreateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; + + /** + * Verifies a CreateTransitionRouteGroupRequest 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 CreateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; + + /** + * Creates a plain object from a CreateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message CreateTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTransitionRouteGroupRequest. */ + interface IUpdateTransitionRouteGroupRequest { + + /** UpdateTransitionRouteGroupRequest transitionRouteGroup */ + transitionRouteGroup?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null); + + /** UpdateTransitionRouteGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransitionRouteGroupRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents an UpdateTransitionRouteGroupRequest. */ + class UpdateTransitionRouteGroupRequest implements IUpdateTransitionRouteGroupRequest { + + /** + * Constructs a new UpdateTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest); + + /** UpdateTransitionRouteGroupRequest transitionRouteGroup. */ + public transitionRouteGroup?: (google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null); + + /** UpdateTransitionRouteGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransitionRouteGroupRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new UpdateTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @param message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @param message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; + + /** + * Verifies an UpdateTransitionRouteGroupRequest 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 UpdateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; + + /** + * Creates a plain object from an UpdateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message UpdateTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTransitionRouteGroupRequest. */ + interface IDeleteTransitionRouteGroupRequest { + + /** DeleteTransitionRouteGroupRequest name */ + name?: (string|null); + + /** DeleteTransitionRouteGroupRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteTransitionRouteGroupRequest. */ + class DeleteTransitionRouteGroupRequest implements IDeleteTransitionRouteGroupRequest { + + /** + * Constructs a new DeleteTransitionRouteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest); + + /** DeleteTransitionRouteGroupRequest name. */ + public name: string; + + /** DeleteTransitionRouteGroupRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteTransitionRouteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTransitionRouteGroupRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest): google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @param message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @param message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTransitionRouteGroupRequest + * @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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest; + + /** + * Verifies a DeleteTransitionRouteGroupRequest 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 DeleteTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTransitionRouteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest; + + /** + * Creates a plain object from a DeleteTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @param message DeleteTransitionRouteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTransitionRouteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTransitionRouteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Webhooks */ + class Webhooks extends $protobuf.rpc.Service { + + /** + * Constructs a new Webhooks service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Webhooks service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Webhooks; + + /** + * Calls ListWebhooks. + * @param request ListWebhooksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWebhooksResponse + */ + public listWebhooks(request: google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, callback: google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooksCallback): void; + + /** + * Calls ListWebhooks. + * @param request ListWebhooksRequest message or plain object + * @returns Promise + */ + public listWebhooks(request: google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest): Promise; + + /** + * Calls GetWebhook. + * @param request GetWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Webhook + */ + public getWebhook(request: google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhookCallback): void; + + /** + * Calls GetWebhook. + * @param request GetWebhookRequest message or plain object + * @returns Promise + */ + public getWebhook(request: google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest): Promise; + + /** + * Calls CreateWebhook. + * @param request CreateWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Webhook + */ + public createWebhook(request: google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhookCallback): void; + + /** + * Calls CreateWebhook. + * @param request CreateWebhookRequest message or plain object + * @returns Promise + */ + public createWebhook(request: google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest): Promise; + + /** + * Calls UpdateWebhook. + * @param request UpdateWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Webhook + */ + public updateWebhook(request: google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhookCallback): void; + + /** + * Calls UpdateWebhook. + * @param request UpdateWebhookRequest message or plain object + * @returns Promise + */ + public updateWebhook(request: google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest): Promise; + + /** + * Calls DeleteWebhook. + * @param request DeleteWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteWebhook(request: google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhookCallback): void; + + /** + * Calls DeleteWebhook. + * @param request DeleteWebhookRequest message or plain object + * @returns Promise + */ + public deleteWebhook(request: google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest): Promise; + } + + namespace Webhooks { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|listWebhooks}. + * @param error Error, if any + * @param [response] ListWebhooksResponse + */ + type ListWebhooksCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|getWebhook}. + * @param error Error, if any + * @param [response] Webhook + */ + type GetWebhookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Webhook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|createWebhook}. + * @param error Error, if any + * @param [response] Webhook + */ + type CreateWebhookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Webhook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|updateWebhook}. + * @param error Error, if any + * @param [response] Webhook + */ + type UpdateWebhookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Webhook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|deleteWebhook}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteWebhookCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Webhook. */ + interface IWebhook { + + /** Webhook name */ + name?: (string|null); + + /** Webhook displayName */ + displayName?: (string|null); + + /** Webhook genericWebService */ + genericWebService?: (google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null); + + /** Webhook serviceDirectory */ + serviceDirectory?: (google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig|null); + + /** Webhook timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Webhook disabled */ + disabled?: (boolean|null); + } + + /** Represents a Webhook. */ + class Webhook implements IWebhook { + + /** + * Constructs a new Webhook. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IWebhook); + + /** Webhook name. */ + public name: string; + + /** Webhook displayName. */ + public displayName: string; + + /** Webhook genericWebService. */ + public genericWebService?: (google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null); + + /** Webhook serviceDirectory. */ + public serviceDirectory?: (google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig|null); + + /** Webhook timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Webhook disabled. */ + public disabled: boolean; + + /** Webhook webhook. */ + public webhook?: ("genericWebService"|"serviceDirectory"); + + /** + * Creates a new Webhook instance using the specified properties. + * @param [properties] Properties to set + * @returns Webhook instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IWebhook): google.cloud.dialogflow.cx.v3beta1.Webhook; + + /** + * Encodes the specified Webhook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.verify|verify} messages. + * @param message Webhook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IWebhook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Webhook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.verify|verify} messages. + * @param message Webhook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IWebhook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Webhook message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Webhook + * @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.dialogflow.cx.v3beta1.Webhook; + + /** + * Decodes a Webhook message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Webhook + * @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.dialogflow.cx.v3beta1.Webhook; + + /** + * Verifies a Webhook 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 Webhook message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Webhook + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Webhook; + + /** + * Creates a plain object from a Webhook message. Also converts values to other types if specified. + * @param message Webhook + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Webhook, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Webhook to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Webhook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Webhook { + + /** Properties of a GenericWebService. */ + interface IGenericWebService { + + /** GenericWebService uri */ + uri?: (string|null); + + /** GenericWebService username */ + username?: (string|null); + + /** GenericWebService password */ + password?: (string|null); + + /** GenericWebService secretVersionForUsernamePassword */ + secretVersionForUsernamePassword?: (string|null); + + /** GenericWebService requestHeaders */ + requestHeaders?: ({ [k: string]: string }|null); + + /** GenericWebService secretVersionsForRequestHeaders */ + secretVersionsForRequestHeaders?: ({ [k: string]: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue }|null); + + /** GenericWebService allowedCaCerts */ + allowedCaCerts?: (Uint8Array[]|null); + + /** GenericWebService oauthConfig */ + oauthConfig?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig|null); + + /** GenericWebService serviceAgentAuth */ + serviceAgentAuth?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth|null); + + /** GenericWebService serviceAccountAuthConfig */ + serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig|null); + + /** GenericWebService webhookType */ + webhookType?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|null); + + /** GenericWebService httpMethod */ + httpMethod?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|null); + + /** GenericWebService requestBody */ + requestBody?: (string|null); + + /** GenericWebService parameterMapping */ + parameterMapping?: ({ [k: string]: string }|null); + } + + /** Represents a GenericWebService. */ + class GenericWebService implements IGenericWebService { + + /** + * Constructs a new GenericWebService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService); + + /** GenericWebService uri. */ + public uri: string; + + /** GenericWebService username. */ + public username: string; + + /** GenericWebService password. */ + public password: string; + + /** GenericWebService secretVersionForUsernamePassword. */ + public secretVersionForUsernamePassword: string; + + /** GenericWebService requestHeaders. */ + public requestHeaders: { [k: string]: string }; + + /** GenericWebService secretVersionsForRequestHeaders. */ + public secretVersionsForRequestHeaders: { [k: string]: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue }; + + /** GenericWebService allowedCaCerts. */ + public allowedCaCerts: Uint8Array[]; + + /** GenericWebService oauthConfig. */ + public oauthConfig?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig|null); + + /** GenericWebService serviceAgentAuth. */ + public serviceAgentAuth: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth); + + /** GenericWebService serviceAccountAuthConfig. */ + public serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig|null); + + /** GenericWebService webhookType. */ + public webhookType: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType); + + /** GenericWebService httpMethod. */ + public httpMethod: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod); + + /** GenericWebService requestBody. */ + public requestBody: string; + + /** GenericWebService parameterMapping. */ + public parameterMapping: { [k: string]: string }; + + /** + * Creates a new GenericWebService instance using the specified properties. + * @param [properties] Properties to set + * @returns GenericWebService instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService; + + /** + * Encodes the specified GenericWebService message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.verify|verify} messages. + * @param message GenericWebService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenericWebService message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.verify|verify} messages. + * @param message GenericWebService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenericWebService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenericWebService + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService; + + /** + * Decodes a GenericWebService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenericWebService + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService; + + /** + * Verifies a GenericWebService 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 GenericWebService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenericWebService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService; + + /** + * Creates a plain object from a GenericWebService message. Also converts values to other types if specified. + * @param message GenericWebService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenericWebService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenericWebService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenericWebService { + + /** Properties of a SecretVersionHeaderValue. */ + interface ISecretVersionHeaderValue { + + /** SecretVersionHeaderValue secretVersion */ + secretVersion?: (string|null); + } + + /** Represents a SecretVersionHeaderValue. */ + class SecretVersionHeaderValue implements ISecretVersionHeaderValue { + + /** + * Constructs a new SecretVersionHeaderValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue); + + /** SecretVersionHeaderValue secretVersion. */ + public secretVersion: string; + + /** + * Creates a new SecretVersionHeaderValue instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretVersionHeaderValue instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Encodes the specified SecretVersionHeaderValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @param message SecretVersionHeaderValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretVersionHeaderValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @param message SecretVersionHeaderValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretVersionHeaderValue + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretVersionHeaderValue + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Verifies a SecretVersionHeaderValue 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 SecretVersionHeaderValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretVersionHeaderValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue; + + /** + * Creates a plain object from a SecretVersionHeaderValue message. Also converts values to other types if specified. + * @param message SecretVersionHeaderValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretVersionHeaderValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretVersionHeaderValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a OAuthConfig. */ + interface IOAuthConfig { + + /** OAuthConfig clientId */ + clientId?: (string|null); + + /** OAuthConfig clientSecret */ + clientSecret?: (string|null); + + /** OAuthConfig secretVersionForClientSecret */ + secretVersionForClientSecret?: (string|null); + + /** OAuthConfig tokenEndpoint */ + tokenEndpoint?: (string|null); + + /** OAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a OAuthConfig. */ + class OAuthConfig implements IOAuthConfig { + + /** + * Constructs a new OAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig); + + /** OAuthConfig clientId. */ + public clientId: string; + + /** OAuthConfig clientSecret. */ + public clientSecret: string; + + /** OAuthConfig secretVersionForClientSecret. */ + public secretVersionForClientSecret: string; + + /** OAuthConfig tokenEndpoint. */ + public tokenEndpoint: string; + + /** OAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthConfig + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthConfig + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig; + + /** + * Verifies a OAuthConfig 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 OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @param message OAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ServiceAgentAuth enum. */ + enum ServiceAgentAuth { + SERVICE_AGENT_AUTH_UNSPECIFIED = 0, + NONE = 1, + ID_TOKEN = 2, + ACCESS_TOKEN = 3 + } + + /** Properties of a ServiceAccountAuthConfig. */ + interface IServiceAccountAuthConfig { + + /** ServiceAccountAuthConfig serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a ServiceAccountAuthConfig. */ + class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { + + /** + * Constructs a new ServiceAccountAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig); + + /** ServiceAccountAuthConfig serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Verifies a ServiceAccountAuthConfig 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 ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAccountAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** WebhookType enum. */ + enum WebhookType { + WEBHOOK_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + FLEXIBLE = 2 + } + + /** HttpMethod enum. */ + enum HttpMethod { + HTTP_METHOD_UNSPECIFIED = 0, + POST = 1, + GET = 2, + HEAD = 3, + PUT = 4, + DELETE = 5, + PATCH = 6, + OPTIONS = 7 + } + } + + /** Properties of a ServiceDirectoryConfig. */ + interface IServiceDirectoryConfig { + + /** ServiceDirectoryConfig service */ + service?: (string|null); + + /** ServiceDirectoryConfig genericWebService */ + genericWebService?: (google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null); + } + + /** Represents a ServiceDirectoryConfig. */ + class ServiceDirectoryConfig implements IServiceDirectoryConfig { + + /** + * Constructs a new ServiceDirectoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig); + + /** ServiceDirectoryConfig service. */ + public service: string; + + /** ServiceDirectoryConfig genericWebService. */ + public genericWebService?: (google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null); + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDirectoryConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig): google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig; + + /** + * Verifies a ServiceDirectoryConfig 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 ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDirectoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @param message ServiceDirectoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListWebhooksRequest. */ + interface IListWebhooksRequest { + + /** ListWebhooksRequest parent */ + parent?: (string|null); + + /** ListWebhooksRequest pageSize */ + pageSize?: (number|null); + + /** ListWebhooksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListWebhooksRequest. */ + class ListWebhooksRequest implements IListWebhooksRequest { + + /** + * Constructs a new ListWebhooksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest); + + /** ListWebhooksRequest parent. */ + public parent: string; + + /** ListWebhooksRequest pageSize. */ + public pageSize: number; + + /** ListWebhooksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListWebhooksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWebhooksRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest): google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest; + + /** + * Encodes the specified ListWebhooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.verify|verify} messages. + * @param message ListWebhooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWebhooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.verify|verify} messages. + * @param message ListWebhooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWebhooksRequest + * @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.dialogflow.cx.v3beta1.ListWebhooksRequest; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWebhooksRequest + * @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.dialogflow.cx.v3beta1.ListWebhooksRequest; + + /** + * Verifies a ListWebhooksRequest 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 ListWebhooksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWebhooksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest; + + /** + * Creates a plain object from a ListWebhooksRequest message. Also converts values to other types if specified. + * @param message ListWebhooksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWebhooksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWebhooksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWebhooksResponse. */ + interface IListWebhooksResponse { + + /** ListWebhooksResponse webhooks */ + webhooks?: (google.cloud.dialogflow.cx.v3beta1.IWebhook[]|null); + + /** ListWebhooksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListWebhooksResponse. */ + class ListWebhooksResponse implements IListWebhooksResponse { + + /** + * Constructs a new ListWebhooksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse); + + /** ListWebhooksResponse webhooks. */ + public webhooks: google.cloud.dialogflow.cx.v3beta1.IWebhook[]; + + /** ListWebhooksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListWebhooksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWebhooksResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse): google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse; + + /** + * Encodes the specified ListWebhooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.verify|verify} messages. + * @param message ListWebhooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWebhooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.verify|verify} messages. + * @param message ListWebhooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWebhooksResponse + * @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.dialogflow.cx.v3beta1.ListWebhooksResponse; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWebhooksResponse + * @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.dialogflow.cx.v3beta1.ListWebhooksResponse; + + /** + * Verifies a ListWebhooksResponse 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 ListWebhooksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWebhooksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse; + + /** + * Creates a plain object from a ListWebhooksResponse message. Also converts values to other types if specified. + * @param message ListWebhooksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWebhooksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWebhooksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetWebhookRequest. */ + interface IGetWebhookRequest { + + /** GetWebhookRequest name */ + name?: (string|null); + } + + /** Represents a GetWebhookRequest. */ + class GetWebhookRequest implements IGetWebhookRequest { + + /** + * Constructs a new GetWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest); + + /** GetWebhookRequest name. */ + public name: string; + + /** + * Creates a new GetWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest): google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest; + + /** + * Encodes the specified GetWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.verify|verify} messages. + * @param message GetWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.verify|verify} messages. + * @param message GetWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWebhookRequest + * @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.dialogflow.cx.v3beta1.GetWebhookRequest; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWebhookRequest + * @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.dialogflow.cx.v3beta1.GetWebhookRequest; + + /** + * Verifies a GetWebhookRequest 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 GetWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest; + + /** + * Creates a plain object from a GetWebhookRequest message. Also converts values to other types if specified. + * @param message GetWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateWebhookRequest. */ + interface ICreateWebhookRequest { + + /** CreateWebhookRequest parent */ + parent?: (string|null); + + /** CreateWebhookRequest webhook */ + webhook?: (google.cloud.dialogflow.cx.v3beta1.IWebhook|null); + } + + /** Represents a CreateWebhookRequest. */ + class CreateWebhookRequest implements ICreateWebhookRequest { + + /** + * Constructs a new CreateWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest); + + /** CreateWebhookRequest parent. */ + public parent: string; + + /** CreateWebhookRequest webhook. */ + public webhook?: (google.cloud.dialogflow.cx.v3beta1.IWebhook|null); + + /** + * Creates a new CreateWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest): google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest; + + /** + * Encodes the specified CreateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.verify|verify} messages. + * @param message CreateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.verify|verify} messages. + * @param message CreateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWebhookRequest + * @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.dialogflow.cx.v3beta1.CreateWebhookRequest; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWebhookRequest + * @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.dialogflow.cx.v3beta1.CreateWebhookRequest; + + /** + * Verifies a CreateWebhookRequest 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 CreateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest; + + /** + * Creates a plain object from a CreateWebhookRequest message. Also converts values to other types if specified. + * @param message CreateWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWebhookRequest. */ + interface IUpdateWebhookRequest { + + /** UpdateWebhookRequest webhook */ + webhook?: (google.cloud.dialogflow.cx.v3beta1.IWebhook|null); + + /** UpdateWebhookRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateWebhookRequest. */ + class UpdateWebhookRequest implements IUpdateWebhookRequest { + + /** + * Constructs a new UpdateWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest); + + /** UpdateWebhookRequest webhook. */ + public webhook?: (google.cloud.dialogflow.cx.v3beta1.IWebhook|null); + + /** UpdateWebhookRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest): google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest; + + /** + * Encodes the specified UpdateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.verify|verify} messages. + * @param message UpdateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.verify|verify} messages. + * @param message UpdateWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWebhookRequest + * @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.dialogflow.cx.v3beta1.UpdateWebhookRequest; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWebhookRequest + * @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.dialogflow.cx.v3beta1.UpdateWebhookRequest; + + /** + * Verifies an UpdateWebhookRequest 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 UpdateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest; + + /** + * Creates a plain object from an UpdateWebhookRequest message. Also converts values to other types if specified. + * @param message UpdateWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWebhookRequest. */ + interface IDeleteWebhookRequest { + + /** DeleteWebhookRequest name */ + name?: (string|null); + + /** DeleteWebhookRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteWebhookRequest. */ + class DeleteWebhookRequest implements IDeleteWebhookRequest { + + /** + * Constructs a new DeleteWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest); + + /** DeleteWebhookRequest name. */ + public name: string; + + /** DeleteWebhookRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest): google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest; + + /** + * Encodes the specified DeleteWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.verify|verify} messages. + * @param message DeleteWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.verify|verify} messages. + * @param message DeleteWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWebhookRequest + * @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.dialogflow.cx.v3beta1.DeleteWebhookRequest; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWebhookRequest + * @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.dialogflow.cx.v3beta1.DeleteWebhookRequest; + + /** + * Verifies a DeleteWebhookRequest 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 DeleteWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest; + + /** + * Creates a plain object from a DeleteWebhookRequest message. Also converts values to other types if specified. + * @param message DeleteWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebhookRequest. */ + interface IWebhookRequest { + + /** WebhookRequest detectIntentResponseId */ + detectIntentResponseId?: (string|null); + + /** WebhookRequest text */ + text?: (string|null); + + /** WebhookRequest triggerIntent */ + triggerIntent?: (string|null); + + /** WebhookRequest transcript */ + transcript?: (string|null); + + /** WebhookRequest triggerEvent */ + triggerEvent?: (string|null); + + /** WebhookRequest dtmfDigits */ + dtmfDigits?: (string|null); + + /** WebhookRequest languageCode */ + languageCode?: (string|null); + + /** WebhookRequest fulfillmentInfo */ + fulfillmentInfo?: (google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo|null); + + /** WebhookRequest intentInfo */ + intentInfo?: (google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo|null); + + /** WebhookRequest pageInfo */ + pageInfo?: (google.cloud.dialogflow.cx.v3beta1.IPageInfo|null); + + /** WebhookRequest sessionInfo */ + sessionInfo?: (google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null); + + /** WebhookRequest messages */ + messages?: (google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]|null); + + /** WebhookRequest payload */ + payload?: (google.protobuf.IStruct|null); + + /** WebhookRequest sentimentAnalysisResult */ + sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult|null); + + /** WebhookRequest languageInfo */ + languageInfo?: (google.cloud.dialogflow.cx.v3beta1.ILanguageInfo|null); + } + + /** Represents a WebhookRequest. */ + class WebhookRequest implements IWebhookRequest { + + /** + * Constructs a new WebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IWebhookRequest); + + /** WebhookRequest detectIntentResponseId. */ + public detectIntentResponseId: string; + + /** WebhookRequest text. */ + public text?: (string|null); + + /** WebhookRequest triggerIntent. */ + public triggerIntent?: (string|null); + + /** WebhookRequest transcript. */ + public transcript?: (string|null); + + /** WebhookRequest triggerEvent. */ + public triggerEvent?: (string|null); + + /** WebhookRequest dtmfDigits. */ + public dtmfDigits?: (string|null); + + /** WebhookRequest languageCode. */ + public languageCode: string; + + /** WebhookRequest fulfillmentInfo. */ + public fulfillmentInfo?: (google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo|null); + + /** WebhookRequest intentInfo. */ + public intentInfo?: (google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo|null); + + /** WebhookRequest pageInfo. */ + public pageInfo?: (google.cloud.dialogflow.cx.v3beta1.IPageInfo|null); + + /** WebhookRequest sessionInfo. */ + public sessionInfo?: (google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null); + + /** WebhookRequest messages. */ + public messages: google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]; + + /** WebhookRequest payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** WebhookRequest sentimentAnalysisResult. */ + public sentimentAnalysisResult?: (google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult|null); + + /** WebhookRequest languageInfo. */ + public languageInfo?: (google.cloud.dialogflow.cx.v3beta1.ILanguageInfo|null); + + /** WebhookRequest query. */ + public query?: ("text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmfDigits"); + + /** + * Creates a new WebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IWebhookRequest): google.cloud.dialogflow.cx.v3beta1.WebhookRequest; + + /** + * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.verify|verify} messages. + * @param message WebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.verify|verify} messages. + * @param message WebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookRequest + * @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.dialogflow.cx.v3beta1.WebhookRequest; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookRequest + * @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.dialogflow.cx.v3beta1.WebhookRequest; + + /** + * Verifies a WebhookRequest 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 WebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.WebhookRequest; + + /** + * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. + * @param message WebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebhookRequest { + + /** Properties of a FulfillmentInfo. */ + interface IFulfillmentInfo { + + /** FulfillmentInfo tag */ + tag?: (string|null); + } + + /** Represents a FulfillmentInfo. */ + class FulfillmentInfo implements IFulfillmentInfo { + + /** + * Constructs a new FulfillmentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo); + + /** FulfillmentInfo tag. */ + public tag: string; + + /** + * Creates a new FulfillmentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillmentInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo; + + /** + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillmentInfo + * @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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillmentInfo + * @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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo; + + /** + * Verifies a FulfillmentInfo 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 FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillmentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo; + + /** + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * @param message FulfillmentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillmentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillmentInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntentInfo. */ + interface IIntentInfo { + + /** IntentInfo lastMatchedIntent */ + lastMatchedIntent?: (string|null); + + /** IntentInfo displayName */ + displayName?: (string|null); + + /** IntentInfo parameters */ + parameters?: ({ [k: string]: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue }|null); + + /** IntentInfo confidence */ + confidence?: (number|null); + } + + /** Represents an IntentInfo. */ + class IntentInfo implements IIntentInfo { + + /** + * Constructs a new IntentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo); + + /** IntentInfo lastMatchedIntent. */ + public lastMatchedIntent: string; + + /** IntentInfo displayName. */ + public displayName: string; + + /** IntentInfo parameters. */ + public parameters: { [k: string]: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue }; + + /** IntentInfo confidence. */ + public confidence: number; + + /** + * Creates a new IntentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo; + + /** + * Encodes the specified IntentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.verify|verify} messages. + * @param message IntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.verify|verify} messages. + * @param message IntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentInfo + * @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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo; + + /** + * Decodes an IntentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentInfo + * @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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo; + + /** + * Verifies an IntentInfo 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 IntentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo; + + /** + * Creates a plain object from an IntentInfo message. Also converts values to other types if specified. + * @param message IntentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntentInfo { + + /** Properties of an IntentParameterValue. */ + interface IIntentParameterValue { + + /** IntentParameterValue originalValue */ + originalValue?: (string|null); + + /** IntentParameterValue resolvedValue */ + resolvedValue?: (google.protobuf.IValue|null); + } + + /** Represents an IntentParameterValue. */ + class IntentParameterValue implements IIntentParameterValue { + + /** + * Constructs a new IntentParameterValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue); + + /** IntentParameterValue originalValue. */ + public originalValue: string; + + /** IntentParameterValue resolvedValue. */ + public resolvedValue?: (google.protobuf.IValue|null); + + /** + * Creates a new IntentParameterValue instance using the specified properties. + * @param [properties] Properties to set + * @returns IntentParameterValue instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Encodes the specified IntentParameterValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @param message IntentParameterValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntentParameterValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @param message IntentParameterValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntentParameterValue + * @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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntentParameterValue + * @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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Verifies an IntentParameterValue 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 IntentParameterValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntentParameterValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue; + + /** + * Creates a plain object from an IntentParameterValue message. Also converts values to other types if specified. + * @param message IntentParameterValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntentParameterValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntentParameterValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SentimentAnalysisResult. */ + interface ISentimentAnalysisResult { + + /** SentimentAnalysisResult score */ + score?: (number|null); + + /** SentimentAnalysisResult magnitude */ + magnitude?: (number|null); + } + + /** Represents a SentimentAnalysisResult. */ + class SentimentAnalysisResult implements ISentimentAnalysisResult { + + /** + * Constructs a new SentimentAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult); + + /** SentimentAnalysisResult score. */ + public score: number; + + /** SentimentAnalysisResult magnitude. */ + public magnitude: number; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisResult + * @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.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult; + + /** + * Verifies a SentimentAnalysisResult 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 SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @param message SentimentAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WebhookResponse. */ + interface IWebhookResponse { + + /** WebhookResponse fulfillmentResponse */ + fulfillmentResponse?: (google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse|null); + + /** WebhookResponse pageInfo */ + pageInfo?: (google.cloud.dialogflow.cx.v3beta1.IPageInfo|null); + + /** WebhookResponse sessionInfo */ + sessionInfo?: (google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null); + + /** WebhookResponse payload */ + payload?: (google.protobuf.IStruct|null); + + /** WebhookResponse targetPage */ + targetPage?: (string|null); + + /** WebhookResponse targetFlow */ + targetFlow?: (string|null); + } + + /** Represents a WebhookResponse. */ + class WebhookResponse implements IWebhookResponse { + + /** + * Constructs a new WebhookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IWebhookResponse); + + /** WebhookResponse fulfillmentResponse. */ + public fulfillmentResponse?: (google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse|null); + + /** WebhookResponse pageInfo. */ + public pageInfo?: (google.cloud.dialogflow.cx.v3beta1.IPageInfo|null); + + /** WebhookResponse sessionInfo. */ + public sessionInfo?: (google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null); + + /** WebhookResponse payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** WebhookResponse targetPage. */ + public targetPage?: (string|null); + + /** WebhookResponse targetFlow. */ + public targetFlow?: (string|null); + + /** WebhookResponse transition. */ + public transition?: ("targetPage"|"targetFlow"); + + /** + * Creates a new WebhookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IWebhookResponse): google.cloud.dialogflow.cx.v3beta1.WebhookResponse; + + /** + * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.verify|verify} messages. + * @param message WebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.verify|verify} messages. + * @param message WebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookResponse + * @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.dialogflow.cx.v3beta1.WebhookResponse; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookResponse + * @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.dialogflow.cx.v3beta1.WebhookResponse; + + /** + * Verifies a WebhookResponse 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 WebhookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.WebhookResponse; + + /** + * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. + * @param message WebhookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.WebhookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebhookResponse { + + /** Properties of a FulfillmentResponse. */ + interface IFulfillmentResponse { + + /** FulfillmentResponse messages */ + messages?: (google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]|null); + + /** FulfillmentResponse mergeBehavior */ + mergeBehavior?: (google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior|keyof typeof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior|null); + } + + /** Represents a FulfillmentResponse. */ + class FulfillmentResponse implements IFulfillmentResponse { + + /** + * Constructs a new FulfillmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse); + + /** FulfillmentResponse messages. */ + public messages: google.cloud.dialogflow.cx.v3beta1.IResponseMessage[]; + + /** FulfillmentResponse mergeBehavior. */ + public mergeBehavior: (google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior|keyof typeof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior); + + /** + * Creates a new FulfillmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillmentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse): google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse; + + /** + * Encodes the specified FulfillmentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @param message FulfillmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillmentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @param message FulfillmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillmentResponse + * @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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillmentResponse + * @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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse; + + /** + * Verifies a FulfillmentResponse 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 FulfillmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse; + + /** + * Creates a plain object from a FulfillmentResponse message. Also converts values to other types if specified. + * @param message FulfillmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FulfillmentResponse { + + /** MergeBehavior enum. */ + enum MergeBehavior { + MERGE_BEHAVIOR_UNSPECIFIED = 0, + APPEND = 1, + REPLACE = 2 + } + } + } + + /** Properties of a PageInfo. */ + interface IPageInfo { + + /** PageInfo currentPage */ + currentPage?: (string|null); + + /** PageInfo displayName */ + displayName?: (string|null); + + /** PageInfo formInfo */ + formInfo?: (google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo|null); + } + + /** Represents a PageInfo. */ + class PageInfo implements IPageInfo { + + /** + * Constructs a new PageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPageInfo); + + /** PageInfo currentPage. */ + public currentPage: string; + + /** PageInfo displayName. */ + public displayName: string; + + /** PageInfo formInfo. */ + public formInfo?: (google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo|null); + + /** + * Creates a new PageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PageInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPageInfo): google.cloud.dialogflow.cx.v3beta1.PageInfo; + + /** + * Encodes the specified PageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.verify|verify} messages. + * @param message PageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.verify|verify} messages. + * @param message PageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageInfo + * @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.dialogflow.cx.v3beta1.PageInfo; + + /** + * Decodes a PageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageInfo + * @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.dialogflow.cx.v3beta1.PageInfo; + + /** + * Verifies a PageInfo 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 PageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PageInfo; + + /** + * Creates a plain object from a PageInfo message. Also converts values to other types if specified. + * @param message PageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PageInfo { + + /** Properties of a FormInfo. */ + interface IFormInfo { + + /** FormInfo parameterInfo */ + parameterInfo?: (google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo[]|null); + } + + /** Represents a FormInfo. */ + class FormInfo implements IFormInfo { + + /** + * Constructs a new FormInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo); + + /** FormInfo parameterInfo. */ + public parameterInfo: google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo[]; + + /** + * Creates a new FormInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FormInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo): google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo; + + /** + * Encodes the specified FormInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.verify|verify} messages. + * @param message FormInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FormInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.verify|verify} messages. + * @param message FormInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FormInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FormInfo + * @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.dialogflow.cx.v3beta1.PageInfo.FormInfo; + + /** + * Decodes a FormInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FormInfo + * @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.dialogflow.cx.v3beta1.PageInfo.FormInfo; + + /** + * Verifies a FormInfo 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 FormInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FormInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo; + + /** + * Creates a plain object from a FormInfo message. Also converts values to other types if specified. + * @param message FormInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FormInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FormInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FormInfo { + + /** Properties of a ParameterInfo. */ + interface IParameterInfo { + + /** ParameterInfo displayName */ + displayName?: (string|null); + + /** ParameterInfo required */ + required?: (boolean|null); + + /** ParameterInfo state */ + state?: (google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState|keyof typeof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState|null); + + /** ParameterInfo value */ + value?: (google.protobuf.IValue|null); + + /** ParameterInfo justCollected */ + justCollected?: (boolean|null); + } + + /** Represents a ParameterInfo. */ + class ParameterInfo implements IParameterInfo { + + /** + * Constructs a new ParameterInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo); + + /** ParameterInfo displayName. */ + public displayName: string; + + /** ParameterInfo required. */ + public required: boolean; + + /** ParameterInfo state. */ + public state: (google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState|keyof typeof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState); + + /** ParameterInfo value. */ + public value?: (google.protobuf.IValue|null); + + /** ParameterInfo justCollected. */ + public justCollected: boolean; + + /** + * Creates a new ParameterInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo): google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo; + + /** + * Encodes the specified ParameterInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @param message ParameterInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @param message ParameterInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterInfo + * @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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterInfo + * @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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo; + + /** + * Verifies a ParameterInfo 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 ParameterInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo; + + /** + * Creates a plain object from a ParameterInfo message. Also converts values to other types if specified. + * @param message ParameterInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ParameterInfo { + + /** ParameterState enum. */ + enum ParameterState { + PARAMETER_STATE_UNSPECIFIED = 0, + EMPTY = 1, + INVALID = 2, + FILLED = 3 + } + } + } + } + + /** Properties of a SessionInfo. */ + interface ISessionInfo { + + /** SessionInfo session */ + session?: (string|null); + + /** SessionInfo parameters */ + parameters?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a SessionInfo. */ + class SessionInfo implements ISessionInfo { + + /** + * Constructs a new SessionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISessionInfo); + + /** SessionInfo session. */ + public session: string; + + /** SessionInfo parameters. */ + public parameters: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new SessionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISessionInfo): google.cloud.dialogflow.cx.v3beta1.SessionInfo; + + /** + * Encodes the specified SessionInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionInfo.verify|verify} messages. + * @param message SessionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISessionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionInfo.verify|verify} messages. + * @param message SessionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISessionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionInfo + * @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.dialogflow.cx.v3beta1.SessionInfo; + + /** + * Decodes a SessionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionInfo + * @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.dialogflow.cx.v3beta1.SessionInfo; + + /** + * Verifies a SessionInfo 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 SessionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SessionInfo; + + /** + * Creates a plain object from a SessionInfo message. Also converts values to other types if specified. + * @param message SessionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SessionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LanguageInfo. */ + interface ILanguageInfo { + + /** LanguageInfo inputLanguageCode */ + inputLanguageCode?: (string|null); + + /** LanguageInfo resolvedLanguageCode */ + resolvedLanguageCode?: (string|null); + + /** LanguageInfo confidenceScore */ + confidenceScore?: (number|null); + } + + /** Represents a LanguageInfo. */ + class LanguageInfo implements ILanguageInfo { + + /** + * Constructs a new LanguageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ILanguageInfo); + + /** LanguageInfo inputLanguageCode. */ + public inputLanguageCode: string; + + /** LanguageInfo resolvedLanguageCode. */ + public resolvedLanguageCode: string; + + /** LanguageInfo confidenceScore. */ + public confidenceScore: number; + + /** + * Creates a new LanguageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageInfo instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ILanguageInfo): google.cloud.dialogflow.cx.v3beta1.LanguageInfo; + + /** + * Encodes the specified LanguageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LanguageInfo.verify|verify} messages. + * @param message LanguageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ILanguageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LanguageInfo.verify|verify} messages. + * @param message LanguageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ILanguageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageInfo + * @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.dialogflow.cx.v3beta1.LanguageInfo; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageInfo + * @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.dialogflow.cx.v3beta1.LanguageInfo; + + /** + * Verifies a LanguageInfo 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 LanguageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LanguageInfo; + + /** + * Creates a plain object from a LanguageInfo message. Also converts values to other types if specified. + * @param message LanguageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LanguageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Deployments */ + class Deployments extends $protobuf.rpc.Service { + + /** + * Constructs a new Deployments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Deployments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Deployments; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse + */ + public listDeployments(request: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeploymentsCallback): void; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @returns Promise + */ + public listDeployments(request: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest): Promise; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public getDeployment(request: google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeploymentCallback): void; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @returns Promise + */ + public getDeployment(request: google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest): Promise; + } + + namespace Deployments { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Deployments|listDeployments}. + * @param error Error, if any + * @param [response] ListDeploymentsResponse + */ + type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Deployments|getDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Deployment) => void; + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment flowVersion */ + flowVersion?: (string|null); + + /** Deployment state */ + state?: (google.cloud.dialogflow.cx.v3beta1.Deployment.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.Deployment.State|null); + + /** Deployment result */ + result?: (google.cloud.dialogflow.cx.v3beta1.Deployment.IResult|null); + + /** Deployment startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Deployment endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment flowVersion. */ + public flowVersion: string; + + /** Deployment state. */ + public state: (google.cloud.dialogflow.cx.v3beta1.Deployment.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.Deployment.State); + + /** Deployment result. */ + public result?: (google.cloud.dialogflow.cx.v3beta1.Deployment.IResult|null); + + /** Deployment startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Deployment endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeployment): google.cloud.dialogflow.cx.v3beta1.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @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.dialogflow.cx.v3beta1.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @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.dialogflow.cx.v3beta1.Deployment; + + /** + * Verifies a Deployment 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 Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Deployment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3 + } + + /** Properties of a Result. */ + interface IResult { + + /** Result deploymentTestResults */ + deploymentTestResults?: (string[]|null); + + /** Result experiment */ + experiment?: (string|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Deployment.IResult); + + /** Result deploymentTestResults. */ + public deploymentTestResults: string[]; + + /** Result experiment. */ + public experiment: string; + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Deployment.IResult): google.cloud.dialogflow.cx.v3beta1.Deployment.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Deployment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Deployment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @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.dialogflow.cx.v3beta1.Deployment.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @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.dialogflow.cx.v3beta1.Deployment.Result; + + /** + * Verifies a Result 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 Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Deployment.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Deployment.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Result + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListDeploymentsRequest. */ + interface IListDeploymentsRequest { + + /** ListDeploymentsRequest parent */ + parent?: (string|null); + + /** ListDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDeploymentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDeploymentsRequest. */ + class ListDeploymentsRequest implements IListDeploymentsRequest { + + /** + * Constructs a new ListDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest); + + /** ListDeploymentsRequest parent. */ + public parent: string; + + /** ListDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListDeploymentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest): google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsRequest + * @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.dialogflow.cx.v3beta1.ListDeploymentsRequest; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsRequest + * @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.dialogflow.cx.v3beta1.ListDeploymentsRequest; + + /** + * Verifies a ListDeploymentsRequest 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 ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsResponse. */ + interface IListDeploymentsResponse { + + /** ListDeploymentsResponse deployments */ + deployments?: (google.cloud.dialogflow.cx.v3beta1.IDeployment[]|null); + + /** ListDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeploymentsResponse. */ + class ListDeploymentsResponse implements IListDeploymentsResponse { + + /** + * Constructs a new ListDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse); + + /** ListDeploymentsResponse deployments. */ + public deployments: google.cloud.dialogflow.cx.v3beta1.IDeployment[]; + + /** ListDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse): google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsResponse + * @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.dialogflow.cx.v3beta1.ListDeploymentsResponse; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsResponse + * @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.dialogflow.cx.v3beta1.ListDeploymentsResponse; + + /** + * Verifies a ListDeploymentsResponse 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 ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeploymentRequest. */ + interface IGetDeploymentRequest { + + /** GetDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetDeploymentRequest. */ + class GetDeploymentRequest implements IGetDeploymentRequest { + + /** + * Constructs a new GetDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest); + + /** GetDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeploymentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest): google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeploymentRequest + * @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.dialogflow.cx.v3beta1.GetDeploymentRequest; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeploymentRequest + * @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.dialogflow.cx.v3beta1.GetDeploymentRequest; + + /** + * Verifies a GetDeploymentRequest 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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @param message GetDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Experiments */ + class Experiments extends $protobuf.rpc.Service { + + /** + * Constructs a new Experiments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Experiments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Experiments; + + /** + * Calls ListExperiments. + * @param request ListExperimentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExperimentsResponse + */ + public listExperiments(request: google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperimentsCallback): void; + + /** + * Calls ListExperiments. + * @param request ListExperimentsRequest message or plain object + * @returns Promise + */ + public listExperiments(request: google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest): Promise; + + /** + * Calls GetExperiment. + * @param request GetExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public getExperiment(request: google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Experiments.GetExperimentCallback): void; + + /** + * Calls GetExperiment. + * @param request GetExperimentRequest message or plain object + * @returns Promise + */ + public getExperiment(request: google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest): Promise; + + /** + * Calls CreateExperiment. + * @param request CreateExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public createExperiment(request: google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Experiments.CreateExperimentCallback): void; + + /** + * Calls CreateExperiment. + * @param request CreateExperimentRequest message or plain object + * @returns Promise + */ + public createExperiment(request: google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest): Promise; + + /** + * Calls UpdateExperiment. + * @param request UpdateExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public updateExperiment(request: google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Experiments.UpdateExperimentCallback): void; + + /** + * Calls UpdateExperiment. + * @param request UpdateExperimentRequest message or plain object + * @returns Promise + */ + public updateExperiment(request: google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest): Promise; + + /** + * Calls DeleteExperiment. + * @param request DeleteExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExperiment(request: google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Experiments.DeleteExperimentCallback): void; + + /** + * Calls DeleteExperiment. + * @param request DeleteExperimentRequest message or plain object + * @returns Promise + */ + public deleteExperiment(request: google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest): Promise; + + /** + * Calls StartExperiment. + * @param request StartExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public startExperiment(request: google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Experiments.StartExperimentCallback): void; + + /** + * Calls StartExperiment. + * @param request StartExperimentRequest message or plain object + * @returns Promise + */ + public startExperiment(request: google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest): Promise; + + /** + * Calls StopExperiment. + * @param request StopExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Experiment + */ + public stopExperiment(request: google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest, callback: google.cloud.dialogflow.cx.v3beta1.Experiments.StopExperimentCallback): void; + + /** + * Calls StopExperiment. + * @param request StopExperimentRequest message or plain object + * @returns Promise + */ + public stopExperiment(request: google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest): Promise; + } + + namespace Experiments { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|listExperiments}. + * @param error Error, if any + * @param [response] ListExperimentsResponse + */ + type ListExperimentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|getExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type GetExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|createExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type CreateExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|updateExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type UpdateExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|deleteExperiment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExperimentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|startExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type StartExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Experiment) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|stopExperiment}. + * @param error Error, if any + * @param [response] Experiment + */ + type StopExperimentCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Experiment) => void; + } + + /** Properties of an Experiment. */ + interface IExperiment { + + /** Experiment name */ + name?: (string|null); + + /** Experiment displayName */ + displayName?: (string|null); + + /** Experiment description */ + description?: (string|null); + + /** Experiment state */ + state?: (google.cloud.dialogflow.cx.v3beta1.Experiment.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.Experiment.State|null); + + /** Experiment definition */ + definition?: (google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition|null); + + /** Experiment rolloutConfig */ + rolloutConfig?: (google.cloud.dialogflow.cx.v3beta1.IRolloutConfig|null); + + /** Experiment rolloutState */ + rolloutState?: (google.cloud.dialogflow.cx.v3beta1.IRolloutState|null); + + /** Experiment rolloutFailureReason */ + rolloutFailureReason?: (string|null); + + /** Experiment result */ + result?: (google.cloud.dialogflow.cx.v3beta1.Experiment.IResult|null); + + /** Experiment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Experiment startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Experiment endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Experiment lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Experiment experimentLength */ + experimentLength?: (google.protobuf.IDuration|null); + + /** Experiment variantsHistory */ + variantsHistory?: (google.cloud.dialogflow.cx.v3beta1.IVariantsHistory[]|null); + } + + /** Represents an Experiment. */ + class Experiment implements IExperiment { + + /** + * Constructs a new Experiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExperiment); + + /** Experiment name. */ + public name: string; + + /** Experiment displayName. */ + public displayName: string; + + /** Experiment description. */ + public description: string; + + /** Experiment state. */ + public state: (google.cloud.dialogflow.cx.v3beta1.Experiment.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.Experiment.State); + + /** Experiment definition. */ + public definition?: (google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition|null); + + /** Experiment rolloutConfig. */ + public rolloutConfig?: (google.cloud.dialogflow.cx.v3beta1.IRolloutConfig|null); + + /** Experiment rolloutState. */ + public rolloutState?: (google.cloud.dialogflow.cx.v3beta1.IRolloutState|null); + + /** Experiment rolloutFailureReason. */ + public rolloutFailureReason: string; + + /** Experiment result. */ + public result?: (google.cloud.dialogflow.cx.v3beta1.Experiment.IResult|null); + + /** Experiment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Experiment startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Experiment endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Experiment lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Experiment experimentLength. */ + public experimentLength?: (google.protobuf.IDuration|null); + + /** Experiment variantsHistory. */ + public variantsHistory: google.cloud.dialogflow.cx.v3beta1.IVariantsHistory[]; + + /** + * Creates a new Experiment instance using the specified properties. + * @param [properties] Properties to set + * @returns Experiment instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExperiment): google.cloud.dialogflow.cx.v3beta1.Experiment; + + /** + * Encodes the specified Experiment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.verify|verify} messages. + * @param message Experiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Experiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.verify|verify} messages. + * @param message Experiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Experiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Experiment + * @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.dialogflow.cx.v3beta1.Experiment; + + /** + * Decodes an Experiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Experiment + * @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.dialogflow.cx.v3beta1.Experiment; + + /** + * Verifies an Experiment 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 Experiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Experiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Experiment; + + /** + * Creates a plain object from an Experiment message. Also converts values to other types if specified. + * @param message Experiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Experiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Experiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Experiment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Experiment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + DRAFT = 1, + RUNNING = 2, + DONE = 3, + ROLLOUT_FAILED = 4 + } + + /** Properties of a Definition. */ + interface IDefinition { + + /** Definition condition */ + condition?: (string|null); + + /** Definition versionVariants */ + versionVariants?: (google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null); + } + + /** Represents a Definition. */ + class Definition implements IDefinition { + + /** + * Constructs a new Definition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition); + + /** Definition condition. */ + public condition: string; + + /** Definition versionVariants. */ + public versionVariants?: (google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null); + + /** Definition variants. */ + public variants?: "versionVariants"; + + /** + * Creates a new Definition instance using the specified properties. + * @param [properties] Properties to set + * @returns Definition instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition): google.cloud.dialogflow.cx.v3beta1.Experiment.Definition; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Definition + * @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.dialogflow.cx.v3beta1.Experiment.Definition; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Definition + * @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.dialogflow.cx.v3beta1.Experiment.Definition; + + /** + * Verifies a Definition 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 Definition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Definition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Experiment.Definition; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @param message Definition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Definition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Definition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Definition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Result. */ + interface IResult { + + /** Result versionMetrics */ + versionMetrics?: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics[]|null); + + /** Result lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.IResult); + + /** Result versionMetrics. */ + public versionMetrics: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics[]; + + /** Result lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.IResult): google.cloud.dialogflow.cx.v3beta1.Experiment.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Experiment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Experiment.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @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.dialogflow.cx.v3beta1.Experiment.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @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.dialogflow.cx.v3beta1.Experiment.Result; + + /** + * Verifies a Result 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 Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Experiment.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Result + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Result { + + /** MetricType enum. */ + enum MetricType { + METRIC_UNSPECIFIED = 0, + CONTAINED_SESSION_NO_CALLBACK_RATE = 1, + LIVE_AGENT_HANDOFF_RATE = 2, + CALLBACK_SESSION_RATE = 3, + ABANDONED_SESSION_RATE = 4, + SESSION_END_RATE = 5 + } + + /** CountType enum. */ + enum CountType { + COUNT_TYPE_UNSPECIFIED = 0, + TOTAL_NO_MATCH_COUNT = 1, + TOTAL_TURN_COUNT = 2, + AVERAGE_TURN_COUNT = 3 + } + + /** Properties of a ConfidenceInterval. */ + interface IConfidenceInterval { + + /** ConfidenceInterval confidenceLevel */ + confidenceLevel?: (number|null); + + /** ConfidenceInterval ratio */ + ratio?: (number|null); + + /** ConfidenceInterval lowerBound */ + lowerBound?: (number|null); + + /** ConfidenceInterval upperBound */ + upperBound?: (number|null); + } + + /** Represents a ConfidenceInterval. */ + class ConfidenceInterval implements IConfidenceInterval { + + /** + * Constructs a new ConfidenceInterval. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval); + + /** ConfidenceInterval confidenceLevel. */ + public confidenceLevel: number; + + /** ConfidenceInterval ratio. */ + public ratio: number; + + /** ConfidenceInterval lowerBound. */ + public lowerBound: number; + + /** ConfidenceInterval upperBound. */ + public upperBound: number; + + /** + * Creates a new ConfidenceInterval instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceInterval instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval): google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval; + + /** + * Encodes the specified ConfidenceInterval message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @param message ConfidenceInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceInterval message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @param message ConfidenceInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceInterval + * @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.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceInterval + * @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.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval; + + /** + * Verifies a ConfidenceInterval 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 ConfidenceInterval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceInterval + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval; + + /** + * Creates a plain object from a ConfidenceInterval message. Also converts values to other types if specified. + * @param message ConfidenceInterval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceInterval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceInterval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metric. */ + interface IMetric { + + /** Metric type */ + type?: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType|null); + + /** Metric countType */ + countType?: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType|null); + + /** Metric ratio */ + ratio?: (number|null); + + /** Metric count */ + count?: (number|null); + + /** Metric confidenceInterval */ + confidenceInterval?: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric); + + /** Metric type. */ + public type: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType); + + /** Metric countType. */ + public countType: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType); + + /** Metric ratio. */ + public ratio?: (number|null); + + /** Metric count. */ + public count?: (number|null); + + /** Metric confidenceInterval. */ + public confidenceInterval?: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval|null); + + /** Metric value. */ + public value?: ("ratio"|"count"); + + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric): google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @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.dialogflow.cx.v3beta1.Experiment.Result.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @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.dialogflow.cx.v3beta1.Experiment.Result.Metric; + + /** + * Verifies a Metric 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 Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VersionMetrics. */ + interface IVersionMetrics { + + /** VersionMetrics version */ + version?: (string|null); + + /** VersionMetrics metrics */ + metrics?: (google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric[]|null); + + /** VersionMetrics sessionCount */ + sessionCount?: (number|null); + } + + /** Represents a VersionMetrics. */ + class VersionMetrics implements IVersionMetrics { + + /** + * Constructs a new VersionMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics); + + /** VersionMetrics version. */ + public version: string; + + /** VersionMetrics metrics. */ + public metrics: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric[]; + + /** VersionMetrics sessionCount. */ + public sessionCount: number; + + /** + * Creates a new VersionMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionMetrics instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics): google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics; + + /** + * Encodes the specified VersionMetrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.verify|verify} messages. + * @param message VersionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionMetrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.verify|verify} messages. + * @param message VersionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionMetrics + * @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.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionMetrics + * @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.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics; + + /** + * Verifies a VersionMetrics 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 VersionMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics; + + /** + * Creates a plain object from a VersionMetrics message. Also converts values to other types if specified. + * @param message VersionMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a VersionVariants. */ + interface IVersionVariants { + + /** VersionVariants variants */ + variants?: (google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant[]|null); + } + + /** Represents a VersionVariants. */ + class VersionVariants implements IVersionVariants { + + /** + * Constructs a new VersionVariants. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IVersionVariants); + + /** VersionVariants variants. */ + public variants: google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant[]; + + /** + * Creates a new VersionVariants instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionVariants instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IVersionVariants): google.cloud.dialogflow.cx.v3beta1.VersionVariants; + + /** + * Encodes the specified VersionVariants message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.verify|verify} messages. + * @param message VersionVariants message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IVersionVariants, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionVariants message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.verify|verify} messages. + * @param message VersionVariants message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IVersionVariants, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionVariants message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionVariants + * @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.dialogflow.cx.v3beta1.VersionVariants; + + /** + * Decodes a VersionVariants message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionVariants + * @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.dialogflow.cx.v3beta1.VersionVariants; + + /** + * Verifies a VersionVariants 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 VersionVariants message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionVariants + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.VersionVariants; + + /** + * Creates a plain object from a VersionVariants message. Also converts values to other types if specified. + * @param message VersionVariants + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.VersionVariants, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionVariants to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionVariants + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VersionVariants { + + /** Properties of a Variant. */ + interface IVariant { + + /** Variant version */ + version?: (string|null); + + /** Variant trafficAllocation */ + trafficAllocation?: (number|null); + + /** Variant isControlGroup */ + isControlGroup?: (boolean|null); + } + + /** Represents a Variant. */ + class Variant implements IVariant { + + /** + * Constructs a new Variant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant); + + /** Variant version. */ + public version: string; + + /** Variant trafficAllocation. */ + public trafficAllocation: number; + + /** Variant isControlGroup. */ + public isControlGroup: boolean; + + /** + * Creates a new Variant instance using the specified properties. + * @param [properties] Properties to set + * @returns Variant instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant): google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant; + + /** + * Encodes the specified Variant message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.verify|verify} messages. + * @param message Variant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Variant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.verify|verify} messages. + * @param message Variant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Variant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Variant + * @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.dialogflow.cx.v3beta1.VersionVariants.Variant; + + /** + * Decodes a Variant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Variant + * @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.dialogflow.cx.v3beta1.VersionVariants.Variant; + + /** + * Verifies a Variant 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 Variant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Variant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant; + + /** + * Creates a plain object from a Variant message. Also converts values to other types if specified. + * @param message Variant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Variant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Variant + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RolloutConfig. */ + interface IRolloutConfig { + + /** RolloutConfig rolloutSteps */ + rolloutSteps?: (google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep[]|null); + + /** RolloutConfig rolloutCondition */ + rolloutCondition?: (string|null); + + /** RolloutConfig failureCondition */ + failureCondition?: (string|null); + } + + /** Represents a RolloutConfig. */ + class RolloutConfig implements IRolloutConfig { + + /** + * Constructs a new RolloutConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRolloutConfig); + + /** RolloutConfig rolloutSteps. */ + public rolloutSteps: google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep[]; + + /** RolloutConfig rolloutCondition. */ + public rolloutCondition: string; + + /** RolloutConfig failureCondition. */ + public failureCondition: string; + + /** + * Creates a new RolloutConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRolloutConfig): google.cloud.dialogflow.cx.v3beta1.RolloutConfig; + + /** + * Encodes the specified RolloutConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.verify|verify} messages. + * @param message RolloutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRolloutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.verify|verify} messages. + * @param message RolloutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRolloutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutConfig + * @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.dialogflow.cx.v3beta1.RolloutConfig; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutConfig + * @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.dialogflow.cx.v3beta1.RolloutConfig; + + /** + * Verifies a RolloutConfig 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 RolloutConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RolloutConfig; + + /** + * Creates a plain object from a RolloutConfig message. Also converts values to other types if specified. + * @param message RolloutConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RolloutConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RolloutConfig { + + /** Properties of a RolloutStep. */ + interface IRolloutStep { + + /** RolloutStep displayName */ + displayName?: (string|null); + + /** RolloutStep trafficPercent */ + trafficPercent?: (number|null); + + /** RolloutStep minDuration */ + minDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a RolloutStep. */ + class RolloutStep implements IRolloutStep { + + /** + * Constructs a new RolloutStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep); + + /** RolloutStep displayName. */ + public displayName: string; + + /** RolloutStep trafficPercent. */ + public trafficPercent: number; + + /** RolloutStep minDuration. */ + public minDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RolloutStep instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutStep instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep): google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep; + + /** + * Encodes the specified RolloutStep message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.verify|verify} messages. + * @param message RolloutStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutStep message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.verify|verify} messages. + * @param message RolloutStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutStep + * @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.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep; + + /** + * Decodes a RolloutStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutStep + * @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.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep; + + /** + * Verifies a RolloutStep 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 RolloutStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutStep + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep; + + /** + * Creates a plain object from a RolloutStep message. Also converts values to other types if specified. + * @param message RolloutStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RolloutState. */ + interface IRolloutState { + + /** RolloutState step */ + step?: (string|null); + + /** RolloutState stepIndex */ + stepIndex?: (number|null); + + /** RolloutState startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RolloutState. */ + class RolloutState implements IRolloutState { + + /** + * Constructs a new RolloutState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRolloutState); + + /** RolloutState step. */ + public step: string; + + /** RolloutState stepIndex. */ + public stepIndex: number; + + /** RolloutState startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RolloutState instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutState instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRolloutState): google.cloud.dialogflow.cx.v3beta1.RolloutState; + + /** + * Encodes the specified RolloutState message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutState.verify|verify} messages. + * @param message RolloutState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRolloutState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutState message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutState.verify|verify} messages. + * @param message RolloutState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRolloutState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutState + * @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.dialogflow.cx.v3beta1.RolloutState; + + /** + * Decodes a RolloutState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutState + * @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.dialogflow.cx.v3beta1.RolloutState; + + /** + * Verifies a RolloutState 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 RolloutState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RolloutState; + + /** + * Creates a plain object from a RolloutState message. Also converts values to other types if specified. + * @param message RolloutState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RolloutState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VariantsHistory. */ + interface IVariantsHistory { + + /** VariantsHistory versionVariants */ + versionVariants?: (google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null); + + /** VariantsHistory updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a VariantsHistory. */ + class VariantsHistory implements IVariantsHistory { + + /** + * Constructs a new VariantsHistory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IVariantsHistory); + + /** VariantsHistory versionVariants. */ + public versionVariants?: (google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null); + + /** VariantsHistory updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VariantsHistory variants. */ + public variants?: "versionVariants"; + + /** + * Creates a new VariantsHistory instance using the specified properties. + * @param [properties] Properties to set + * @returns VariantsHistory instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IVariantsHistory): google.cloud.dialogflow.cx.v3beta1.VariantsHistory; + + /** + * Encodes the specified VariantsHistory message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VariantsHistory.verify|verify} messages. + * @param message VariantsHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IVariantsHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VariantsHistory message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VariantsHistory.verify|verify} messages. + * @param message VariantsHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IVariantsHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VariantsHistory + * @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.dialogflow.cx.v3beta1.VariantsHistory; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VariantsHistory + * @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.dialogflow.cx.v3beta1.VariantsHistory; + + /** + * Verifies a VariantsHistory 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 VariantsHistory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VariantsHistory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.VariantsHistory; + + /** + * Creates a plain object from a VariantsHistory message. Also converts values to other types if specified. + * @param message VariantsHistory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.VariantsHistory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VariantsHistory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VariantsHistory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExperimentsRequest. */ + interface IListExperimentsRequest { + + /** ListExperimentsRequest parent */ + parent?: (string|null); + + /** ListExperimentsRequest pageSize */ + pageSize?: (number|null); + + /** ListExperimentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListExperimentsRequest. */ + class ListExperimentsRequest implements IListExperimentsRequest { + + /** + * Constructs a new ListExperimentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest); + + /** ListExperimentsRequest parent. */ + public parent: string; + + /** ListExperimentsRequest pageSize. */ + public pageSize: number; + + /** ListExperimentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListExperimentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExperimentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest): google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest; + + /** + * Encodes the specified ListExperimentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest.verify|verify} messages. + * @param message ListExperimentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest.verify|verify} messages. + * @param message ListExperimentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExperimentsRequest + * @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.dialogflow.cx.v3beta1.ListExperimentsRequest; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExperimentsRequest + * @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.dialogflow.cx.v3beta1.ListExperimentsRequest; + + /** + * Verifies a ListExperimentsRequest 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 ListExperimentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExperimentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest; + + /** + * Creates a plain object from a ListExperimentsRequest message. Also converts values to other types if specified. + * @param message ListExperimentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExperimentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExperimentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExperimentsResponse. */ + interface IListExperimentsResponse { + + /** ListExperimentsResponse experiments */ + experiments?: (google.cloud.dialogflow.cx.v3beta1.IExperiment[]|null); + + /** ListExperimentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExperimentsResponse. */ + class ListExperimentsResponse implements IListExperimentsResponse { + + /** + * Constructs a new ListExperimentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse); + + /** ListExperimentsResponse experiments. */ + public experiments: google.cloud.dialogflow.cx.v3beta1.IExperiment[]; + + /** ListExperimentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExperimentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExperimentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse): google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse; + + /** + * Encodes the specified ListExperimentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse.verify|verify} messages. + * @param message ListExperimentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse.verify|verify} messages. + * @param message ListExperimentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExperimentsResponse + * @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.dialogflow.cx.v3beta1.ListExperimentsResponse; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExperimentsResponse + * @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.dialogflow.cx.v3beta1.ListExperimentsResponse; + + /** + * Verifies a ListExperimentsResponse 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 ListExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExperimentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse; + + /** + * Creates a plain object from a ListExperimentsResponse message. Also converts values to other types if specified. + * @param message ListExperimentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExperimentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExperimentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExperimentRequest. */ + interface IGetExperimentRequest { + + /** GetExperimentRequest name */ + name?: (string|null); + } + + /** Represents a GetExperimentRequest. */ + class GetExperimentRequest implements IGetExperimentRequest { + + /** + * Constructs a new GetExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest); + + /** GetExperimentRequest name. */ + public name: string; + + /** + * Creates a new GetExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest): google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest; + + /** + * Encodes the specified GetExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest.verify|verify} messages. + * @param message GetExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest.verify|verify} messages. + * @param message GetExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExperimentRequest + * @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.dialogflow.cx.v3beta1.GetExperimentRequest; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExperimentRequest + * @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.dialogflow.cx.v3beta1.GetExperimentRequest; + + /** + * Verifies a GetExperimentRequest 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 GetExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest; + + /** + * Creates a plain object from a GetExperimentRequest message. Also converts values to other types if specified. + * @param message GetExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExperimentRequest. */ + interface ICreateExperimentRequest { + + /** CreateExperimentRequest parent */ + parent?: (string|null); + + /** CreateExperimentRequest experiment */ + experiment?: (google.cloud.dialogflow.cx.v3beta1.IExperiment|null); + } + + /** Represents a CreateExperimentRequest. */ + class CreateExperimentRequest implements ICreateExperimentRequest { + + /** + * Constructs a new CreateExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest); + + /** CreateExperimentRequest parent. */ + public parent: string; + + /** CreateExperimentRequest experiment. */ + public experiment?: (google.cloud.dialogflow.cx.v3beta1.IExperiment|null); + + /** + * Creates a new CreateExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest): google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest; + + /** + * Encodes the specified CreateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest.verify|verify} messages. + * @param message CreateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest.verify|verify} messages. + * @param message CreateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExperimentRequest + * @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.dialogflow.cx.v3beta1.CreateExperimentRequest; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExperimentRequest + * @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.dialogflow.cx.v3beta1.CreateExperimentRequest; + + /** + * Verifies a CreateExperimentRequest 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 CreateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest; + + /** + * Creates a plain object from a CreateExperimentRequest message. Also converts values to other types if specified. + * @param message CreateExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExperimentRequest. */ + interface IUpdateExperimentRequest { + + /** UpdateExperimentRequest experiment */ + experiment?: (google.cloud.dialogflow.cx.v3beta1.IExperiment|null); + + /** UpdateExperimentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExperimentRequest. */ + class UpdateExperimentRequest implements IUpdateExperimentRequest { + + /** + * Constructs a new UpdateExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest); + + /** UpdateExperimentRequest experiment. */ + public experiment?: (google.cloud.dialogflow.cx.v3beta1.IExperiment|null); + + /** UpdateExperimentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest): google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest; + + /** + * Encodes the specified UpdateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest.verify|verify} messages. + * @param message UpdateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest.verify|verify} messages. + * @param message UpdateExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExperimentRequest + * @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.dialogflow.cx.v3beta1.UpdateExperimentRequest; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExperimentRequest + * @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.dialogflow.cx.v3beta1.UpdateExperimentRequest; + + /** + * Verifies an UpdateExperimentRequest 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 UpdateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest; + + /** + * Creates a plain object from an UpdateExperimentRequest message. Also converts values to other types if specified. + * @param message UpdateExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExperimentRequest. */ + interface IDeleteExperimentRequest { + + /** DeleteExperimentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteExperimentRequest. */ + class DeleteExperimentRequest implements IDeleteExperimentRequest { + + /** + * Constructs a new DeleteExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest); + + /** DeleteExperimentRequest name. */ + public name: string; + + /** + * Creates a new DeleteExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest): google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest; + + /** + * Encodes the specified DeleteExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest.verify|verify} messages. + * @param message DeleteExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest.verify|verify} messages. + * @param message DeleteExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExperimentRequest + * @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.dialogflow.cx.v3beta1.DeleteExperimentRequest; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExperimentRequest + * @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.dialogflow.cx.v3beta1.DeleteExperimentRequest; + + /** + * Verifies a DeleteExperimentRequest 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 DeleteExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest; + + /** + * Creates a plain object from a DeleteExperimentRequest message. Also converts values to other types if specified. + * @param message DeleteExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartExperimentRequest. */ + interface IStartExperimentRequest { + + /** StartExperimentRequest name */ + name?: (string|null); + } + + /** Represents a StartExperimentRequest. */ + class StartExperimentRequest implements IStartExperimentRequest { + + /** + * Constructs a new StartExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest); + + /** StartExperimentRequest name. */ + public name: string; + + /** + * Creates a new StartExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest): google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest; + + /** + * Encodes the specified StartExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest.verify|verify} messages. + * @param message StartExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest.verify|verify} messages. + * @param message StartExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartExperimentRequest + * @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.dialogflow.cx.v3beta1.StartExperimentRequest; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartExperimentRequest + * @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.dialogflow.cx.v3beta1.StartExperimentRequest; + + /** + * Verifies a StartExperimentRequest 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 StartExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest; + + /** + * Creates a plain object from a StartExperimentRequest message. Also converts values to other types if specified. + * @param message StartExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopExperimentRequest. */ + interface IStopExperimentRequest { + + /** StopExperimentRequest name */ + name?: (string|null); + } + + /** Represents a StopExperimentRequest. */ + class StopExperimentRequest implements IStopExperimentRequest { + + /** + * Constructs a new StopExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest); + + /** StopExperimentRequest name. */ + public name: string; + + /** + * Creates a new StopExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopExperimentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest): google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest; + + /** + * Encodes the specified StopExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest.verify|verify} messages. + * @param message StopExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest.verify|verify} messages. + * @param message StopExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopExperimentRequest + * @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.dialogflow.cx.v3beta1.StopExperimentRequest; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopExperimentRequest + * @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.dialogflow.cx.v3beta1.StopExperimentRequest; + + /** + * Verifies a StopExperimentRequest 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 StopExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest; + + /** + * Creates a plain object from a StopExperimentRequest message. Also converts values to other types if specified. + * @param message StopExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Generators */ + class Generators extends $protobuf.rpc.Service { + + /** + * Constructs a new Generators service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Generators service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Generators; + + /** + * Calls ListGenerators. + * @param request ListGeneratorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGeneratorsResponse + */ + public listGenerators(request: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Generators.ListGeneratorsCallback): void; + + /** + * Calls ListGenerators. + * @param request ListGeneratorsRequest message or plain object + * @returns Promise + */ + public listGenerators(request: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest): Promise; + + /** + * Calls GetGenerator. + * @param request GetGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Generator + */ + public getGenerator(request: google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest, callback: google.cloud.dialogflow.cx.v3beta1.Generators.GetGeneratorCallback): void; + + /** + * Calls GetGenerator. + * @param request GetGeneratorRequest message or plain object + * @returns Promise + */ + public getGenerator(request: google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest): Promise; + + /** + * Calls CreateGenerator. + * @param request CreateGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Generator + */ + public createGenerator(request: google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest, callback: google.cloud.dialogflow.cx.v3beta1.Generators.CreateGeneratorCallback): void; + + /** + * Calls CreateGenerator. + * @param request CreateGeneratorRequest message or plain object + * @returns Promise + */ + public createGenerator(request: google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest): Promise; + + /** + * Calls UpdateGenerator. + * @param request UpdateGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Generator + */ + public updateGenerator(request: google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest, callback: google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGeneratorCallback): void; + + /** + * Calls UpdateGenerator. + * @param request UpdateGeneratorRequest message or plain object + * @returns Promise + */ + public updateGenerator(request: google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest): Promise; + + /** + * Calls DeleteGenerator. + * @param request DeleteGeneratorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteGenerator(request: google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest, callback: google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGeneratorCallback): void; + + /** + * Calls DeleteGenerator. + * @param request DeleteGeneratorRequest message or plain object + * @returns Promise + */ + public deleteGenerator(request: google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest): Promise; + } + + namespace Generators { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|listGenerators}. + * @param error Error, if any + * @param [response] ListGeneratorsResponse + */ + type ListGeneratorsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|getGenerator}. + * @param error Error, if any + * @param [response] Generator + */ + type GetGeneratorCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Generator) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|createGenerator}. + * @param error Error, if any + * @param [response] Generator + */ + type CreateGeneratorCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Generator) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|updateGenerator}. + * @param error Error, if any + * @param [response] Generator + */ + type UpdateGeneratorCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Generator) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|deleteGenerator}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteGeneratorCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Generator. */ + interface IGenerator { + + /** Generator name */ + name?: (string|null); + + /** Generator displayName */ + displayName?: (string|null); + + /** Generator promptText */ + promptText?: (google.cloud.dialogflow.cx.v3beta1.IPhrase|null); + + /** Generator placeholders */ + placeholders?: (google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder[]|null); + + /** Generator llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + + /** Generator modelParameter */ + modelParameter?: (google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter|null); + } + + /** Represents a Generator. */ + class Generator implements IGenerator { + + /** + * Constructs a new Generator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGenerator); + + /** Generator name. */ + public name: string; + + /** Generator displayName. */ + public displayName: string; + + /** Generator promptText. */ + public promptText?: (google.cloud.dialogflow.cx.v3beta1.IPhrase|null); + + /** Generator placeholders. */ + public placeholders: google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder[]; + + /** Generator llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + + /** Generator modelParameter. */ + public modelParameter?: (google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter|null); + + /** + * Creates a new Generator instance using the specified properties. + * @param [properties] Properties to set + * @returns Generator instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGenerator): google.cloud.dialogflow.cx.v3beta1.Generator; + + /** + * Encodes the specified Generator message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.verify|verify} messages. + * @param message Generator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGenerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Generator message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.verify|verify} messages. + * @param message Generator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGenerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Generator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Generator + * @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.dialogflow.cx.v3beta1.Generator; + + /** + * Decodes a Generator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Generator + * @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.dialogflow.cx.v3beta1.Generator; + + /** + * Verifies a Generator 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 Generator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Generator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Generator; + + /** + * Creates a plain object from a Generator message. Also converts values to other types if specified. + * @param message Generator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Generator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Generator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Generator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Generator { + + /** Properties of a Placeholder. */ + interface IPlaceholder { + + /** Placeholder id */ + id?: (string|null); + + /** Placeholder name */ + name?: (string|null); + } + + /** Represents a Placeholder. */ + class Placeholder implements IPlaceholder { + + /** + * Constructs a new Placeholder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder); + + /** Placeholder id. */ + public id: string; + + /** Placeholder name. */ + public name: string; + + /** + * Creates a new Placeholder instance using the specified properties. + * @param [properties] Properties to set + * @returns Placeholder instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder): google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder; + + /** + * Encodes the specified Placeholder message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.verify|verify} messages. + * @param message Placeholder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Placeholder message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.verify|verify} messages. + * @param message Placeholder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Placeholder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Placeholder + * @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.dialogflow.cx.v3beta1.Generator.Placeholder; + + /** + * Decodes a Placeholder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Placeholder + * @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.dialogflow.cx.v3beta1.Generator.Placeholder; + + /** + * Verifies a Placeholder 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 Placeholder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Placeholder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder; + + /** + * Creates a plain object from a Placeholder message. Also converts values to other types if specified. + * @param message Placeholder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Placeholder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Placeholder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelParameter. */ + interface IModelParameter { + + /** ModelParameter temperature */ + temperature?: (number|null); + + /** ModelParameter maxDecodeSteps */ + maxDecodeSteps?: (number|null); + + /** ModelParameter topP */ + topP?: (number|null); + + /** ModelParameter topK */ + topK?: (number|null); + } + + /** Represents a ModelParameter. */ + class ModelParameter implements IModelParameter { + + /** + * Constructs a new ModelParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter); + + /** ModelParameter temperature. */ + public temperature?: (number|null); + + /** ModelParameter maxDecodeSteps. */ + public maxDecodeSteps?: (number|null); + + /** ModelParameter topP. */ + public topP?: (number|null); + + /** ModelParameter topK. */ + public topK?: (number|null); + + /** + * Creates a new ModelParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelParameter instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter): google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter; + + /** + * Encodes the specified ModelParameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.verify|verify} messages. + * @param message ModelParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelParameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.verify|verify} messages. + * @param message ModelParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelParameter + * @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.dialogflow.cx.v3beta1.Generator.ModelParameter; + + /** + * Decodes a ModelParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelParameter + * @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.dialogflow.cx.v3beta1.Generator.ModelParameter; + + /** + * Verifies a ModelParameter 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 ModelParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter; + + /** + * Creates a plain object from a ModelParameter message. Also converts values to other types if specified. + * @param message ModelParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase text */ + text?: (string|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPhrase); + + /** Phrase text. */ + public text: string; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPhrase): google.cloud.dialogflow.cx.v3beta1.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @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.dialogflow.cx.v3beta1.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @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.dialogflow.cx.v3beta1.Phrase; + + /** + * Verifies a Phrase 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 Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGeneratorsRequest. */ + interface IListGeneratorsRequest { + + /** ListGeneratorsRequest parent */ + parent?: (string|null); + + /** ListGeneratorsRequest languageCode */ + languageCode?: (string|null); + + /** ListGeneratorsRequest pageSize */ + pageSize?: (number|null); + + /** ListGeneratorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListGeneratorsRequest. */ + class ListGeneratorsRequest implements IListGeneratorsRequest { + + /** + * Constructs a new ListGeneratorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest); + + /** ListGeneratorsRequest parent. */ + public parent: string; + + /** ListGeneratorsRequest languageCode. */ + public languageCode: string; + + /** ListGeneratorsRequest pageSize. */ + public pageSize: number; + + /** ListGeneratorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListGeneratorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGeneratorsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest): google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest; + + /** + * Encodes the specified ListGeneratorsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest.verify|verify} messages. + * @param message ListGeneratorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGeneratorsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest.verify|verify} messages. + * @param message ListGeneratorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGeneratorsRequest + * @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.dialogflow.cx.v3beta1.ListGeneratorsRequest; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGeneratorsRequest + * @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.dialogflow.cx.v3beta1.ListGeneratorsRequest; + + /** + * Verifies a ListGeneratorsRequest 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 ListGeneratorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGeneratorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest; + + /** + * Creates a plain object from a ListGeneratorsRequest message. Also converts values to other types if specified. + * @param message ListGeneratorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGeneratorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGeneratorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGeneratorsResponse. */ + interface IListGeneratorsResponse { + + /** ListGeneratorsResponse generators */ + generators?: (google.cloud.dialogflow.cx.v3beta1.IGenerator[]|null); + + /** ListGeneratorsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGeneratorsResponse. */ + class ListGeneratorsResponse implements IListGeneratorsResponse { + + /** + * Constructs a new ListGeneratorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse); + + /** ListGeneratorsResponse generators. */ + public generators: google.cloud.dialogflow.cx.v3beta1.IGenerator[]; + + /** ListGeneratorsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGeneratorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGeneratorsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse): google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse; + + /** + * Encodes the specified ListGeneratorsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse.verify|verify} messages. + * @param message ListGeneratorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGeneratorsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse.verify|verify} messages. + * @param message ListGeneratorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGeneratorsResponse + * @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.dialogflow.cx.v3beta1.ListGeneratorsResponse; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGeneratorsResponse + * @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.dialogflow.cx.v3beta1.ListGeneratorsResponse; + + /** + * Verifies a ListGeneratorsResponse 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 ListGeneratorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGeneratorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse; + + /** + * Creates a plain object from a ListGeneratorsResponse message. Also converts values to other types if specified. + * @param message ListGeneratorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGeneratorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGeneratorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGeneratorRequest. */ + interface IGetGeneratorRequest { + + /** GetGeneratorRequest name */ + name?: (string|null); + + /** GetGeneratorRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetGeneratorRequest. */ + class GetGeneratorRequest implements IGetGeneratorRequest { + + /** + * Constructs a new GetGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest); + + /** GetGeneratorRequest name. */ + public name: string; + + /** GetGeneratorRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest): google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest; + + /** + * Encodes the specified GetGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest.verify|verify} messages. + * @param message GetGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest.verify|verify} messages. + * @param message GetGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGeneratorRequest + * @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.dialogflow.cx.v3beta1.GetGeneratorRequest; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGeneratorRequest + * @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.dialogflow.cx.v3beta1.GetGeneratorRequest; + + /** + * Verifies a GetGeneratorRequest 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 GetGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest; + + /** + * Creates a plain object from a GetGeneratorRequest message. Also converts values to other types if specified. + * @param message GetGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGeneratorRequest. */ + interface ICreateGeneratorRequest { + + /** CreateGeneratorRequest parent */ + parent?: (string|null); + + /** CreateGeneratorRequest generator */ + generator?: (google.cloud.dialogflow.cx.v3beta1.IGenerator|null); + + /** CreateGeneratorRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CreateGeneratorRequest. */ + class CreateGeneratorRequest implements ICreateGeneratorRequest { + + /** + * Constructs a new CreateGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest); + + /** CreateGeneratorRequest parent. */ + public parent: string; + + /** CreateGeneratorRequest generator. */ + public generator?: (google.cloud.dialogflow.cx.v3beta1.IGenerator|null); + + /** CreateGeneratorRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CreateGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest): google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest; + + /** + * Encodes the specified CreateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest.verify|verify} messages. + * @param message CreateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest.verify|verify} messages. + * @param message CreateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGeneratorRequest + * @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.dialogflow.cx.v3beta1.CreateGeneratorRequest; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGeneratorRequest + * @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.dialogflow.cx.v3beta1.CreateGeneratorRequest; + + /** + * Verifies a CreateGeneratorRequest 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 CreateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest; + + /** + * Creates a plain object from a CreateGeneratorRequest message. Also converts values to other types if specified. + * @param message CreateGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGeneratorRequest. */ + interface IUpdateGeneratorRequest { + + /** UpdateGeneratorRequest generator */ + generator?: (google.cloud.dialogflow.cx.v3beta1.IGenerator|null); + + /** UpdateGeneratorRequest languageCode */ + languageCode?: (string|null); + + /** UpdateGeneratorRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGeneratorRequest. */ + class UpdateGeneratorRequest implements IUpdateGeneratorRequest { + + /** + * Constructs a new UpdateGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest); + + /** UpdateGeneratorRequest generator. */ + public generator?: (google.cloud.dialogflow.cx.v3beta1.IGenerator|null); + + /** UpdateGeneratorRequest languageCode. */ + public languageCode: string; + + /** UpdateGeneratorRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest): google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest; + + /** + * Encodes the specified UpdateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.verify|verify} messages. + * @param message UpdateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.verify|verify} messages. + * @param message UpdateGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGeneratorRequest + * @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.dialogflow.cx.v3beta1.UpdateGeneratorRequest; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGeneratorRequest + * @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.dialogflow.cx.v3beta1.UpdateGeneratorRequest; + + /** + * Verifies an UpdateGeneratorRequest 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 UpdateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest; + + /** + * Creates a plain object from an UpdateGeneratorRequest message. Also converts values to other types if specified. + * @param message UpdateGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGeneratorRequest. */ + interface IDeleteGeneratorRequest { + + /** DeleteGeneratorRequest name */ + name?: (string|null); + + /** DeleteGeneratorRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteGeneratorRequest. */ + class DeleteGeneratorRequest implements IDeleteGeneratorRequest { + + /** + * Constructs a new DeleteGeneratorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest); + + /** DeleteGeneratorRequest name. */ + public name: string; + + /** DeleteGeneratorRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteGeneratorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGeneratorRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest): google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest; + + /** + * Encodes the specified DeleteGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest.verify|verify} messages. + * @param message DeleteGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest.verify|verify} messages. + * @param message DeleteGeneratorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGeneratorRequest + * @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.dialogflow.cx.v3beta1.DeleteGeneratorRequest; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGeneratorRequest + * @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.dialogflow.cx.v3beta1.DeleteGeneratorRequest; + + /** + * Verifies a DeleteGeneratorRequest 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 DeleteGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGeneratorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest; + + /** + * Creates a plain object from a DeleteGeneratorRequest message. Also converts values to other types if specified. + * @param message DeleteGeneratorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGeneratorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGeneratorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Playbooks */ + class Playbooks extends $protobuf.rpc.Service { + + /** + * Constructs a new Playbooks service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Playbooks service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Playbooks; + + /** + * Calls CreatePlaybook. + * @param request CreatePlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Playbook + */ + public createPlaybook(request: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.CreatePlaybookCallback): void; + + /** + * Calls CreatePlaybook. + * @param request CreatePlaybookRequest message or plain object + * @returns Promise + */ + public createPlaybook(request: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest): Promise; + + /** + * Calls DeletePlaybook. + * @param request DeletePlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePlaybook(request: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.DeletePlaybookCallback): void; + + /** + * Calls DeletePlaybook. + * @param request DeletePlaybookRequest message or plain object + * @returns Promise + */ + public deletePlaybook(request: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest): Promise; + + /** + * Calls ListPlaybooks. + * @param request ListPlaybooksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPlaybooksResponse + */ + public listPlaybooks(request: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybooksCallback): void; + + /** + * Calls ListPlaybooks. + * @param request ListPlaybooksRequest message or plain object + * @returns Promise + */ + public listPlaybooks(request: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest): Promise; + + /** + * Calls GetPlaybook. + * @param request GetPlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Playbook + */ + public getPlaybook(request: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.GetPlaybookCallback): void; + + /** + * Calls GetPlaybook. + * @param request GetPlaybookRequest message or plain object + * @returns Promise + */ + public getPlaybook(request: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest): Promise; + + /** + * Calls ExportPlaybook. + * @param request ExportPlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportPlaybook(request: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.ExportPlaybookCallback): void; + + /** + * Calls ExportPlaybook. + * @param request ExportPlaybookRequest message or plain object + * @returns Promise + */ + public exportPlaybook(request: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest): Promise; + + /** + * Calls ImportPlaybook. + * @param request ImportPlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importPlaybook(request: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.ImportPlaybookCallback): void; + + /** + * Calls ImportPlaybook. + * @param request ImportPlaybookRequest message or plain object + * @returns Promise + */ + public importPlaybook(request: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest): Promise; + + /** + * Calls UpdatePlaybook. + * @param request UpdatePlaybookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Playbook + */ + public updatePlaybook(request: google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.UpdatePlaybookCallback): void; + + /** + * Calls UpdatePlaybook. + * @param request UpdatePlaybookRequest message or plain object + * @returns Promise + */ + public updatePlaybook(request: google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest): Promise; + + /** + * Calls CreatePlaybookVersion. + * @param request CreatePlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PlaybookVersion + */ + public createPlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.CreatePlaybookVersionCallback): void; + + /** + * Calls CreatePlaybookVersion. + * @param request CreatePlaybookVersionRequest message or plain object + * @returns Promise + */ + public createPlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest): Promise; + + /** + * Calls GetPlaybookVersion. + * @param request GetPlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PlaybookVersion + */ + public getPlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.GetPlaybookVersionCallback): void; + + /** + * Calls GetPlaybookVersion. + * @param request GetPlaybookVersionRequest message or plain object + * @returns Promise + */ + public getPlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest): Promise; + + /** + * Calls RestorePlaybookVersion. + * @param request RestorePlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestorePlaybookVersionResponse + */ + public restorePlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.RestorePlaybookVersionCallback): void; + + /** + * Calls RestorePlaybookVersion. + * @param request RestorePlaybookVersionRequest message or plain object + * @returns Promise + */ + public restorePlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest): Promise; + + /** + * Calls ListPlaybookVersions. + * @param request ListPlaybookVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPlaybookVersionsResponse + */ + public listPlaybookVersions(request: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybookVersionsCallback): void; + + /** + * Calls ListPlaybookVersions. + * @param request ListPlaybookVersionsRequest message or plain object + * @returns Promise + */ + public listPlaybookVersions(request: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest): Promise; + + /** + * Calls DeletePlaybookVersion. + * @param request DeletePlaybookVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Playbooks.DeletePlaybookVersionCallback): void; + + /** + * Calls DeletePlaybookVersion. + * @param request DeletePlaybookVersionRequest message or plain object + * @returns Promise + */ + public deletePlaybookVersion(request: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest): Promise; + } + + namespace Playbooks { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|createPlaybook}. + * @param error Error, if any + * @param [response] Playbook + */ + type CreatePlaybookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Playbook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|deletePlaybook}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePlaybookCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|listPlaybooks}. + * @param error Error, if any + * @param [response] ListPlaybooksResponse + */ + type ListPlaybooksCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|getPlaybook}. + * @param error Error, if any + * @param [response] Playbook + */ + type GetPlaybookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Playbook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|exportPlaybook}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportPlaybookCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|importPlaybook}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportPlaybookCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|updatePlaybook}. + * @param error Error, if any + * @param [response] Playbook + */ + type UpdatePlaybookCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Playbook) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|createPlaybookVersion}. + * @param error Error, if any + * @param [response] PlaybookVersion + */ + type CreatePlaybookVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.PlaybookVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|getPlaybookVersion}. + * @param error Error, if any + * @param [response] PlaybookVersion + */ + type GetPlaybookVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.PlaybookVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|restorePlaybookVersion}. + * @param error Error, if any + * @param [response] RestorePlaybookVersionResponse + */ + type RestorePlaybookVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|listPlaybookVersions}. + * @param error Error, if any + * @param [response] ListPlaybookVersionsResponse + */ + type ListPlaybookVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|deletePlaybookVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePlaybookVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreatePlaybookRequest. */ + interface ICreatePlaybookRequest { + + /** CreatePlaybookRequest parent */ + parent?: (string|null); + + /** CreatePlaybookRequest playbook */ + playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + } + + /** Represents a CreatePlaybookRequest. */ + class CreatePlaybookRequest implements ICreatePlaybookRequest { + + /** + * Constructs a new CreatePlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest); + + /** CreatePlaybookRequest parent. */ + public parent: string; + + /** CreatePlaybookRequest playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + + /** + * Creates a new CreatePlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest): google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest; + + /** + * Encodes the specified CreatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest.verify|verify} messages. + * @param message CreatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest.verify|verify} messages. + * @param message CreatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePlaybookRequest + * @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.dialogflow.cx.v3beta1.CreatePlaybookRequest; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePlaybookRequest + * @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.dialogflow.cx.v3beta1.CreatePlaybookRequest; + + /** + * Verifies a CreatePlaybookRequest 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 CreatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest; + + /** + * Creates a plain object from a CreatePlaybookRequest message. Also converts values to other types if specified. + * @param message CreatePlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePlaybookRequest. */ + interface IDeletePlaybookRequest { + + /** DeletePlaybookRequest name */ + name?: (string|null); + } + + /** Represents a DeletePlaybookRequest. */ + class DeletePlaybookRequest implements IDeletePlaybookRequest { + + /** + * Constructs a new DeletePlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest); + + /** DeletePlaybookRequest name. */ + public name: string; + + /** + * Creates a new DeletePlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest): google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest; + + /** + * Encodes the specified DeletePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest.verify|verify} messages. + * @param message DeletePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest.verify|verify} messages. + * @param message DeletePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePlaybookRequest + * @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.dialogflow.cx.v3beta1.DeletePlaybookRequest; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePlaybookRequest + * @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.dialogflow.cx.v3beta1.DeletePlaybookRequest; + + /** + * Verifies a DeletePlaybookRequest 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 DeletePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest; + + /** + * Creates a plain object from a DeletePlaybookRequest message. Also converts values to other types if specified. + * @param message DeletePlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybooksRequest. */ + interface IListPlaybooksRequest { + + /** ListPlaybooksRequest parent */ + parent?: (string|null); + + /** ListPlaybooksRequest pageSize */ + pageSize?: (number|null); + + /** ListPlaybooksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPlaybooksRequest. */ + class ListPlaybooksRequest implements IListPlaybooksRequest { + + /** + * Constructs a new ListPlaybooksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest); + + /** ListPlaybooksRequest parent. */ + public parent: string; + + /** ListPlaybooksRequest pageSize. */ + public pageSize: number; + + /** ListPlaybooksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPlaybooksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybooksRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest): google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest; + + /** + * Encodes the specified ListPlaybooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest.verify|verify} messages. + * @param message ListPlaybooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest.verify|verify} messages. + * @param message ListPlaybooksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybooksRequest + * @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.dialogflow.cx.v3beta1.ListPlaybooksRequest; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybooksRequest + * @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.dialogflow.cx.v3beta1.ListPlaybooksRequest; + + /** + * Verifies a ListPlaybooksRequest 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 ListPlaybooksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybooksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest; + + /** + * Creates a plain object from a ListPlaybooksRequest message. Also converts values to other types if specified. + * @param message ListPlaybooksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybooksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybooksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybooksResponse. */ + interface IListPlaybooksResponse { + + /** ListPlaybooksResponse playbooks */ + playbooks?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook[]|null); + + /** ListPlaybooksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPlaybooksResponse. */ + class ListPlaybooksResponse implements IListPlaybooksResponse { + + /** + * Constructs a new ListPlaybooksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse); + + /** ListPlaybooksResponse playbooks. */ + public playbooks: google.cloud.dialogflow.cx.v3beta1.IPlaybook[]; + + /** ListPlaybooksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPlaybooksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybooksResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse): google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse; + + /** + * Encodes the specified ListPlaybooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse.verify|verify} messages. + * @param message ListPlaybooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse.verify|verify} messages. + * @param message ListPlaybooksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybooksResponse + * @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.dialogflow.cx.v3beta1.ListPlaybooksResponse; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybooksResponse + * @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.dialogflow.cx.v3beta1.ListPlaybooksResponse; + + /** + * Verifies a ListPlaybooksResponse 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 ListPlaybooksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybooksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse; + + /** + * Creates a plain object from a ListPlaybooksResponse message. Also converts values to other types if specified. + * @param message ListPlaybooksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybooksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybooksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPlaybookRequest. */ + interface IGetPlaybookRequest { + + /** GetPlaybookRequest name */ + name?: (string|null); + } + + /** Represents a GetPlaybookRequest. */ + class GetPlaybookRequest implements IGetPlaybookRequest { + + /** + * Constructs a new GetPlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest); + + /** GetPlaybookRequest name. */ + public name: string; + + /** + * Creates a new GetPlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest): google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest; + + /** + * Encodes the specified GetPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest.verify|verify} messages. + * @param message GetPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest.verify|verify} messages. + * @param message GetPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPlaybookRequest + * @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.dialogflow.cx.v3beta1.GetPlaybookRequest; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPlaybookRequest + * @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.dialogflow.cx.v3beta1.GetPlaybookRequest; + + /** + * Verifies a GetPlaybookRequest 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 GetPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest; + + /** + * Creates a plain object from a GetPlaybookRequest message. Also converts values to other types if specified. + * @param message GetPlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePlaybookRequest. */ + interface IUpdatePlaybookRequest { + + /** UpdatePlaybookRequest playbook */ + playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + + /** UpdatePlaybookRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePlaybookRequest. */ + class UpdatePlaybookRequest implements IUpdatePlaybookRequest { + + /** + * Constructs a new UpdatePlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest); + + /** UpdatePlaybookRequest playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + + /** UpdatePlaybookRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest): google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest; + + /** + * Encodes the specified UpdatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest.verify|verify} messages. + * @param message UpdatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest.verify|verify} messages. + * @param message UpdatePlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePlaybookRequest + * @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.dialogflow.cx.v3beta1.UpdatePlaybookRequest; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePlaybookRequest + * @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.dialogflow.cx.v3beta1.UpdatePlaybookRequest; + + /** + * Verifies an UpdatePlaybookRequest 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 UpdatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest; + + /** + * Creates a plain object from an UpdatePlaybookRequest message. Also converts values to other types if specified. + * @param message UpdatePlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Playbook. */ + interface IPlaybook { + + /** Playbook name */ + name?: (string|null); + + /** Playbook displayName */ + displayName?: (string|null); + + /** Playbook goal */ + goal?: (string|null); + + /** Playbook inputParameterDefinitions */ + inputParameterDefinitions?: (google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]|null); + + /** Playbook outputParameterDefinitions */ + outputParameterDefinitions?: (google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]|null); + + /** Playbook instruction */ + instruction?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null); + + /** Playbook tokenCount */ + tokenCount?: (number|Long|string|null); + + /** Playbook createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Playbook updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Playbook referencedPlaybooks */ + referencedPlaybooks?: (string[]|null); + + /** Playbook referencedFlows */ + referencedFlows?: (string[]|null); + + /** Playbook referencedTools */ + referencedTools?: (string[]|null); + + /** Playbook inlineActions */ + inlineActions?: (string[]|null); + + /** Playbook codeBlock */ + codeBlock?: (google.cloud.dialogflow.cx.v3beta1.ICodeBlock|null); + + /** Playbook llmModelSettings */ + llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + + /** Playbook speechSettings */ + speechSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null); + + /** Playbook handlers */ + handlers?: (google.cloud.dialogflow.cx.v3beta1.IHandler[]|null); + + /** Playbook playbookType */ + playbookType?: (google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType|null); + } + + /** Represents a Playbook. */ + class Playbook implements IPlaybook { + + /** + * Constructs a new Playbook. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybook); + + /** Playbook name. */ + public name: string; + + /** Playbook displayName. */ + public displayName: string; + + /** Playbook goal. */ + public goal: string; + + /** Playbook inputParameterDefinitions. */ + public inputParameterDefinitions: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]; + + /** Playbook outputParameterDefinitions. */ + public outputParameterDefinitions: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]; + + /** Playbook instruction. */ + public instruction?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null); + + /** Playbook tokenCount. */ + public tokenCount: (number|Long|string); + + /** Playbook createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Playbook updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Playbook referencedPlaybooks. */ + public referencedPlaybooks: string[]; + + /** Playbook referencedFlows. */ + public referencedFlows: string[]; + + /** Playbook referencedTools. */ + public referencedTools: string[]; + + /** Playbook inlineActions. */ + public inlineActions: string[]; + + /** Playbook codeBlock. */ + public codeBlock?: (google.cloud.dialogflow.cx.v3beta1.ICodeBlock|null); + + /** Playbook llmModelSettings. */ + public llmModelSettings?: (google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null); + + /** Playbook speechSettings. */ + public speechSettings?: (google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null); + + /** Playbook handlers. */ + public handlers: google.cloud.dialogflow.cx.v3beta1.IHandler[]; + + /** Playbook playbookType. */ + public playbookType: (google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType); + + /** + * Creates a new Playbook instance using the specified properties. + * @param [properties] Properties to set + * @returns Playbook instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybook): google.cloud.dialogflow.cx.v3beta1.Playbook; + + /** + * Encodes the specified Playbook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.verify|verify} messages. + * @param message Playbook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Playbook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.verify|verify} messages. + * @param message Playbook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Playbook message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Playbook + * @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.dialogflow.cx.v3beta1.Playbook; + + /** + * Decodes a Playbook message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Playbook + * @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.dialogflow.cx.v3beta1.Playbook; + + /** + * Verifies a Playbook 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 Playbook message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Playbook + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Playbook; + + /** + * Creates a plain object from a Playbook message. Also converts values to other types if specified. + * @param message Playbook + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Playbook, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Playbook to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Playbook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Playbook { + + /** Properties of a Step. */ + interface IStep { + + /** Step text */ + text?: (string|null); + + /** Step steps */ + steps?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]|null); + } + + /** Represents a Step. */ + class Step implements IStep { + + /** + * Constructs a new Step. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep); + + /** Step text. */ + public text?: (string|null); + + /** Step steps. */ + public steps: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]; + + /** Step instruction. */ + public instruction?: "text"; + + /** + * Creates a new Step instance using the specified properties. + * @param [properties] Properties to set + * @returns Step instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep): google.cloud.dialogflow.cx.v3beta1.Playbook.Step; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Step message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Step + * @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.dialogflow.cx.v3beta1.Playbook.Step; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Step + * @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.dialogflow.cx.v3beta1.Playbook.Step; + + /** + * Verifies a Step 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 Step message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Step + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Playbook.Step; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @param message Step + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Playbook.Step, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Step to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Step + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instruction. */ + interface IInstruction { + + /** Instruction guidelines */ + guidelines?: (string|null); + + /** Instruction steps */ + steps?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]|null); + } + + /** Represents an Instruction. */ + class Instruction implements IInstruction { + + /** + * Constructs a new Instruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction); + + /** Instruction guidelines. */ + public guidelines: string; + + /** Instruction steps. */ + public steps: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]; + + /** + * Creates a new Instruction instance using the specified properties. + * @param [properties] Properties to set + * @returns Instruction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction): google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instruction + * @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.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instruction + * @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.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Verifies an Instruction 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 Instruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instruction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @param message Instruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PlaybookType enum. */ + enum PlaybookType { + PLAYBOOK_TYPE_UNSPECIFIED = 0, + TASK = 1, + ROUTINE = 3 + } + } + + /** Properties of a CreatePlaybookVersionRequest. */ + interface ICreatePlaybookVersionRequest { + + /** CreatePlaybookVersionRequest parent */ + parent?: (string|null); + + /** CreatePlaybookVersionRequest playbookVersion */ + playbookVersion?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion|null); + } + + /** Represents a CreatePlaybookVersionRequest. */ + class CreatePlaybookVersionRequest implements ICreatePlaybookVersionRequest { + + /** + * Constructs a new CreatePlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest); + + /** CreatePlaybookVersionRequest parent. */ + public parent: string; + + /** CreatePlaybookVersionRequest playbookVersion. */ + public playbookVersion?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion|null); + + /** + * Creates a new CreatePlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest): google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest; + + /** + * Encodes the specified CreatePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest.verify|verify} messages. + * @param message CreatePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest.verify|verify} messages. + * @param message CreatePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest; + + /** + * Verifies a CreatePlaybookVersionRequest 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 CreatePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest; + + /** + * Creates a plain object from a CreatePlaybookVersionRequest message. Also converts values to other types if specified. + * @param message CreatePlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookVersion. */ + interface IPlaybookVersion { + + /** PlaybookVersion name */ + name?: (string|null); + + /** PlaybookVersion description */ + description?: (string|null); + + /** PlaybookVersion playbook */ + playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + + /** PlaybookVersion examples */ + examples?: (google.cloud.dialogflow.cx.v3beta1.IExample[]|null); + + /** PlaybookVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PlaybookVersion. */ + class PlaybookVersion implements IPlaybookVersion { + + /** + * Constructs a new PlaybookVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion); + + /** PlaybookVersion name. */ + public name: string; + + /** PlaybookVersion description. */ + public description: string; + + /** PlaybookVersion playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + + /** PlaybookVersion examples. */ + public examples: google.cloud.dialogflow.cx.v3beta1.IExample[]; + + /** PlaybookVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PlaybookVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookVersion instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion): google.cloud.dialogflow.cx.v3beta1.PlaybookVersion; + + /** + * Encodes the specified PlaybookVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.verify|verify} messages. + * @param message PlaybookVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.verify|verify} messages. + * @param message PlaybookVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookVersion + * @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.dialogflow.cx.v3beta1.PlaybookVersion; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookVersion + * @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.dialogflow.cx.v3beta1.PlaybookVersion; + + /** + * Verifies a PlaybookVersion 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 PlaybookVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PlaybookVersion; + + /** + * Creates a plain object from a PlaybookVersion message. Also converts values to other types if specified. + * @param message PlaybookVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PlaybookVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPlaybookVersionRequest. */ + interface IGetPlaybookVersionRequest { + + /** GetPlaybookVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetPlaybookVersionRequest. */ + class GetPlaybookVersionRequest implements IGetPlaybookVersionRequest { + + /** + * Constructs a new GetPlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest); + + /** GetPlaybookVersionRequest name. */ + public name: string; + + /** + * Creates a new GetPlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest): google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest; + + /** + * Encodes the specified GetPlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest.verify|verify} messages. + * @param message GetPlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest.verify|verify} messages. + * @param message GetPlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.GetPlaybookVersionRequest; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.GetPlaybookVersionRequest; + + /** + * Verifies a GetPlaybookVersionRequest 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 GetPlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest; + + /** + * Creates a plain object from a GetPlaybookVersionRequest message. Also converts values to other types if specified. + * @param message GetPlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestorePlaybookVersionRequest. */ + interface IRestorePlaybookVersionRequest { + + /** RestorePlaybookVersionRequest name */ + name?: (string|null); + } + + /** Represents a RestorePlaybookVersionRequest. */ + class RestorePlaybookVersionRequest implements IRestorePlaybookVersionRequest { + + /** + * Constructs a new RestorePlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest); + + /** RestorePlaybookVersionRequest name. */ + public name: string; + + /** + * Creates a new RestorePlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestorePlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest): google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest; + + /** + * Encodes the specified RestorePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest.verify|verify} messages. + * @param message RestorePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestorePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest.verify|verify} messages. + * @param message RestorePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestorePlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestorePlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest; + + /** + * Verifies a RestorePlaybookVersionRequest 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 RestorePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestorePlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest; + + /** + * Creates a plain object from a RestorePlaybookVersionRequest message. Also converts values to other types if specified. + * @param message RestorePlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestorePlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestorePlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestorePlaybookVersionResponse. */ + interface IRestorePlaybookVersionResponse { + + /** RestorePlaybookVersionResponse playbook */ + playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + } + + /** Represents a RestorePlaybookVersionResponse. */ + class RestorePlaybookVersionResponse implements IRestorePlaybookVersionResponse { + + /** + * Constructs a new RestorePlaybookVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse); + + /** RestorePlaybookVersionResponse playbook. */ + public playbook?: (google.cloud.dialogflow.cx.v3beta1.IPlaybook|null); + + /** + * Creates a new RestorePlaybookVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestorePlaybookVersionResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse): google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse; + + /** + * Encodes the specified RestorePlaybookVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse.verify|verify} messages. + * @param message RestorePlaybookVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestorePlaybookVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse.verify|verify} messages. + * @param message RestorePlaybookVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestorePlaybookVersionResponse + * @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.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestorePlaybookVersionResponse + * @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.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse; + + /** + * Verifies a RestorePlaybookVersionResponse 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 RestorePlaybookVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestorePlaybookVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse; + + /** + * Creates a plain object from a RestorePlaybookVersionResponse message. Also converts values to other types if specified. + * @param message RestorePlaybookVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestorePlaybookVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestorePlaybookVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybookVersionsRequest. */ + interface IListPlaybookVersionsRequest { + + /** ListPlaybookVersionsRequest parent */ + parent?: (string|null); + + /** ListPlaybookVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListPlaybookVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPlaybookVersionsRequest. */ + class ListPlaybookVersionsRequest implements IListPlaybookVersionsRequest { + + /** + * Constructs a new ListPlaybookVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest); + + /** ListPlaybookVersionsRequest parent. */ + public parent: string; + + /** ListPlaybookVersionsRequest pageSize. */ + public pageSize: number; + + /** ListPlaybookVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPlaybookVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybookVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest): google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest; + + /** + * Encodes the specified ListPlaybookVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest.verify|verify} messages. + * @param message ListPlaybookVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybookVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest.verify|verify} messages. + * @param message ListPlaybookVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybookVersionsRequest + * @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.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybookVersionsRequest + * @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.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest; + + /** + * Verifies a ListPlaybookVersionsRequest 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 ListPlaybookVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybookVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest; + + /** + * Creates a plain object from a ListPlaybookVersionsRequest message. Also converts values to other types if specified. + * @param message ListPlaybookVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybookVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybookVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPlaybookVersionsResponse. */ + interface IListPlaybookVersionsResponse { + + /** ListPlaybookVersionsResponse playbookVersions */ + playbookVersions?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[]|null); + + /** ListPlaybookVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPlaybookVersionsResponse. */ + class ListPlaybookVersionsResponse implements IListPlaybookVersionsResponse { + + /** + * Constructs a new ListPlaybookVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse); + + /** ListPlaybookVersionsResponse playbookVersions. */ + public playbookVersions: google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[]; + + /** ListPlaybookVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPlaybookVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPlaybookVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse): google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse; + + /** + * Encodes the specified ListPlaybookVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse.verify|verify} messages. + * @param message ListPlaybookVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPlaybookVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse.verify|verify} messages. + * @param message ListPlaybookVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPlaybookVersionsResponse + * @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.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPlaybookVersionsResponse + * @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.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse; + + /** + * Verifies a ListPlaybookVersionsResponse 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 ListPlaybookVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPlaybookVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse; + + /** + * Creates a plain object from a ListPlaybookVersionsResponse message. Also converts values to other types if specified. + * @param message ListPlaybookVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPlaybookVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPlaybookVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePlaybookVersionRequest. */ + interface IDeletePlaybookVersionRequest { + + /** DeletePlaybookVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeletePlaybookVersionRequest. */ + class DeletePlaybookVersionRequest implements IDeletePlaybookVersionRequest { + + /** + * Constructs a new DeletePlaybookVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest); + + /** DeletePlaybookVersionRequest name. */ + public name: string; + + /** + * Creates a new DeletePlaybookVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePlaybookVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest): google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest; + + /** + * Encodes the specified DeletePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest.verify|verify} messages. + * @param message DeletePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest.verify|verify} messages. + * @param message DeletePlaybookVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePlaybookVersionRequest + * @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.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest; + + /** + * Verifies a DeletePlaybookVersionRequest 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 DeletePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePlaybookVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest; + + /** + * Creates a plain object from a DeletePlaybookVersionRequest message. Also converts values to other types if specified. + * @param message DeletePlaybookVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePlaybookVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePlaybookVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportPlaybookRequest. */ + interface IExportPlaybookRequest { + + /** ExportPlaybookRequest name */ + name?: (string|null); + + /** ExportPlaybookRequest playbookUri */ + playbookUri?: (string|null); + + /** ExportPlaybookRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat|null); + } + + /** Represents an ExportPlaybookRequest. */ + class ExportPlaybookRequest implements IExportPlaybookRequest { + + /** + * Constructs a new ExportPlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest); + + /** ExportPlaybookRequest name. */ + public name: string; + + /** ExportPlaybookRequest playbookUri. */ + public playbookUri: string; + + /** ExportPlaybookRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat); + + /** + * Creates a new ExportPlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest): google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest; + + /** + * Encodes the specified ExportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.verify|verify} messages. + * @param message ExportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.verify|verify} messages. + * @param message ExportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPlaybookRequest + * @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.dialogflow.cx.v3beta1.ExportPlaybookRequest; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPlaybookRequest + * @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.dialogflow.cx.v3beta1.ExportPlaybookRequest; + + /** + * Verifies an ExportPlaybookRequest 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 ExportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest; + + /** + * Creates a plain object from an ExportPlaybookRequest message. Also converts values to other types if specified. + * @param message ExportPlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportPlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportPlaybookRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1, + JSON = 2 + } + } + + /** Properties of an ImportPlaybookRequest. */ + interface IImportPlaybookRequest { + + /** ImportPlaybookRequest parent */ + parent?: (string|null); + + /** ImportPlaybookRequest playbookUri */ + playbookUri?: (string|null); + + /** ImportPlaybookRequest playbookContent */ + playbookContent?: (Uint8Array|Buffer|string|null); + + /** ImportPlaybookRequest importStrategy */ + importStrategy?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy|null); + } + + /** Represents an ImportPlaybookRequest. */ + class ImportPlaybookRequest implements IImportPlaybookRequest { + + /** + * Constructs a new ImportPlaybookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest); + + /** ImportPlaybookRequest parent. */ + public parent: string; + + /** ImportPlaybookRequest playbookUri. */ + public playbookUri?: (string|null); + + /** ImportPlaybookRequest playbookContent. */ + public playbookContent?: (Uint8Array|Buffer|string|null); + + /** ImportPlaybookRequest importStrategy. */ + public importStrategy?: (google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy|null); + + /** ImportPlaybookRequest playbook. */ + public playbook?: ("playbookUri"|"playbookContent"); + + /** + * Creates a new ImportPlaybookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportPlaybookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest): google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest; + + /** + * Encodes the specified ImportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest.verify|verify} messages. + * @param message ImportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest.verify|verify} messages. + * @param message ImportPlaybookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportPlaybookRequest + * @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.dialogflow.cx.v3beta1.ImportPlaybookRequest; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportPlaybookRequest + * @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.dialogflow.cx.v3beta1.ImportPlaybookRequest; + + /** + * Verifies an ImportPlaybookRequest 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 ImportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportPlaybookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest; + + /** + * Creates a plain object from an ImportPlaybookRequest message. Also converts values to other types if specified. + * @param message ImportPlaybookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportPlaybookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportPlaybookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlaybookImportStrategy. */ + interface IPlaybookImportStrategy { + + /** PlaybookImportStrategy mainPlaybookImportStrategy */ + mainPlaybookImportStrategy?: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null); + + /** PlaybookImportStrategy nestedResourceImportStrategy */ + nestedResourceImportStrategy?: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null); + + /** PlaybookImportStrategy toolImportStrategy */ + toolImportStrategy?: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null); + } + + /** Represents a PlaybookImportStrategy. */ + class PlaybookImportStrategy implements IPlaybookImportStrategy { + + /** + * Constructs a new PlaybookImportStrategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy); + + /** PlaybookImportStrategy mainPlaybookImportStrategy. */ + public mainPlaybookImportStrategy: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy); + + /** PlaybookImportStrategy nestedResourceImportStrategy. */ + public nestedResourceImportStrategy: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy); + + /** PlaybookImportStrategy toolImportStrategy. */ + public toolImportStrategy: (google.cloud.dialogflow.cx.v3beta1.ImportStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.ImportStrategy); + + /** + * Creates a new PlaybookImportStrategy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlaybookImportStrategy instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy): google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy; + + /** + * Encodes the specified PlaybookImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.verify|verify} messages. + * @param message PlaybookImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlaybookImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.verify|verify} messages. + * @param message PlaybookImportStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlaybookImportStrategy + * @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.dialogflow.cx.v3beta1.PlaybookImportStrategy; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlaybookImportStrategy + * @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.dialogflow.cx.v3beta1.PlaybookImportStrategy; + + /** + * Verifies a PlaybookImportStrategy 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 PlaybookImportStrategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlaybookImportStrategy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy; + + /** + * Creates a plain object from a PlaybookImportStrategy message. Also converts values to other types if specified. + * @param message PlaybookImportStrategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlaybookImportStrategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlaybookImportStrategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportPlaybookResponse. */ + interface IImportPlaybookResponse { + + /** ImportPlaybookResponse playbook */ + playbook?: (string|null); + + /** ImportPlaybookResponse conflictingResources */ + conflictingResources?: (google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources|null); + } + + /** Represents an ImportPlaybookResponse. */ + class ImportPlaybookResponse implements IImportPlaybookResponse { + + /** + * Constructs a new ImportPlaybookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse); + + /** ImportPlaybookResponse playbook. */ + public playbook: string; + + /** ImportPlaybookResponse conflictingResources. */ + public conflictingResources?: (google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources|null); + + /** + * Creates a new ImportPlaybookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportPlaybookResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse): google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse; + + /** + * Encodes the specified ImportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.verify|verify} messages. + * @param message ImportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.verify|verify} messages. + * @param message ImportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportPlaybookResponse + * @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.dialogflow.cx.v3beta1.ImportPlaybookResponse; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportPlaybookResponse + * @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.dialogflow.cx.v3beta1.ImportPlaybookResponse; + + /** + * Verifies an ImportPlaybookResponse 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 ImportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportPlaybookResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse; + + /** + * Creates a plain object from an ImportPlaybookResponse message. Also converts values to other types if specified. + * @param message ImportPlaybookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportPlaybookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportPlaybookResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportPlaybookResponse { + + /** Properties of a ConflictingResources. */ + interface IConflictingResources { + + /** ConflictingResources mainPlaybookDisplayName */ + mainPlaybookDisplayName?: (string|null); + + /** ConflictingResources nestedPlaybookDisplayNames */ + nestedPlaybookDisplayNames?: (string[]|null); + + /** ConflictingResources toolDisplayNames */ + toolDisplayNames?: (string[]|null); + } + + /** Represents a ConflictingResources. */ + class ConflictingResources implements IConflictingResources { + + /** + * Constructs a new ConflictingResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources); + + /** ConflictingResources mainPlaybookDisplayName. */ + public mainPlaybookDisplayName: string; + + /** ConflictingResources nestedPlaybookDisplayNames. */ + public nestedPlaybookDisplayNames: string[]; + + /** ConflictingResources toolDisplayNames. */ + public toolDisplayNames: string[]; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ConflictingResources instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources): google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @param message ConflictingResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConflictingResources + * @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.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConflictingResources + * @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.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources; + + /** + * Verifies a ConflictingResources 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 ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConflictingResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @param message ConflictingResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConflictingResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConflictingResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportPlaybookResponse. */ + interface IExportPlaybookResponse { + + /** ExportPlaybookResponse playbookUri */ + playbookUri?: (string|null); + + /** ExportPlaybookResponse playbookContent */ + playbookContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ExportPlaybookResponse. */ + class ExportPlaybookResponse implements IExportPlaybookResponse { + + /** + * Constructs a new ExportPlaybookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse); + + /** ExportPlaybookResponse playbookUri. */ + public playbookUri?: (string|null); + + /** ExportPlaybookResponse playbookContent. */ + public playbookContent?: (Uint8Array|Buffer|string|null); + + /** ExportPlaybookResponse playbook. */ + public playbook?: ("playbookUri"|"playbookContent"); + + /** + * Creates a new ExportPlaybookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPlaybookResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse): google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse; + + /** + * Encodes the specified ExportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse.verify|verify} messages. + * @param message ExportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse.verify|verify} messages. + * @param message ExportPlaybookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPlaybookResponse + * @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.dialogflow.cx.v3beta1.ExportPlaybookResponse; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPlaybookResponse + * @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.dialogflow.cx.v3beta1.ExportPlaybookResponse; + + /** + * Verifies an ExportPlaybookResponse 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 ExportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPlaybookResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse; + + /** + * Creates a plain object from an ExportPlaybookResponse message. Also converts values to other types if specified. + * @param message ExportPlaybookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportPlaybookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPlaybookResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Handler. */ + interface IHandler { + + /** Handler eventHandler */ + eventHandler?: (google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler|null); + + /** Handler lifecycleHandler */ + lifecycleHandler?: (google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler|null); + } + + /** Represents a Handler. */ + class Handler implements IHandler { + + /** + * Constructs a new Handler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IHandler); + + /** Handler eventHandler. */ + public eventHandler?: (google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler|null); + + /** Handler lifecycleHandler. */ + public lifecycleHandler?: (google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler|null); + + /** Handler handler. */ + public handler?: ("eventHandler"|"lifecycleHandler"); + + /** + * Creates a new Handler instance using the specified properties. + * @param [properties] Properties to set + * @returns Handler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IHandler): google.cloud.dialogflow.cx.v3beta1.Handler; + + /** + * Encodes the specified Handler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.verify|verify} messages. + * @param message Handler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Handler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.verify|verify} messages. + * @param message Handler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Handler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Handler + * @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.dialogflow.cx.v3beta1.Handler; + + /** + * Decodes a Handler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Handler + * @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.dialogflow.cx.v3beta1.Handler; + + /** + * Verifies a Handler 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 Handler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Handler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Handler; + + /** + * Creates a plain object from a Handler message. Also converts values to other types if specified. + * @param message Handler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Handler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Handler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Handler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Handler { + + /** Properties of an EventHandler. */ + interface IEventHandler { + + /** EventHandler event */ + event?: (string|null); + + /** EventHandler condition */ + condition?: (string|null); + + /** EventHandler fulfillment */ + fulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + } + + /** Represents an EventHandler. */ + class EventHandler implements IEventHandler { + + /** + * Constructs a new EventHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler); + + /** EventHandler event. */ + public event: string; + + /** EventHandler condition. */ + public condition: string; + + /** EventHandler fulfillment. */ + public fulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** + * Creates a new EventHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns EventHandler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler): google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.verify|verify} messages. + * @param message EventHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventHandler + * @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.dialogflow.cx.v3beta1.Handler.EventHandler; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventHandler + * @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.dialogflow.cx.v3beta1.Handler.EventHandler; + + /** + * Verifies an EventHandler 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 EventHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventHandler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @param message EventHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LifecycleHandler. */ + interface ILifecycleHandler { + + /** LifecycleHandler lifecycleStage */ + lifecycleStage?: (string|null); + + /** LifecycleHandler condition */ + condition?: (string|null); + + /** LifecycleHandler fulfillment */ + fulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + } + + /** Represents a LifecycleHandler. */ + class LifecycleHandler implements ILifecycleHandler { + + /** + * Constructs a new LifecycleHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler); + + /** LifecycleHandler lifecycleStage. */ + public lifecycleStage: string; + + /** LifecycleHandler condition. */ + public condition: string; + + /** LifecycleHandler fulfillment. */ + public fulfillment?: (google.cloud.dialogflow.cx.v3beta1.IFulfillment|null); + + /** + * Creates a new LifecycleHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns LifecycleHandler instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler): google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler; + + /** + * Encodes the specified LifecycleHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.verify|verify} messages. + * @param message LifecycleHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LifecycleHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.verify|verify} messages. + * @param message LifecycleHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LifecycleHandler + * @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.dialogflow.cx.v3beta1.Handler.LifecycleHandler; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LifecycleHandler + * @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.dialogflow.cx.v3beta1.Handler.LifecycleHandler; + + /** + * Verifies a LifecycleHandler 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 LifecycleHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LifecycleHandler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler; + + /** + * Creates a plain object from a LifecycleHandler message. Also converts values to other types if specified. + * @param message LifecycleHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LifecycleHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LifecycleHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a SecuritySettingsService */ + class SecuritySettingsService extends $protobuf.rpc.Service { + + /** + * Constructs a new SecuritySettingsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SecuritySettingsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecuritySettingsService; + + /** + * Calls CreateSecuritySettings. + * @param request CreateSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public createSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.CreateSecuritySettingsCallback): void; + + /** + * Calls CreateSecuritySettings. + * @param request CreateSecuritySettingsRequest message or plain object + * @returns Promise + */ + public createSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest): Promise; + + /** + * Calls GetSecuritySettings. + * @param request GetSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public getSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettingsCallback): void; + + /** + * Calls GetSecuritySettings. + * @param request GetSecuritySettingsRequest message or plain object + * @returns Promise + */ + public getSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest): Promise; + + /** + * Calls UpdateSecuritySettings. + * @param request UpdateSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public updateSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettingsCallback): void; + + /** + * Calls UpdateSecuritySettings. + * @param request UpdateSecuritySettingsRequest message or plain object + * @returns Promise + */ + public updateSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest): Promise; + + /** + * Calls ListSecuritySettings. + * @param request ListSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecuritySettingsResponse + */ + public listSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.ListSecuritySettingsCallback): void; + + /** + * Calls ListSecuritySettings. + * @param request ListSecuritySettingsRequest message or plain object + * @returns Promise + */ + public listSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest): Promise; + + /** + * Calls DeleteSecuritySettings. + * @param request DeleteSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.DeleteSecuritySettingsCallback): void; + + /** + * Calls DeleteSecuritySettings. + * @param request DeleteSecuritySettingsRequest message or plain object + * @returns Promise + */ + public deleteSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest): Promise; + } + + namespace SecuritySettingsService { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|createSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type CreateSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|getSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type GetSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|updateSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type UpdateSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|listSecuritySettings}. + * @param error Error, if any + * @param [response] ListSecuritySettingsResponse + */ + type ListSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|deleteSecuritySettings}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSecuritySettingsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetSecuritySettingsRequest. */ + interface IGetSecuritySettingsRequest { + + /** GetSecuritySettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetSecuritySettingsRequest. */ + class GetSecuritySettingsRequest implements IGetSecuritySettingsRequest { + + /** + * Constructs a new GetSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest); + + /** GetSecuritySettingsRequest name. */ + public name: string; + + /** + * Creates a new GetSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Encodes the specified GetSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @param message GetSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @param message GetSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Verifies a GetSecuritySettingsRequest 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 GetSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Creates a plain object from a GetSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message GetSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSecuritySettingsRequest. */ + interface IUpdateSecuritySettingsRequest { + + /** UpdateSecuritySettingsRequest securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + + /** UpdateSecuritySettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSecuritySettingsRequest. */ + class UpdateSecuritySettingsRequest implements IUpdateSecuritySettingsRequest { + + /** + * Constructs a new UpdateSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest); + + /** UpdateSecuritySettingsRequest securitySettings. */ + public securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + + /** UpdateSecuritySettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @param message UpdateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @param message UpdateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Verifies an UpdateSecuritySettingsRequest 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 UpdateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Creates a plain object from an UpdateSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message UpdateSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecuritySettingsRequest. */ + interface IListSecuritySettingsRequest { + + /** ListSecuritySettingsRequest parent */ + parent?: (string|null); + + /** ListSecuritySettingsRequest pageSize */ + pageSize?: (number|null); + + /** ListSecuritySettingsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSecuritySettingsRequest. */ + class ListSecuritySettingsRequest implements IListSecuritySettingsRequest { + + /** + * Constructs a new ListSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest); + + /** ListSecuritySettingsRequest parent. */ + public parent: string; + + /** ListSecuritySettingsRequest pageSize. */ + public pageSize: number; + + /** ListSecuritySettingsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Encodes the specified ListSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @param message ListSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @param message ListSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Verifies a ListSecuritySettingsRequest 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 ListSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Creates a plain object from a ListSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message ListSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecuritySettingsResponse. */ + interface IListSecuritySettingsResponse { + + /** ListSecuritySettingsResponse securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[]|null); + + /** ListSecuritySettingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSecuritySettingsResponse. */ + class ListSecuritySettingsResponse implements IListSecuritySettingsResponse { + + /** + * Constructs a new ListSecuritySettingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse); + + /** ListSecuritySettingsResponse securitySettings. */ + public securitySettings: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[]; + + /** ListSecuritySettingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSecuritySettingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecuritySettingsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Encodes the specified ListSecuritySettingsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @param message ListSecuritySettingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecuritySettingsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @param message ListSecuritySettingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecuritySettingsResponse + * @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.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecuritySettingsResponse + * @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.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Verifies a ListSecuritySettingsResponse 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 ListSecuritySettingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecuritySettingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Creates a plain object from a ListSecuritySettingsResponse message. Also converts values to other types if specified. + * @param message ListSecuritySettingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecuritySettingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecuritySettingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecuritySettingsRequest. */ + interface ICreateSecuritySettingsRequest { + + /** CreateSecuritySettingsRequest parent */ + parent?: (string|null); + + /** CreateSecuritySettingsRequest securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + } + + /** Represents a CreateSecuritySettingsRequest. */ + class CreateSecuritySettingsRequest implements ICreateSecuritySettingsRequest { + + /** + * Constructs a new CreateSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest); + + /** CreateSecuritySettingsRequest parent. */ + public parent: string; + + /** CreateSecuritySettingsRequest securitySettings. */ + public securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + + /** + * Creates a new CreateSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Encodes the specified CreateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @param message CreateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @param message CreateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Verifies a CreateSecuritySettingsRequest 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 CreateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Creates a plain object from a CreateSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message CreateSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSecuritySettingsRequest. */ + interface IDeleteSecuritySettingsRequest { + + /** DeleteSecuritySettingsRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSecuritySettingsRequest. */ + class DeleteSecuritySettingsRequest implements IDeleteSecuritySettingsRequest { + + /** + * Constructs a new DeleteSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest); + + /** DeleteSecuritySettingsRequest name. */ + public name: string; + + /** + * Creates a new DeleteSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @param message DeleteSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @param message DeleteSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSecuritySettingsRequest + * @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.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Verifies a DeleteSecuritySettingsRequest 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 DeleteSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Creates a plain object from a DeleteSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message DeleteSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSecuritySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecuritySettings. */ + interface ISecuritySettings { + + /** SecuritySettings name */ + name?: (string|null); + + /** SecuritySettings displayName */ + displayName?: (string|null); + + /** SecuritySettings redactionStrategy */ + redactionStrategy?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|null); + + /** SecuritySettings redactionScope */ + redactionScope?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|null); + + /** SecuritySettings inspectTemplate */ + inspectTemplate?: (string|null); + + /** SecuritySettings deidentifyTemplate */ + deidentifyTemplate?: (string|null); + + /** SecuritySettings retentionWindowDays */ + retentionWindowDays?: (number|null); + + /** SecuritySettings retentionStrategy */ + retentionStrategy?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy|null); + + /** SecuritySettings purgeDataTypes */ + purgeDataTypes?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[]|null); + + /** SecuritySettings audioExportSettings */ + audioExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null); + + /** SecuritySettings insightsExportSettings */ + insightsExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null); + } + + /** Represents a SecuritySettings. */ + class SecuritySettings implements ISecuritySettings { + + /** + * Constructs a new SecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings); + + /** SecuritySettings name. */ + public name: string; + + /** SecuritySettings displayName. */ + public displayName: string; + + /** SecuritySettings redactionStrategy. */ + public redactionStrategy: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy); + + /** SecuritySettings redactionScope. */ + public redactionScope: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope); + + /** SecuritySettings inspectTemplate. */ + public inspectTemplate: string; + + /** SecuritySettings deidentifyTemplate. */ + public deidentifyTemplate: string; + + /** SecuritySettings retentionWindowDays. */ + public retentionWindowDays?: (number|null); + + /** SecuritySettings retentionStrategy. */ + public retentionStrategy?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy|null); + + /** SecuritySettings purgeDataTypes. */ + public purgeDataTypes: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[]; + + /** SecuritySettings audioExportSettings. */ + public audioExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null); + + /** SecuritySettings insightsExportSettings. */ + public insightsExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null); + + /** SecuritySettings dataRetention. */ + public dataRetention?: ("retentionWindowDays"|"retentionStrategy"); + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SecuritySettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings): google.cloud.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecuritySettings + * @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.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecuritySettings + * @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.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Verifies a SecuritySettings 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 SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @param message SecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecuritySettings { + + /** RedactionStrategy enum. */ + enum RedactionStrategy { + REDACTION_STRATEGY_UNSPECIFIED = 0, + REDACT_WITH_SERVICE = 1 + } + + /** RedactionScope enum. */ + enum RedactionScope { + REDACTION_SCOPE_UNSPECIFIED = 0, + REDACT_DISK_STORAGE = 2 + } + + /** RetentionStrategy enum. */ + enum RetentionStrategy { + RETENTION_STRATEGY_UNSPECIFIED = 0, + REMOVE_AFTER_CONVERSATION = 1 + } + + /** PurgeDataType enum. */ + enum PurgeDataType { + PURGE_DATA_TYPE_UNSPECIFIED = 0, + DIALOGFLOW_HISTORY = 1 + } + + /** Properties of an AudioExportSettings. */ + interface IAudioExportSettings { + + /** AudioExportSettings gcsBucket */ + gcsBucket?: (string|null); + + /** AudioExportSettings audioExportPattern */ + audioExportPattern?: (string|null); + + /** AudioExportSettings enableAudioRedaction */ + enableAudioRedaction?: (boolean|null); + + /** AudioExportSettings audioFormat */ + audioFormat?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|null); + + /** AudioExportSettings storeTtsAudio */ + storeTtsAudio?: (boolean|null); + } + + /** Represents an AudioExportSettings. */ + class AudioExportSettings implements IAudioExportSettings { + + /** + * Constructs a new AudioExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings); + + /** AudioExportSettings gcsBucket. */ + public gcsBucket: string; + + /** AudioExportSettings audioExportPattern. */ + public audioExportPattern: string; + + /** AudioExportSettings enableAudioRedaction. */ + public enableAudioRedaction: boolean; + + /** AudioExportSettings audioFormat. */ + public audioFormat: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat); + + /** AudioExportSettings storeTtsAudio. */ + public storeTtsAudio: boolean; + + /** + * Creates a new AudioExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioExportSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Encodes the specified AudioExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @param message AudioExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @param message AudioExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioExportSettings + * @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.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioExportSettings + * @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.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Verifies an AudioExportSettings 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 AudioExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Creates a plain object from an AudioExportSettings message. Also converts values to other types if specified. + * @param message AudioExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AudioExportSettings { + + /** AudioFormat enum. */ + enum AudioFormat { + AUDIO_FORMAT_UNSPECIFIED = 0, + MULAW = 1, + MP3 = 2, + OGG = 3 + } + } + + /** Properties of an InsightsExportSettings. */ + interface IInsightsExportSettings { + + /** InsightsExportSettings enableInsightsExport */ + enableInsightsExport?: (boolean|null); + } + + /** Represents an InsightsExportSettings. */ + class InsightsExportSettings implements IInsightsExportSettings { + + /** + * Constructs a new InsightsExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings); + + /** InsightsExportSettings enableInsightsExport. */ + public enableInsightsExport: boolean; + + /** + * Creates a new InsightsExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns InsightsExportSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings; + + /** + * Encodes the specified InsightsExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @param message InsightsExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsightsExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @param message InsightsExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsightsExportSettings + * @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.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsightsExportSettings + * @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.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings; + + /** + * Verifies an InsightsExportSettings 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 InsightsExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsightsExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings; + + /** + * Creates a plain object from an InsightsExportSettings message. Also converts values to other types if specified. + * @param message InsightsExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsightsExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsightsExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a Tools */ + class Tools extends $protobuf.rpc.Service { + + /** + * Constructs a new Tools service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Tools service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Tools; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public createTool(request: google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.CreateToolCallback): void; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @returns Promise + */ + public createTool(request: google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest): Promise; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsResponse + */ + public listTools(request: google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.ListToolsCallback): void; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @returns Promise + */ + public listTools(request: google.cloud.dialogflow.cx.v3beta1.IListToolsRequest): Promise; + + /** + * Calls ExportTools. + * @param request ExportToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportTools(request: google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.ExportToolsCallback): void; + + /** + * Calls ExportTools. + * @param request ExportToolsRequest message or plain object + * @returns Promise + */ + public exportTools(request: google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest): Promise; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public getTool(request: google.cloud.dialogflow.cx.v3beta1.IGetToolRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.GetToolCallback): void; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @returns Promise + */ + public getTool(request: google.cloud.dialogflow.cx.v3beta1.IGetToolRequest): Promise; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public updateTool(request: google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.UpdateToolCallback): void; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @returns Promise + */ + public updateTool(request: google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest): Promise; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTool(request: google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.DeleteToolCallback): void; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @returns Promise + */ + public deleteTool(request: google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest): Promise; + + /** + * Calls ListToolVersions. + * @param request ListToolVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolVersionsResponse + */ + public listToolVersions(request: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.ListToolVersionsCallback): void; + + /** + * Calls ListToolVersions. + * @param request ListToolVersionsRequest message or plain object + * @returns Promise + */ + public listToolVersions(request: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest): Promise; + + /** + * Calls CreateToolVersion. + * @param request CreateToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ToolVersion + */ + public createToolVersion(request: google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.CreateToolVersionCallback): void; + + /** + * Calls CreateToolVersion. + * @param request CreateToolVersionRequest message or plain object + * @returns Promise + */ + public createToolVersion(request: google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest): Promise; + + /** + * Calls GetToolVersion. + * @param request GetToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ToolVersion + */ + public getToolVersion(request: google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.GetToolVersionCallback): void; + + /** + * Calls GetToolVersion. + * @param request GetToolVersionRequest message or plain object + * @returns Promise + */ + public getToolVersion(request: google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest): Promise; + + /** + * Calls DeleteToolVersion. + * @param request DeleteToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteToolVersion(request: google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.DeleteToolVersionCallback): void; + + /** + * Calls DeleteToolVersion. + * @param request DeleteToolVersionRequest message or plain object + * @returns Promise + */ + public deleteToolVersion(request: google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest): Promise; + + /** + * Calls RestoreToolVersion. + * @param request RestoreToolVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestoreToolVersionResponse + */ + public restoreToolVersion(request: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Tools.RestoreToolVersionCallback): void; + + /** + * Calls RestoreToolVersion. + * @param request RestoreToolVersionRequest message or plain object + * @returns Promise + */ + public restoreToolVersion(request: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest): Promise; + } + + namespace Tools { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|createTool}. + * @param error Error, if any + * @param [response] Tool + */ + type CreateToolCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Tool) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|listTools}. + * @param error Error, if any + * @param [response] ListToolsResponse + */ + type ListToolsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListToolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|exportTools}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportToolsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|getTool}. + * @param error Error, if any + * @param [response] Tool + */ + type GetToolCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Tool) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|updateTool}. + * @param error Error, if any + * @param [response] Tool + */ + type UpdateToolCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Tool) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|deleteTool}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|listToolVersions}. + * @param error Error, if any + * @param [response] ListToolVersionsResponse + */ + type ListToolVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|createToolVersion}. + * @param error Error, if any + * @param [response] ToolVersion + */ + type CreateToolVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ToolVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|getToolVersion}. + * @param error Error, if any + * @param [response] ToolVersion + */ + type GetToolVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ToolVersion) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|deleteToolVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|restoreToolVersion}. + * @param error Error, if any + * @param [response] RestoreToolVersionResponse + */ + type RestoreToolVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse) => void; + } + + /** Properties of a CreateToolRequest. */ + interface ICreateToolRequest { + + /** CreateToolRequest parent */ + parent?: (string|null); + + /** CreateToolRequest tool */ + tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + } + + /** Represents a CreateToolRequest. */ + class CreateToolRequest implements ICreateToolRequest { + + /** + * Constructs a new CreateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest); + + /** CreateToolRequest parent. */ + public parent: string; + + /** CreateToolRequest tool. */ + public tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest): google.cloud.dialogflow.cx.v3beta1.CreateToolRequest; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolRequest + * @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.dialogflow.cx.v3beta1.CreateToolRequest; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolRequest + * @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.dialogflow.cx.v3beta1.CreateToolRequest; + + /** + * Verifies a CreateToolRequest 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 CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateToolRequest; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @param message CreateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsRequest. */ + interface IListToolsRequest { + + /** ListToolsRequest parent */ + parent?: (string|null); + + /** ListToolsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListToolsRequest. */ + class ListToolsRequest implements IListToolsRequest { + + /** + * Constructs a new ListToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolsRequest); + + /** ListToolsRequest parent. */ + public parent: string; + + /** ListToolsRequest pageSize. */ + public pageSize: number; + + /** ListToolsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolsRequest): google.cloud.dialogflow.cx.v3beta1.ListToolsRequest; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsRequest + * @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.dialogflow.cx.v3beta1.ListToolsRequest; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsRequest + * @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.dialogflow.cx.v3beta1.ListToolsRequest; + + /** + * Verifies a ListToolsRequest 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 ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListToolsRequest; + + /** + * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. + * @param message ListToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsResponse. */ + interface IListToolsResponse { + + /** ListToolsResponse tools */ + tools?: (google.cloud.dialogflow.cx.v3beta1.ITool[]|null); + + /** ListToolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsResponse. */ + class ListToolsResponse implements IListToolsResponse { + + /** + * Constructs a new ListToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolsResponse); + + /** ListToolsResponse tools. */ + public tools: google.cloud.dialogflow.cx.v3beta1.ITool[]; + + /** ListToolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolsResponse): google.cloud.dialogflow.cx.v3beta1.ListToolsResponse; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsResponse + * @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.dialogflow.cx.v3beta1.ListToolsResponse; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsResponse + * @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.dialogflow.cx.v3beta1.ListToolsResponse; + + /** + * Verifies a ListToolsResponse 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 ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListToolsResponse; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @param message ListToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolRequest. */ + interface IGetToolRequest { + + /** GetToolRequest name */ + name?: (string|null); + } + + /** Represents a GetToolRequest. */ + class GetToolRequest implements IGetToolRequest { + + /** + * Constructs a new GetToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetToolRequest); + + /** GetToolRequest name. */ + public name: string; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetToolRequest): google.cloud.dialogflow.cx.v3beta1.GetToolRequest; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolRequest + * @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.dialogflow.cx.v3beta1.GetToolRequest; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolRequest + * @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.dialogflow.cx.v3beta1.GetToolRequest; + + /** + * Verifies a GetToolRequest 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 GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetToolRequest; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @param message GetToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportToolsRequest. */ + interface IExportToolsRequest { + + /** ExportToolsRequest parent */ + parent?: (string|null); + + /** ExportToolsRequest tools */ + tools?: (string[]|null); + + /** ExportToolsRequest toolsUri */ + toolsUri?: (string|null); + + /** ExportToolsRequest toolsContentInline */ + toolsContentInline?: (boolean|null); + + /** ExportToolsRequest dataFormat */ + dataFormat?: (google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat|null); + } + + /** Represents an ExportToolsRequest. */ + class ExportToolsRequest implements IExportToolsRequest { + + /** + * Constructs a new ExportToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest); + + /** ExportToolsRequest parent. */ + public parent: string; + + /** ExportToolsRequest tools. */ + public tools: string[]; + + /** ExportToolsRequest toolsUri. */ + public toolsUri?: (string|null); + + /** ExportToolsRequest toolsContentInline. */ + public toolsContentInline?: (boolean|null); + + /** ExportToolsRequest dataFormat. */ + public dataFormat: (google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat); + + /** ExportToolsRequest destination. */ + public destination?: ("toolsUri"|"toolsContentInline"); + + /** + * Creates a new ExportToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportToolsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest): google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest; + + /** + * Encodes the specified ExportToolsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.verify|verify} messages. + * @param message ExportToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportToolsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.verify|verify} messages. + * @param message ExportToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportToolsRequest + * @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.dialogflow.cx.v3beta1.ExportToolsRequest; + + /** + * Decodes an ExportToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportToolsRequest + * @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.dialogflow.cx.v3beta1.ExportToolsRequest; + + /** + * Verifies an ExportToolsRequest 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 ExportToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest; + + /** + * Creates a plain object from an ExportToolsRequest message. Also converts values to other types if specified. + * @param message ExportToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportToolsRequest { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + BLOB = 1 + } + } + + /** Properties of an ExportToolsResponse. */ + interface IExportToolsResponse { + + /** ExportToolsResponse toolsUri */ + toolsUri?: (string|null); + + /** ExportToolsResponse toolsContent */ + toolsContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null); + } + + /** Represents an ExportToolsResponse. */ + class ExportToolsResponse implements IExportToolsResponse { + + /** + * Constructs a new ExportToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse); + + /** ExportToolsResponse toolsUri. */ + public toolsUri?: (string|null); + + /** ExportToolsResponse toolsContent. */ + public toolsContent?: (google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null); + + /** ExportToolsResponse tools. */ + public tools?: ("toolsUri"|"toolsContent"); + + /** + * Creates a new ExportToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportToolsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse): google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse; + + /** + * Encodes the specified ExportToolsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse.verify|verify} messages. + * @param message ExportToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportToolsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse.verify|verify} messages. + * @param message ExportToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportToolsResponse + * @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.dialogflow.cx.v3beta1.ExportToolsResponse; + + /** + * Decodes an ExportToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportToolsResponse + * @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.dialogflow.cx.v3beta1.ExportToolsResponse; + + /** + * Verifies an ExportToolsResponse 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 ExportToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse; + + /** + * Creates a plain object from an ExportToolsResponse message. Also converts values to other types if specified. + * @param message ExportToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolRequest. */ + interface IUpdateToolRequest { + + /** UpdateToolRequest tool */ + tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + + /** UpdateToolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolRequest. */ + class UpdateToolRequest implements IUpdateToolRequest { + + /** + * Constructs a new UpdateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest); + + /** UpdateToolRequest tool. */ + public tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + + /** UpdateToolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest): google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolRequest + * @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.dialogflow.cx.v3beta1.UpdateToolRequest; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolRequest + * @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.dialogflow.cx.v3beta1.UpdateToolRequest; + + /** + * Verifies an UpdateToolRequest 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 UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @param message UpdateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolRequest. */ + interface IDeleteToolRequest { + + /** DeleteToolRequest name */ + name?: (string|null); + + /** DeleteToolRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteToolRequest. */ + class DeleteToolRequest implements IDeleteToolRequest { + + /** + * Constructs a new DeleteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest); + + /** DeleteToolRequest name. */ + public name: string; + + /** DeleteToolRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest): google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolRequest + * @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.dialogflow.cx.v3beta1.DeleteToolRequest; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolRequest + * @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.dialogflow.cx.v3beta1.DeleteToolRequest; + + /** + * Verifies a DeleteToolRequest 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 DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @param message DeleteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tool. */ + interface ITool { + + /** Tool name */ + name?: (string|null); + + /** Tool displayName */ + displayName?: (string|null); + + /** Tool description */ + description?: (string|null); + + /** Tool openApiSpec */ + openApiSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null); + + /** Tool dataStoreSpec */ + dataStoreSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool|null); + + /** Tool extensionSpec */ + extensionSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool|null); + + /** Tool functionSpec */ + functionSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool|null); + + /** Tool connectorSpec */ + connectorSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool|null); + + /** Tool toolType */ + toolType?: (google.cloud.dialogflow.cx.v3beta1.Tool.ToolType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.ToolType|null); + } + + /** Represents a Tool. */ + class Tool implements ITool { + + /** + * Constructs a new Tool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ITool); + + /** Tool name. */ + public name: string; + + /** Tool displayName. */ + public displayName: string; + + /** Tool description. */ + public description: string; + + /** Tool openApiSpec. */ + public openApiSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null); + + /** Tool dataStoreSpec. */ + public dataStoreSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool|null); + + /** Tool extensionSpec. */ + public extensionSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool|null); + + /** Tool functionSpec. */ + public functionSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool|null); + + /** Tool connectorSpec. */ + public connectorSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool|null); + + /** Tool toolType. */ + public toolType: (google.cloud.dialogflow.cx.v3beta1.Tool.ToolType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.ToolType); + + /** Tool specification. */ + public specification?: ("openApiSpec"|"dataStoreSpec"|"extensionSpec"|"functionSpec"|"connectorSpec"); + + /** + * Creates a new Tool instance using the specified properties. + * @param [properties] Properties to set + * @returns Tool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ITool): google.cloud.dialogflow.cx.v3beta1.Tool; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tool + * @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.dialogflow.cx.v3beta1.Tool; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tool + * @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.dialogflow.cx.v3beta1.Tool; + + /** + * Verifies a Tool 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 Tool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @param message Tool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Tool { + + /** Properties of an OpenApiTool. */ + interface IOpenApiTool { + + /** OpenApiTool textSchema */ + textSchema?: (string|null); + + /** OpenApiTool authentication */ + authentication?: (google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication|null); + + /** OpenApiTool tlsConfig */ + tlsConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig|null); + + /** OpenApiTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig|null); + } + + /** Represents an OpenApiTool. */ + class OpenApiTool implements IOpenApiTool { + + /** + * Constructs a new OpenApiTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool); + + /** OpenApiTool textSchema. */ + public textSchema?: (string|null); + + /** OpenApiTool authentication. */ + public authentication?: (google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication|null); + + /** OpenApiTool tlsConfig. */ + public tlsConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig|null); + + /** OpenApiTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig|null); + + /** OpenApiTool schema. */ + public schema?: "textSchema"; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool): google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiTool + * @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.dialogflow.cx.v3beta1.Tool.OpenApiTool; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiTool + * @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.dialogflow.cx.v3beta1.Tool.OpenApiTool; + + /** + * Verifies an OpenApiTool 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 OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @param message OpenApiTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreTool. */ + interface IDataStoreTool { + + /** DataStoreTool dataStoreConnections */ + dataStoreConnections?: (google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection[]|null); + + /** DataStoreTool fallbackPrompt */ + fallbackPrompt?: (google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt|null); + } + + /** Represents a DataStoreTool. */ + class DataStoreTool implements IDataStoreTool { + + /** + * Constructs a new DataStoreTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool); + + /** DataStoreTool dataStoreConnections. */ + public dataStoreConnections: google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection[]; + + /** DataStoreTool fallbackPrompt. */ + public fallbackPrompt?: (google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt|null); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool): google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreTool + * @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.dialogflow.cx.v3beta1.Tool.DataStoreTool; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreTool + * @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.dialogflow.cx.v3beta1.Tool.DataStoreTool; + + /** + * Verifies a DataStoreTool 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 DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @param message DataStoreTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreTool { + + /** Properties of a FallbackPrompt. */ + interface IFallbackPrompt { + } + + /** Represents a FallbackPrompt. */ + class FallbackPrompt implements IFallbackPrompt { + + /** + * Constructs a new FallbackPrompt. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt); + + /** + * Creates a new FallbackPrompt instance using the specified properties. + * @param [properties] Properties to set + * @returns FallbackPrompt instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt): google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt; + + /** + * Encodes the specified FallbackPrompt message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @param message FallbackPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FallbackPrompt message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @param message FallbackPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FallbackPrompt + * @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.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FallbackPrompt + * @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.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt; + + /** + * Verifies a FallbackPrompt 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 FallbackPrompt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FallbackPrompt + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt; + + /** + * Creates a plain object from a FallbackPrompt message. Also converts values to other types if specified. + * @param message FallbackPrompt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FallbackPrompt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FallbackPrompt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionTool. */ + interface IExtensionTool { + + /** ExtensionTool name */ + name?: (string|null); + } + + /** Represents an ExtensionTool. */ + class ExtensionTool implements IExtensionTool { + + /** + * Constructs a new ExtensionTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool); + + /** ExtensionTool name. */ + public name: string; + + /** + * Creates a new ExtensionTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool): google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool; + + /** + * Encodes the specified ExtensionTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.verify|verify} messages. + * @param message ExtensionTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.verify|verify} messages. + * @param message ExtensionTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionTool + * @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.dialogflow.cx.v3beta1.Tool.ExtensionTool; + + /** + * Decodes an ExtensionTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionTool + * @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.dialogflow.cx.v3beta1.Tool.ExtensionTool; + + /** + * Verifies an ExtensionTool 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 ExtensionTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool; + + /** + * Creates a plain object from an ExtensionTool message. Also converts values to other types if specified. + * @param message ExtensionTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunctionTool. */ + interface IFunctionTool { + + /** FunctionTool inputSchema */ + inputSchema?: (google.protobuf.IStruct|null); + + /** FunctionTool outputSchema */ + outputSchema?: (google.protobuf.IStruct|null); + } + + /** Represents a FunctionTool. */ + class FunctionTool implements IFunctionTool { + + /** + * Constructs a new FunctionTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool); + + /** FunctionTool inputSchema. */ + public inputSchema?: (google.protobuf.IStruct|null); + + /** FunctionTool outputSchema. */ + public outputSchema?: (google.protobuf.IStruct|null); + + /** + * Creates a new FunctionTool instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool): google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool; + + /** + * Encodes the specified FunctionTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.verify|verify} messages. + * @param message FunctionTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.verify|verify} messages. + * @param message FunctionTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionTool + * @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.dialogflow.cx.v3beta1.Tool.FunctionTool; + + /** + * Decodes a FunctionTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionTool + * @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.dialogflow.cx.v3beta1.Tool.FunctionTool; + + /** + * Verifies a FunctionTool 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 FunctionTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool; + + /** + * Creates a plain object from a FunctionTool message. Also converts values to other types if specified. + * @param message FunctionTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunctionTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectorTool. */ + interface IConnectorTool { + + /** ConnectorTool name */ + name?: (string|null); + + /** ConnectorTool actions */ + actions?: (google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction[]|null); + + /** ConnectorTool endUserAuthConfig */ + endUserAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig|null); + } + + /** Represents a ConnectorTool. */ + class ConnectorTool implements IConnectorTool { + + /** + * Constructs a new ConnectorTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool); + + /** ConnectorTool name. */ + public name: string; + + /** ConnectorTool actions. */ + public actions: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction[]; + + /** ConnectorTool endUserAuthConfig. */ + public endUserAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig|null); + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorTool instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool): google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorTool + * @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.dialogflow.cx.v3beta1.Tool.ConnectorTool; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorTool + * @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.dialogflow.cx.v3beta1.Tool.ConnectorTool; + + /** + * Verifies a ConnectorTool 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 ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @param message ConnectorTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConnectorTool { + + /** Properties of an Action. */ + interface IAction { + + /** Action connectionActionId */ + connectionActionId?: (string|null); + + /** Action entityOperation */ + entityOperation?: (google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation|null); + + /** Action inputFields */ + inputFields?: (string[]|null); + + /** Action outputFields */ + outputFields?: (string[]|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction); + + /** Action connectionActionId. */ + public connectionActionId?: (string|null); + + /** Action entityOperation. */ + public entityOperation?: (google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation|null); + + /** Action inputFields. */ + public inputFields: string[]; + + /** Action outputFields. */ + public outputFields: string[]; + + /** Action actionSpec. */ + public actionSpec?: ("connectionActionId"|"entityOperation"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction): google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @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.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @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.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action; + + /** + * Verifies an Action 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 Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Action { + + /** Properties of an EntityOperation. */ + interface IEntityOperation { + + /** EntityOperation entityId */ + entityId?: (string|null); + + /** EntityOperation operation */ + operation?: (google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType|null); + } + + /** Represents an EntityOperation. */ + class EntityOperation implements IEntityOperation { + + /** + * Constructs a new EntityOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation); + + /** EntityOperation entityId. */ + public entityId: string; + + /** EntityOperation operation. */ + public operation: (google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType); + + /** + * Creates a new EntityOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityOperation instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation): google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityOperation + * @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.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityOperation + * @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.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation; + + /** + * Verifies an EntityOperation 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 EntityOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @param message EntityOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityOperation { + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + LIST = 1, + GET = 2, + CREATE = 3, + UPDATE = 4, + DELETE = 5 + } + } + } + } + + /** Properties of an Authentication. */ + interface IAuthentication { + + /** Authentication apiKeyConfig */ + apiKeyConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig|null); + + /** Authentication oauthConfig */ + oauthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig|null); + + /** Authentication serviceAgentAuthConfig */ + serviceAgentAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig|null); + + /** Authentication bearerTokenConfig */ + bearerTokenConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig|null); + + /** Authentication serviceAccountAuthConfig */ + serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig|null); + } + + /** Represents an Authentication. */ + class Authentication implements IAuthentication { + + /** + * Constructs a new Authentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication); + + /** Authentication apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig|null); + + /** Authentication oauthConfig. */ + public oauthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig|null); + + /** Authentication serviceAgentAuthConfig. */ + public serviceAgentAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig|null); + + /** Authentication bearerTokenConfig. */ + public bearerTokenConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig|null); + + /** Authentication serviceAccountAuthConfig. */ + public serviceAccountAuthConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig|null); + + /** Authentication authConfig. */ + public authConfig?: ("apiKeyConfig"|"oauthConfig"|"serviceAgentAuthConfig"|"bearerTokenConfig"|"serviceAccountAuthConfig"); + + /** + * Creates a new Authentication instance using the specified properties. + * @param [properties] Properties to set + * @returns Authentication instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Authentication + * @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.dialogflow.cx.v3beta1.Tool.Authentication; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Authentication + * @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.dialogflow.cx.v3beta1.Tool.Authentication; + + /** + * Verifies an Authentication 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 Authentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Authentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @param message Authentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Authentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Authentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Authentication { + + /** Properties of an ApiKeyConfig. */ + interface IApiKeyConfig { + + /** ApiKeyConfig keyName */ + keyName?: (string|null); + + /** ApiKeyConfig apiKey */ + apiKey?: (string|null); + + /** ApiKeyConfig secretVersionForApiKey */ + secretVersionForApiKey?: (string|null); + + /** ApiKeyConfig requestLocation */ + requestLocation?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation|null); + } + + /** Represents an ApiKeyConfig. */ + class ApiKeyConfig implements IApiKeyConfig { + + /** + * Constructs a new ApiKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig); + + /** ApiKeyConfig keyName. */ + public keyName: string; + + /** ApiKeyConfig apiKey. */ + public apiKey: string; + + /** ApiKeyConfig secretVersionForApiKey. */ + public secretVersionForApiKey: string; + + /** ApiKeyConfig requestLocation. */ + public requestLocation: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation); + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiKeyConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiKeyConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiKeyConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig; + + /** + * Verifies an ApiKeyConfig 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 ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @param message ApiKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RequestLocation enum. */ + enum RequestLocation { + REQUEST_LOCATION_UNSPECIFIED = 0, + HEADER = 1, + QUERY_STRING = 2 + } + + /** Properties of a OAuthConfig. */ + interface IOAuthConfig { + + /** OAuthConfig oauthGrantType */ + oauthGrantType?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType|null); + + /** OAuthConfig clientId */ + clientId?: (string|null); + + /** OAuthConfig clientSecret */ + clientSecret?: (string|null); + + /** OAuthConfig secretVersionForClientSecret */ + secretVersionForClientSecret?: (string|null); + + /** OAuthConfig tokenEndpoint */ + tokenEndpoint?: (string|null); + + /** OAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a OAuthConfig. */ + class OAuthConfig implements IOAuthConfig { + + /** + * Constructs a new OAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig); + + /** OAuthConfig oauthGrantType. */ + public oauthGrantType: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType); + + /** OAuthConfig clientId. */ + public clientId: string; + + /** OAuthConfig clientSecret. */ + public clientSecret: string; + + /** OAuthConfig secretVersionForClientSecret. */ + public secretVersionForClientSecret: string; + + /** OAuthConfig tokenEndpoint. */ + public tokenEndpoint: string; + + /** OAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig; + + /** + * Verifies a OAuthConfig 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 OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @param message OAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OAuthConfig { + + /** OauthGrantType enum. */ + enum OauthGrantType { + OAUTH_GRANT_TYPE_UNSPECIFIED = 0, + CLIENT_CREDENTIAL = 1 + } + } + + /** Properties of a ServiceAgentAuthConfig. */ + interface IServiceAgentAuthConfig { + + /** ServiceAgentAuthConfig serviceAgentAuth */ + serviceAgentAuth?: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|null); + } + + /** Represents a ServiceAgentAuthConfig. */ + class ServiceAgentAuthConfig implements IServiceAgentAuthConfig { + + /** + * Constructs a new ServiceAgentAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig); + + /** ServiceAgentAuthConfig serviceAgentAuth. */ + public serviceAgentAuth: (google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|keyof typeof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth); + + /** + * Creates a new ServiceAgentAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAgentAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Encodes the specified ServiceAgentAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @param message ServiceAgentAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAgentAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @param message ServiceAgentAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAgentAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAgentAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Verifies a ServiceAgentAuthConfig 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 ServiceAgentAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAgentAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig; + + /** + * Creates a plain object from a ServiceAgentAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAgentAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAgentAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAgentAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServiceAgentAuthConfig { + + /** ServiceAgentAuth enum. */ + enum ServiceAgentAuth { + SERVICE_AGENT_AUTH_UNSPECIFIED = 0, + ID_TOKEN = 1, + ACCESS_TOKEN = 2 + } + } + + /** Properties of a BearerTokenConfig. */ + interface IBearerTokenConfig { + + /** BearerTokenConfig token */ + token?: (string|null); + + /** BearerTokenConfig secretVersionForToken */ + secretVersionForToken?: (string|null); + } + + /** Represents a BearerTokenConfig. */ + class BearerTokenConfig implements IBearerTokenConfig { + + /** + * Constructs a new BearerTokenConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig); + + /** BearerTokenConfig token. */ + public token: string; + + /** BearerTokenConfig secretVersionForToken. */ + public secretVersionForToken: string; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BearerTokenConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BearerTokenConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BearerTokenConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig; + + /** + * Verifies a BearerTokenConfig 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 BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BearerTokenConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @param message BearerTokenConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BearerTokenConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BearerTokenConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceAccountAuthConfig. */ + interface IServiceAccountAuthConfig { + + /** ServiceAccountAuthConfig serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a ServiceAccountAuthConfig. */ + class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { + + /** + * Constructs a new ServiceAccountAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig); + + /** ServiceAccountAuthConfig serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Verifies a ServiceAccountAuthConfig 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 ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAccountAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TLSConfig. */ + interface ITLSConfig { + + /** TLSConfig caCerts */ + caCerts?: (google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert[]|null); + } + + /** Represents a TLSConfig. */ + class TLSConfig implements ITLSConfig { + + /** + * Constructs a new TLSConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig); + + /** TLSConfig caCerts. */ + public caCerts: google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert[]; + + /** + * Creates a new TLSConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TLSConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig): google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig; + + /** + * Encodes the specified TLSConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.verify|verify} messages. + * @param message TLSConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TLSConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.verify|verify} messages. + * @param message TLSConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TLSConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TLSConfig + * @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.dialogflow.cx.v3beta1.Tool.TLSConfig; + + /** + * Decodes a TLSConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TLSConfig + * @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.dialogflow.cx.v3beta1.Tool.TLSConfig; + + /** + * Verifies a TLSConfig 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 TLSConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TLSConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig; + + /** + * Creates a plain object from a TLSConfig message. Also converts values to other types if specified. + * @param message TLSConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TLSConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TLSConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TLSConfig { + + /** Properties of a CACert. */ + interface ICACert { + + /** CACert displayName */ + displayName?: (string|null); + + /** CACert cert */ + cert?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CACert. */ + class CACert implements ICACert { + + /** + * Constructs a new CACert. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert); + + /** CACert displayName. */ + public displayName: string; + + /** CACert cert. */ + public cert: (Uint8Array|Buffer|string); + + /** + * Creates a new CACert instance using the specified properties. + * @param [properties] Properties to set + * @returns CACert instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert): google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert; + + /** + * Encodes the specified CACert message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.verify|verify} messages. + * @param message CACert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CACert message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.verify|verify} messages. + * @param message CACert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CACert message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CACert + * @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.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert; + + /** + * Decodes a CACert message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CACert + * @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.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert; + + /** + * Verifies a CACert 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 CACert message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CACert + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert; + + /** + * Creates a plain object from a CACert message. Also converts values to other types if specified. + * @param message CACert + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CACert to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CACert + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ServiceDirectoryConfig. */ + interface IServiceDirectoryConfig { + + /** ServiceDirectoryConfig service */ + service?: (string|null); + } + + /** Represents a ServiceDirectoryConfig. */ + class ServiceDirectoryConfig implements IServiceDirectoryConfig { + + /** + * Constructs a new ServiceDirectoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig); + + /** ServiceDirectoryConfig service. */ + public service: string; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDirectoryConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig): google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDirectoryConfig + * @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.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig; + + /** + * Verifies a ServiceDirectoryConfig 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 ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDirectoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @param message ServiceDirectoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndUserAuthConfig. */ + interface IEndUserAuthConfig { + + /** EndUserAuthConfig oauth2AuthCodeConfig */ + oauth2AuthCodeConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig */ + oauth2JwtBearerConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + } + + /** Represents an EndUserAuthConfig. */ + class EndUserAuthConfig implements IEndUserAuthConfig { + + /** + * Constructs a new EndUserAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig); + + /** EndUserAuthConfig oauth2AuthCodeConfig. */ + public oauth2AuthCodeConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig. */ + public oauth2JwtBearerConfig?: (google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + + /** EndUserAuthConfig endUserAuthConfig. */ + public endUserAuthConfig?: ("oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EndUserAuthConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig): google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndUserAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndUserAuthConfig + * @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.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig; + + /** + * Verifies an EndUserAuthConfig 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 EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndUserAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @param message EndUserAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndUserAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndUserAuthConfig { + + /** Properties of an Oauth2AuthCodeConfig. */ + interface IOauth2AuthCodeConfig { + + /** Oauth2AuthCodeConfig oauthToken */ + oauthToken?: (string|null); + } + + /** Represents an Oauth2AuthCodeConfig. */ + class Oauth2AuthCodeConfig implements IOauth2AuthCodeConfig { + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig); + + /** Oauth2AuthCodeConfig oauthToken. */ + public oauthToken: string; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2AuthCodeConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig): google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2AuthCodeConfig + * @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.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2AuthCodeConfig + * @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.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Verifies an Oauth2AuthCodeConfig 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 Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2AuthCodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @param message Oauth2AuthCodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Oauth2JwtBearerConfig. */ + interface IOauth2JwtBearerConfig { + + /** Oauth2JwtBearerConfig issuer */ + issuer?: (string|null); + + /** Oauth2JwtBearerConfig subject */ + subject?: (string|null); + + /** Oauth2JwtBearerConfig clientKey */ + clientKey?: (string|null); + } + + /** Represents an Oauth2JwtBearerConfig. */ + class Oauth2JwtBearerConfig implements IOauth2JwtBearerConfig { + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig); + + /** Oauth2JwtBearerConfig issuer. */ + public issuer: string; + + /** Oauth2JwtBearerConfig subject. */ + public subject: string; + + /** Oauth2JwtBearerConfig clientKey. */ + public clientKey: string; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2JwtBearerConfig instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig): google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2JwtBearerConfig + * @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.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2JwtBearerConfig + * @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.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Verifies an Oauth2JwtBearerConfig 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 Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2JwtBearerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @param message Oauth2JwtBearerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ToolType enum. */ + enum ToolType { + TOOL_TYPE_UNSPECIFIED = 0, + CUSTOMIZED_TOOL = 1, + BUILTIN_TOOL = 2 + } + } + + /** Properties of a ListToolVersionsRequest. */ + interface IListToolVersionsRequest { + + /** ListToolVersionsRequest parent */ + parent?: (string|null); + + /** ListToolVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListToolVersionsRequest. */ + class ListToolVersionsRequest implements IListToolVersionsRequest { + + /** + * Constructs a new ListToolVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest); + + /** ListToolVersionsRequest parent. */ + public parent: string; + + /** ListToolVersionsRequest pageSize. */ + public pageSize: number; + + /** ListToolVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListToolVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest): google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest; + + /** + * Encodes the specified ListToolVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest.verify|verify} messages. + * @param message ListToolVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest.verify|verify} messages. + * @param message ListToolVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolVersionsRequest + * @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.dialogflow.cx.v3beta1.ListToolVersionsRequest; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolVersionsRequest + * @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.dialogflow.cx.v3beta1.ListToolVersionsRequest; + + /** + * Verifies a ListToolVersionsRequest 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 ListToolVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest; + + /** + * Creates a plain object from a ListToolVersionsRequest message. Also converts values to other types if specified. + * @param message ListToolVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolVersionsResponse. */ + interface IListToolVersionsResponse { + + /** ListToolVersionsResponse toolVersions */ + toolVersions?: (google.cloud.dialogflow.cx.v3beta1.IToolVersion[]|null); + + /** ListToolVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolVersionsResponse. */ + class ListToolVersionsResponse implements IListToolVersionsResponse { + + /** + * Constructs a new ListToolVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse); + + /** ListToolVersionsResponse toolVersions. */ + public toolVersions: google.cloud.dialogflow.cx.v3beta1.IToolVersion[]; + + /** ListToolVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse): google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse; + + /** + * Encodes the specified ListToolVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse.verify|verify} messages. + * @param message ListToolVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse.verify|verify} messages. + * @param message ListToolVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolVersionsResponse + * @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.dialogflow.cx.v3beta1.ListToolVersionsResponse; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolVersionsResponse + * @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.dialogflow.cx.v3beta1.ListToolVersionsResponse; + + /** + * Verifies a ListToolVersionsResponse 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 ListToolVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse; + + /** + * Creates a plain object from a ListToolVersionsResponse message. Also converts values to other types if specified. + * @param message ListToolVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolVersionRequest. */ + interface ICreateToolVersionRequest { + + /** CreateToolVersionRequest parent */ + parent?: (string|null); + + /** CreateToolVersionRequest toolVersion */ + toolVersion?: (google.cloud.dialogflow.cx.v3beta1.IToolVersion|null); + } + + /** Represents a CreateToolVersionRequest. */ + class CreateToolVersionRequest implements ICreateToolVersionRequest { + + /** + * Constructs a new CreateToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest); + + /** CreateToolVersionRequest parent. */ + public parent: string; + + /** CreateToolVersionRequest toolVersion. */ + public toolVersion?: (google.cloud.dialogflow.cx.v3beta1.IToolVersion|null); + + /** + * Creates a new CreateToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest): google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest; + + /** + * Encodes the specified CreateToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest.verify|verify} messages. + * @param message CreateToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest.verify|verify} messages. + * @param message CreateToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolVersionRequest + * @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.dialogflow.cx.v3beta1.CreateToolVersionRequest; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolVersionRequest + * @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.dialogflow.cx.v3beta1.CreateToolVersionRequest; + + /** + * Verifies a CreateToolVersionRequest 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 CreateToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest; + + /** + * Creates a plain object from a CreateToolVersionRequest message. Also converts values to other types if specified. + * @param message CreateToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolVersionRequest. */ + interface IGetToolVersionRequest { + + /** GetToolVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetToolVersionRequest. */ + class GetToolVersionRequest implements IGetToolVersionRequest { + + /** + * Constructs a new GetToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest); + + /** GetToolVersionRequest name. */ + public name: string; + + /** + * Creates a new GetToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest): google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest; + + /** + * Encodes the specified GetToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest.verify|verify} messages. + * @param message GetToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest.verify|verify} messages. + * @param message GetToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolVersionRequest + * @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.dialogflow.cx.v3beta1.GetToolVersionRequest; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolVersionRequest + * @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.dialogflow.cx.v3beta1.GetToolVersionRequest; + + /** + * Verifies a GetToolVersionRequest 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 GetToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest; + + /** + * Creates a plain object from a GetToolVersionRequest message. Also converts values to other types if specified. + * @param message GetToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolVersionRequest. */ + interface IDeleteToolVersionRequest { + + /** DeleteToolVersionRequest name */ + name?: (string|null); + + /** DeleteToolVersionRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteToolVersionRequest. */ + class DeleteToolVersionRequest implements IDeleteToolVersionRequest { + + /** + * Constructs a new DeleteToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest); + + /** DeleteToolVersionRequest name. */ + public name: string; + + /** DeleteToolVersionRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest): google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest; + + /** + * Encodes the specified DeleteToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest.verify|verify} messages. + * @param message DeleteToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest.verify|verify} messages. + * @param message DeleteToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolVersionRequest + * @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.dialogflow.cx.v3beta1.DeleteToolVersionRequest; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolVersionRequest + * @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.dialogflow.cx.v3beta1.DeleteToolVersionRequest; + + /** + * Verifies a DeleteToolVersionRequest 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 DeleteToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest; + + /** + * Creates a plain object from a DeleteToolVersionRequest message. Also converts values to other types if specified. + * @param message DeleteToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreToolVersionRequest. */ + interface IRestoreToolVersionRequest { + + /** RestoreToolVersionRequest name */ + name?: (string|null); + } + + /** Represents a RestoreToolVersionRequest. */ + class RestoreToolVersionRequest implements IRestoreToolVersionRequest { + + /** + * Constructs a new RestoreToolVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest); + + /** RestoreToolVersionRequest name. */ + public name: string; + + /** + * Creates a new RestoreToolVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreToolVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest): google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest; + + /** + * Encodes the specified RestoreToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest.verify|verify} messages. + * @param message RestoreToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest.verify|verify} messages. + * @param message RestoreToolVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreToolVersionRequest + * @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.dialogflow.cx.v3beta1.RestoreToolVersionRequest; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreToolVersionRequest + * @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.dialogflow.cx.v3beta1.RestoreToolVersionRequest; + + /** + * Verifies a RestoreToolVersionRequest 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 RestoreToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreToolVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest; + + /** + * Creates a plain object from a RestoreToolVersionRequest message. Also converts values to other types if specified. + * @param message RestoreToolVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreToolVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreToolVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreToolVersionResponse. */ + interface IRestoreToolVersionResponse { + + /** RestoreToolVersionResponse tool */ + tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + } + + /** Represents a RestoreToolVersionResponse. */ + class RestoreToolVersionResponse implements IRestoreToolVersionResponse { + + /** + * Constructs a new RestoreToolVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse); + + /** RestoreToolVersionResponse tool. */ + public tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + + /** + * Creates a new RestoreToolVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreToolVersionResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse): google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse; + + /** + * Encodes the specified RestoreToolVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse.verify|verify} messages. + * @param message RestoreToolVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreToolVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse.verify|verify} messages. + * @param message RestoreToolVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreToolVersionResponse + * @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.dialogflow.cx.v3beta1.RestoreToolVersionResponse; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreToolVersionResponse + * @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.dialogflow.cx.v3beta1.RestoreToolVersionResponse; + + /** + * Verifies a RestoreToolVersionResponse 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 RestoreToolVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreToolVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse; + + /** + * Creates a plain object from a RestoreToolVersionResponse message. Also converts values to other types if specified. + * @param message RestoreToolVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreToolVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreToolVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolVersion. */ + interface IToolVersion { + + /** ToolVersion name */ + name?: (string|null); + + /** ToolVersion displayName */ + displayName?: (string|null); + + /** ToolVersion tool */ + tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + + /** ToolVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ToolVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ToolVersion. */ + class ToolVersion implements IToolVersion { + + /** + * Constructs a new ToolVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IToolVersion); + + /** ToolVersion name. */ + public name: string; + + /** ToolVersion displayName. */ + public displayName: string; + + /** ToolVersion tool. */ + public tool?: (google.cloud.dialogflow.cx.v3beta1.ITool|null); + + /** ToolVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ToolVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ToolVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolVersion instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IToolVersion): google.cloud.dialogflow.cx.v3beta1.ToolVersion; + + /** + * Encodes the specified ToolVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolVersion.verify|verify} messages. + * @param message ToolVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IToolVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolVersion.verify|verify} messages. + * @param message ToolVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IToolVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolVersion + * @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.dialogflow.cx.v3beta1.ToolVersion; + + /** + * Decodes a ToolVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolVersion + * @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.dialogflow.cx.v3beta1.ToolVersion; + + /** + * Verifies a ToolVersion 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 ToolVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolVersion; + + /** + * Creates a plain object from a ToolVersion message. Also converts values to other types if specified. + * @param message ToolVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportToolsMetadata. */ + interface IExportToolsMetadata { + } + + /** Represents an ExportToolsMetadata. */ + class ExportToolsMetadata implements IExportToolsMetadata { + + /** + * Constructs a new ExportToolsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata); + + /** + * Creates a new ExportToolsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportToolsMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata): google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata; + + /** + * Encodes the specified ExportToolsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata.verify|verify} messages. + * @param message ExportToolsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportToolsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata.verify|verify} messages. + * @param message ExportToolsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportToolsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportToolsMetadata + * @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.dialogflow.cx.v3beta1.ExportToolsMetadata; + + /** + * Decodes an ExportToolsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportToolsMetadata + * @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.dialogflow.cx.v3beta1.ExportToolsMetadata; + + /** + * Verifies an ExportToolsMetadata 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 ExportToolsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportToolsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata; + + /** + * Creates a plain object from an ExportToolsMetadata message. Also converts values to other types if specified. + * @param message ExportToolsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportToolsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportToolsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Versions */ + class Versions extends $protobuf.rpc.Service { + + /** + * Constructs a new Versions service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Versions service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Versions; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVersionsResponse + */ + public listVersions(request: google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Versions.ListVersionsCallback): void; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @returns Promise + */ + public listVersions(request: google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest): Promise; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public getVersion(request: google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Versions.GetVersionCallback): void; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @returns Promise + */ + public getVersion(request: google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest): Promise; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createVersion(request: google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersionCallback): void; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @returns Promise + */ + public createVersion(request: google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest): Promise; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public updateVersion(request: google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersionCallback): void; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @returns Promise + */ + public updateVersion(request: google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest): Promise; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteVersion(request: google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersionCallback): void; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @returns Promise + */ + public deleteVersion(request: google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest): Promise; + + /** + * Calls LoadVersion. + * @param request LoadVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public loadVersion(request: google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest, callback: google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersionCallback): void; + + /** + * Calls LoadVersion. + * @param request LoadVersionRequest message or plain object + * @returns Promise + */ + public loadVersion(request: google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest): Promise; + + /** + * Calls CompareVersions. + * @param request CompareVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompareVersionsResponse + */ + public compareVersions(request: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest, callback: google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersionsCallback): void; + + /** + * Calls CompareVersions. + * @param request CompareVersionsRequest message or plain object + * @returns Promise + */ + public compareVersions(request: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest): Promise; + } + + namespace Versions { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|listVersions}. + * @param error Error, if any + * @param [response] ListVersionsResponse + */ + type ListVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|getVersion}. + * @param error Error, if any + * @param [response] Version + */ + type GetVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Version) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|createVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|updateVersion}. + * @param error Error, if any + * @param [response] Version + */ + type UpdateVersionCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.Version) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|deleteVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|loadVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type LoadVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|compareVersions}. + * @param error Error, if any + * @param [response] CompareVersionsResponse + */ + type CompareVersionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse) => void; + } + + /** Properties of a CreateVersionOperationMetadata. */ + interface ICreateVersionOperationMetadata { + + /** CreateVersionOperationMetadata version */ + version?: (string|null); + } + + /** Represents a CreateVersionOperationMetadata. */ + class CreateVersionOperationMetadata implements ICreateVersionOperationMetadata { + + /** + * Constructs a new CreateVersionOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata); + + /** CreateVersionOperationMetadata version. */ + public version: string; + + /** + * Creates a new CreateVersionOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionOperationMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata): google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata; + + /** + * Encodes the specified CreateVersionOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.verify|verify} messages. + * @param message CreateVersionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.verify|verify} messages. + * @param message CreateVersionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionOperationMetadata + * @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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionOperationMetadata + * @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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata; + + /** + * Verifies a CreateVersionOperationMetadata 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 CreateVersionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata; + + /** + * Creates a plain object from a CreateVersionOperationMetadata message. Also converts values to other types if specified. + * @param message CreateVersionOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Version. */ + interface IVersion { + + /** Version name */ + name?: (string|null); + + /** Version displayName */ + displayName?: (string|null); + + /** Version description */ + description?: (string|null); + + /** Version nluSettings */ + nluSettings?: (google.cloud.dialogflow.cx.v3beta1.INluSettings|null); + + /** Version createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Version state */ + state?: (google.cloud.dialogflow.cx.v3beta1.Version.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.Version.State|null); + } + + /** Represents a Version. */ + class Version implements IVersion { + + /** + * Constructs a new Version. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IVersion); + + /** Version name. */ + public name: string; + + /** Version displayName. */ + public displayName: string; + + /** Version description. */ + public description: string; + + /** Version nluSettings. */ + public nluSettings?: (google.cloud.dialogflow.cx.v3beta1.INluSettings|null); + + /** Version createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Version state. */ + public state: (google.cloud.dialogflow.cx.v3beta1.Version.State|keyof typeof google.cloud.dialogflow.cx.v3beta1.Version.State); + + /** + * Creates a new Version instance using the specified properties. + * @param [properties] Properties to set + * @returns Version instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IVersion): google.cloud.dialogflow.cx.v3beta1.Version; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Version message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Version + * @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.dialogflow.cx.v3beta1.Version; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Version + * @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.dialogflow.cx.v3beta1.Version; + + /** + * Verifies a Version 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 Version message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Version + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Version; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @param message Version + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Version to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Version + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Version { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3 + } + } + + /** Properties of a ListVersionsRequest. */ + interface IListVersionsRequest { + + /** ListVersionsRequest parent */ + parent?: (string|null); + + /** ListVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListVersionsRequest. */ + class ListVersionsRequest implements IListVersionsRequest { + + /** + * Constructs a new ListVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest); + + /** ListVersionsRequest parent. */ + public parent: string; + + /** ListVersionsRequest pageSize. */ + public pageSize: number; + + /** ListVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest): google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsRequest + * @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.dialogflow.cx.v3beta1.ListVersionsRequest; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsRequest + * @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.dialogflow.cx.v3beta1.ListVersionsRequest; + + /** + * Verifies a ListVersionsRequest 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 ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest; + + /** + * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. + * @param message ListVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVersionsResponse. */ + interface IListVersionsResponse { + + /** ListVersionsResponse versions */ + versions?: (google.cloud.dialogflow.cx.v3beta1.IVersion[]|null); + + /** ListVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVersionsResponse. */ + class ListVersionsResponse implements IListVersionsResponse { + + /** + * Constructs a new ListVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse); + + /** ListVersionsResponse versions. */ + public versions: google.cloud.dialogflow.cx.v3beta1.IVersion[]; + + /** ListVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse): google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsResponse + * @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.dialogflow.cx.v3beta1.ListVersionsResponse; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsResponse + * @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.dialogflow.cx.v3beta1.ListVersionsResponse; + + /** + * Verifies a ListVersionsResponse 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 ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @param message ListVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVersionRequest. */ + interface IGetVersionRequest { + + /** GetVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetVersionRequest. */ + class GetVersionRequest implements IGetVersionRequest { + + /** + * Constructs a new GetVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest); + + /** GetVersionRequest name. */ + public name: string; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest): google.cloud.dialogflow.cx.v3beta1.GetVersionRequest; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVersionRequest + * @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.dialogflow.cx.v3beta1.GetVersionRequest; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVersionRequest + * @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.dialogflow.cx.v3beta1.GetVersionRequest; + + /** + * Verifies a GetVersionRequest 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 GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetVersionRequest; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @param message GetVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVersionRequest. */ + interface ICreateVersionRequest { + + /** CreateVersionRequest parent */ + parent?: (string|null); + + /** CreateVersionRequest version */ + version?: (google.cloud.dialogflow.cx.v3beta1.IVersion|null); + } + + /** Represents a CreateVersionRequest. */ + class CreateVersionRequest implements ICreateVersionRequest { + + /** + * Constructs a new CreateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest); + + /** CreateVersionRequest parent. */ + public parent: string; + + /** CreateVersionRequest version. */ + public version?: (google.cloud.dialogflow.cx.v3beta1.IVersion|null); + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest): google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionRequest + * @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.dialogflow.cx.v3beta1.CreateVersionRequest; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionRequest + * @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.dialogflow.cx.v3beta1.CreateVersionRequest; + + /** + * Verifies a CreateVersionRequest 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 CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @param message CreateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVersionRequest. */ + interface IUpdateVersionRequest { + + /** UpdateVersionRequest version */ + version?: (google.cloud.dialogflow.cx.v3beta1.IVersion|null); + + /** UpdateVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateVersionRequest. */ + class UpdateVersionRequest implements IUpdateVersionRequest { + + /** + * Constructs a new UpdateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest); + + /** UpdateVersionRequest version. */ + public version?: (google.cloud.dialogflow.cx.v3beta1.IVersion|null); + + /** UpdateVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest): google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVersionRequest + * @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.dialogflow.cx.v3beta1.UpdateVersionRequest; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVersionRequest + * @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.dialogflow.cx.v3beta1.UpdateVersionRequest; + + /** + * Verifies an UpdateVersionRequest 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @param message UpdateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteVersionRequest. */ + interface IDeleteVersionRequest { + + /** DeleteVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteVersionRequest. */ + class DeleteVersionRequest implements IDeleteVersionRequest { + + /** + * Constructs a new DeleteVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest); + + /** DeleteVersionRequest name. */ + public name: string; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest): google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVersionRequest + * @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.dialogflow.cx.v3beta1.DeleteVersionRequest; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVersionRequest + * @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.dialogflow.cx.v3beta1.DeleteVersionRequest; + + /** + * Verifies a DeleteVersionRequest 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 DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @param message DeleteVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoadVersionRequest. */ + interface ILoadVersionRequest { + + /** LoadVersionRequest name */ + name?: (string|null); + + /** LoadVersionRequest allowOverrideAgentResources */ + allowOverrideAgentResources?: (boolean|null); + } + + /** Represents a LoadVersionRequest. */ + class LoadVersionRequest implements ILoadVersionRequest { + + /** + * Constructs a new LoadVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest); + + /** LoadVersionRequest name. */ + public name: string; + + /** LoadVersionRequest allowOverrideAgentResources. */ + public allowOverrideAgentResources: boolean; + + /** + * Creates a new LoadVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadVersionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest): google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest; + + /** + * Encodes the specified LoadVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.verify|verify} messages. + * @param message LoadVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.verify|verify} messages. + * @param message LoadVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadVersionRequest + * @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.dialogflow.cx.v3beta1.LoadVersionRequest; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadVersionRequest + * @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.dialogflow.cx.v3beta1.LoadVersionRequest; + + /** + * Verifies a LoadVersionRequest 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 LoadVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest; + + /** + * Creates a plain object from a LoadVersionRequest message. Also converts values to other types if specified. + * @param message LoadVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompareVersionsRequest. */ + interface ICompareVersionsRequest { + + /** CompareVersionsRequest baseVersion */ + baseVersion?: (string|null); + + /** CompareVersionsRequest targetVersion */ + targetVersion?: (string|null); + + /** CompareVersionsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a CompareVersionsRequest. */ + class CompareVersionsRequest implements ICompareVersionsRequest { + + /** + * Constructs a new CompareVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest); + + /** CompareVersionsRequest baseVersion. */ + public baseVersion: string; + + /** CompareVersionsRequest targetVersion. */ + public targetVersion: string; + + /** CompareVersionsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new CompareVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompareVersionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest): google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest; + + /** + * Encodes the specified CompareVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest.verify|verify} messages. + * @param message CompareVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompareVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest.verify|verify} messages. + * @param message CompareVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompareVersionsRequest + * @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.dialogflow.cx.v3beta1.CompareVersionsRequest; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompareVersionsRequest + * @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.dialogflow.cx.v3beta1.CompareVersionsRequest; + + /** + * Verifies a CompareVersionsRequest 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 CompareVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompareVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest; + + /** + * Creates a plain object from a CompareVersionsRequest message. Also converts values to other types if specified. + * @param message CompareVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompareVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompareVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompareVersionsResponse. */ + interface ICompareVersionsResponse { + + /** CompareVersionsResponse baseVersionContentJson */ + baseVersionContentJson?: (string|null); + + /** CompareVersionsResponse targetVersionContentJson */ + targetVersionContentJson?: (string|null); + + /** CompareVersionsResponse compareTime */ + compareTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CompareVersionsResponse. */ + class CompareVersionsResponse implements ICompareVersionsResponse { + + /** + * Constructs a new CompareVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse); + + /** CompareVersionsResponse baseVersionContentJson. */ + public baseVersionContentJson: string; + + /** CompareVersionsResponse targetVersionContentJson. */ + public targetVersionContentJson: string; + + /** CompareVersionsResponse compareTime. */ + public compareTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CompareVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CompareVersionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse): google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse; + + /** + * Encodes the specified CompareVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse.verify|verify} messages. + * @param message CompareVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompareVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse.verify|verify} messages. + * @param message CompareVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompareVersionsResponse + * @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.dialogflow.cx.v3beta1.CompareVersionsResponse; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompareVersionsResponse + * @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.dialogflow.cx.v3beta1.CompareVersionsResponse; + + /** + * Verifies a CompareVersionsResponse 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 CompareVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompareVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse; + + /** + * Creates a plain object from a CompareVersionsResponse message. Also converts values to other types if specified. + * @param message CompareVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompareVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompareVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @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.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @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.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @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.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @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.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @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.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @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.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @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.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @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.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @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.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @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.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @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.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @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.api.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @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.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @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.api.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @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.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @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.api.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @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.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @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.api.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @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.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @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.api.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @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.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @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.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures 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 ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @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.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @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.api.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @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.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @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.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @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.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @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.api.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @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.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @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.api.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @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.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @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.api.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @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.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @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.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @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.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @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.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration 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 SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @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.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @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.api.ResourceReference; + + /** + * Verifies a ResourceReference 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @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.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @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.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @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.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @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.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @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.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @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.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport 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 FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart 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 NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @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.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @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.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @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.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @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.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature 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 VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @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.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @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.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @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.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @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.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location 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 Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation 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 Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @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.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @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.protobuf.Duration; + + /** + * Verifies a Duration 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 Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @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.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @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.protobuf.Struct; + + /** + * Verifies a Struct 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 Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @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.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @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.protobuf.Value; + + /** + * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @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.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @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.protobuf.ListValue; + + /** + * Verifies a ListValue 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 ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @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.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @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.protobuf.Empty; + + /** + * Verifies an Empty 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 Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Verifies a FieldMask 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @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.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @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.protobuf.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @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.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @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.protobuf.Timestamp; + + /** + * Verifies a Timestamp 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @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.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @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.longrunning.Operation; + + /** + * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @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.type.LatLng; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @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.type.LatLng; + + /** + * Verifies a LatLng 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 LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatLng + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.js b/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.js new file mode 100644 index 000000000000..bb70f38c1462 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.js @@ -0,0 +1,286783 @@ +// Copyright 2026 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_dialogflow_cx_protos || ($protobuf.roots._google_cloud_dialogflow_cx_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.dialogflow = (function() { + + /** + * Namespace dialogflow. + * @memberof google.cloud + * @namespace + */ + var dialogflow = {}; + + dialogflow.cx = (function() { + + /** + * Namespace cx. + * @memberof google.cloud.dialogflow + * @namespace + */ + var cx = {}; + + cx.v3 = (function() { + + /** + * Namespace v3. + * @memberof google.cloud.dialogflow.cx + * @namespace + */ + var v3 = {}; + + v3.AdvancedSettings = (function() { + + /** + * Properties of an AdvancedSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IAdvancedSettings + * @property {google.cloud.dialogflow.cx.v3.IGcsDestination|null} [audioExportGcsDestination] AdvancedSettings audioExportGcsDestination + * @property {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings|null} [speechSettings] AdvancedSettings speechSettings + * @property {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings|null} [dtmfSettings] AdvancedSettings dtmfSettings + * @property {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings|null} [loggingSettings] AdvancedSettings loggingSettings + */ + + /** + * Constructs a new AdvancedSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an AdvancedSettings. + * @implements IAdvancedSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings=} [properties] Properties to set + */ + function AdvancedSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedSettings audioExportGcsDestination. + * @member {google.cloud.dialogflow.cx.v3.IGcsDestination|null|undefined} audioExportGcsDestination + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.audioExportGcsDestination = null; + + /** + * AdvancedSettings speechSettings. + * @member {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings|null|undefined} speechSettings + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.speechSettings = null; + + /** + * AdvancedSettings dtmfSettings. + * @member {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings|null|undefined} dtmfSettings + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.dtmfSettings = null; + + /** + * AdvancedSettings loggingSettings. + * @member {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings|null|undefined} loggingSettings + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.loggingSettings = null; + + /** + * Creates a new AdvancedSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings instance + */ + AdvancedSettings.create = function create(properties) { + return new AdvancedSettings(properties); + }; + + /** + * Encodes the specified AdvancedSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings} message AdvancedSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioExportGcsDestination != null && Object.hasOwnProperty.call(message, "audioExportGcsDestination")) + $root.google.cloud.dialogflow.cx.v3.GcsDestination.encode(message.audioExportGcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speechSettings != null && Object.hasOwnProperty.call(message, "speechSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.encode(message.speechSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dtmfSettings != null && Object.hasOwnProperty.call(message, "dtmfSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.encode(message.dtmfSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AdvancedSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings} message AdvancedSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3.GcsDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.speechSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.dtmfSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.loggingSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioExportGcsDestination != null && message.hasOwnProperty("audioExportGcsDestination")) { + var error = $root.google.cloud.dialogflow.cx.v3.GcsDestination.verify(message.audioExportGcsDestination, long + 1); + if (error) + return "audioExportGcsDestination." + error; + } + if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify(message.speechSettings, long + 1); + if (error) + return "speechSettings." + error; + } + if (message.dtmfSettings != null && message.hasOwnProperty("dtmfSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.verify(message.dtmfSettings, long + 1); + if (error) + return "dtmfSettings." + error; + } + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.verify(message.loggingSettings, long + 1); + if (error) + return "loggingSettings." + error; + } + return null; + }; + + /** + * Creates an AdvancedSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings + */ + AdvancedSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AdvancedSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings(); + if (object.audioExportGcsDestination != null) { + if (typeof object.audioExportGcsDestination !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.audioExportGcsDestination: object expected"); + message.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3.GcsDestination.fromObject(object.audioExportGcsDestination, long + 1); + } + if (object.speechSettings != null) { + if (typeof object.speechSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.speechSettings: object expected"); + message.speechSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.fromObject(object.speechSettings, long + 1); + } + if (object.dtmfSettings != null) { + if (typeof object.dtmfSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.dtmfSettings: object expected"); + message.dtmfSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.fromObject(object.dtmfSettings, long + 1); + } + if (object.loggingSettings != null) { + if (typeof object.loggingSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.loggingSettings: object expected"); + message.loggingSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.fromObject(object.loggingSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AdvancedSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings} message AdvancedSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioExportGcsDestination = null; + object.speechSettings = null; + object.dtmfSettings = null; + object.loggingSettings = null; + } + if (message.audioExportGcsDestination != null && message.hasOwnProperty("audioExportGcsDestination")) + object.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3.GcsDestination.toObject(message.audioExportGcsDestination, options); + if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) + object.speechSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.toObject(message.speechSettings, options); + if (message.dtmfSettings != null && message.hasOwnProperty("dtmfSettings")) + object.dtmfSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.toObject(message.dtmfSettings, options); + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) + object.loggingSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.toObject(message.loggingSettings, options); + return object; + }; + + /** + * Converts this AdvancedSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @instance + * @returns {Object.} JSON object + */ + AdvancedSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AdvancedSettings"; + }; + + AdvancedSettings.SpeechSettings = (function() { + + /** + * Properties of a SpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @interface ISpeechSettings + * @property {number|null} [endpointerSensitivity] SpeechSettings endpointerSensitivity + * @property {google.protobuf.IDuration|null} [noSpeechTimeout] SpeechSettings noSpeechTimeout + * @property {boolean|null} [useTimeoutBasedEndpointing] SpeechSettings useTimeoutBasedEndpointing + * @property {Object.|null} [models] SpeechSettings models + */ + + /** + * Constructs a new SpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @classdesc Represents a SpeechSettings. + * @implements ISpeechSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings=} [properties] Properties to set + */ + function SpeechSettings(properties) { + this.models = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechSettings endpointerSensitivity. + * @member {number} endpointerSensitivity + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.endpointerSensitivity = 0; + + /** + * SpeechSettings noSpeechTimeout. + * @member {google.protobuf.IDuration|null|undefined} noSpeechTimeout + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.noSpeechTimeout = null; + + /** + * SpeechSettings useTimeoutBasedEndpointing. + * @member {boolean} useTimeoutBasedEndpointing + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.useTimeoutBasedEndpointing = false; + + /** + * SpeechSettings models. + * @member {Object.} models + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.models = $util.emptyObject; + + /** + * Creates a new SpeechSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings instance + */ + SpeechSettings.create = function create(properties) { + return new SpeechSettings(properties); + }; + + /** + * Encodes the specified SpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings} message SpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpointerSensitivity != null && Object.hasOwnProperty.call(message, "endpointerSensitivity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.endpointerSensitivity); + if (message.noSpeechTimeout != null && Object.hasOwnProperty.call(message, "noSpeechTimeout")) + $root.google.protobuf.Duration.encode(message.noSpeechTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.useTimeoutBasedEndpointing != null && Object.hasOwnProperty.call(message, "useTimeoutBasedEndpointing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useTimeoutBasedEndpointing); + if (message.models != null && Object.hasOwnProperty.call(message, "models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings} message SpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.endpointerSensitivity = reader.int32(); + break; + } + case 2: { + message.noSpeechTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.useTimeoutBasedEndpointing = reader.bool(); + break; + } + case 5: { + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.models, key); + message.models[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.endpointerSensitivity != null && message.hasOwnProperty("endpointerSensitivity")) + if (!$util.isInteger(message.endpointerSensitivity)) + return "endpointerSensitivity: integer expected"; + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.noSpeechTimeout, long + 1); + if (error) + return "noSpeechTimeout." + error; + } + if (message.useTimeoutBasedEndpointing != null && message.hasOwnProperty("useTimeoutBasedEndpointing")) + if (typeof message.useTimeoutBasedEndpointing !== "boolean") + return "useTimeoutBasedEndpointing: boolean expected"; + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SpeechSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings + */ + SpeechSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings(); + if (object.endpointerSensitivity != null) + message.endpointerSensitivity = object.endpointerSensitivity | 0; + if (object.noSpeechTimeout != null) { + if (typeof object.noSpeechTimeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.noSpeechTimeout: object expected"); + message.noSpeechTimeout = $root.google.protobuf.Duration.fromObject(object.noSpeechTimeout, long + 1); + } + if (object.useTimeoutBasedEndpointing != null) + message.useTimeoutBasedEndpointing = Boolean(object.useTimeoutBasedEndpointing); + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.models, keys[i]); + message.models[keys[i]] = String(object.models[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} message SpeechSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.models = {}; + if (options.defaults) { + object.endpointerSensitivity = 0; + object.noSpeechTimeout = null; + object.useTimeoutBasedEndpointing = false; + } + if (message.endpointerSensitivity != null && message.hasOwnProperty("endpointerSensitivity")) + object.endpointerSensitivity = message.endpointerSensitivity; + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) + object.noSpeechTimeout = $root.google.protobuf.Duration.toObject(message.noSpeechTimeout, options); + if (message.useTimeoutBasedEndpointing != null && message.hasOwnProperty("useTimeoutBasedEndpointing")) + object.useTimeoutBasedEndpointing = message.useTimeoutBasedEndpointing; + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.models, keys2[j]); + object.models[keys2[j]] = message.models[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this SpeechSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @instance + * @returns {Object.} JSON object + */ + SpeechSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings"; + }; + + return SpeechSettings; + })(); + + AdvancedSettings.DtmfSettings = (function() { + + /** + * Properties of a DtmfSettings. + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @interface IDtmfSettings + * @property {boolean|null} [enabled] DtmfSettings enabled + * @property {number|null} [maxDigits] DtmfSettings maxDigits + * @property {string|null} [finishDigit] DtmfSettings finishDigit + * @property {google.protobuf.IDuration|null} [interdigitTimeoutDuration] DtmfSettings interdigitTimeoutDuration + * @property {google.protobuf.IDuration|null} [endpointingTimeoutDuration] DtmfSettings endpointingTimeoutDuration + */ + + /** + * Constructs a new DtmfSettings. + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @classdesc Represents a DtmfSettings. + * @implements IDtmfSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings=} [properties] Properties to set + */ + function DtmfSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DtmfSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.enabled = false; + + /** + * DtmfSettings maxDigits. + * @member {number} maxDigits + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.maxDigits = 0; + + /** + * DtmfSettings finishDigit. + * @member {string} finishDigit + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.finishDigit = ""; + + /** + * DtmfSettings interdigitTimeoutDuration. + * @member {google.protobuf.IDuration|null|undefined} interdigitTimeoutDuration + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.interdigitTimeoutDuration = null; + + /** + * DtmfSettings endpointingTimeoutDuration. + * @member {google.protobuf.IDuration|null|undefined} endpointingTimeoutDuration + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.endpointingTimeoutDuration = null; + + /** + * Creates a new DtmfSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings} DtmfSettings instance + */ + DtmfSettings.create = function create(properties) { + return new DtmfSettings(properties); + }; + + /** + * Encodes the specified DtmfSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings} message DtmfSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.maxDigits != null && Object.hasOwnProperty.call(message, "maxDigits")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDigits); + if (message.finishDigit != null && Object.hasOwnProperty.call(message, "finishDigit")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.finishDigit); + if (message.interdigitTimeoutDuration != null && Object.hasOwnProperty.call(message, "interdigitTimeoutDuration")) + $root.google.protobuf.Duration.encode(message.interdigitTimeoutDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endpointingTimeoutDuration != null && Object.hasOwnProperty.call(message, "endpointingTimeoutDuration")) + $root.google.protobuf.Duration.encode(message.endpointingTimeoutDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DtmfSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings} message DtmfSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings} DtmfSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.maxDigits = reader.int32(); + break; + } + case 3: { + message.finishDigit = reader.string(); + break; + } + case 6: { + message.interdigitTimeoutDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.endpointingTimeoutDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings} DtmfSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DtmfSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DtmfSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.maxDigits != null && message.hasOwnProperty("maxDigits")) + if (!$util.isInteger(message.maxDigits)) + return "maxDigits: integer expected"; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + if (!$util.isString(message.finishDigit)) + return "finishDigit: string expected"; + if (message.interdigitTimeoutDuration != null && message.hasOwnProperty("interdigitTimeoutDuration")) { + var error = $root.google.protobuf.Duration.verify(message.interdigitTimeoutDuration, long + 1); + if (error) + return "interdigitTimeoutDuration." + error; + } + if (message.endpointingTimeoutDuration != null && message.hasOwnProperty("endpointingTimeoutDuration")) { + var error = $root.google.protobuf.Duration.verify(message.endpointingTimeoutDuration, long + 1); + if (error) + return "endpointingTimeoutDuration." + error; + } + return null; + }; + + /** + * Creates a DtmfSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings} DtmfSettings + */ + DtmfSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.maxDigits != null) + message.maxDigits = object.maxDigits | 0; + if (object.finishDigit != null) + message.finishDigit = String(object.finishDigit); + if (object.interdigitTimeoutDuration != null) { + if (typeof object.interdigitTimeoutDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.interdigitTimeoutDuration: object expected"); + message.interdigitTimeoutDuration = $root.google.protobuf.Duration.fromObject(object.interdigitTimeoutDuration, long + 1); + } + if (object.endpointingTimeoutDuration != null) { + if (typeof object.endpointingTimeoutDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.endpointingTimeoutDuration: object expected"); + message.endpointingTimeoutDuration = $root.google.protobuf.Duration.fromObject(object.endpointingTimeoutDuration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DtmfSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings} message DtmfSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DtmfSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.maxDigits = 0; + object.finishDigit = ""; + object.interdigitTimeoutDuration = null; + object.endpointingTimeoutDuration = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.maxDigits != null && message.hasOwnProperty("maxDigits")) + object.maxDigits = message.maxDigits; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + object.finishDigit = message.finishDigit; + if (message.interdigitTimeoutDuration != null && message.hasOwnProperty("interdigitTimeoutDuration")) + object.interdigitTimeoutDuration = $root.google.protobuf.Duration.toObject(message.interdigitTimeoutDuration, options); + if (message.endpointingTimeoutDuration != null && message.hasOwnProperty("endpointingTimeoutDuration")) + object.endpointingTimeoutDuration = $root.google.protobuf.Duration.toObject(message.endpointingTimeoutDuration, options); + return object; + }; + + /** + * Converts this DtmfSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @instance + * @returns {Object.} JSON object + */ + DtmfSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DtmfSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DtmfSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings"; + }; + + return DtmfSettings; + })(); + + AdvancedSettings.LoggingSettings = (function() { + + /** + * Properties of a LoggingSettings. + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @interface ILoggingSettings + * @property {boolean|null} [enableStackdriverLogging] LoggingSettings enableStackdriverLogging + * @property {boolean|null} [enableInteractionLogging] LoggingSettings enableInteractionLogging + * @property {boolean|null} [enableConsentBasedRedaction] LoggingSettings enableConsentBasedRedaction + */ + + /** + * Constructs a new LoggingSettings. + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings + * @classdesc Represents a LoggingSettings. + * @implements ILoggingSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings=} [properties] Properties to set + */ + function LoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingSettings enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @instance + */ + LoggingSettings.prototype.enableStackdriverLogging = false; + + /** + * LoggingSettings enableInteractionLogging. + * @member {boolean} enableInteractionLogging + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @instance + */ + LoggingSettings.prototype.enableInteractionLogging = false; + + /** + * LoggingSettings enableConsentBasedRedaction. + * @member {boolean} enableConsentBasedRedaction + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @instance + */ + LoggingSettings.prototype.enableConsentBasedRedaction = false; + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings} LoggingSettings instance + */ + LoggingSettings.create = function create(properties) { + return new LoggingSettings(properties); + }; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableStackdriverLogging); + if (message.enableInteractionLogging != null && Object.hasOwnProperty.call(message, "enableInteractionLogging")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableInteractionLogging); + if (message.enableConsentBasedRedaction != null && Object.hasOwnProperty.call(message, "enableConsentBasedRedaction")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableConsentBasedRedaction); + return writer; + }; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.enableStackdriverLogging = reader.bool(); + break; + } + case 3: { + message.enableInteractionLogging = reader.bool(); + break; + } + case 4: { + message.enableConsentBasedRedaction = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; + if (message.enableInteractionLogging != null && message.hasOwnProperty("enableInteractionLogging")) + if (typeof message.enableInteractionLogging !== "boolean") + return "enableInteractionLogging: boolean expected"; + if (message.enableConsentBasedRedaction != null && message.hasOwnProperty("enableConsentBasedRedaction")) + if (typeof message.enableConsentBasedRedaction !== "boolean") + return "enableConsentBasedRedaction: boolean expected"; + return null; + }; + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings} LoggingSettings + */ + LoggingSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings(); + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); + if (object.enableInteractionLogging != null) + message.enableInteractionLogging = Boolean(object.enableInteractionLogging); + if (object.enableConsentBasedRedaction != null) + message.enableConsentBasedRedaction = Boolean(object.enableConsentBasedRedaction); + return message; + }; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings} message LoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableStackdriverLogging = false; + object.enableInteractionLogging = false; + object.enableConsentBasedRedaction = false; + } + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; + if (message.enableInteractionLogging != null && message.hasOwnProperty("enableInteractionLogging")) + object.enableInteractionLogging = message.enableInteractionLogging; + if (message.enableConsentBasedRedaction != null && message.hasOwnProperty("enableConsentBasedRedaction")) + object.enableConsentBasedRedaction = message.enableConsentBasedRedaction; + return object; + }; + + /** + * Converts this LoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @instance + * @returns {Object.} JSON object + */ + LoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings"; + }; + + return LoggingSettings; + })(); + + return AdvancedSettings; + })(); + + v3.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GcsDestination) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GcsDestination"; + }; + + return GcsDestination; + })(); + + v3.Agents = (function() { + + /** + * Constructs a new Agents service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Agents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Agents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Agents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Agents; + + /** + * Creates new Agents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Agents} RPC service. Useful where requests and/or responses are streamed. + */ + Agents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|listAgents}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef ListAgentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListAgentsResponse} [response] ListAgentsResponse + */ + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListAgentsRequest} request ListAgentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.ListAgentsCallback} callback Node-style callback called with the error, if any, and ListAgentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.listAgents = function listAgents(request, callback) { + return this.rpcCall(listAgents, $root.google.cloud.dialogflow.cx.v3.ListAgentsRequest, $root.google.cloud.dialogflow.cx.v3.ListAgentsResponse, request, callback); + }, "name", { value: "ListAgents" }); + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListAgentsRequest} request ListAgentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|getAgent}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef GetAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Agent} [response] Agent + */ + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetAgentRequest} request GetAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getAgent = function getAgent(request, callback) { + return this.rpcCall(getAgent, $root.google.cloud.dialogflow.cx.v3.GetAgentRequest, $root.google.cloud.dialogflow.cx.v3.Agent, request, callback); + }, "name", { value: "GetAgent" }); + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetAgentRequest} request GetAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|createAgent}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef CreateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Agent} [response] Agent + */ + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.CreateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.createAgent = function createAgent(request, callback) { + return this.rpcCall(createAgent, $root.google.cloud.dialogflow.cx.v3.CreateAgentRequest, $root.google.cloud.dialogflow.cx.v3.Agent, request, callback); + }, "name", { value: "CreateAgent" }); + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|updateAgent}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef UpdateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Agent} [response] Agent + */ + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.UpdateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.updateAgent = function updateAgent(request, callback) { + return this.rpcCall(updateAgent, $root.google.cloud.dialogflow.cx.v3.UpdateAgentRequest, $root.google.cloud.dialogflow.cx.v3.Agent, request, callback); + }, "name", { value: "UpdateAgent" }); + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|deleteAgent}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef DeleteAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.deleteAgent = function deleteAgent(request, callback) { + return this.rpcCall(deleteAgent, $root.google.cloud.dialogflow.cx.v3.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgent" }); + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|exportAgent}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef ExportAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAgent. + * @function exportAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportAgentRequest} request ExportAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.ExportAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.exportAgent = function exportAgent(request, callback) { + return this.rpcCall(exportAgent, $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAgent" }); + + /** + * Calls ExportAgent. + * @function exportAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportAgentRequest} request ExportAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|restoreAgent}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef RestoreAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreAgent. + * @function restoreAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRestoreAgentRequest} request RestoreAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.RestoreAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.restoreAgent = function restoreAgent(request, callback) { + return this.rpcCall(restoreAgent, $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreAgent" }); + + /** + * Calls RestoreAgent. + * @function restoreAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRestoreAgentRequest} request RestoreAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|validateAgent}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef ValidateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.AgentValidationResult} [response] AgentValidationResult + */ + + /** + * Calls ValidateAgent. + * @function validateAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IValidateAgentRequest} request ValidateAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.ValidateAgentCallback} callback Node-style callback called with the error, if any, and AgentValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.validateAgent = function validateAgent(request, callback) { + return this.rpcCall(validateAgent, $root.google.cloud.dialogflow.cx.v3.ValidateAgentRequest, $root.google.cloud.dialogflow.cx.v3.AgentValidationResult, request, callback); + }, "name", { value: "ValidateAgent" }); + + /** + * Calls ValidateAgent. + * @function validateAgent + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IValidateAgentRequest} request ValidateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|getAgentValidationResult}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef GetAgentValidationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.AgentValidationResult} [response] AgentValidationResult + */ + + /** + * Calls GetAgentValidationResult. + * @function getAgentValidationResult + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest} request GetAgentValidationResultRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResultCallback} callback Node-style callback called with the error, if any, and AgentValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getAgentValidationResult = function getAgentValidationResult(request, callback) { + return this.rpcCall(getAgentValidationResult, $root.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest, $root.google.cloud.dialogflow.cx.v3.AgentValidationResult, request, callback); + }, "name", { value: "GetAgentValidationResult" }); + + /** + * Calls GetAgentValidationResult. + * @function getAgentValidationResult + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest} request GetAgentValidationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|getGenerativeSettings}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef GetGenerativeSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings} [response] GenerativeSettings + */ + + /** + * Calls GetGenerativeSettings. + * @function getGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest} request GetGenerativeSettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.GetGenerativeSettingsCallback} callback Node-style callback called with the error, if any, and GenerativeSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getGenerativeSettings = function getGenerativeSettings(request, callback) { + return this.rpcCall(getGenerativeSettings, $root.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest, $root.google.cloud.dialogflow.cx.v3.GenerativeSettings, request, callback); + }, "name", { value: "GetGenerativeSettings" }); + + /** + * Calls GetGenerativeSettings. + * @function getGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest} request GetGenerativeSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Agents|updateGenerativeSettings}. + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @typedef UpdateGenerativeSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings} [response] GenerativeSettings + */ + + /** + * Calls UpdateGenerativeSettings. + * @function updateGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest} request UpdateGenerativeSettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Agents.UpdateGenerativeSettingsCallback} callback Node-style callback called with the error, if any, and GenerativeSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.updateGenerativeSettings = function updateGenerativeSettings(request, callback) { + return this.rpcCall(updateGenerativeSettings, $root.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest, $root.google.cloud.dialogflow.cx.v3.GenerativeSettings, request, callback); + }, "name", { value: "UpdateGenerativeSettings" }); + + /** + * Calls UpdateGenerativeSettings. + * @function updateGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest} request UpdateGenerativeSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Agents; + })(); + + v3.SpeechToTextSettings = (function() { + + /** + * Properties of a SpeechToTextSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISpeechToTextSettings + * @property {boolean|null} [enableSpeechAdaptation] SpeechToTextSettings enableSpeechAdaptation + */ + + /** + * Constructs a new SpeechToTextSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SpeechToTextSettings. + * @implements ISpeechToTextSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISpeechToTextSettings=} [properties] Properties to set + */ + function SpeechToTextSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechToTextSettings enableSpeechAdaptation. + * @member {boolean} enableSpeechAdaptation + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @instance + */ + SpeechToTextSettings.prototype.enableSpeechAdaptation = false; + + /** + * Creates a new SpeechToTextSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechToTextSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SpeechToTextSettings} SpeechToTextSettings instance + */ + SpeechToTextSettings.create = function create(properties) { + return new SpeechToTextSettings(properties); + }; + + /** + * Encodes the specified SpeechToTextSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechToTextSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechToTextSettings} message SpeechToTextSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSpeechAdaptation != null && Object.hasOwnProperty.call(message, "enableSpeechAdaptation")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeechAdaptation); + return writer; + }; + + /** + * Encodes the specified SpeechToTextSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechToTextSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechToTextSettings} message SpeechToTextSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SpeechToTextSettings} SpeechToTextSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableSpeechAdaptation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SpeechToTextSettings} SpeechToTextSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechToTextSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechToTextSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableSpeechAdaptation != null && message.hasOwnProperty("enableSpeechAdaptation")) + if (typeof message.enableSpeechAdaptation !== "boolean") + return "enableSpeechAdaptation: boolean expected"; + return null; + }; + + /** + * Creates a SpeechToTextSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SpeechToTextSettings} SpeechToTextSettings + */ + SpeechToTextSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings(); + if (object.enableSpeechAdaptation != null) + message.enableSpeechAdaptation = Boolean(object.enableSpeechAdaptation); + return message; + }; + + /** + * Creates a plain object from a SpeechToTextSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SpeechToTextSettings} message SpeechToTextSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechToTextSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableSpeechAdaptation = false; + if (message.enableSpeechAdaptation != null && message.hasOwnProperty("enableSpeechAdaptation")) + object.enableSpeechAdaptation = message.enableSpeechAdaptation; + return object; + }; + + /** + * Converts this SpeechToTextSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @instance + * @returns {Object.} JSON object + */ + SpeechToTextSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechToTextSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SpeechToTextSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechToTextSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SpeechToTextSettings"; + }; + + return SpeechToTextSettings; + })(); + + v3.Agent = (function() { + + /** + * Properties of an Agent. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IAgent + * @property {string|null} [name] Agent name + * @property {string|null} [displayName] Agent displayName + * @property {string|null} [defaultLanguageCode] Agent defaultLanguageCode + * @property {Array.|null} [supportedLanguageCodes] Agent supportedLanguageCodes + * @property {string|null} [timeZone] Agent timeZone + * @property {string|null} [description] Agent description + * @property {string|null} [avatarUri] Agent avatarUri + * @property {google.cloud.dialogflow.cx.v3.ISpeechToTextSettings|null} [speechToTextSettings] Agent speechToTextSettings + * @property {string|null} [startFlow] Agent startFlow + * @property {string|null} [startPlaybook] Agent startPlaybook + * @property {string|null} [securitySettings] Agent securitySettings + * @property {boolean|null} [enableStackdriverLogging] Agent enableStackdriverLogging + * @property {boolean|null} [enableSpellCorrection] Agent enableSpellCorrection + * @property {boolean|null} [enableMultiLanguageTraining] Agent enableMultiLanguageTraining + * @property {boolean|null} [locked] Agent locked + * @property {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null} [advancedSettings] Agent advancedSettings + * @property {google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings|null} [gitIntegrationSettings] Agent gitIntegrationSettings + * @property {google.cloud.dialogflow.cx.v3.ITextToSpeechSettings|null} [textToSpeechSettings] Agent textToSpeechSettings + * @property {google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings|null} [genAppBuilderSettings] Agent genAppBuilderSettings + * @property {google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings|null} [answerFeedbackSettings] Agent answerFeedbackSettings + * @property {google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings|null} [personalizationSettings] Agent personalizationSettings + * @property {google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings|null} [clientCertificateSettings] Agent clientCertificateSettings + * @property {boolean|null} [satisfiesPzs] Agent satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Agent satisfiesPzi + */ + + /** + * Constructs a new Agent. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Agent. + * @implements IAgent + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IAgent=} [properties] Properties to set + */ + function Agent(properties) { + this.supportedLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Agent name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.name = ""; + + /** + * Agent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.displayName = ""; + + /** + * Agent defaultLanguageCode. + * @member {string} defaultLanguageCode + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.defaultLanguageCode = ""; + + /** + * Agent supportedLanguageCodes. + * @member {Array.} supportedLanguageCodes + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.supportedLanguageCodes = $util.emptyArray; + + /** + * Agent timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.timeZone = ""; + + /** + * Agent description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.description = ""; + + /** + * Agent avatarUri. + * @member {string} avatarUri + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.avatarUri = ""; + + /** + * Agent speechToTextSettings. + * @member {google.cloud.dialogflow.cx.v3.ISpeechToTextSettings|null|undefined} speechToTextSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.speechToTextSettings = null; + + /** + * Agent startFlow. + * @member {string|null|undefined} startFlow + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.startFlow = null; + + /** + * Agent startPlaybook. + * @member {string|null|undefined} startPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.startPlaybook = null; + + /** + * Agent securitySettings. + * @member {string} securitySettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.securitySettings = ""; + + /** + * Agent enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.enableStackdriverLogging = false; + + /** + * Agent enableSpellCorrection. + * @member {boolean} enableSpellCorrection + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.enableSpellCorrection = false; + + /** + * Agent enableMultiLanguageTraining. + * @member {boolean} enableMultiLanguageTraining + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.enableMultiLanguageTraining = false; + + /** + * Agent locked. + * @member {boolean} locked + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.locked = false; + + /** + * Agent advancedSettings. + * @member {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.advancedSettings = null; + + /** + * Agent gitIntegrationSettings. + * @member {google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings|null|undefined} gitIntegrationSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.gitIntegrationSettings = null; + + /** + * Agent textToSpeechSettings. + * @member {google.cloud.dialogflow.cx.v3.ITextToSpeechSettings|null|undefined} textToSpeechSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.textToSpeechSettings = null; + + /** + * Agent genAppBuilderSettings. + * @member {google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings|null|undefined} genAppBuilderSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.genAppBuilderSettings = null; + + /** + * Agent answerFeedbackSettings. + * @member {google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings|null|undefined} answerFeedbackSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.answerFeedbackSettings = null; + + /** + * Agent personalizationSettings. + * @member {google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings|null|undefined} personalizationSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.personalizationSettings = null; + + /** + * Agent clientCertificateSettings. + * @member {google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings|null|undefined} clientCertificateSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.clientCertificateSettings = null; + + /** + * Agent satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.satisfiesPzs = null; + + /** + * Agent satisfiesPzi. + * @member {boolean|null|undefined} satisfiesPzi + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Agent.prototype.satisfiesPzi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Agent sessionEntryResource. + * @member {"startFlow"|"startPlaybook"|undefined} sessionEntryResource + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + */ + Object.defineProperty(Agent.prototype, "sessionEntryResource", { + get: $util.oneOfGetter($oneOfFields = ["startFlow", "startPlaybook"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Agent.prototype, "_genAppBuilderSettings", { + get: $util.oneOfGetter($oneOfFields = ["genAppBuilderSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Agent.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Agent.prototype, "_satisfiesPzi", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Agent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Agent} Agent instance + */ + Agent.create = function create(properties) { + return new Agent(properties); + }; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultLanguageCode); + if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.supportedLanguageCodes[i]); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.avatarUri != null && Object.hasOwnProperty.call(message, "avatarUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.avatarUri); + if (message.speechToTextSettings != null && Object.hasOwnProperty.call(message, "speechToTextSettings")) + $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings.encode(message.speechToTextSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.startFlow != null && Object.hasOwnProperty.call(message, "startFlow")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.startFlow); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.securitySettings); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableStackdriverLogging); + if (message.enableSpellCorrection != null && Object.hasOwnProperty.call(message, "enableSpellCorrection")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.enableSpellCorrection); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.locked); + if (message.gitIntegrationSettings != null && Object.hasOwnProperty.call(message, "gitIntegrationSettings")) + $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.encode(message.gitIntegrationSettings, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.textToSpeechSettings != null && Object.hasOwnProperty.call(message, "textToSpeechSettings")) + $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings.encode(message.textToSpeechSettings, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.genAppBuilderSettings != null && Object.hasOwnProperty.call(message, "genAppBuilderSettings")) + $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.encode(message.genAppBuilderSettings, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.answerFeedbackSettings != null && Object.hasOwnProperty.call(message, "answerFeedbackSettings")) + $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.encode(message.answerFeedbackSettings, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.startPlaybook != null && Object.hasOwnProperty.call(message, "startPlaybook")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.startPlaybook); + if (message.enableMultiLanguageTraining != null && Object.hasOwnProperty.call(message, "enableMultiLanguageTraining")) + writer.uint32(/* id 40, wireType 0 =*/320).bool(message.enableMultiLanguageTraining); + if (message.personalizationSettings != null && Object.hasOwnProperty.call(message, "personalizationSettings")) + $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.encode(message.personalizationSettings, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.clientCertificateSettings != null && Object.hasOwnProperty.call(message, "clientCertificateSettings")) + $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.encode(message.clientCertificateSettings, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 45, wireType 0 =*/360).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 46, wireType 0 =*/368).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Agent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.defaultLanguageCode = reader.string(); + break; + } + case 4: { + if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) + message.supportedLanguageCodes = []; + message.supportedLanguageCodes.push(reader.string()); + break; + } + case 5: { + message.timeZone = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.avatarUri = reader.string(); + break; + } + case 13: { + message.speechToTextSettings = $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.startFlow = reader.string(); + break; + } + case 39: { + message.startPlaybook = reader.string(); + break; + } + case 17: { + message.securitySettings = reader.string(); + break; + } + case 18: { + message.enableStackdriverLogging = reader.bool(); + break; + } + case 20: { + message.enableSpellCorrection = reader.bool(); + break; + } + case 40: { + message.enableMultiLanguageTraining = reader.bool(); + break; + } + case 27: { + message.locked = reader.bool(); + break; + } + case 22: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.gitIntegrationSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.textToSpeechSettings = $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.genAppBuilderSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 38: { + message.answerFeedbackSettings = $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 42: { + message.personalizationSettings = $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 43: { + message.clientCertificateSettings = $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 45: { + message.satisfiesPzs = reader.bool(); + break; + } + case 46: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Agent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Agent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + if (!$util.isString(message.defaultLanguageCode)) + return "defaultLanguageCode: string expected"; + if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { + if (!Array.isArray(message.supportedLanguageCodes)) + return "supportedLanguageCodes: array expected"; + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + if (!$util.isString(message.supportedLanguageCodes[i])) + return "supportedLanguageCodes: string[] expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) + if (!$util.isString(message.avatarUri)) + return "avatarUri: string expected"; + if (message.speechToTextSettings != null && message.hasOwnProperty("speechToTextSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings.verify(message.speechToTextSettings, long + 1); + if (error) + return "speechToTextSettings." + error; + } + if (message.startFlow != null && message.hasOwnProperty("startFlow")) { + properties.sessionEntryResource = 1; + if (!$util.isString(message.startFlow)) + return "startFlow: string expected"; + } + if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) { + if (properties.sessionEntryResource === 1) + return "sessionEntryResource: multiple values"; + properties.sessionEntryResource = 1; + if (!$util.isString(message.startPlaybook)) + return "startPlaybook: string expected"; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + if (!$util.isString(message.securitySettings)) + return "securitySettings: string expected"; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; + if (message.enableSpellCorrection != null && message.hasOwnProperty("enableSpellCorrection")) + if (typeof message.enableSpellCorrection !== "boolean") + return "enableSpellCorrection: boolean expected"; + if (message.enableMultiLanguageTraining != null && message.hasOwnProperty("enableMultiLanguageTraining")) + if (typeof message.enableMultiLanguageTraining !== "boolean") + return "enableMultiLanguageTraining: boolean expected"; + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.gitIntegrationSettings != null && message.hasOwnProperty("gitIntegrationSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.verify(message.gitIntegrationSettings, long + 1); + if (error) + return "gitIntegrationSettings." + error; + } + if (message.textToSpeechSettings != null && message.hasOwnProperty("textToSpeechSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings.verify(message.textToSpeechSettings, long + 1); + if (error) + return "textToSpeechSettings." + error; + } + if (message.genAppBuilderSettings != null && message.hasOwnProperty("genAppBuilderSettings")) { + properties._genAppBuilderSettings = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.verify(message.genAppBuilderSettings, long + 1); + if (error) + return "genAppBuilderSettings." + error; + } + } + if (message.answerFeedbackSettings != null && message.hasOwnProperty("answerFeedbackSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.verify(message.answerFeedbackSettings, long + 1); + if (error) + return "answerFeedbackSettings." + error; + } + if (message.personalizationSettings != null && message.hasOwnProperty("personalizationSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.verify(message.personalizationSettings, long + 1); + if (error) + return "personalizationSettings." + error; + } + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.verify(message.clientCertificateSettings, long + 1); + if (error) + return "clientCertificateSettings." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + properties._satisfiesPzi = 1; + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + } + return null; + }; + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Agent} Agent + */ + Agent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Agent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Agent(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.defaultLanguageCode != null) + message.defaultLanguageCode = String(object.defaultLanguageCode); + if (object.supportedLanguageCodes) { + if (!Array.isArray(object.supportedLanguageCodes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.supportedLanguageCodes: array expected"); + message.supportedLanguageCodes = []; + for (var i = 0; i < object.supportedLanguageCodes.length; ++i) + message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.description != null) + message.description = String(object.description); + if (object.avatarUri != null) + message.avatarUri = String(object.avatarUri); + if (object.speechToTextSettings != null) { + if (typeof object.speechToTextSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.speechToTextSettings: object expected"); + message.speechToTextSettings = $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings.fromObject(object.speechToTextSettings, long + 1); + } + if (object.startFlow != null) + message.startFlow = String(object.startFlow); + if (object.startPlaybook != null) + message.startPlaybook = String(object.startPlaybook); + if (object.securitySettings != null) + message.securitySettings = String(object.securitySettings); + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); + if (object.enableSpellCorrection != null) + message.enableSpellCorrection = Boolean(object.enableSpellCorrection); + if (object.enableMultiLanguageTraining != null) + message.enableMultiLanguageTraining = Boolean(object.enableMultiLanguageTraining); + if (object.locked != null) + message.locked = Boolean(object.locked); + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.gitIntegrationSettings != null) { + if (typeof object.gitIntegrationSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.gitIntegrationSettings: object expected"); + message.gitIntegrationSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.fromObject(object.gitIntegrationSettings, long + 1); + } + if (object.textToSpeechSettings != null) { + if (typeof object.textToSpeechSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.textToSpeechSettings: object expected"); + message.textToSpeechSettings = $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings.fromObject(object.textToSpeechSettings, long + 1); + } + if (object.genAppBuilderSettings != null) { + if (typeof object.genAppBuilderSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.genAppBuilderSettings: object expected"); + message.genAppBuilderSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.fromObject(object.genAppBuilderSettings, long + 1); + } + if (object.answerFeedbackSettings != null) { + if (typeof object.answerFeedbackSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.answerFeedbackSettings: object expected"); + message.answerFeedbackSettings = $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.fromObject(object.answerFeedbackSettings, long + 1); + } + if (object.personalizationSettings != null) { + if (typeof object.personalizationSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.personalizationSettings: object expected"); + message.personalizationSettings = $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.fromObject(object.personalizationSettings, long + 1); + } + if (object.clientCertificateSettings != null) { + if (typeof object.clientCertificateSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.clientCertificateSettings: object expected"); + message.clientCertificateSettings = $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.fromObject(object.clientCertificateSettings, long + 1); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent} message Agent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Agent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedLanguageCodes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.defaultLanguageCode = ""; + object.timeZone = ""; + object.description = ""; + object.avatarUri = ""; + object.speechToTextSettings = null; + object.securitySettings = ""; + object.enableStackdriverLogging = false; + object.enableSpellCorrection = false; + object.advancedSettings = null; + object.locked = false; + object.gitIntegrationSettings = null; + object.textToSpeechSettings = null; + object.answerFeedbackSettings = null; + object.enableMultiLanguageTraining = false; + object.personalizationSettings = null; + object.clientCertificateSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + object.defaultLanguageCode = message.defaultLanguageCode; + if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { + object.supportedLanguageCodes = []; + for (var j = 0; j < message.supportedLanguageCodes.length; ++j) + object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) + object.avatarUri = message.avatarUri; + if (message.speechToTextSettings != null && message.hasOwnProperty("speechToTextSettings")) + object.speechToTextSettings = $root.google.cloud.dialogflow.cx.v3.SpeechToTextSettings.toObject(message.speechToTextSettings, options); + if (message.startFlow != null && message.hasOwnProperty("startFlow")) { + object.startFlow = message.startFlow; + if (options.oneofs) + object.sessionEntryResource = "startFlow"; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = message.securitySettings; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; + if (message.enableSpellCorrection != null && message.hasOwnProperty("enableSpellCorrection")) + object.enableSpellCorrection = message.enableSpellCorrection; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.gitIntegrationSettings != null && message.hasOwnProperty("gitIntegrationSettings")) + object.gitIntegrationSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.toObject(message.gitIntegrationSettings, options); + if (message.textToSpeechSettings != null && message.hasOwnProperty("textToSpeechSettings")) + object.textToSpeechSettings = $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings.toObject(message.textToSpeechSettings, options); + if (message.genAppBuilderSettings != null && message.hasOwnProperty("genAppBuilderSettings")) { + object.genAppBuilderSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.toObject(message.genAppBuilderSettings, options); + if (options.oneofs) + object._genAppBuilderSettings = "genAppBuilderSettings"; + } + if (message.answerFeedbackSettings != null && message.hasOwnProperty("answerFeedbackSettings")) + object.answerFeedbackSettings = $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.toObject(message.answerFeedbackSettings, options); + if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) { + object.startPlaybook = message.startPlaybook; + if (options.oneofs) + object.sessionEntryResource = "startPlaybook"; + } + if (message.enableMultiLanguageTraining != null && message.hasOwnProperty("enableMultiLanguageTraining")) + object.enableMultiLanguageTraining = message.enableMultiLanguageTraining; + if (message.personalizationSettings != null && message.hasOwnProperty("personalizationSettings")) + object.personalizationSettings = $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.toObject(message.personalizationSettings, options); + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) + object.clientCertificateSettings = $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.toObject(message.clientCertificateSettings, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + object.satisfiesPzi = message.satisfiesPzi; + if (options.oneofs) + object._satisfiesPzi = "satisfiesPzi"; + } + return object; + }; + + /** + * Converts this Agent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @instance + * @returns {Object.} JSON object + */ + Agent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Agent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Agent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Agent"; + }; + + Agent.GitIntegrationSettings = (function() { + + /** + * Properties of a GitIntegrationSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @interface IGitIntegrationSettings + * @property {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings|null} [githubSettings] GitIntegrationSettings githubSettings + */ + + /** + * Constructs a new GitIntegrationSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @classdesc Represents a GitIntegrationSettings. + * @implements IGitIntegrationSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings=} [properties] Properties to set + */ + function GitIntegrationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitIntegrationSettings githubSettings. + * @member {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings|null|undefined} githubSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @instance + */ + GitIntegrationSettings.prototype.githubSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GitIntegrationSettings gitSettings. + * @member {"githubSettings"|undefined} gitSettings + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @instance + */ + Object.defineProperty(GitIntegrationSettings.prototype, "gitSettings", { + get: $util.oneOfGetter($oneOfFields = ["githubSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GitIntegrationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings} GitIntegrationSettings instance + */ + GitIntegrationSettings.create = function create(properties) { + return new GitIntegrationSettings(properties); + }; + + /** + * Encodes the specified GitIntegrationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings} message GitIntegrationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitIntegrationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.githubSettings != null && Object.hasOwnProperty.call(message, "githubSettings")) + $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.encode(message.githubSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GitIntegrationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IGitIntegrationSettings} message GitIntegrationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitIntegrationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings} GitIntegrationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitIntegrationSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.githubSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings} GitIntegrationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitIntegrationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitIntegrationSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitIntegrationSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.githubSettings != null && message.hasOwnProperty("githubSettings")) { + properties.gitSettings = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.verify(message.githubSettings, long + 1); + if (error) + return "githubSettings." + error; + } + } + return null; + }; + + /** + * Creates a GitIntegrationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings} GitIntegrationSettings + */ + GitIntegrationSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings(); + if (object.githubSettings != null) { + if (typeof object.githubSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.githubSettings: object expected"); + message.githubSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.fromObject(object.githubSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GitIntegrationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings} message GitIntegrationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitIntegrationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.githubSettings != null && message.hasOwnProperty("githubSettings")) { + object.githubSettings = $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.toObject(message.githubSettings, options); + if (options.oneofs) + object.gitSettings = "githubSettings"; + } + return object; + }; + + /** + * Converts this GitIntegrationSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @instance + * @returns {Object.} JSON object + */ + GitIntegrationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitIntegrationSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitIntegrationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings"; + }; + + GitIntegrationSettings.GithubSettings = (function() { + + /** + * Properties of a GithubSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @interface IGithubSettings + * @property {string|null} [displayName] GithubSettings displayName + * @property {string|null} [repositoryUri] GithubSettings repositoryUri + * @property {string|null} [trackingBranch] GithubSettings trackingBranch + * @property {string|null} [accessToken] GithubSettings accessToken + * @property {Array.|null} [branches] GithubSettings branches + */ + + /** + * Constructs a new GithubSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings + * @classdesc Represents a GithubSettings. + * @implements IGithubSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings=} [properties] Properties to set + */ + function GithubSettings(properties) { + this.branches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GithubSettings displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.displayName = ""; + + /** + * GithubSettings repositoryUri. + * @member {string} repositoryUri + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.repositoryUri = ""; + + /** + * GithubSettings trackingBranch. + * @member {string} trackingBranch + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.trackingBranch = ""; + + /** + * GithubSettings accessToken. + * @member {string} accessToken + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.accessToken = ""; + + /** + * GithubSettings branches. + * @member {Array.} branches + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.branches = $util.emptyArray; + + /** + * Creates a new GithubSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings} GithubSettings instance + */ + GithubSettings.create = function create(properties) { + return new GithubSettings(properties); + }; + + /** + * Encodes the specified GithubSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings} message GithubSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GithubSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.repositoryUri != null && Object.hasOwnProperty.call(message, "repositoryUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.repositoryUri); + if (message.trackingBranch != null && Object.hasOwnProperty.call(message, "trackingBranch")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.trackingBranch); + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.accessToken); + if (message.branches != null && message.branches.length) + for (var i = 0; i < message.branches.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.branches[i]); + return writer; + }; + + /** + * Encodes the specified GithubSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.IGithubSettings} message GithubSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GithubSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GithubSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings} GithubSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GithubSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.repositoryUri = reader.string(); + break; + } + case 3: { + message.trackingBranch = reader.string(); + break; + } + case 4: { + message.accessToken = reader.string(); + break; + } + case 5: { + if (!(message.branches && message.branches.length)) + message.branches = []; + message.branches.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GithubSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings} GithubSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GithubSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GithubSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GithubSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.repositoryUri != null && message.hasOwnProperty("repositoryUri")) + if (!$util.isString(message.repositoryUri)) + return "repositoryUri: string expected"; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + if (!$util.isString(message.trackingBranch)) + return "trackingBranch: string expected"; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (!$util.isString(message.accessToken)) + return "accessToken: string expected"; + if (message.branches != null && message.hasOwnProperty("branches")) { + if (!Array.isArray(message.branches)) + return "branches: array expected"; + for (var i = 0; i < message.branches.length; ++i) + if (!$util.isString(message.branches[i])) + return "branches: string[] expected"; + } + return null; + }; + + /** + * Creates a GithubSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings} GithubSettings + */ + GithubSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.repositoryUri != null) + message.repositoryUri = String(object.repositoryUri); + if (object.trackingBranch != null) + message.trackingBranch = String(object.trackingBranch); + if (object.accessToken != null) + message.accessToken = String(object.accessToken); + if (object.branches) { + if (!Array.isArray(object.branches)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings.branches: array expected"); + message.branches = []; + for (var i = 0; i < object.branches.length; ++i) + message.branches[i] = String(object.branches[i]); + } + return message; + }; + + /** + * Creates a plain object from a GithubSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings} message GithubSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GithubSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.branches = []; + if (options.defaults) { + object.displayName = ""; + object.repositoryUri = ""; + object.trackingBranch = ""; + object.accessToken = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.repositoryUri != null && message.hasOwnProperty("repositoryUri")) + object.repositoryUri = message.repositoryUri; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + object.trackingBranch = message.trackingBranch; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + object.accessToken = message.accessToken; + if (message.branches && message.branches.length) { + object.branches = []; + for (var j = 0; j < message.branches.length; ++j) + object.branches[j] = message.branches[j]; + } + return object; + }; + + /** + * Converts this GithubSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @instance + * @returns {Object.} JSON object + */ + GithubSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GithubSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GithubSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings"; + }; + + return GithubSettings; + })(); + + return GitIntegrationSettings; + })(); + + Agent.GenAppBuilderSettings = (function() { + + /** + * Properties of a GenAppBuilderSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @interface IGenAppBuilderSettings + * @property {string|null} [engine] GenAppBuilderSettings engine + */ + + /** + * Constructs a new GenAppBuilderSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @classdesc Represents a GenAppBuilderSettings. + * @implements IGenAppBuilderSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings=} [properties] Properties to set + */ + function GenAppBuilderSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAppBuilderSettings engine. + * @member {string} engine + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @instance + */ + GenAppBuilderSettings.prototype.engine = ""; + + /** + * Creates a new GenAppBuilderSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings} GenAppBuilderSettings instance + */ + GenAppBuilderSettings.create = function create(properties) { + return new GenAppBuilderSettings(properties); + }; + + /** + * Encodes the specified GenAppBuilderSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings} message GenAppBuilderSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAppBuilderSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); + return writer; + }; + + /** + * Encodes the specified GenAppBuilderSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IGenAppBuilderSettings} message GenAppBuilderSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAppBuilderSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings} GenAppBuilderSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAppBuilderSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.engine = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings} GenAppBuilderSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAppBuilderSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAppBuilderSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAppBuilderSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.engine != null && message.hasOwnProperty("engine")) + if (!$util.isString(message.engine)) + return "engine: string expected"; + return null; + }; + + /** + * Creates a GenAppBuilderSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings} GenAppBuilderSettings + */ + GenAppBuilderSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings(); + if (object.engine != null) + message.engine = String(object.engine); + return message; + }; + + /** + * Creates a plain object from a GenAppBuilderSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings} message GenAppBuilderSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAppBuilderSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.engine = ""; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = message.engine; + return object; + }; + + /** + * Converts this GenAppBuilderSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @instance + * @returns {Object.} JSON object + */ + GenAppBuilderSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAppBuilderSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAppBuilderSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings"; + }; + + return GenAppBuilderSettings; + })(); + + Agent.AnswerFeedbackSettings = (function() { + + /** + * Properties of an AnswerFeedbackSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @interface IAnswerFeedbackSettings + * @property {boolean|null} [enableAnswerFeedback] AnswerFeedbackSettings enableAnswerFeedback + */ + + /** + * Constructs a new AnswerFeedbackSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @classdesc Represents an AnswerFeedbackSettings. + * @implements IAnswerFeedbackSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings=} [properties] Properties to set + */ + function AnswerFeedbackSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerFeedbackSettings enableAnswerFeedback. + * @member {boolean} enableAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @instance + */ + AnswerFeedbackSettings.prototype.enableAnswerFeedback = false; + + /** + * Creates a new AnswerFeedbackSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings instance + */ + AnswerFeedbackSettings.create = function create(properties) { + return new AnswerFeedbackSettings(properties); + }; + + /** + * Encodes the specified AnswerFeedbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings} message AnswerFeedbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedbackSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableAnswerFeedback != null && Object.hasOwnProperty.call(message, "enableAnswerFeedback")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableAnswerFeedback); + return writer; + }; + + /** + * Encodes the specified AnswerFeedbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IAnswerFeedbackSettings} message AnswerFeedbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedbackSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedbackSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableAnswerFeedback = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedbackSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerFeedbackSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerFeedbackSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableAnswerFeedback != null && message.hasOwnProperty("enableAnswerFeedback")) + if (typeof message.enableAnswerFeedback !== "boolean") + return "enableAnswerFeedback: boolean expected"; + return null; + }; + + /** + * Creates an AnswerFeedbackSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings + */ + AnswerFeedbackSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings(); + if (object.enableAnswerFeedback != null) + message.enableAnswerFeedback = Boolean(object.enableAnswerFeedback); + return message; + }; + + /** + * Creates a plain object from an AnswerFeedbackSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings} message AnswerFeedbackSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerFeedbackSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableAnswerFeedback = false; + if (message.enableAnswerFeedback != null && message.hasOwnProperty("enableAnswerFeedback")) + object.enableAnswerFeedback = message.enableAnswerFeedback; + return object; + }; + + /** + * Converts this AnswerFeedbackSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @instance + * @returns {Object.} JSON object + */ + AnswerFeedbackSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerFeedbackSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerFeedbackSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings"; + }; + + return AnswerFeedbackSettings; + })(); + + Agent.PersonalizationSettings = (function() { + + /** + * Properties of a PersonalizationSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @interface IPersonalizationSettings + * @property {google.protobuf.IStruct|null} [defaultEndUserMetadata] PersonalizationSettings defaultEndUserMetadata + */ + + /** + * Constructs a new PersonalizationSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @classdesc Represents a PersonalizationSettings. + * @implements IPersonalizationSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings=} [properties] Properties to set + */ + function PersonalizationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonalizationSettings defaultEndUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} defaultEndUserMetadata + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @instance + */ + PersonalizationSettings.prototype.defaultEndUserMetadata = null; + + /** + * Creates a new PersonalizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings} PersonalizationSettings instance + */ + PersonalizationSettings.create = function create(properties) { + return new PersonalizationSettings(properties); + }; + + /** + * Encodes the specified PersonalizationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings} message PersonalizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultEndUserMetadata != null && Object.hasOwnProperty.call(message, "defaultEndUserMetadata")) + $root.google.protobuf.Struct.encode(message.defaultEndUserMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PersonalizationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IPersonalizationSettings} message PersonalizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings} PersonalizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultEndUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings} PersonalizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalizationSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalizationSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.defaultEndUserMetadata != null && message.hasOwnProperty("defaultEndUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.defaultEndUserMetadata, long + 1); + if (error) + return "defaultEndUserMetadata." + error; + } + return null; + }; + + /** + * Creates a PersonalizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings} PersonalizationSettings + */ + PersonalizationSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings(); + if (object.defaultEndUserMetadata != null) { + if (typeof object.defaultEndUserMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings.defaultEndUserMetadata: object expected"); + message.defaultEndUserMetadata = $root.google.protobuf.Struct.fromObject(object.defaultEndUserMetadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PersonalizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings} message PersonalizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.defaultEndUserMetadata = null; + if (message.defaultEndUserMetadata != null && message.hasOwnProperty("defaultEndUserMetadata")) + object.defaultEndUserMetadata = $root.google.protobuf.Struct.toObject(message.defaultEndUserMetadata, options); + return object; + }; + + /** + * Converts this PersonalizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @instance + * @returns {Object.} JSON object + */ + PersonalizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonalizationSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonalizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings"; + }; + + return PersonalizationSettings; + })(); + + Agent.ClientCertificateSettings = (function() { + + /** + * Properties of a ClientCertificateSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @interface IClientCertificateSettings + * @property {string|null} [sslCertificate] ClientCertificateSettings sslCertificate + * @property {string|null} [privateKey] ClientCertificateSettings privateKey + * @property {string|null} [passphrase] ClientCertificateSettings passphrase + */ + + /** + * Constructs a new ClientCertificateSettings. + * @memberof google.cloud.dialogflow.cx.v3.Agent + * @classdesc Represents a ClientCertificateSettings. + * @implements IClientCertificateSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings=} [properties] Properties to set + */ + function ClientCertificateSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientCertificateSettings sslCertificate. + * @member {string} sslCertificate + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.sslCertificate = ""; + + /** + * ClientCertificateSettings privateKey. + * @member {string} privateKey + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.privateKey = ""; + + /** + * ClientCertificateSettings passphrase. + * @member {string} passphrase + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.passphrase = ""; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings} ClientCertificateSettings instance + */ + ClientCertificateSettings.create = function create(properties) { + return new ClientCertificateSettings(properties); + }; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslCertificate != null && Object.hasOwnProperty.call(message, "sslCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sslCertificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); + if (message.passphrase != null && Object.hasOwnProperty.call(message, "passphrase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.passphrase); + return writer; + }; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sslCertificate = reader.string(); + break; + } + case 2: { + message.privateKey = reader.string(); + break; + } + case 3: { + message.passphrase = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientCertificateSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientCertificateSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + if (!$util.isString(message.sslCertificate)) + return "sslCertificate: string expected"; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + if (!$util.isString(message.passphrase)) + return "passphrase: string expected"; + return null; + }; + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings} ClientCertificateSettings + */ + ClientCertificateSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings(); + if (object.sslCertificate != null) + message.sslCertificate = String(object.sslCertificate); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + if (object.passphrase != null) + message.passphrase = String(object.passphrase); + return message; + }; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings} message ClientCertificateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientCertificateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslCertificate = ""; + object.privateKey = ""; + object.passphrase = ""; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + object.sslCertificate = message.sslCertificate; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + object.privateKey = message.privateKey; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + object.passphrase = message.passphrase; + return object; + }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @instance + * @returns {Object.} JSON object + */ + ClientCertificateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientCertificateSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientCertificateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings"; + }; + + return ClientCertificateSettings; + })(); + + return Agent; + })(); + + v3.ListAgentsRequest = (function() { + + /** + * Properties of a ListAgentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListAgentsRequest + * @property {string|null} [parent] ListAgentsRequest parent + * @property {number|null} [pageSize] ListAgentsRequest pageSize + * @property {string|null} [pageToken] ListAgentsRequest pageToken + */ + + /** + * Constructs a new ListAgentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListAgentsRequest. + * @implements IListAgentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListAgentsRequest=} [properties] Properties to set + */ + function ListAgentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.parent = ""; + + /** + * ListAgentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageSize = 0; + + /** + * ListAgentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListAgentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsRequest} ListAgentsRequest instance + */ + ListAgentsRequest.create = function create(properties) { + return new ListAgentsRequest(properties); + }; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListAgentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsRequest} ListAgentsRequest + */ + ListAgentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListAgentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListAgentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListAgentsRequest} message ListAgentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListAgentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAgentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListAgentsRequest"; + }; + + return ListAgentsRequest; + })(); + + v3.ListAgentsResponse = (function() { + + /** + * Properties of a ListAgentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListAgentsResponse + * @property {Array.|null} [agents] ListAgentsResponse agents + * @property {string|null} [nextPageToken] ListAgentsResponse nextPageToken + */ + + /** + * Constructs a new ListAgentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListAgentsResponse. + * @implements IListAgentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListAgentsResponse=} [properties] Properties to set + */ + function ListAgentsResponse(properties) { + this.agents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsResponse agents. + * @member {Array.} agents + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.agents = $util.emptyArray; + + /** + * ListAgentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListAgentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsResponse} ListAgentsResponse instance + */ + ListAgentsResponse.create = function create(properties) { + return new ListAgentsResponse(properties); + }; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Agent.encode(message.agents[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 ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListAgentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListAgentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.dialogflow.cx.v3.Agent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.verify(message.agents[i], long + 1); + if (error) + return "agents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListAgentsResponse} ListAgentsResponse + */ + ListAgentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListAgentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListAgentsResponse(); + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListAgentsResponse.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListAgentsResponse.agents: object expected"); + message.agents[i] = $root.google.cloud.dialogflow.cx.v3.Agent.fromObject(object.agents[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListAgentsResponse} message ListAgentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.dialogflow.cx.v3.Agent.toObject(message.agents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAgentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAgentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListAgentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListAgentsResponse"; + }; + + return ListAgentsResponse; + })(); + + v3.GetAgentRequest = (function() { + + /** + * Properties of a GetAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetAgentRequest + * @property {string|null} [name] GetAgentRequest name + */ + + /** + * Constructs a new GetAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetAgentRequest. + * @implements IGetAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetAgentRequest=} [properties] Properties to set + */ + function GetAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @instance + */ + GetAgentRequest.prototype.name = ""; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetAgentRequest} GetAgentRequest instance + */ + GetAgentRequest.create = function create(properties) { + return new GetAgentRequest(properties); + }; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.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 GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetAgentRequest} GetAgentRequest + */ + GetAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetAgentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetAgentRequest} message GetAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentRequest.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 GetAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetAgentRequest"; + }; + + return GetAgentRequest; + })(); + + v3.CreateAgentRequest = (function() { + + /** + * Properties of a CreateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateAgentRequest + * @property {string|null} [parent] CreateAgentRequest parent + * @property {google.cloud.dialogflow.cx.v3.IAgent|null} [agent] CreateAgentRequest agent + */ + + /** + * Constructs a new CreateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateAgentRequest. + * @implements ICreateAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateAgentRequest=} [properties] Properties to set + */ + function CreateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.parent = ""; + + /** + * CreateAgentRequest agent. + * @member {google.cloud.dialogflow.cx.v3.IAgent|null|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agent = null; + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateAgentRequest} CreateAgentRequest instance + */ + CreateAgentRequest.create = function create(properties) { + return new CreateAgentRequest(properties); + }; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.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.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.dialogflow.cx.v3.Agent.encode(message.agent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.agent = $root.google.cloud.dialogflow.cx.v3.Agent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.verify(message.agent, long + 1); + if (error) + return "agent." + error; + } + return null; + }; + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateAgentRequest} CreateAgentRequest + */ + CreateAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.dialogflow.cx.v3.Agent.fromObject(object.agent, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateAgentRequest} message CreateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.agent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.dialogflow.cx.v3.Agent.toObject(message.agent, options); + return object; + }; + + /** + * Converts this CreateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateAgentRequest"; + }; + + return CreateAgentRequest; + })(); + + v3.UpdateAgentRequest = (function() { + + /** + * Properties of an UpdateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateAgentRequest + * @property {google.cloud.dialogflow.cx.v3.IAgent|null} [agent] UpdateAgentRequest agent + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentRequest updateMask + */ + + /** + * Constructs a new UpdateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateAgentRequest. + * @implements IUpdateAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateAgentRequest=} [properties] Properties to set + */ + function UpdateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAgentRequest agent. + * @member {google.cloud.dialogflow.cx.v3.IAgent|null|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.agent = null; + + /** + * UpdateAgentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateAgentRequest} UpdateAgentRequest instance + */ + UpdateAgentRequest.create = function create(properties) { + return new UpdateAgentRequest(properties); + }; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.dialogflow.cx.v3.Agent.encode(message.agent, 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 UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = $root.google.cloud.dialogflow.cx.v3.Agent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.dialogflow.cx.v3.Agent.verify(message.agent, long + 1); + if (error) + return "agent." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateAgentRequest} UpdateAgentRequest + */ + UpdateAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateAgentRequest(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.dialogflow.cx.v3.Agent.fromObject(object.agent, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateAgentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateAgentRequest} message UpdateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agent = null; + object.updateMask = null; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.dialogflow.cx.v3.Agent.toObject(message.agent, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateAgentRequest"; + }; + + return UpdateAgentRequest; + })(); + + v3.DeleteAgentRequest = (function() { + + /** + * Properties of a DeleteAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteAgentRequest + * @property {string|null} [name] DeleteAgentRequest name + */ + + /** + * Constructs a new DeleteAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteAgentRequest. + * @implements IDeleteAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteAgentRequest=} [properties] Properties to set + */ + function DeleteAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.name = ""; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteAgentRequest} DeleteAgentRequest instance + */ + DeleteAgentRequest.create = function create(properties) { + return new DeleteAgentRequest(properties); + }; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.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 DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteAgentRequest} DeleteAgentRequest + */ + DeleteAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteAgentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteAgentRequest} message DeleteAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAgentRequest.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 DeleteAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteAgentRequest"; + }; + + return DeleteAgentRequest; + })(); + + v3.ExportAgentRequest = (function() { + + /** + * Properties of an ExportAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportAgentRequest + * @property {string|null} [name] ExportAgentRequest name + * @property {string|null} [agentUri] ExportAgentRequest agentUri + * @property {google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat|null} [dataFormat] ExportAgentRequest dataFormat + * @property {string|null} [environment] ExportAgentRequest environment + * @property {google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination|null} [gitDestination] ExportAgentRequest gitDestination + * @property {boolean|null} [includeBigqueryExportSettings] ExportAgentRequest includeBigqueryExportSettings + */ + + /** + * Constructs a new ExportAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportAgentRequest. + * @implements IExportAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportAgentRequest=} [properties] Properties to set + */ + function ExportAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.name = ""; + + /** + * ExportAgentRequest agentUri. + * @member {string} agentUri + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.agentUri = ""; + + /** + * ExportAgentRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.dataFormat = 0; + + /** + * ExportAgentRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.environment = ""; + + /** + * ExportAgentRequest gitDestination. + * @member {google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination|null|undefined} gitDestination + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.gitDestination = null; + + /** + * ExportAgentRequest includeBigqueryExportSettings. + * @member {boolean} includeBigqueryExportSettings + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.includeBigqueryExportSettings = false; + + /** + * Creates a new ExportAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest} ExportAgentRequest instance + */ + ExportAgentRequest.create = function create(properties) { + return new ExportAgentRequest(properties); + }; + + /** + * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentRequest.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.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.environment); + if (message.gitDestination != null && Object.hasOwnProperty.call(message, "gitDestination")) + $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.encode(message.gitDestination, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.includeBigqueryExportSettings != null && Object.hasOwnProperty.call(message, "includeBigqueryExportSettings")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.includeBigqueryExportSettings); + return writer; + }; + + /** + * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest} ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.agentUri = reader.string(); + break; + } + case 3: { + message.dataFormat = reader.int32(); + break; + } + case 5: { + message.environment = reader.string(); + break; + } + case 6: { + message.gitDestination = $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.includeBigqueryExportSettings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest} ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 4: + break; + } + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.gitDestination != null && message.hasOwnProperty("gitDestination")) { + var error = $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.verify(message.gitDestination, long + 1); + if (error) + return "gitDestination." + error; + } + if (message.includeBigqueryExportSettings != null && message.hasOwnProperty("includeBigqueryExportSettings")) + if (typeof message.includeBigqueryExportSettings !== "boolean") + return "includeBigqueryExportSettings: boolean expected"; + return null; + }; + + /** + * Creates an ExportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest} ExportAgentRequest + */ + ExportAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON_PACKAGE": + case 4: + message.dataFormat = 4; + break; + } + if (object.environment != null) + message.environment = String(object.environment); + if (object.gitDestination != null) { + if (typeof object.gitDestination !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ExportAgentRequest.gitDestination: object expected"); + message.gitDestination = $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.fromObject(object.gitDestination, long + 1); + } + if (object.includeBigqueryExportSettings != null) + message.includeBigqueryExportSettings = Boolean(object.includeBigqueryExportSettings); + return message; + }; + + /** + * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest} message ExportAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.agentUri = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.environment = ""; + object.gitDestination = null; + object.includeBigqueryExportSettings = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) + object.agentUri = message.agentUri; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat[message.dataFormat] : message.dataFormat; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.gitDestination != null && message.hasOwnProperty("gitDestination")) + object.gitDestination = $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.toObject(message.gitDestination, options); + if (message.includeBigqueryExportSettings != null && message.hasOwnProperty("includeBigqueryExportSettings")) + object.includeBigqueryExportSettings = message.includeBigqueryExportSettings; + return object; + }; + + /** + * Converts this ExportAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportAgentRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON_PACKAGE=4 JSON_PACKAGE value + */ + ExportAgentRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[4] = "JSON_PACKAGE"] = 4; + return values; + })(); + + ExportAgentRequest.GitDestination = (function() { + + /** + * Properties of a GitDestination. + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @interface IGitDestination + * @property {string|null} [trackingBranch] GitDestination trackingBranch + * @property {string|null} [commitMessage] GitDestination commitMessage + */ + + /** + * Constructs a new GitDestination. + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest + * @classdesc Represents a GitDestination. + * @implements IGitDestination + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination=} [properties] Properties to set + */ + function GitDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitDestination trackingBranch. + * @member {string} trackingBranch + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @instance + */ + GitDestination.prototype.trackingBranch = ""; + + /** + * GitDestination commitMessage. + * @member {string} commitMessage + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @instance + */ + GitDestination.prototype.commitMessage = ""; + + /** + * Creates a new GitDestination instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination} GitDestination instance + */ + GitDestination.create = function create(properties) { + return new GitDestination(properties); + }; + + /** + * Encodes the specified GitDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination} message GitDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackingBranch != null && Object.hasOwnProperty.call(message, "trackingBranch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackingBranch); + if (message.commitMessage != null && Object.hasOwnProperty.call(message, "commitMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commitMessage); + return writer; + }; + + /** + * Encodes the specified GitDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest.IGitDestination} message GitDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination} GitDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitDestination.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trackingBranch = reader.string(); + break; + } + case 2: { + message.commitMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GitDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination} GitDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitDestination message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitDestination.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + if (!$util.isString(message.trackingBranch)) + return "trackingBranch: string expected"; + if (message.commitMessage != null && message.hasOwnProperty("commitMessage")) + if (!$util.isString(message.commitMessage)) + return "commitMessage: string expected"; + return null; + }; + + /** + * Creates a GitDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination} GitDestination + */ + GitDestination.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination(); + if (object.trackingBranch != null) + message.trackingBranch = String(object.trackingBranch); + if (object.commitMessage != null) + message.commitMessage = String(object.commitMessage); + return message; + }; + + /** + * Creates a plain object from a GitDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination} message GitDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trackingBranch = ""; + object.commitMessage = ""; + } + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + object.trackingBranch = message.trackingBranch; + if (message.commitMessage != null && message.hasOwnProperty("commitMessage")) + object.commitMessage = message.commitMessage; + return object; + }; + + /** + * Converts this GitDestination to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @instance + * @returns {Object.} JSON object + */ + GitDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitDestination + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination"; + }; + + return GitDestination; + })(); + + return ExportAgentRequest; + })(); + + v3.ExportAgentResponse = (function() { + + /** + * Properties of an ExportAgentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportAgentResponse + * @property {string|null} [agentUri] ExportAgentResponse agentUri + * @property {Uint8Array|null} [agentContent] ExportAgentResponse agentContent + * @property {string|null} [commitSha] ExportAgentResponse commitSha + */ + + /** + * Constructs a new ExportAgentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportAgentResponse. + * @implements IExportAgentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportAgentResponse=} [properties] Properties to set + */ + function ExportAgentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAgentResponse agentUri. + * @member {string|null|undefined} agentUri + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.agentUri = null; + + /** + * ExportAgentResponse agentContent. + * @member {Uint8Array|null|undefined} agentContent + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.agentContent = null; + + /** + * ExportAgentResponse commitSha. + * @member {string|null|undefined} commitSha + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.commitSha = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportAgentResponse agent. + * @member {"agentUri"|"agentContent"|"commitSha"|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @instance + */ + Object.defineProperty(ExportAgentResponse.prototype, "agent", { + get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent", "commitSha"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportAgentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportAgentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentResponse} ExportAgentResponse instance + */ + ExportAgentResponse.create = function create(properties) { + return new ExportAgentResponse(properties); + }; + + /** + * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agentUri); + if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.agentContent); + if (message.commitSha != null && Object.hasOwnProperty.call(message, "commitSha")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.commitSha); + return writer; + }; + + /** + * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportAgentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentResponse} ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportAgentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agentUri = reader.string(); + break; + } + case 2: { + message.agentContent = reader.bytes(); + break; + } + case 3: { + message.commitSha = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentResponse} ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAgentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAgentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + properties.agent = 1; + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) + return "agentContent: buffer expected"; + } + if (message.commitSha != null && message.hasOwnProperty("commitSha")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!$util.isString(message.commitSha)) + return "commitSha: string expected"; + } + return null; + }; + + /** + * Creates an ExportAgentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportAgentResponse} ExportAgentResponse + */ + ExportAgentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportAgentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportAgentResponse(); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + if (object.agentContent != null) + if (typeof object.agentContent === "string") + $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); + else if (object.agentContent.length >= 0) + message.agentContent = object.agentContent; + if (object.commitSha != null) + message.commitSha = String(object.commitSha); + return message; + }; + + /** + * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportAgentResponse} message ExportAgentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAgentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + object.agentUri = message.agentUri; + if (options.oneofs) + object.agent = "agentUri"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; + if (options.oneofs) + object.agent = "agentContent"; + } + if (message.commitSha != null && message.hasOwnProperty("commitSha")) { + object.commitSha = message.commitSha; + if (options.oneofs) + object.agent = "commitSha"; + } + return object; + }; + + /** + * Converts this ExportAgentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAgentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAgentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportAgentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAgentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportAgentResponse"; + }; + + return ExportAgentResponse; + })(); + + v3.RestoreAgentRequest = (function() { + + /** + * Properties of a RestoreAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRestoreAgentRequest + * @property {string|null} [name] RestoreAgentRequest name + * @property {string|null} [agentUri] RestoreAgentRequest agentUri + * @property {Uint8Array|null} [agentContent] RestoreAgentRequest agentContent + * @property {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource|null} [gitSource] RestoreAgentRequest gitSource + * @property {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption|null} [restoreOption] RestoreAgentRequest restoreOption + */ + + /** + * Constructs a new RestoreAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RestoreAgentRequest. + * @implements IRestoreAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRestoreAgentRequest=} [properties] Properties to set + */ + function RestoreAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.name = ""; + + /** + * RestoreAgentRequest agentUri. + * @member {string|null|undefined} agentUri + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.agentUri = null; + + /** + * RestoreAgentRequest agentContent. + * @member {Uint8Array|null|undefined} agentContent + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.agentContent = null; + + /** + * RestoreAgentRequest gitSource. + * @member {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource|null|undefined} gitSource + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.gitSource = null; + + /** + * RestoreAgentRequest restoreOption. + * @member {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption} restoreOption + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.restoreOption = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreAgentRequest agent. + * @member {"agentUri"|"agentContent"|"gitSource"|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @instance + */ + Object.defineProperty(RestoreAgentRequest.prototype, "agent", { + get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent", "gitSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest} RestoreAgentRequest instance + */ + RestoreAgentRequest.create = function create(properties) { + return new RestoreAgentRequest(properties); + }; + + /** + * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAgentRequest.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.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.agentContent); + if (message.restoreOption != null && Object.hasOwnProperty.call(message, "restoreOption")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.restoreOption); + if (message.gitSource != null && Object.hasOwnProperty.call(message, "gitSource")) + $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.encode(message.gitSource, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest} RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.agentUri = reader.string(); + break; + } + case 3: { + message.agentContent = reader.bytes(); + break; + } + case 6: { + message.gitSource = $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.restoreOption = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest} RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + properties.agent = 1; + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) + return "agentContent: buffer expected"; + } + if (message.gitSource != null && message.hasOwnProperty("gitSource")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.verify(message.gitSource, long + 1); + if (error) + return "gitSource." + error; + } + } + if (message.restoreOption != null && message.hasOwnProperty("restoreOption")) + switch (message.restoreOption) { + default: + return "restoreOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest} RestoreAgentRequest + */ + RestoreAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + if (object.agentContent != null) + if (typeof object.agentContent === "string") + $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); + else if (object.agentContent.length >= 0) + message.agentContent = object.agentContent; + if (object.gitSource != null) { + if (typeof object.gitSource !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RestoreAgentRequest.gitSource: object expected"); + message.gitSource = $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.fromObject(object.gitSource, long + 1); + } + switch (object.restoreOption) { + default: + if (typeof object.restoreOption === "number") { + message.restoreOption = object.restoreOption; + break; + } + break; + case "RESTORE_OPTION_UNSPECIFIED": + case 0: + message.restoreOption = 0; + break; + case "KEEP": + case 1: + message.restoreOption = 1; + break; + case "FALLBACK": + case 2: + message.restoreOption = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest} message RestoreAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.restoreOption = options.enums === String ? "RESTORE_OPTION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + object.agentUri = message.agentUri; + if (options.oneofs) + object.agent = "agentUri"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; + if (options.oneofs) + object.agent = "agentContent"; + } + if (message.restoreOption != null && message.hasOwnProperty("restoreOption")) + object.restoreOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption[message.restoreOption] === undefined ? message.restoreOption : $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption[message.restoreOption] : message.restoreOption; + if (message.gitSource != null && message.hasOwnProperty("gitSource")) { + object.gitSource = $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.toObject(message.gitSource, options); + if (options.oneofs) + object.agent = "gitSource"; + } + return object; + }; + + /** + * Converts this RestoreAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RestoreAgentRequest"; + }; + + RestoreAgentRequest.GitSource = (function() { + + /** + * Properties of a GitSource. + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @interface IGitSource + * @property {string|null} [trackingBranch] GitSource trackingBranch + */ + + /** + * Constructs a new GitSource. + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest + * @classdesc Represents a GitSource. + * @implements IGitSource + * @constructor + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource=} [properties] Properties to set + */ + function GitSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitSource trackingBranch. + * @member {string} trackingBranch + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @instance + */ + GitSource.prototype.trackingBranch = ""; + + /** + * Creates a new GitSource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource} GitSource instance + */ + GitSource.create = function create(properties) { + return new GitSource(properties); + }; + + /** + * Encodes the specified GitSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource} message GitSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackingBranch != null && Object.hasOwnProperty.call(message, "trackingBranch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackingBranch); + return writer; + }; + + /** + * Encodes the specified GitSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.IGitSource} message GitSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource} GitSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitSource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trackingBranch = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GitSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource} GitSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitSource message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitSource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + if (!$util.isString(message.trackingBranch)) + return "trackingBranch: string expected"; + return null; + }; + + /** + * Creates a GitSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource} GitSource + */ + GitSource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource(); + if (object.trackingBranch != null) + message.trackingBranch = String(object.trackingBranch); + return message; + }; + + /** + * Creates a plain object from a GitSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource} message GitSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.trackingBranch = ""; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + object.trackingBranch = message.trackingBranch; + return object; + }; + + /** + * Converts this GitSource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @instance + * @returns {Object.} JSON object + */ + GitSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitSource + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource"; + }; + + return GitSource; + })(); + + /** + * RestoreOption enum. + * @name google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption + * @enum {number} + * @property {number} RESTORE_OPTION_UNSPECIFIED=0 RESTORE_OPTION_UNSPECIFIED value + * @property {number} KEEP=1 KEEP value + * @property {number} FALLBACK=2 FALLBACK value + */ + RestoreAgentRequest.RestoreOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTORE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEEP"] = 1; + values[valuesById[2] = "FALLBACK"] = 2; + return values; + })(); + + return RestoreAgentRequest; + })(); + + v3.ValidateAgentRequest = (function() { + + /** + * Properties of a ValidateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IValidateAgentRequest + * @property {string|null} [name] ValidateAgentRequest name + * @property {string|null} [languageCode] ValidateAgentRequest languageCode + */ + + /** + * Constructs a new ValidateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ValidateAgentRequest. + * @implements IValidateAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IValidateAgentRequest=} [properties] Properties to set + */ + function ValidateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @instance + */ + ValidateAgentRequest.prototype.name = ""; + + /** + * ValidateAgentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @instance + */ + ValidateAgentRequest.prototype.languageCode = ""; + + /** + * Creates a new ValidateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ValidateAgentRequest} ValidateAgentRequest instance + */ + ValidateAgentRequest.create = function create(properties) { + return new ValidateAgentRequest(properties); + }; + + /** + * Encodes the specified ValidateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidateAgentRequest} message ValidateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateAgentRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ValidateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidateAgentRequest} message ValidateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ValidateAgentRequest} ValidateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ValidateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ValidateAgentRequest} ValidateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ValidateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ValidateAgentRequest} ValidateAgentRequest + */ + ValidateAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ValidateAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ValidateAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ValidateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ValidateAgentRequest} message ValidateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ValidateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ValidateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ValidateAgentRequest"; + }; + + return ValidateAgentRequest; + })(); + + v3.GetAgentValidationResultRequest = (function() { + + /** + * Properties of a GetAgentValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetAgentValidationResultRequest + * @property {string|null} [name] GetAgentValidationResultRequest name + * @property {string|null} [languageCode] GetAgentValidationResultRequest languageCode + */ + + /** + * Constructs a new GetAgentValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetAgentValidationResultRequest. + * @implements IGetAgentValidationResultRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest=} [properties] Properties to set + */ + function GetAgentValidationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentValidationResultRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @instance + */ + GetAgentValidationResultRequest.prototype.name = ""; + + /** + * GetAgentValidationResultRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @instance + */ + GetAgentValidationResultRequest.prototype.languageCode = ""; + + /** + * Creates a new GetAgentValidationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest} GetAgentValidationResultRequest instance + */ + GetAgentValidationResultRequest.create = function create(properties) { + return new GetAgentValidationResultRequest(properties); + }; + + /** + * Encodes the specified GetAgentValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest} message GetAgentValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentValidationResultRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetAgentValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest} message GetAgentValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentValidationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest} GetAgentValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentValidationResultRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest} GetAgentValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentValidationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentValidationResultRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentValidationResultRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetAgentValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest} GetAgentValidationResultRequest + */ + GetAgentValidationResultRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetAgentValidationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest} message GetAgentValidationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentValidationResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetAgentValidationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentValidationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentValidationResultRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentValidationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest"; + }; + + return GetAgentValidationResultRequest; + })(); + + v3.AgentValidationResult = (function() { + + /** + * Properties of an AgentValidationResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IAgentValidationResult + * @property {string|null} [name] AgentValidationResult name + * @property {Array.|null} [flowValidationResults] AgentValidationResult flowValidationResults + */ + + /** + * Constructs a new AgentValidationResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an AgentValidationResult. + * @implements IAgentValidationResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IAgentValidationResult=} [properties] Properties to set + */ + function AgentValidationResult(properties) { + this.flowValidationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentValidationResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @instance + */ + AgentValidationResult.prototype.name = ""; + + /** + * AgentValidationResult flowValidationResults. + * @member {Array.} flowValidationResults + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @instance + */ + AgentValidationResult.prototype.flowValidationResults = $util.emptyArray; + + /** + * Creates a new AgentValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgentValidationResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AgentValidationResult} AgentValidationResult instance + */ + AgentValidationResult.create = function create(properties) { + return new AgentValidationResult(properties); + }; + + /** + * Encodes the specified AgentValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgentValidationResult} message AgentValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentValidationResult.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.flowValidationResults != null && message.flowValidationResults.length) + for (var i = 0; i < message.flowValidationResults.length; ++i) + $root.google.cloud.dialogflow.cx.v3.FlowValidationResult.encode(message.flowValidationResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AgentValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgentValidationResult} message AgentValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AgentValidationResult} AgentValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentValidationResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AgentValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.flowValidationResults && message.flowValidationResults.length)) + message.flowValidationResults = []; + message.flowValidationResults.push($root.google.cloud.dialogflow.cx.v3.FlowValidationResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AgentValidationResult} AgentValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentValidationResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentValidationResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flowValidationResults != null && message.hasOwnProperty("flowValidationResults")) { + if (!Array.isArray(message.flowValidationResults)) + return "flowValidationResults: array expected"; + for (var i = 0; i < message.flowValidationResults.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.FlowValidationResult.verify(message.flowValidationResults[i], long + 1); + if (error) + return "flowValidationResults." + error; + } + } + return null; + }; + + /** + * Creates an AgentValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AgentValidationResult} AgentValidationResult + */ + AgentValidationResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AgentValidationResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AgentValidationResult(); + if (object.name != null) + message.name = String(object.name); + if (object.flowValidationResults) { + if (!Array.isArray(object.flowValidationResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3.AgentValidationResult.flowValidationResults: array expected"); + message.flowValidationResults = []; + for (var i = 0; i < object.flowValidationResults.length; ++i) { + if (typeof object.flowValidationResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AgentValidationResult.flowValidationResults: object expected"); + message.flowValidationResults[i] = $root.google.cloud.dialogflow.cx.v3.FlowValidationResult.fromObject(object.flowValidationResults[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an AgentValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.AgentValidationResult} message AgentValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.flowValidationResults = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flowValidationResults && message.flowValidationResults.length) { + object.flowValidationResults = []; + for (var j = 0; j < message.flowValidationResults.length; ++j) + object.flowValidationResults[j] = $root.google.cloud.dialogflow.cx.v3.FlowValidationResult.toObject(message.flowValidationResults[j], options); + } + return object; + }; + + /** + * Converts this AgentValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @instance + * @returns {Object.} JSON object + */ + AgentValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentValidationResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AgentValidationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AgentValidationResult"; + }; + + return AgentValidationResult; + })(); + + v3.GetGenerativeSettingsRequest = (function() { + + /** + * Properties of a GetGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetGenerativeSettingsRequest + * @property {string|null} [name] GetGenerativeSettingsRequest name + * @property {string|null} [languageCode] GetGenerativeSettingsRequest languageCode + */ + + /** + * Constructs a new GetGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetGenerativeSettingsRequest. + * @implements IGetGenerativeSettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest=} [properties] Properties to set + */ + function GetGenerativeSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGenerativeSettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @instance + */ + GetGenerativeSettingsRequest.prototype.name = ""; + + /** + * GetGenerativeSettingsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @instance + */ + GetGenerativeSettingsRequest.prototype.languageCode = ""; + + /** + * Creates a new GetGenerativeSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest instance + */ + GetGenerativeSettingsRequest.create = function create(properties) { + return new GetGenerativeSettingsRequest(properties); + }; + + /** + * Encodes the specified GetGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest} message GetGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGenerativeSettingsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest} message GetGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGenerativeSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGenerativeSettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGenerativeSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGenerativeSettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGenerativeSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest + */ + GetGenerativeSettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetGenerativeSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest} message GetGenerativeSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGenerativeSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetGenerativeSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetGenerativeSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGenerativeSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGenerativeSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest"; + }; + + return GetGenerativeSettingsRequest; + })(); + + v3.UpdateGenerativeSettingsRequest = (function() { + + /** + * Properties of an UpdateGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateGenerativeSettingsRequest + * @property {google.cloud.dialogflow.cx.v3.IGenerativeSettings|null} [generativeSettings] UpdateGenerativeSettingsRequest generativeSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGenerativeSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateGenerativeSettingsRequest. + * @implements IUpdateGenerativeSettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest=} [properties] Properties to set + */ + function UpdateGenerativeSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGenerativeSettingsRequest generativeSettings. + * @member {google.cloud.dialogflow.cx.v3.IGenerativeSettings|null|undefined} generativeSettings + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @instance + */ + UpdateGenerativeSettingsRequest.prototype.generativeSettings = null; + + /** + * UpdateGenerativeSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @instance + */ + UpdateGenerativeSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGenerativeSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest instance + */ + UpdateGenerativeSettingsRequest.create = function create(properties) { + return new UpdateGenerativeSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest} message UpdateGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGenerativeSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generativeSettings != null && Object.hasOwnProperty.call(message, "generativeSettings")) + $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.encode(message.generativeSettings, 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 UpdateGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest} message UpdateGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGenerativeSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGenerativeSettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generativeSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGenerativeSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGenerativeSettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGenerativeSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generativeSettings != null && message.hasOwnProperty("generativeSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.verify(message.generativeSettings, long + 1); + if (error) + return "generativeSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest + */ + UpdateGenerativeSettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest(); + if (object.generativeSettings != null) { + if (typeof object.generativeSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest.generativeSettings: object expected"); + message.generativeSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.fromObject(object.generativeSettings, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGenerativeSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest} message UpdateGenerativeSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGenerativeSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.generativeSettings = null; + object.updateMask = null; + } + if (message.generativeSettings != null && message.hasOwnProperty("generativeSettings")) + object.generativeSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.toObject(message.generativeSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGenerativeSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGenerativeSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGenerativeSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGenerativeSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest"; + }; + + return UpdateGenerativeSettingsRequest; + })(); + + /** + * AudioEncoding enum. + * @name google.cloud.dialogflow.cx.v3.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value + * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value + * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value + * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value + * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value + * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value + * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value + * @property {number} AUDIO_ENCODING_ALAW=8 AUDIO_ENCODING_ALAW value + */ + v3.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; + values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; + values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; + values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; + values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; + values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; + values[valuesById[8] = "AUDIO_ENCODING_ALAW"] = 8; + return values; + })(); + + /** + * SpeechModelVariant enum. + * @name google.cloud.dialogflow.cx.v3.SpeechModelVariant + * @enum {number} + * @property {number} SPEECH_MODEL_VARIANT_UNSPECIFIED=0 SPEECH_MODEL_VARIANT_UNSPECIFIED value + * @property {number} USE_BEST_AVAILABLE=1 USE_BEST_AVAILABLE value + * @property {number} USE_STANDARD=2 USE_STANDARD value + * @property {number} USE_ENHANCED=3 USE_ENHANCED value + */ + v3.SpeechModelVariant = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_MODEL_VARIANT_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_BEST_AVAILABLE"] = 1; + values[valuesById[2] = "USE_STANDARD"] = 2; + values[valuesById[3] = "USE_ENHANCED"] = 3; + return values; + })(); + + v3.SpeechWordInfo = (function() { + + /** + * Properties of a SpeechWordInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISpeechWordInfo + * @property {string|null} [word] SpeechWordInfo word + * @property {google.protobuf.IDuration|null} [startOffset] SpeechWordInfo startOffset + * @property {google.protobuf.IDuration|null} [endOffset] SpeechWordInfo endOffset + * @property {number|null} [confidence] SpeechWordInfo confidence + */ + + /** + * Constructs a new SpeechWordInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SpeechWordInfo. + * @implements ISpeechWordInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISpeechWordInfo=} [properties] Properties to set + */ + function SpeechWordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechWordInfo word. + * @member {string} word + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.word = ""; + + /** + * SpeechWordInfo startOffset. + * @member {google.protobuf.IDuration|null|undefined} startOffset + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.startOffset = null; + + /** + * SpeechWordInfo endOffset. + * @member {google.protobuf.IDuration|null|undefined} endOffset + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.endOffset = null; + + /** + * SpeechWordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.confidence = 0; + + /** + * Creates a new SpeechWordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechWordInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SpeechWordInfo} SpeechWordInfo instance + */ + SpeechWordInfo.create = function create(properties) { + return new SpeechWordInfo(properties); + }; + + /** + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechWordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechWordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechWordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechWordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SpeechWordInfo} SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechWordInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SpeechWordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.word = reader.string(); + break; + } + case 1: { + message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SpeechWordInfo} SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechWordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechWordInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechWordInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startOffset, long + 1); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endOffset, long + 1); + if (error) + return "endOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SpeechWordInfo} SpeechWordInfo + */ + SpeechWordInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SpeechWordInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SpeechWordInfo(); + if (object.word != null) + message.word = String(object.word); + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SpeechWordInfo.startOffset: object expected"); + message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset, long + 1); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SpeechWordInfo.endOffset: object expected"); + message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset, long + 1); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.SpeechWordInfo} message SpeechWordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechWordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startOffset = null; + object.endOffset = null; + object.word = ""; + object.confidence = 0; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this SpeechWordInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @instance + * @returns {Object.} JSON object + */ + SpeechWordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechWordInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SpeechWordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechWordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SpeechWordInfo"; + }; + + return SpeechWordInfo; + })(); + + v3.BargeInConfig = (function() { + + /** + * Properties of a BargeInConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IBargeInConfig + * @property {google.protobuf.IDuration|null} [noBargeInDuration] BargeInConfig noBargeInDuration + * @property {google.protobuf.IDuration|null} [totalDuration] BargeInConfig totalDuration + */ + + /** + * Constructs a new BargeInConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a BargeInConfig. + * @implements IBargeInConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IBargeInConfig=} [properties] Properties to set + */ + function BargeInConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BargeInConfig noBargeInDuration. + * @member {google.protobuf.IDuration|null|undefined} noBargeInDuration + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @instance + */ + BargeInConfig.prototype.noBargeInDuration = null; + + /** + * BargeInConfig totalDuration. + * @member {google.protobuf.IDuration|null|undefined} totalDuration + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @instance + */ + BargeInConfig.prototype.totalDuration = null; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IBargeInConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BargeInConfig} BargeInConfig instance + */ + BargeInConfig.create = function create(properties) { + return new BargeInConfig(properties); + }; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BargeInConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.noBargeInDuration != null && Object.hasOwnProperty.call(message, "noBargeInDuration")) + $root.google.protobuf.Duration.encode(message.noBargeInDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.totalDuration != null && Object.hasOwnProperty.call(message, "totalDuration")) + $root.google.protobuf.Duration.encode(message.totalDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BargeInConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BargeInConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.noBargeInDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.totalDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BargeInConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BargeInConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.noBargeInDuration != null && message.hasOwnProperty("noBargeInDuration")) { + var error = $root.google.protobuf.Duration.verify(message.noBargeInDuration, long + 1); + if (error) + return "noBargeInDuration." + error; + } + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) { + var error = $root.google.protobuf.Duration.verify(message.totalDuration, long + 1); + if (error) + return "totalDuration." + error; + } + return null; + }; + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BargeInConfig} BargeInConfig + */ + BargeInConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BargeInConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BargeInConfig(); + if (object.noBargeInDuration != null) { + if (typeof object.noBargeInDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BargeInConfig.noBargeInDuration: object expected"); + message.noBargeInDuration = $root.google.protobuf.Duration.fromObject(object.noBargeInDuration, long + 1); + } + if (object.totalDuration != null) { + if (typeof object.totalDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BargeInConfig.totalDuration: object expected"); + message.totalDuration = $root.google.protobuf.Duration.fromObject(object.totalDuration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.BargeInConfig} message BargeInConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BargeInConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.noBargeInDuration = null; + object.totalDuration = null; + } + if (message.noBargeInDuration != null && message.hasOwnProperty("noBargeInDuration")) + object.noBargeInDuration = $root.google.protobuf.Duration.toObject(message.noBargeInDuration, options); + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) + object.totalDuration = $root.google.protobuf.Duration.toObject(message.totalDuration, options); + return object; + }; + + /** + * Converts this BargeInConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @instance + * @returns {Object.} JSON object + */ + BargeInConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BargeInConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BargeInConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BargeInConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BargeInConfig"; + }; + + return BargeInConfig; + })(); + + v3.InputAudioConfig = (function() { + + /** + * Properties of an InputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IInputAudioConfig + * @property {google.cloud.dialogflow.cx.v3.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz + * @property {boolean|null} [enableWordInfo] InputAudioConfig enableWordInfo + * @property {Array.|null} [phraseHints] InputAudioConfig phraseHints + * @property {string|null} [model] InputAudioConfig model + * @property {google.cloud.dialogflow.cx.v3.SpeechModelVariant|null} [modelVariant] InputAudioConfig modelVariant + * @property {boolean|null} [singleUtterance] InputAudioConfig singleUtterance + * @property {google.cloud.dialogflow.cx.v3.IBargeInConfig|null} [bargeInConfig] InputAudioConfig bargeInConfig + * @property {boolean|null} [optOutConformerModelMigration] InputAudioConfig optOutConformerModelMigration + */ + + /** + * Constructs a new InputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an InputAudioConfig. + * @implements IInputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IInputAudioConfig=} [properties] Properties to set + */ + function InputAudioConfig(properties) { + this.phraseHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.cx.v3.AudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.audioEncoding = 0; + + /** + * InputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * InputAudioConfig enableWordInfo. + * @member {boolean} enableWordInfo + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.enableWordInfo = false; + + /** + * InputAudioConfig phraseHints. + * @member {Array.} phraseHints + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.phraseHints = $util.emptyArray; + + /** + * InputAudioConfig model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.model = ""; + + /** + * InputAudioConfig modelVariant. + * @member {google.cloud.dialogflow.cx.v3.SpeechModelVariant} modelVariant + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.modelVariant = 0; + + /** + * InputAudioConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.singleUtterance = false; + + /** + * InputAudioConfig bargeInConfig. + * @member {google.cloud.dialogflow.cx.v3.IBargeInConfig|null|undefined} bargeInConfig + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.bargeInConfig = null; + + /** + * InputAudioConfig optOutConformerModelMigration. + * @member {boolean} optOutConformerModelMigration + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.optOutConformerModelMigration = false; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IInputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.InputAudioConfig} InputAudioConfig instance + */ + InputAudioConfig.create = function create(properties) { + return new InputAudioConfig(properties); + }; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.phraseHints != null && message.phraseHints.length) + for (var i = 0; i < message.phraseHints.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.phraseHints[i]); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.model); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.singleUtterance); + if (message.modelVariant != null && Object.hasOwnProperty.call(message, "modelVariant")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.modelVariant); + if (message.enableWordInfo != null && Object.hasOwnProperty.call(message, "enableWordInfo")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.enableWordInfo); + if (message.bargeInConfig != null && Object.hasOwnProperty.call(message, "bargeInConfig")) + $root.google.cloud.dialogflow.cx.v3.BargeInConfig.encode(message.bargeInConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.optOutConformerModelMigration != null && Object.hasOwnProperty.call(message, "optOutConformerModelMigration")) + writer.uint32(/* id 26, wireType 0 =*/208).bool(message.optOutConformerModelMigration); + return writer; + }; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.InputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 13: { + message.enableWordInfo = reader.bool(); + break; + } + case 4: { + if (!(message.phraseHints && message.phraseHints.length)) + message.phraseHints = []; + message.phraseHints.push(reader.string()); + break; + } + case 7: { + message.model = reader.string(); + break; + } + case 10: { + message.modelVariant = reader.int32(); + break; + } + case 8: { + message.singleUtterance = reader.bool(); + break; + } + case 15: { + message.bargeInConfig = $root.google.cloud.dialogflow.cx.v3.BargeInConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.optOutConformerModelMigration = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAudioConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAudioConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + if (typeof message.enableWordInfo !== "boolean") + return "enableWordInfo: boolean expected"; + if (message.phraseHints != null && message.hasOwnProperty("phraseHints")) { + if (!Array.isArray(message.phraseHints)) + return "phraseHints: array expected"; + for (var i = 0; i < message.phraseHints.length; ++i) + if (!$util.isString(message.phraseHints[i])) + return "phraseHints: string[] expected"; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + switch (message.modelVariant) { + default: + return "modelVariant: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.BargeInConfig.verify(message.bargeInConfig, long + 1); + if (error) + return "bargeInConfig." + error; + } + if (message.optOutConformerModelMigration != null && message.hasOwnProperty("optOutConformerModelMigration")) + if (typeof message.optOutConformerModelMigration !== "boolean") + return "optOutConformerModelMigration: boolean expected"; + return null; + }; + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.InputAudioConfig} InputAudioConfig + */ + InputAudioConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.InputAudioConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.InputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "AUDIO_ENCODING_LINEAR_16": + case 1: + message.audioEncoding = 1; + break; + case "AUDIO_ENCODING_FLAC": + case 2: + message.audioEncoding = 2; + break; + case "AUDIO_ENCODING_MULAW": + case 3: + message.audioEncoding = 3; + break; + case "AUDIO_ENCODING_AMR": + case 4: + message.audioEncoding = 4; + break; + case "AUDIO_ENCODING_AMR_WB": + case 5: + message.audioEncoding = 5; + break; + case "AUDIO_ENCODING_OGG_OPUS": + case 6: + message.audioEncoding = 6; + break; + case "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": + case 7: + message.audioEncoding = 7; + break; + case "AUDIO_ENCODING_ALAW": + case 8: + message.audioEncoding = 8; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.enableWordInfo != null) + message.enableWordInfo = Boolean(object.enableWordInfo); + if (object.phraseHints) { + if (!Array.isArray(object.phraseHints)) + throw TypeError(".google.cloud.dialogflow.cx.v3.InputAudioConfig.phraseHints: array expected"); + message.phraseHints = []; + for (var i = 0; i < object.phraseHints.length; ++i) + message.phraseHints[i] = String(object.phraseHints[i]); + } + if (object.model != null) + message.model = String(object.model); + switch (object.modelVariant) { + default: + if (typeof object.modelVariant === "number") { + message.modelVariant = object.modelVariant; + break; + } + break; + case "SPEECH_MODEL_VARIANT_UNSPECIFIED": + case 0: + message.modelVariant = 0; + break; + case "USE_BEST_AVAILABLE": + case 1: + message.modelVariant = 1; + break; + case "USE_STANDARD": + case 2: + message.modelVariant = 2; + break; + case "USE_ENHANCED": + case 3: + message.modelVariant = 3; + break; + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.bargeInConfig != null) { + if (typeof object.bargeInConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.InputAudioConfig.bargeInConfig: object expected"); + message.bargeInConfig = $root.google.cloud.dialogflow.cx.v3.BargeInConfig.fromObject(object.bargeInConfig, long + 1); + } + if (object.optOutConformerModelMigration != null) + message.optOutConformerModelMigration = Boolean(object.optOutConformerModelMigration); + return message; + }; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.InputAudioConfig} message InputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phraseHints = []; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.model = ""; + object.singleUtterance = false; + object.modelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; + object.enableWordInfo = false; + object.bargeInConfig = null; + object.optOutConformerModelMigration = false; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.dialogflow.cx.v3.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.phraseHints && message.phraseHints.length) { + object.phraseHints = []; + for (var j = 0; j < message.phraseHints.length; ++j) + object.phraseHints[j] = message.phraseHints[j]; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + object.modelVariant = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SpeechModelVariant[message.modelVariant] === undefined ? message.modelVariant : $root.google.cloud.dialogflow.cx.v3.SpeechModelVariant[message.modelVariant] : message.modelVariant; + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + object.enableWordInfo = message.enableWordInfo; + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) + object.bargeInConfig = $root.google.cloud.dialogflow.cx.v3.BargeInConfig.toObject(message.bargeInConfig, options); + if (message.optOutConformerModelMigration != null && message.hasOwnProperty("optOutConformerModelMigration")) + object.optOutConformerModelMigration = message.optOutConformerModelMigration; + return object; + }; + + /** + * Converts this InputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + InputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.InputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.InputAudioConfig"; + }; + + return InputAudioConfig; + })(); + + /** + * SsmlVoiceGender enum. + * @name google.cloud.dialogflow.cx.v3.SsmlVoiceGender + * @enum {number} + * @property {number} SSML_VOICE_GENDER_UNSPECIFIED=0 SSML_VOICE_GENDER_UNSPECIFIED value + * @property {number} SSML_VOICE_GENDER_MALE=1 SSML_VOICE_GENDER_MALE value + * @property {number} SSML_VOICE_GENDER_FEMALE=2 SSML_VOICE_GENDER_FEMALE value + * @property {number} SSML_VOICE_GENDER_NEUTRAL=3 SSML_VOICE_GENDER_NEUTRAL value + */ + v3.SsmlVoiceGender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSML_VOICE_GENDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSML_VOICE_GENDER_MALE"] = 1; + values[valuesById[2] = "SSML_VOICE_GENDER_FEMALE"] = 2; + values[valuesById[3] = "SSML_VOICE_GENDER_NEUTRAL"] = 3; + return values; + })(); + + v3.VoiceSelectionParams = (function() { + + /** + * Properties of a VoiceSelectionParams. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IVoiceSelectionParams + * @property {string|null} [name] VoiceSelectionParams name + * @property {google.cloud.dialogflow.cx.v3.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender + */ + + /** + * Constructs a new VoiceSelectionParams. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a VoiceSelectionParams. + * @implements IVoiceSelectionParams + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IVoiceSelectionParams=} [properties] Properties to set + */ + function VoiceSelectionParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceSelectionParams name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.name = ""; + + /** + * VoiceSelectionParams ssmlGender. + * @member {google.cloud.dialogflow.cx.v3.SsmlVoiceGender} ssmlGender + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.ssmlGender = 0; + + /** + * Creates a new VoiceSelectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3.IVoiceSelectionParams=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.VoiceSelectionParams} VoiceSelectionParams instance + */ + VoiceSelectionParams.create = function create(properties) { + return new VoiceSelectionParams(properties); + }; + + /** + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VoiceSelectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.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.ssmlGender != null && Object.hasOwnProperty.call(message, "ssmlGender")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ssmlGender); + return writer; + }; + + /** + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VoiceSelectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ssmlGender = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceSelectionParams message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceSelectionParams.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + switch (message.ssmlGender) { + default: + return "ssmlGender: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.VoiceSelectionParams} VoiceSelectionParams + */ + VoiceSelectionParams.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams(); + if (object.name != null) + message.name = String(object.name); + switch (object.ssmlGender) { + default: + if (typeof object.ssmlGender === "number") { + message.ssmlGender = object.ssmlGender; + break; + } + break; + case "SSML_VOICE_GENDER_UNSPECIFIED": + case 0: + message.ssmlGender = 0; + break; + case "SSML_VOICE_GENDER_MALE": + case 1: + message.ssmlGender = 1; + break; + case "SSML_VOICE_GENDER_FEMALE": + case 2: + message.ssmlGender = 2; + break; + case "SSML_VOICE_GENDER_NEUTRAL": + case 3: + message.ssmlGender = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3.VoiceSelectionParams} message VoiceSelectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceSelectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + object.ssmlGender = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SsmlVoiceGender[message.ssmlGender] === undefined ? message.ssmlGender : $root.google.cloud.dialogflow.cx.v3.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; + return object; + }; + + /** + * Converts this VoiceSelectionParams to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @instance + * @returns {Object.} JSON object + */ + VoiceSelectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceSelectionParams + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.VoiceSelectionParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceSelectionParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.VoiceSelectionParams"; + }; + + return VoiceSelectionParams; + })(); + + v3.SynthesizeSpeechConfig = (function() { + + /** + * Properties of a SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISynthesizeSpeechConfig + * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate + * @property {number|null} [pitch] SynthesizeSpeechConfig pitch + * @property {number|null} [volumeGainDb] SynthesizeSpeechConfig volumeGainDb + * @property {Array.|null} [effectsProfileId] SynthesizeSpeechConfig effectsProfileId + * @property {google.cloud.dialogflow.cx.v3.IVoiceSelectionParams|null} [voice] SynthesizeSpeechConfig voice + */ + + /** + * Constructs a new SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SynthesizeSpeechConfig. + * @implements ISynthesizeSpeechConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig=} [properties] Properties to set + */ + function SynthesizeSpeechConfig(properties) { + this.effectsProfileId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SynthesizeSpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.speakingRate = 0; + + /** + * SynthesizeSpeechConfig pitch. + * @member {number} pitch + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.pitch = 0; + + /** + * SynthesizeSpeechConfig volumeGainDb. + * @member {number} volumeGainDb + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.volumeGainDb = 0; + + /** + * SynthesizeSpeechConfig effectsProfileId. + * @member {Array.} effectsProfileId + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.effectsProfileId = $util.emptyArray; + + /** + * SynthesizeSpeechConfig voice. + * @member {google.cloud.dialogflow.cx.v3.IVoiceSelectionParams|null|undefined} voice + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.voice = null; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + */ + SynthesizeSpeechConfig.create = function create(properties) { + return new SynthesizeSpeechConfig(properties); + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); + if (message.pitch != null && Object.hasOwnProperty.call(message, "pitch")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.pitch); + if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams.encode(message.voice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.effectsProfileId != null && message.effectsProfileId.length) + for (var i = 0; i < message.effectsProfileId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.effectsProfileId[i]); + return writer; + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speakingRate = reader.double(); + break; + } + case 2: { + message.pitch = reader.double(); + break; + } + case 3: { + message.volumeGainDb = reader.double(); + break; + } + case 5: { + if (!(message.effectsProfileId && message.effectsProfileId.length)) + message.effectsProfileId = []; + message.effectsProfileId.push(reader.string()); + break; + } + case 4: { + message.voice = $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynthesizeSpeechConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + if (message.pitch != null && message.hasOwnProperty("pitch")) + if (typeof message.pitch !== "number") + return "pitch: number expected"; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + if (typeof message.volumeGainDb !== "number") + return "volumeGainDb: number expected"; + if (message.effectsProfileId != null && message.hasOwnProperty("effectsProfileId")) { + if (!Array.isArray(message.effectsProfileId)) + return "effectsProfileId: array expected"; + for (var i = 0; i < message.effectsProfileId.length; ++i) + if (!$util.isString(message.effectsProfileId[i])) + return "effectsProfileId: string[] expected"; + } + if (message.voice != null && message.hasOwnProperty("voice")) { + var error = $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams.verify(message.voice, long + 1); + if (error) + return "voice." + error; + } + return null; + }; + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig} SynthesizeSpeechConfig + */ + SynthesizeSpeechConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig(); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + if (object.pitch != null) + message.pitch = Number(object.pitch); + if (object.volumeGainDb != null) + message.volumeGainDb = Number(object.volumeGainDb); + if (object.effectsProfileId) { + if (!Array.isArray(object.effectsProfileId)) + throw TypeError(".google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.effectsProfileId: array expected"); + message.effectsProfileId = []; + for (var i = 0; i < object.effectsProfileId.length; ++i) + message.effectsProfileId[i] = String(object.effectsProfileId[i]); + } + if (object.voice != null) { + if (typeof object.voice !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.voice: object expected"); + message.voice = $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams.fromObject(object.voice, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynthesizeSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.effectsProfileId = []; + if (options.defaults) { + object.speakingRate = 0; + object.pitch = 0; + object.volumeGainDb = 0; + object.voice = null; + } + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + if (message.pitch != null && message.hasOwnProperty("pitch")) + object.pitch = options.json && !isFinite(message.pitch) ? String(message.pitch) : message.pitch; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = $root.google.cloud.dialogflow.cx.v3.VoiceSelectionParams.toObject(message.voice, options); + if (message.effectsProfileId && message.effectsProfileId.length) { + object.effectsProfileId = []; + for (var j = 0; j < message.effectsProfileId.length; ++j) + object.effectsProfileId[j] = message.effectsProfileId[j]; + } + return object; + }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SynthesizeSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig"; + }; + + return SynthesizeSpeechConfig; + })(); + + /** + * OutputAudioEncoding enum. + * @name google.cloud.dialogflow.cx.v3.OutputAudioEncoding + * @enum {number} + * @property {number} OUTPUT_AUDIO_ENCODING_UNSPECIFIED=0 OUTPUT_AUDIO_ENCODING_UNSPECIFIED value + * @property {number} OUTPUT_AUDIO_ENCODING_LINEAR_16=1 OUTPUT_AUDIO_ENCODING_LINEAR_16 value + * @property {number} OUTPUT_AUDIO_ENCODING_MP3=2 OUTPUT_AUDIO_ENCODING_MP3 value + * @property {number} OUTPUT_AUDIO_ENCODING_MP3_64_KBPS=4 OUTPUT_AUDIO_ENCODING_MP3_64_KBPS value + * @property {number} OUTPUT_AUDIO_ENCODING_OGG_OPUS=3 OUTPUT_AUDIO_ENCODING_OGG_OPUS value + * @property {number} OUTPUT_AUDIO_ENCODING_MULAW=5 OUTPUT_AUDIO_ENCODING_MULAW value + * @property {number} OUTPUT_AUDIO_ENCODING_ALAW=6 OUTPUT_AUDIO_ENCODING_ALAW value + */ + v3.OutputAudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTPUT_AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "OUTPUT_AUDIO_ENCODING_MP3"] = 2; + values[valuesById[4] = "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS"] = 4; + values[valuesById[3] = "OUTPUT_AUDIO_ENCODING_OGG_OPUS"] = 3; + values[valuesById[5] = "OUTPUT_AUDIO_ENCODING_MULAW"] = 5; + values[valuesById[6] = "OUTPUT_AUDIO_ENCODING_ALAW"] = 6; + return values; + })(); + + v3.OutputAudioConfig = (function() { + + /** + * Properties of an OutputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IOutputAudioConfig + * @property {google.cloud.dialogflow.cx.v3.OutputAudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz + * @property {google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig|null} [synthesizeSpeechConfig] OutputAudioConfig synthesizeSpeechConfig + */ + + /** + * Constructs a new OutputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an OutputAudioConfig. + * @implements IOutputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IOutputAudioConfig=} [properties] Properties to set + */ + function OutputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.cx.v3.OutputAudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.audioEncoding = 0; + + /** + * OutputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * OutputAudioConfig synthesizeSpeechConfig. + * @member {google.cloud.dialogflow.cx.v3.ISynthesizeSpeechConfig|null|undefined} synthesizeSpeechConfig + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.synthesizeSpeechConfig = null; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IOutputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.OutputAudioConfig} OutputAudioConfig instance + */ + OutputAudioConfig.create = function create(properties) { + return new OutputAudioConfig(properties); + }; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.synthesizeSpeechConfig != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfig")) + $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 3: { + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 3: + case 5: + case 6: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfig, long + 1); + if (error) + return "synthesizeSpeechConfig." + error; + } + return null; + }; + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.OutputAudioConfig} OutputAudioConfig + */ + OutputAudioConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "OUTPUT_AUDIO_ENCODING_LINEAR_16": + case 1: + message.audioEncoding = 1; + break; + case "OUTPUT_AUDIO_ENCODING_MP3": + case 2: + message.audioEncoding = 2; + break; + case "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS": + case 4: + message.audioEncoding = 4; + break; + case "OUTPUT_AUDIO_ENCODING_OGG_OPUS": + case 3: + message.audioEncoding = 3; + break; + case "OUTPUT_AUDIO_ENCODING_MULAW": + case 5: + message.audioEncoding = 5; + break; + case "OUTPUT_AUDIO_ENCODING_ALAW": + case 6: + message.audioEncoding = 6; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.synthesizeSpeechConfig != null) { + if (typeof object.synthesizeSpeechConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.OutputAudioConfig.synthesizeSpeechConfig: object expected"); + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.OutputAudioConfig} message OutputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.synthesizeSpeechConfig = null; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.OutputAudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.dialogflow.cx.v3.OutputAudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) + object.synthesizeSpeechConfig = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfig, options); + return object; + }; + + /** + * Converts this OutputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + OutputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.OutputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.OutputAudioConfig"; + }; + + return OutputAudioConfig; + })(); + + v3.TextToSpeechSettings = (function() { + + /** + * Properties of a TextToSpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITextToSpeechSettings + * @property {Object.|null} [synthesizeSpeechConfigs] TextToSpeechSettings synthesizeSpeechConfigs + */ + + /** + * Constructs a new TextToSpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TextToSpeechSettings. + * @implements ITextToSpeechSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITextToSpeechSettings=} [properties] Properties to set + */ + function TextToSpeechSettings(properties) { + this.synthesizeSpeechConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextToSpeechSettings synthesizeSpeechConfigs. + * @member {Object.} synthesizeSpeechConfigs + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @instance + */ + TextToSpeechSettings.prototype.synthesizeSpeechConfigs = $util.emptyObject; + + /** + * Creates a new TextToSpeechSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ITextToSpeechSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TextToSpeechSettings} TextToSpeechSettings instance + */ + TextToSpeechSettings.create = function create(properties) { + return new TextToSpeechSettings(properties); + }; + + /** + * Encodes the specified TextToSpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextToSpeechSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ITextToSpeechSettings} message TextToSpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextToSpeechSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synthesizeSpeechConfigs != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfigs")) + for (var keys = Object.keys(message.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TextToSpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextToSpeechSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ITextToSpeechSettings} message TextToSpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextToSpeechSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TextToSpeechSettings} TextToSpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextToSpeechSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.synthesizeSpeechConfigs === $util.emptyObject) + message.synthesizeSpeechConfigs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.synthesizeSpeechConfigs, key); + message.synthesizeSpeechConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TextToSpeechSettings} TextToSpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextToSpeechSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextToSpeechSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextToSpeechSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.synthesizeSpeechConfigs != null && message.hasOwnProperty("synthesizeSpeechConfigs")) { + if (!$util.isObject(message.synthesizeSpeechConfigs)) + return "synthesizeSpeechConfigs: object expected"; + var key = Object.keys(message.synthesizeSpeechConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfigs[key[i]], long + 1); + if (error) + return "synthesizeSpeechConfigs." + error; + } + } + return null; + }; + + /** + * Creates a TextToSpeechSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TextToSpeechSettings} TextToSpeechSettings + */ + TextToSpeechSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TextToSpeechSettings(); + if (object.synthesizeSpeechConfigs) { + if (typeof object.synthesizeSpeechConfigs !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TextToSpeechSettings.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs = {}; + for (var keys = Object.keys(object.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.synthesizeSpeechConfigs, keys[i]); + if (typeof object.synthesizeSpeechConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TextToSpeechSettings.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs[keys[i]] = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfigs[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TextToSpeechSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.TextToSpeechSettings} message TextToSpeechSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextToSpeechSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.synthesizeSpeechConfigs = {}; + var keys2; + if (message.synthesizeSpeechConfigs && (keys2 = Object.keys(message.synthesizeSpeechConfigs)).length) { + object.synthesizeSpeechConfigs = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.synthesizeSpeechConfigs, keys2[j]); + object.synthesizeSpeechConfigs[keys2[j]] = $root.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfigs[keys2[j]], options); + } + } + return object; + }; + + /** + * Converts this TextToSpeechSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @instance + * @returns {Object.} JSON object + */ + TextToSpeechSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextToSpeechSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TextToSpeechSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextToSpeechSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TextToSpeechSettings"; + }; + + return TextToSpeechSettings; + })(); + + v3.Flows = (function() { + + /** + * Constructs a new Flows service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Flows + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Flows(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Flows.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Flows; + + /** + * Creates new Flows service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Flows} RPC service. Useful where requests and/or responses are streamed. + */ + Flows.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|createFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef CreateFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Flow} [response] Flow + */ + + /** + * Calls CreateFlow. + * @function createFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateFlowRequest} request CreateFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.CreateFlowCallback} callback Node-style callback called with the error, if any, and Flow + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.createFlow = function createFlow(request, callback) { + return this.rpcCall(createFlow, $root.google.cloud.dialogflow.cx.v3.CreateFlowRequest, $root.google.cloud.dialogflow.cx.v3.Flow, request, callback); + }, "name", { value: "CreateFlow" }); + + /** + * Calls CreateFlow. + * @function createFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateFlowRequest} request CreateFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|deleteFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef DeleteFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFlow. + * @function deleteFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteFlowRequest} request DeleteFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.DeleteFlowCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.deleteFlow = function deleteFlow(request, callback) { + return this.rpcCall(deleteFlow, $root.google.cloud.dialogflow.cx.v3.DeleteFlowRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFlow" }); + + /** + * Calls DeleteFlow. + * @function deleteFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteFlowRequest} request DeleteFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|listFlows}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef ListFlowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListFlowsResponse} [response] ListFlowsResponse + */ + + /** + * Calls ListFlows. + * @function listFlows + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListFlowsRequest} request ListFlowsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.ListFlowsCallback} callback Node-style callback called with the error, if any, and ListFlowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.listFlows = function listFlows(request, callback) { + return this.rpcCall(listFlows, $root.google.cloud.dialogflow.cx.v3.ListFlowsRequest, $root.google.cloud.dialogflow.cx.v3.ListFlowsResponse, request, callback); + }, "name", { value: "ListFlows" }); + + /** + * Calls ListFlows. + * @function listFlows + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListFlowsRequest} request ListFlowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|getFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef GetFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Flow} [response] Flow + */ + + /** + * Calls GetFlow. + * @function getFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetFlowRequest} request GetFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.GetFlowCallback} callback Node-style callback called with the error, if any, and Flow + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.getFlow = function getFlow(request, callback) { + return this.rpcCall(getFlow, $root.google.cloud.dialogflow.cx.v3.GetFlowRequest, $root.google.cloud.dialogflow.cx.v3.Flow, request, callback); + }, "name", { value: "GetFlow" }); + + /** + * Calls GetFlow. + * @function getFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetFlowRequest} request GetFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|updateFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef UpdateFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Flow} [response] Flow + */ + + /** + * Calls UpdateFlow. + * @function updateFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateFlowRequest} request UpdateFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.UpdateFlowCallback} callback Node-style callback called with the error, if any, and Flow + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.updateFlow = function updateFlow(request, callback) { + return this.rpcCall(updateFlow, $root.google.cloud.dialogflow.cx.v3.UpdateFlowRequest, $root.google.cloud.dialogflow.cx.v3.Flow, request, callback); + }, "name", { value: "UpdateFlow" }); + + /** + * Calls UpdateFlow. + * @function updateFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateFlowRequest} request UpdateFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|trainFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef TrainFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TrainFlow. + * @function trainFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.ITrainFlowRequest} request TrainFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.TrainFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.trainFlow = function trainFlow(request, callback) { + return this.rpcCall(trainFlow, $root.google.cloud.dialogflow.cx.v3.TrainFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TrainFlow" }); + + /** + * Calls TrainFlow. + * @function trainFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.ITrainFlowRequest} request TrainFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|validateFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef ValidateFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.FlowValidationResult} [response] FlowValidationResult + */ + + /** + * Calls ValidateFlow. + * @function validateFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IValidateFlowRequest} request ValidateFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.ValidateFlowCallback} callback Node-style callback called with the error, if any, and FlowValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.validateFlow = function validateFlow(request, callback) { + return this.rpcCall(validateFlow, $root.google.cloud.dialogflow.cx.v3.ValidateFlowRequest, $root.google.cloud.dialogflow.cx.v3.FlowValidationResult, request, callback); + }, "name", { value: "ValidateFlow" }); + + /** + * Calls ValidateFlow. + * @function validateFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IValidateFlowRequest} request ValidateFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|getFlowValidationResult}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef GetFlowValidationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.FlowValidationResult} [response] FlowValidationResult + */ + + /** + * Calls GetFlowValidationResult. + * @function getFlowValidationResult + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest} request GetFlowValidationResultRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResultCallback} callback Node-style callback called with the error, if any, and FlowValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.getFlowValidationResult = function getFlowValidationResult(request, callback) { + return this.rpcCall(getFlowValidationResult, $root.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest, $root.google.cloud.dialogflow.cx.v3.FlowValidationResult, request, callback); + }, "name", { value: "GetFlowValidationResult" }); + + /** + * Calls GetFlowValidationResult. + * @function getFlowValidationResult + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest} request GetFlowValidationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|importFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef ImportFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportFlow. + * @function importFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportFlowRequest} request ImportFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.ImportFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.importFlow = function importFlow(request, callback) { + return this.rpcCall(importFlow, $root.google.cloud.dialogflow.cx.v3.ImportFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportFlow" }); + + /** + * Calls ImportFlow. + * @function importFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportFlowRequest} request ImportFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Flows|exportFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @typedef ExportFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportFlow. + * @function exportFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportFlowRequest} request ExportFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Flows.ExportFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.exportFlow = function exportFlow(request, callback) { + return this.rpcCall(exportFlow, $root.google.cloud.dialogflow.cx.v3.ExportFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportFlow" }); + + /** + * Calls ExportFlow. + * @function exportFlow + * @memberof google.cloud.dialogflow.cx.v3.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportFlowRequest} request ExportFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Flows; + })(); + + v3.NluSettings = (function() { + + /** + * Properties of a NluSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface INluSettings + * @property {google.cloud.dialogflow.cx.v3.NluSettings.ModelType|null} [modelType] NluSettings modelType + * @property {number|null} [classificationThreshold] NluSettings classificationThreshold + * @property {google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode|null} [modelTrainingMode] NluSettings modelTrainingMode + */ + + /** + * Constructs a new NluSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a NluSettings. + * @implements INluSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.INluSettings=} [properties] Properties to set + */ + function NluSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NluSettings modelType. + * @member {google.cloud.dialogflow.cx.v3.NluSettings.ModelType} modelType + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @instance + */ + NluSettings.prototype.modelType = 0; + + /** + * NluSettings classificationThreshold. + * @member {number} classificationThreshold + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @instance + */ + NluSettings.prototype.classificationThreshold = 0; + + /** + * NluSettings modelTrainingMode. + * @member {google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode} modelTrainingMode + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @instance + */ + NluSettings.prototype.modelTrainingMode = 0; + + /** + * Creates a new NluSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.INluSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.NluSettings} NluSettings instance + */ + NluSettings.create = function create(properties) { + return new NluSettings(properties); + }; + + /** + * Encodes the specified NluSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.NluSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.INluSettings} message NluSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NluSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); + if (message.classificationThreshold != null && Object.hasOwnProperty.call(message, "classificationThreshold")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.classificationThreshold); + if (message.modelTrainingMode != null && Object.hasOwnProperty.call(message, "modelTrainingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.modelTrainingMode); + return writer; + }; + + /** + * Encodes the specified NluSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.NluSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.INluSettings} message NluSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NluSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NluSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.NluSettings} NluSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NluSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.NluSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelType = reader.int32(); + break; + } + case 3: { + message.classificationThreshold = reader.float(); + break; + } + case 4: { + message.modelTrainingMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NluSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.NluSettings} NluSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NluSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NluSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NluSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) + if (typeof message.classificationThreshold !== "number") + return "classificationThreshold: number expected"; + if (message.modelTrainingMode != null && message.hasOwnProperty("modelTrainingMode")) + switch (message.modelTrainingMode) { + default: + return "modelTrainingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NluSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.NluSettings} NluSettings + */ + NluSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.NluSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.NluSettings(); + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "MODEL_TYPE_STANDARD": + case 1: + message.modelType = 1; + break; + case "MODEL_TYPE_ADVANCED": + case 3: + message.modelType = 3; + break; + } + if (object.classificationThreshold != null) + message.classificationThreshold = Number(object.classificationThreshold); + switch (object.modelTrainingMode) { + default: + if (typeof object.modelTrainingMode === "number") { + message.modelTrainingMode = object.modelTrainingMode; + break; + } + break; + case "MODEL_TRAINING_MODE_UNSPECIFIED": + case 0: + message.modelTrainingMode = 0; + break; + case "MODEL_TRAINING_MODE_AUTOMATIC": + case 1: + message.modelTrainingMode = 1; + break; + case "MODEL_TRAINING_MODE_MANUAL": + case 2: + message.modelTrainingMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NluSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.NluSettings} message NluSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NluSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + object.classificationThreshold = 0; + object.modelTrainingMode = options.enums === String ? "MODEL_TRAINING_MODE_UNSPECIFIED" : 0; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.NluSettings.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.dialogflow.cx.v3.NluSettings.ModelType[message.modelType] : message.modelType; + if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) + object.classificationThreshold = options.json && !isFinite(message.classificationThreshold) ? String(message.classificationThreshold) : message.classificationThreshold; + if (message.modelTrainingMode != null && message.hasOwnProperty("modelTrainingMode")) + object.modelTrainingMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode[message.modelTrainingMode] === undefined ? message.modelTrainingMode : $root.google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode[message.modelTrainingMode] : message.modelTrainingMode; + return object; + }; + + /** + * Converts this NluSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @instance + * @returns {Object.} JSON object + */ + NluSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NluSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.NluSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NluSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.NluSettings"; + }; + + /** + * ModelType enum. + * @name google.cloud.dialogflow.cx.v3.NluSettings.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} MODEL_TYPE_STANDARD=1 MODEL_TYPE_STANDARD value + * @property {number} MODEL_TYPE_ADVANCED=3 MODEL_TYPE_ADVANCED value + */ + NluSettings.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_TYPE_STANDARD"] = 1; + values[valuesById[3] = "MODEL_TYPE_ADVANCED"] = 3; + return values; + })(); + + /** + * ModelTrainingMode enum. + * @name google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode + * @enum {number} + * @property {number} MODEL_TRAINING_MODE_UNSPECIFIED=0 MODEL_TRAINING_MODE_UNSPECIFIED value + * @property {number} MODEL_TRAINING_MODE_AUTOMATIC=1 MODEL_TRAINING_MODE_AUTOMATIC value + * @property {number} MODEL_TRAINING_MODE_MANUAL=2 MODEL_TRAINING_MODE_MANUAL value + */ + NluSettings.ModelTrainingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TRAINING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_TRAINING_MODE_AUTOMATIC"] = 1; + values[valuesById[2] = "MODEL_TRAINING_MODE_MANUAL"] = 2; + return values; + })(); + + return NluSettings; + })(); + + v3.Flow = (function() { + + /** + * Properties of a Flow. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFlow + * @property {string|null} [name] Flow name + * @property {string|null} [displayName] Flow displayName + * @property {string|null} [description] Flow description + * @property {Array.|null} [transitionRoutes] Flow transitionRoutes + * @property {Array.|null} [eventHandlers] Flow eventHandlers + * @property {Array.|null} [transitionRouteGroups] Flow transitionRouteGroups + * @property {google.cloud.dialogflow.cx.v3.INluSettings|null} [nluSettings] Flow nluSettings + * @property {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null} [advancedSettings] Flow advancedSettings + * @property {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null} [knowledgeConnectorSettings] Flow knowledgeConnectorSettings + * @property {Array.|null} [inputParameterDefinitions] Flow inputParameterDefinitions + * @property {Array.|null} [outputParameterDefinitions] Flow outputParameterDefinitions + * @property {google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings|null} [multiLanguageSettings] Flow multiLanguageSettings + * @property {boolean|null} [locked] Flow locked + */ + + /** + * Constructs a new Flow. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Flow. + * @implements IFlow + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFlow=} [properties] Properties to set + */ + function Flow(properties) { + this.transitionRoutes = []; + this.eventHandlers = []; + this.transitionRouteGroups = []; + this.inputParameterDefinitions = []; + this.outputParameterDefinitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Flow name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.name = ""; + + /** + * Flow displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.displayName = ""; + + /** + * Flow description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.description = ""; + + /** + * Flow transitionRoutes. + * @member {Array.} transitionRoutes + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.transitionRoutes = $util.emptyArray; + + /** + * Flow eventHandlers. + * @member {Array.} eventHandlers + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.eventHandlers = $util.emptyArray; + + /** + * Flow transitionRouteGroups. + * @member {Array.} transitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.transitionRouteGroups = $util.emptyArray; + + /** + * Flow nluSettings. + * @member {google.cloud.dialogflow.cx.v3.INluSettings|null|undefined} nluSettings + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.nluSettings = null; + + /** + * Flow advancedSettings. + * @member {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.advancedSettings = null; + + /** + * Flow knowledgeConnectorSettings. + * @member {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null|undefined} knowledgeConnectorSettings + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.knowledgeConnectorSettings = null; + + /** + * Flow inputParameterDefinitions. + * @member {Array.} inputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.inputParameterDefinitions = $util.emptyArray; + + /** + * Flow outputParameterDefinitions. + * @member {Array.} outputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.outputParameterDefinitions = $util.emptyArray; + + /** + * Flow multiLanguageSettings. + * @member {google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings|null|undefined} multiLanguageSettings + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.multiLanguageSettings = null; + + /** + * Flow locked. + * @member {boolean} locked + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + */ + Flow.prototype.locked = false; + + /** + * Creates a new Flow instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlow=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Flow} Flow instance + */ + Flow.create = function create(properties) { + return new Flow(properties); + }; + + /** + * Encodes the specified Flow message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlow} message Flow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Flow.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.transitionRoutes != null && message.transitionRoutes.length) + for (var i = 0; i < message.transitionRoutes.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TransitionRoute.encode(message.transitionRoutes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.eventHandlers != null && message.eventHandlers.length) + for (var i = 0; i < message.eventHandlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3.EventHandler.encode(message.eventHandlers[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.nluSettings != null && Object.hasOwnProperty.call(message, "nluSettings")) + $root.google.cloud.dialogflow.cx.v3.NluSettings.encode(message.nluSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.transitionRouteGroups != null && message.transitionRouteGroups.length) + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.transitionRouteGroups[i]); + if (message.knowledgeConnectorSettings != null && Object.hasOwnProperty.call(message, "knowledgeConnectorSettings")) + $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.encode(message.knowledgeConnectorSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.inputParameterDefinitions != null && message.inputParameterDefinitions.length) + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.encode(message.inputParameterDefinitions[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.outputParameterDefinitions != null && message.outputParameterDefinitions.length) + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.encode(message.outputParameterDefinitions[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.multiLanguageSettings != null && Object.hasOwnProperty.call(message, "multiLanguageSettings")) + $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.encode(message.multiLanguageSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.locked); + return writer; + }; + + /** + * Encodes the specified Flow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlow} message Flow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Flow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Flow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Flow} Flow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Flow.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Flow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.transitionRoutes && message.transitionRoutes.length)) + message.transitionRoutes = []; + message.transitionRoutes.push($root.google.cloud.dialogflow.cx.v3.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.eventHandlers && message.eventHandlers.length)) + message.eventHandlers = []; + message.eventHandlers.push($root.google.cloud.dialogflow.cx.v3.EventHandler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 15: { + if (!(message.transitionRouteGroups && message.transitionRouteGroups.length)) + message.transitionRouteGroups = []; + message.transitionRouteGroups.push(reader.string()); + break; + } + case 11: { + message.nluSettings = $root.google.cloud.dialogflow.cx.v3.NluSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + if (!(message.inputParameterDefinitions && message.inputParameterDefinitions.length)) + message.inputParameterDefinitions = []; + message.inputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 27: { + if (!(message.outputParameterDefinitions && message.outputParameterDefinitions.length)) + message.outputParameterDefinitions = []; + message.outputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 28: { + message.multiLanguageSettings = $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.locked = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Flow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Flow} Flow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Flow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Flow message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Flow.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.transitionRoutes != null && message.hasOwnProperty("transitionRoutes")) { + if (!Array.isArray(message.transitionRoutes)) + return "transitionRoutes: array expected"; + for (var i = 0; i < message.transitionRoutes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.verify(message.transitionRoutes[i], long + 1); + if (error) + return "transitionRoutes." + error; + } + } + if (message.eventHandlers != null && message.hasOwnProperty("eventHandlers")) { + if (!Array.isArray(message.eventHandlers)) + return "eventHandlers: array expected"; + for (var i = 0; i < message.eventHandlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.EventHandler.verify(message.eventHandlers[i], long + 1); + if (error) + return "eventHandlers." + error; + } + } + if (message.transitionRouteGroups != null && message.hasOwnProperty("transitionRouteGroups")) { + if (!Array.isArray(message.transitionRouteGroups)) + return "transitionRouteGroups: array expected"; + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + if (!$util.isString(message.transitionRouteGroups[i])) + return "transitionRouteGroups: string[] expected"; + } + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.NluSettings.verify(message.nluSettings, long + 1); + if (error) + return "nluSettings." + error; + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.verify(message.knowledgeConnectorSettings, long + 1); + if (error) + return "knowledgeConnectorSettings." + error; + } + if (message.inputParameterDefinitions != null && message.hasOwnProperty("inputParameterDefinitions")) { + if (!Array.isArray(message.inputParameterDefinitions)) + return "inputParameterDefinitions: array expected"; + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.verify(message.inputParameterDefinitions[i], long + 1); + if (error) + return "inputParameterDefinitions." + error; + } + } + if (message.outputParameterDefinitions != null && message.hasOwnProperty("outputParameterDefinitions")) { + if (!Array.isArray(message.outputParameterDefinitions)) + return "outputParameterDefinitions: array expected"; + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.verify(message.outputParameterDefinitions[i], long + 1); + if (error) + return "outputParameterDefinitions." + error; + } + } + if (message.multiLanguageSettings != null && message.hasOwnProperty("multiLanguageSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.verify(message.multiLanguageSettings, long + 1); + if (error) + return "multiLanguageSettings." + error; + } + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + return null; + }; + + /** + * Creates a Flow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Flow} Flow + */ + Flow.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Flow) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Flow(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.transitionRoutes) { + if (!Array.isArray(object.transitionRoutes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.transitionRoutes: array expected"); + message.transitionRoutes = []; + for (var i = 0; i < object.transitionRoutes.length; ++i) { + if (typeof object.transitionRoutes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.transitionRoutes: object expected"); + message.transitionRoutes[i] = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.fromObject(object.transitionRoutes[i], long + 1); + } + } + if (object.eventHandlers) { + if (!Array.isArray(object.eventHandlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.eventHandlers: array expected"); + message.eventHandlers = []; + for (var i = 0; i < object.eventHandlers.length; ++i) { + if (typeof object.eventHandlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.eventHandlers: object expected"); + message.eventHandlers[i] = $root.google.cloud.dialogflow.cx.v3.EventHandler.fromObject(object.eventHandlers[i], long + 1); + } + } + if (object.transitionRouteGroups) { + if (!Array.isArray(object.transitionRouteGroups)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.transitionRouteGroups: array expected"); + message.transitionRouteGroups = []; + for (var i = 0; i < object.transitionRouteGroups.length; ++i) + message.transitionRouteGroups[i] = String(object.transitionRouteGroups[i]); + } + if (object.nluSettings != null) { + if (typeof object.nluSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.nluSettings: object expected"); + message.nluSettings = $root.google.cloud.dialogflow.cx.v3.NluSettings.fromObject(object.nluSettings, long + 1); + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.knowledgeConnectorSettings != null) { + if (typeof object.knowledgeConnectorSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.knowledgeConnectorSettings: object expected"); + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.fromObject(object.knowledgeConnectorSettings, long + 1); + } + if (object.inputParameterDefinitions) { + if (!Array.isArray(object.inputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.inputParameterDefinitions: array expected"); + message.inputParameterDefinitions = []; + for (var i = 0; i < object.inputParameterDefinitions.length; ++i) { + if (typeof object.inputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.inputParameterDefinitions: object expected"); + message.inputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.fromObject(object.inputParameterDefinitions[i], long + 1); + } + } + if (object.outputParameterDefinitions) { + if (!Array.isArray(object.outputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.outputParameterDefinitions: array expected"); + message.outputParameterDefinitions = []; + for (var i = 0; i < object.outputParameterDefinitions.length; ++i) { + if (typeof object.outputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.outputParameterDefinitions: object expected"); + message.outputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.fromObject(object.outputParameterDefinitions[i], long + 1); + } + } + if (object.multiLanguageSettings != null) { + if (typeof object.multiLanguageSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.multiLanguageSettings: object expected"); + message.multiLanguageSettings = $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.fromObject(object.multiLanguageSettings, long + 1); + } + if (object.locked != null) + message.locked = Boolean(object.locked); + return message; + }; + + /** + * Creates a plain object from a Flow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3.Flow} message Flow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Flow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.transitionRoutes = []; + object.eventHandlers = []; + object.transitionRouteGroups = []; + object.inputParameterDefinitions = []; + object.outputParameterDefinitions = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.nluSettings = null; + object.advancedSettings = null; + object.knowledgeConnectorSettings = null; + object.multiLanguageSettings = null; + object.locked = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.transitionRoutes && message.transitionRoutes.length) { + object.transitionRoutes = []; + for (var j = 0; j < message.transitionRoutes.length; ++j) + object.transitionRoutes[j] = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.toObject(message.transitionRoutes[j], options); + } + if (message.eventHandlers && message.eventHandlers.length) { + object.eventHandlers = []; + for (var j = 0; j < message.eventHandlers.length; ++j) + object.eventHandlers[j] = $root.google.cloud.dialogflow.cx.v3.EventHandler.toObject(message.eventHandlers[j], options); + } + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) + object.nluSettings = $root.google.cloud.dialogflow.cx.v3.NluSettings.toObject(message.nluSettings, options); + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.transitionRouteGroups && message.transitionRouteGroups.length) { + object.transitionRouteGroups = []; + for (var j = 0; j < message.transitionRouteGroups.length; ++j) + object.transitionRouteGroups[j] = message.transitionRouteGroups[j]; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) + object.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.toObject(message.knowledgeConnectorSettings, options); + if (message.inputParameterDefinitions && message.inputParameterDefinitions.length) { + object.inputParameterDefinitions = []; + for (var j = 0; j < message.inputParameterDefinitions.length; ++j) + object.inputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.toObject(message.inputParameterDefinitions[j], options); + } + if (message.outputParameterDefinitions && message.outputParameterDefinitions.length) { + object.outputParameterDefinitions = []; + for (var j = 0; j < message.outputParameterDefinitions.length; ++j) + object.outputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.toObject(message.outputParameterDefinitions[j], options); + } + if (message.multiLanguageSettings != null && message.hasOwnProperty("multiLanguageSettings")) + object.multiLanguageSettings = $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.toObject(message.multiLanguageSettings, options); + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + return object; + }; + + /** + * Converts this Flow to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @instance + * @returns {Object.} JSON object + */ + Flow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Flow + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Flow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Flow"; + }; + + Flow.MultiLanguageSettings = (function() { + + /** + * Properties of a MultiLanguageSettings. + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @interface IMultiLanguageSettings + * @property {boolean|null} [enableMultiLanguageDetection] MultiLanguageSettings enableMultiLanguageDetection + * @property {Array.|null} [supportedResponseLanguageCodes] MultiLanguageSettings supportedResponseLanguageCodes + */ + + /** + * Constructs a new MultiLanguageSettings. + * @memberof google.cloud.dialogflow.cx.v3.Flow + * @classdesc Represents a MultiLanguageSettings. + * @implements IMultiLanguageSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings=} [properties] Properties to set + */ + function MultiLanguageSettings(properties) { + this.supportedResponseLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiLanguageSettings enableMultiLanguageDetection. + * @member {boolean} enableMultiLanguageDetection + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @instance + */ + MultiLanguageSettings.prototype.enableMultiLanguageDetection = false; + + /** + * MultiLanguageSettings supportedResponseLanguageCodes. + * @member {Array.} supportedResponseLanguageCodes + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @instance + */ + MultiLanguageSettings.prototype.supportedResponseLanguageCodes = $util.emptyArray; + + /** + * Creates a new MultiLanguageSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings} MultiLanguageSettings instance + */ + MultiLanguageSettings.create = function create(properties) { + return new MultiLanguageSettings(properties); + }; + + /** + * Encodes the specified MultiLanguageSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings} message MultiLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableMultiLanguageDetection != null && Object.hasOwnProperty.call(message, "enableMultiLanguageDetection")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableMultiLanguageDetection); + if (message.supportedResponseLanguageCodes != null && message.supportedResponseLanguageCodes.length) + for (var i = 0; i < message.supportedResponseLanguageCodes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.supportedResponseLanguageCodes[i]); + return writer; + }; + + /** + * Encodes the specified MultiLanguageSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Flow.IMultiLanguageSettings} message MultiLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings} MultiLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiLanguageSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableMultiLanguageDetection = reader.bool(); + break; + } + case 2: { + if (!(message.supportedResponseLanguageCodes && message.supportedResponseLanguageCodes.length)) + message.supportedResponseLanguageCodes = []; + message.supportedResponseLanguageCodes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings} MultiLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiLanguageSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiLanguageSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableMultiLanguageDetection != null && message.hasOwnProperty("enableMultiLanguageDetection")) + if (typeof message.enableMultiLanguageDetection !== "boolean") + return "enableMultiLanguageDetection: boolean expected"; + if (message.supportedResponseLanguageCodes != null && message.hasOwnProperty("supportedResponseLanguageCodes")) { + if (!Array.isArray(message.supportedResponseLanguageCodes)) + return "supportedResponseLanguageCodes: array expected"; + for (var i = 0; i < message.supportedResponseLanguageCodes.length; ++i) + if (!$util.isString(message.supportedResponseLanguageCodes[i])) + return "supportedResponseLanguageCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a MultiLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings} MultiLanguageSettings + */ + MultiLanguageSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings(); + if (object.enableMultiLanguageDetection != null) + message.enableMultiLanguageDetection = Boolean(object.enableMultiLanguageDetection); + if (object.supportedResponseLanguageCodes) { + if (!Array.isArray(object.supportedResponseLanguageCodes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings.supportedResponseLanguageCodes: array expected"); + message.supportedResponseLanguageCodes = []; + for (var i = 0; i < object.supportedResponseLanguageCodes.length; ++i) + message.supportedResponseLanguageCodes[i] = String(object.supportedResponseLanguageCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a MultiLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings} message MultiLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedResponseLanguageCodes = []; + if (options.defaults) + object.enableMultiLanguageDetection = false; + if (message.enableMultiLanguageDetection != null && message.hasOwnProperty("enableMultiLanguageDetection")) + object.enableMultiLanguageDetection = message.enableMultiLanguageDetection; + if (message.supportedResponseLanguageCodes && message.supportedResponseLanguageCodes.length) { + object.supportedResponseLanguageCodes = []; + for (var j = 0; j < message.supportedResponseLanguageCodes.length; ++j) + object.supportedResponseLanguageCodes[j] = message.supportedResponseLanguageCodes[j]; + } + return object; + }; + + /** + * Converts this MultiLanguageSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + MultiLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiLanguageSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings"; + }; + + return MultiLanguageSettings; + })(); + + return Flow; + })(); + + v3.CreateFlowRequest = (function() { + + /** + * Properties of a CreateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateFlowRequest + * @property {string|null} [parent] CreateFlowRequest parent + * @property {google.cloud.dialogflow.cx.v3.IFlow|null} [flow] CreateFlowRequest flow + * @property {string|null} [languageCode] CreateFlowRequest languageCode + */ + + /** + * Constructs a new CreateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateFlowRequest. + * @implements ICreateFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateFlowRequest=} [properties] Properties to set + */ + function CreateFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFlowRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @instance + */ + CreateFlowRequest.prototype.parent = ""; + + /** + * CreateFlowRequest flow. + * @member {google.cloud.dialogflow.cx.v3.IFlow|null|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @instance + */ + CreateFlowRequest.prototype.flow = null; + + /** + * CreateFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @instance + */ + CreateFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateFlowRequest} CreateFlowRequest instance + */ + CreateFlowRequest.create = function create(properties) { + return new CreateFlowRequest(properties); + }; + + /** + * Encodes the specified CreateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateFlowRequest} message CreateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFlowRequest.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.flow != null && Object.hasOwnProperty.call(message, "flow")) + $root.google.cloud.dialogflow.cx.v3.Flow.encode(message.flow, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateFlowRequest} message CreateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateFlowRequest} CreateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.flow = $root.google.cloud.dialogflow.cx.v3.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateFlowRequest} CreateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.flow != null && message.hasOwnProperty("flow")) { + var error = $root.google.cloud.dialogflow.cx.v3.Flow.verify(message.flow, long + 1); + if (error) + return "flow." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateFlowRequest} CreateFlowRequest + */ + CreateFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateFlowRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.flow != null) { + if (typeof object.flow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateFlowRequest.flow: object expected"); + message.flow = $root.google.cloud.dialogflow.cx.v3.Flow.fromObject(object.flow, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateFlowRequest} message CreateFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.flow = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = $root.google.cloud.dialogflow.cx.v3.Flow.toObject(message.flow, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateFlowRequest"; + }; + + return CreateFlowRequest; + })(); + + v3.DeleteFlowRequest = (function() { + + /** + * Properties of a DeleteFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteFlowRequest + * @property {string|null} [name] DeleteFlowRequest name + * @property {boolean|null} [force] DeleteFlowRequest force + */ + + /** + * Constructs a new DeleteFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteFlowRequest. + * @implements IDeleteFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteFlowRequest=} [properties] Properties to set + */ + function DeleteFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @instance + */ + DeleteFlowRequest.prototype.name = ""; + + /** + * DeleteFlowRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @instance + */ + DeleteFlowRequest.prototype.force = false; + + /** + * Creates a new DeleteFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteFlowRequest} DeleteFlowRequest instance + */ + DeleteFlowRequest.create = function create(properties) { + return new DeleteFlowRequest(properties); + }; + + /** + * Encodes the specified DeleteFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteFlowRequest} message DeleteFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFlowRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteFlowRequest} message DeleteFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteFlowRequest} DeleteFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteFlowRequest} DeleteFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteFlowRequest} DeleteFlowRequest + */ + DeleteFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteFlowRequest} message DeleteFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteFlowRequest"; + }; + + return DeleteFlowRequest; + })(); + + v3.ListFlowsRequest = (function() { + + /** + * Properties of a ListFlowsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListFlowsRequest + * @property {string|null} [parent] ListFlowsRequest parent + * @property {number|null} [pageSize] ListFlowsRequest pageSize + * @property {string|null} [pageToken] ListFlowsRequest pageToken + * @property {string|null} [languageCode] ListFlowsRequest languageCode + */ + + /** + * Constructs a new ListFlowsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListFlowsRequest. + * @implements IListFlowsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListFlowsRequest=} [properties] Properties to set + */ + function ListFlowsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFlowsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.parent = ""; + + /** + * ListFlowsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.pageSize = 0; + + /** + * ListFlowsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.pageToken = ""; + + /** + * ListFlowsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.languageCode = ""; + + /** + * Creates a new ListFlowsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListFlowsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsRequest} ListFlowsRequest instance + */ + ListFlowsRequest.create = function create(properties) { + return new ListFlowsRequest(properties); + }; + + /** + * Encodes the specified ListFlowsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListFlowsRequest} message ListFlowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListFlowsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListFlowsRequest} message ListFlowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsRequest} ListFlowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListFlowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsRequest} ListFlowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFlowsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFlowsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListFlowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsRequest} ListFlowsRequest + */ + ListFlowsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListFlowsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListFlowsRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListFlowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListFlowsRequest} message ListFlowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFlowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListFlowsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFlowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFlowsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFlowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListFlowsRequest"; + }; + + return ListFlowsRequest; + })(); + + v3.ListFlowsResponse = (function() { + + /** + * Properties of a ListFlowsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListFlowsResponse + * @property {Array.|null} [flows] ListFlowsResponse flows + * @property {string|null} [nextPageToken] ListFlowsResponse nextPageToken + */ + + /** + * Constructs a new ListFlowsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListFlowsResponse. + * @implements IListFlowsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListFlowsResponse=} [properties] Properties to set + */ + function ListFlowsResponse(properties) { + this.flows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFlowsResponse flows. + * @member {Array.} flows + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @instance + */ + ListFlowsResponse.prototype.flows = $util.emptyArray; + + /** + * ListFlowsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @instance + */ + ListFlowsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFlowsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListFlowsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsResponse} ListFlowsResponse instance + */ + ListFlowsResponse.create = function create(properties) { + return new ListFlowsResponse(properties); + }; + + /** + * Encodes the specified ListFlowsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListFlowsResponse} message ListFlowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flows != null && message.flows.length) + for (var i = 0; i < message.flows.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Flow.encode(message.flows[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 ListFlowsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListFlowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListFlowsResponse} message ListFlowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsResponse} ListFlowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListFlowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.flows && message.flows.length)) + message.flows = []; + message.flows.push($root.google.cloud.dialogflow.cx.v3.Flow.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsResponse} ListFlowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFlowsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFlowsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flows != null && message.hasOwnProperty("flows")) { + if (!Array.isArray(message.flows)) + return "flows: array expected"; + for (var i = 0; i < message.flows.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Flow.verify(message.flows[i], long + 1); + if (error) + return "flows." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFlowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListFlowsResponse} ListFlowsResponse + */ + ListFlowsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListFlowsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListFlowsResponse(); + if (object.flows) { + if (!Array.isArray(object.flows)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListFlowsResponse.flows: array expected"); + message.flows = []; + for (var i = 0; i < object.flows.length; ++i) { + if (typeof object.flows[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListFlowsResponse.flows: object expected"); + message.flows[i] = $root.google.cloud.dialogflow.cx.v3.Flow.fromObject(object.flows[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFlowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListFlowsResponse} message ListFlowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFlowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.flows = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.flows && message.flows.length) { + object.flows = []; + for (var j = 0; j < message.flows.length; ++j) + object.flows[j] = $root.google.cloud.dialogflow.cx.v3.Flow.toObject(message.flows[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFlowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFlowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFlowsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListFlowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFlowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListFlowsResponse"; + }; + + return ListFlowsResponse; + })(); + + v3.GetFlowRequest = (function() { + + /** + * Properties of a GetFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetFlowRequest + * @property {string|null} [name] GetFlowRequest name + * @property {string|null} [languageCode] GetFlowRequest languageCode + */ + + /** + * Constructs a new GetFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetFlowRequest. + * @implements IGetFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetFlowRequest=} [properties] Properties to set + */ + function GetFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @instance + */ + GetFlowRequest.prototype.name = ""; + + /** + * GetFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @instance + */ + GetFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new GetFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetFlowRequest} GetFlowRequest instance + */ + GetFlowRequest.create = function create(properties) { + return new GetFlowRequest(properties); + }; + + /** + * Encodes the specified GetFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetFlowRequest} message GetFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetFlowRequest} message GetFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetFlowRequest} GetFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetFlowRequest} GetFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetFlowRequest} GetFlowRequest + */ + GetFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetFlowRequest} message GetFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @instance + * @returns {Object.} JSON object + */ + GetFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetFlowRequest"; + }; + + return GetFlowRequest; + })(); + + v3.UpdateFlowRequest = (function() { + + /** + * Properties of an UpdateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateFlowRequest + * @property {google.cloud.dialogflow.cx.v3.IFlow|null} [flow] UpdateFlowRequest flow + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFlowRequest updateMask + * @property {string|null} [languageCode] UpdateFlowRequest languageCode + */ + + /** + * Constructs a new UpdateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateFlowRequest. + * @implements IUpdateFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateFlowRequest=} [properties] Properties to set + */ + function UpdateFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFlowRequest flow. + * @member {google.cloud.dialogflow.cx.v3.IFlow|null|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @instance + */ + UpdateFlowRequest.prototype.flow = null; + + /** + * UpdateFlowRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @instance + */ + UpdateFlowRequest.prototype.updateMask = null; + + /** + * UpdateFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @instance + */ + UpdateFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new UpdateFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateFlowRequest} UpdateFlowRequest instance + */ + UpdateFlowRequest.create = function create(properties) { + return new UpdateFlowRequest(properties); + }; + + /** + * Encodes the specified UpdateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateFlowRequest} message UpdateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFlowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + $root.google.cloud.dialogflow.cx.v3.Flow.encode(message.flow, 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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified UpdateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateFlowRequest} message UpdateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateFlowRequest} UpdateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = $root.google.cloud.dialogflow.cx.v3.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateFlowRequest} UpdateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) { + var error = $root.google.cloud.dialogflow.cx.v3.Flow.verify(message.flow, long + 1); + if (error) + return "flow." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an UpdateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateFlowRequest} UpdateFlowRequest + */ + UpdateFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateFlowRequest(); + if (object.flow != null) { + if (typeof object.flow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateFlowRequest.flow: object expected"); + message.flow = $root.google.cloud.dialogflow.cx.v3.Flow.fromObject(object.flow, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateFlowRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an UpdateFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateFlowRequest} message UpdateFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = null; + object.updateMask = null; + object.languageCode = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = $root.google.cloud.dialogflow.cx.v3.Flow.toObject(message.flow, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this UpdateFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateFlowRequest"; + }; + + return UpdateFlowRequest; + })(); + + v3.TrainFlowRequest = (function() { + + /** + * Properties of a TrainFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITrainFlowRequest + * @property {string|null} [name] TrainFlowRequest name + */ + + /** + * Constructs a new TrainFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TrainFlowRequest. + * @implements ITrainFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITrainFlowRequest=} [properties] Properties to set + */ + function TrainFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @instance + */ + TrainFlowRequest.prototype.name = ""; + + /** + * Creates a new TrainFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ITrainFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TrainFlowRequest} TrainFlowRequest instance + */ + TrainFlowRequest.create = function create(properties) { + return new TrainFlowRequest(properties); + }; + + /** + * Encodes the specified TrainFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TrainFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ITrainFlowRequest} message TrainFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainFlowRequest.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 TrainFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TrainFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ITrainFlowRequest} message TrainFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TrainFlowRequest} TrainFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TrainFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TrainFlowRequest} TrainFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a TrainFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TrainFlowRequest} TrainFlowRequest + */ + TrainFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TrainFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TrainFlowRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a TrainFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.TrainFlowRequest} message TrainFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainFlowRequest.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 TrainFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @instance + * @returns {Object.} JSON object + */ + TrainFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TrainFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TrainFlowRequest"; + }; + + return TrainFlowRequest; + })(); + + v3.ValidateFlowRequest = (function() { + + /** + * Properties of a ValidateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IValidateFlowRequest + * @property {string|null} [name] ValidateFlowRequest name + * @property {string|null} [languageCode] ValidateFlowRequest languageCode + */ + + /** + * Constructs a new ValidateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ValidateFlowRequest. + * @implements IValidateFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IValidateFlowRequest=} [properties] Properties to set + */ + function ValidateFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @instance + */ + ValidateFlowRequest.prototype.name = ""; + + /** + * ValidateFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @instance + */ + ValidateFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new ValidateFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidateFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ValidateFlowRequest} ValidateFlowRequest instance + */ + ValidateFlowRequest.create = function create(properties) { + return new ValidateFlowRequest(properties); + }; + + /** + * Encodes the specified ValidateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidateFlowRequest} message ValidateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateFlowRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ValidateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidateFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidateFlowRequest} message ValidateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ValidateFlowRequest} ValidateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ValidateFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ValidateFlowRequest} ValidateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ValidateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ValidateFlowRequest} ValidateFlowRequest + */ + ValidateFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ValidateFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ValidateFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ValidateFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ValidateFlowRequest} message ValidateFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ValidateFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ValidateFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ValidateFlowRequest"; + }; + + return ValidateFlowRequest; + })(); + + v3.GetFlowValidationResultRequest = (function() { + + /** + * Properties of a GetFlowValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetFlowValidationResultRequest + * @property {string|null} [name] GetFlowValidationResultRequest name + * @property {string|null} [languageCode] GetFlowValidationResultRequest languageCode + */ + + /** + * Constructs a new GetFlowValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetFlowValidationResultRequest. + * @implements IGetFlowValidationResultRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest=} [properties] Properties to set + */ + function GetFlowValidationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFlowValidationResultRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @instance + */ + GetFlowValidationResultRequest.prototype.name = ""; + + /** + * GetFlowValidationResultRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @instance + */ + GetFlowValidationResultRequest.prototype.languageCode = ""; + + /** + * Creates a new GetFlowValidationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest} GetFlowValidationResultRequest instance + */ + GetFlowValidationResultRequest.create = function create(properties) { + return new GetFlowValidationResultRequest(properties); + }; + + /** + * Encodes the specified GetFlowValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest} message GetFlowValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowValidationResultRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetFlowValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest} message GetFlowValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowValidationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest} GetFlowValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowValidationResultRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest} GetFlowValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowValidationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFlowValidationResultRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFlowValidationResultRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetFlowValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest} GetFlowValidationResultRequest + */ + GetFlowValidationResultRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetFlowValidationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest} message GetFlowValidationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFlowValidationResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetFlowValidationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetFlowValidationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFlowValidationResultRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFlowValidationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest"; + }; + + return GetFlowValidationResultRequest; + })(); + + v3.FlowValidationResult = (function() { + + /** + * Properties of a FlowValidationResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFlowValidationResult + * @property {string|null} [name] FlowValidationResult name + * @property {Array.|null} [validationMessages] FlowValidationResult validationMessages + * @property {google.protobuf.ITimestamp|null} [updateTime] FlowValidationResult updateTime + */ + + /** + * Constructs a new FlowValidationResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FlowValidationResult. + * @implements IFlowValidationResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFlowValidationResult=} [properties] Properties to set + */ + function FlowValidationResult(properties) { + this.validationMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowValidationResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @instance + */ + FlowValidationResult.prototype.name = ""; + + /** + * FlowValidationResult validationMessages. + * @member {Array.} validationMessages + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @instance + */ + FlowValidationResult.prototype.validationMessages = $util.emptyArray; + + /** + * FlowValidationResult updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @instance + */ + FlowValidationResult.prototype.updateTime = null; + + /** + * Creates a new FlowValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowValidationResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FlowValidationResult} FlowValidationResult instance + */ + FlowValidationResult.create = function create(properties) { + return new FlowValidationResult(properties); + }; + + /** + * Encodes the specified FlowValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowValidationResult} message FlowValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowValidationResult.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.validationMessages != null && message.validationMessages.length) + for (var i = 0; i < message.validationMessages.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ValidationMessage.encode(message.validationMessages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FlowValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowValidationResult} message FlowValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FlowValidationResult} FlowValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowValidationResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FlowValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.validationMessages && message.validationMessages.length)) + message.validationMessages = []; + message.validationMessages.push($root.google.cloud.dialogflow.cx.v3.ValidationMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FlowValidationResult} FlowValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowValidationResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowValidationResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validationMessages != null && message.hasOwnProperty("validationMessages")) { + if (!Array.isArray(message.validationMessages)) + return "validationMessages: array expected"; + for (var i = 0; i < message.validationMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ValidationMessage.verify(message.validationMessages[i], long + 1); + if (error) + return "validationMessages." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a FlowValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FlowValidationResult} FlowValidationResult + */ + FlowValidationResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FlowValidationResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FlowValidationResult(); + if (object.name != null) + message.name = String(object.name); + if (object.validationMessages) { + if (!Array.isArray(object.validationMessages)) + throw TypeError(".google.cloud.dialogflow.cx.v3.FlowValidationResult.validationMessages: array expected"); + message.validationMessages = []; + for (var i = 0; i < object.validationMessages.length; ++i) { + if (typeof object.validationMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.FlowValidationResult.validationMessages: object expected"); + message.validationMessages[i] = $root.google.cloud.dialogflow.cx.v3.ValidationMessage.fromObject(object.validationMessages[i], long + 1); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.FlowValidationResult.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FlowValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3.FlowValidationResult} message FlowValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validationMessages = []; + if (options.defaults) { + object.name = ""; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validationMessages && message.validationMessages.length) { + object.validationMessages = []; + for (var j = 0; j < message.validationMessages.length; ++j) + object.validationMessages[j] = $root.google.cloud.dialogflow.cx.v3.ValidationMessage.toObject(message.validationMessages[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this FlowValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @instance + * @returns {Object.} JSON object + */ + FlowValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowValidationResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FlowValidationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FlowValidationResult"; + }; + + return FlowValidationResult; + })(); + + v3.ImportFlowRequest = (function() { + + /** + * Properties of an ImportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportFlowRequest + * @property {string|null} [parent] ImportFlowRequest parent + * @property {string|null} [flowUri] ImportFlowRequest flowUri + * @property {Uint8Array|null} [flowContent] ImportFlowRequest flowContent + * @property {google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption|null} [importOption] ImportFlowRequest importOption + * @property {google.cloud.dialogflow.cx.v3.IFlowImportStrategy|null} [flowImportStrategy] ImportFlowRequest flowImportStrategy + */ + + /** + * Constructs a new ImportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportFlowRequest. + * @implements IImportFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportFlowRequest=} [properties] Properties to set + */ + function ImportFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportFlowRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.parent = ""; + + /** + * ImportFlowRequest flowUri. + * @member {string|null|undefined} flowUri + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.flowUri = null; + + /** + * ImportFlowRequest flowContent. + * @member {Uint8Array|null|undefined} flowContent + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.flowContent = null; + + /** + * ImportFlowRequest importOption. + * @member {google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption} importOption + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.importOption = 0; + + /** + * ImportFlowRequest flowImportStrategy. + * @member {google.cloud.dialogflow.cx.v3.IFlowImportStrategy|null|undefined} flowImportStrategy + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.flowImportStrategy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportFlowRequest flow. + * @member {"flowUri"|"flowContent"|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @instance + */ + Object.defineProperty(ImportFlowRequest.prototype, "flow", { + get: $util.oneOfGetter($oneOfFields = ["flowUri", "flowContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowRequest} ImportFlowRequest instance + */ + ImportFlowRequest.create = function create(properties) { + return new ImportFlowRequest(properties); + }; + + /** + * Encodes the specified ImportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportFlowRequest} message ImportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowRequest.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.flowUri != null && Object.hasOwnProperty.call(message, "flowUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowUri); + if (message.flowContent != null && Object.hasOwnProperty.call(message, "flowContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.flowContent); + if (message.importOption != null && Object.hasOwnProperty.call(message, "importOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.importOption); + if (message.flowImportStrategy != null && Object.hasOwnProperty.call(message, "flowImportStrategy")) + $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy.encode(message.flowImportStrategy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportFlowRequest} message ImportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowRequest} ImportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.flowUri = reader.string(); + break; + } + case 3: { + message.flowContent = reader.bytes(); + break; + } + case 4: { + message.importOption = reader.int32(); + break; + } + case 5: { + message.flowImportStrategy = $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowRequest} ImportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + properties.flow = 1; + if (!$util.isString(message.flowUri)) + return "flowUri: string expected"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + if (properties.flow === 1) + return "flow: multiple values"; + properties.flow = 1; + if (!(message.flowContent && typeof message.flowContent.length === "number" || $util.isString(message.flowContent))) + return "flowContent: buffer expected"; + } + if (message.importOption != null && message.hasOwnProperty("importOption")) + switch (message.importOption) { + default: + return "importOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.flowImportStrategy != null && message.hasOwnProperty("flowImportStrategy")) { + var error = $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy.verify(message.flowImportStrategy, long + 1); + if (error) + return "flowImportStrategy." + error; + } + return null; + }; + + /** + * Creates an ImportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowRequest} ImportFlowRequest + */ + ImportFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportFlowRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.flowUri != null) + message.flowUri = String(object.flowUri); + if (object.flowContent != null) + if (typeof object.flowContent === "string") + $util.base64.decode(object.flowContent, message.flowContent = $util.newBuffer($util.base64.length(object.flowContent)), 0); + else if (object.flowContent.length >= 0) + message.flowContent = object.flowContent; + switch (object.importOption) { + default: + if (typeof object.importOption === "number") { + message.importOption = object.importOption; + break; + } + break; + case "IMPORT_OPTION_UNSPECIFIED": + case 0: + message.importOption = 0; + break; + case "KEEP": + case 1: + message.importOption = 1; + break; + case "FALLBACK": + case 2: + message.importOption = 2; + break; + } + if (object.flowImportStrategy != null) { + if (typeof object.flowImportStrategy !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportFlowRequest.flowImportStrategy: object expected"); + message.flowImportStrategy = $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy.fromObject(object.flowImportStrategy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportFlowRequest} message ImportFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.importOption = options.enums === String ? "IMPORT_OPTION_UNSPECIFIED" : 0; + object.flowImportStrategy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + object.flowUri = message.flowUri; + if (options.oneofs) + object.flow = "flowUri"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + object.flowContent = options.bytes === String ? $util.base64.encode(message.flowContent, 0, message.flowContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.flowContent) : message.flowContent; + if (options.oneofs) + object.flow = "flowContent"; + } + if (message.importOption != null && message.hasOwnProperty("importOption")) + object.importOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption[message.importOption] === undefined ? message.importOption : $root.google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption[message.importOption] : message.importOption; + if (message.flowImportStrategy != null && message.hasOwnProperty("flowImportStrategy")) + object.flowImportStrategy = $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy.toObject(message.flowImportStrategy, options); + return object; + }; + + /** + * Converts this ImportFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @instance + * @returns {Object.} JSON object + */ + ImportFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportFlowRequest"; + }; + + /** + * ImportOption enum. + * @name google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption + * @enum {number} + * @property {number} IMPORT_OPTION_UNSPECIFIED=0 IMPORT_OPTION_UNSPECIFIED value + * @property {number} KEEP=1 KEEP value + * @property {number} FALLBACK=2 FALLBACK value + */ + ImportFlowRequest.ImportOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEEP"] = 1; + values[valuesById[2] = "FALLBACK"] = 2; + return values; + })(); + + return ImportFlowRequest; + })(); + + v3.FlowImportStrategy = (function() { + + /** + * Properties of a FlowImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFlowImportStrategy + * @property {google.cloud.dialogflow.cx.v3.ImportStrategy|null} [globalImportStrategy] FlowImportStrategy globalImportStrategy + */ + + /** + * Constructs a new FlowImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FlowImportStrategy. + * @implements IFlowImportStrategy + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFlowImportStrategy=} [properties] Properties to set + */ + function FlowImportStrategy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowImportStrategy globalImportStrategy. + * @member {google.cloud.dialogflow.cx.v3.ImportStrategy} globalImportStrategy + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @instance + */ + FlowImportStrategy.prototype.globalImportStrategy = 0; + + /** + * Creates a new FlowImportStrategy instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowImportStrategy=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FlowImportStrategy} FlowImportStrategy instance + */ + FlowImportStrategy.create = function create(properties) { + return new FlowImportStrategy(properties); + }; + + /** + * Encodes the specified FlowImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowImportStrategy.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowImportStrategy} message FlowImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowImportStrategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.globalImportStrategy != null && Object.hasOwnProperty.call(message, "globalImportStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.globalImportStrategy); + return writer; + }; + + /** + * Encodes the specified FlowImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowImportStrategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowImportStrategy} message FlowImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowImportStrategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FlowImportStrategy} FlowImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowImportStrategy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.globalImportStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FlowImportStrategy} FlowImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowImportStrategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowImportStrategy message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowImportStrategy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.globalImportStrategy != null && message.hasOwnProperty("globalImportStrategy")) + switch (message.globalImportStrategy) { + default: + return "globalImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FlowImportStrategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FlowImportStrategy} FlowImportStrategy + */ + FlowImportStrategy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FlowImportStrategy(); + switch (object.globalImportStrategy) { + default: + if (typeof object.globalImportStrategy === "number") { + message.globalImportStrategy = object.globalImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.globalImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.globalImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.globalImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.globalImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.globalImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.globalImportStrategy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FlowImportStrategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.FlowImportStrategy} message FlowImportStrategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowImportStrategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.globalImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + if (message.globalImportStrategy != null && message.hasOwnProperty("globalImportStrategy")) + object.globalImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.globalImportStrategy] === undefined ? message.globalImportStrategy : $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.globalImportStrategy] : message.globalImportStrategy; + return object; + }; + + /** + * Converts this FlowImportStrategy to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @instance + * @returns {Object.} JSON object + */ + FlowImportStrategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowImportStrategy + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FlowImportStrategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowImportStrategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FlowImportStrategy"; + }; + + return FlowImportStrategy; + })(); + + v3.ImportFlowResponse = (function() { + + /** + * Properties of an ImportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportFlowResponse + * @property {string|null} [flow] ImportFlowResponse flow + */ + + /** + * Constructs a new ImportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportFlowResponse. + * @implements IImportFlowResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportFlowResponse=} [properties] Properties to set + */ + function ImportFlowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportFlowResponse flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @instance + */ + ImportFlowResponse.prototype.flow = ""; + + /** + * Creates a new ImportFlowResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportFlowResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowResponse} ImportFlowResponse instance + */ + ImportFlowResponse.create = function create(properties) { + return new ImportFlowResponse(properties); + }; + + /** + * Encodes the specified ImportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportFlowResponse} message ImportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + return writer; + }; + + /** + * Encodes the specified ImportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportFlowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportFlowResponse} message ImportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowResponse} ImportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportFlowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowResponse} ImportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportFlowResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportFlowResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + return null; + }; + + /** + * Creates an ImportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportFlowResponse} ImportFlowResponse + */ + ImportFlowResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportFlowResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportFlowResponse(); + if (object.flow != null) + message.flow = String(object.flow); + return message; + }; + + /** + * Creates a plain object from an ImportFlowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportFlowResponse} message ImportFlowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportFlowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.flow = ""; + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + return object; + }; + + /** + * Converts this ImportFlowResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @instance + * @returns {Object.} JSON object + */ + ImportFlowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportFlowResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportFlowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportFlowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportFlowResponse"; + }; + + return ImportFlowResponse; + })(); + + v3.ExportFlowRequest = (function() { + + /** + * Properties of an ExportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportFlowRequest + * @property {string|null} [name] ExportFlowRequest name + * @property {string|null} [flowUri] ExportFlowRequest flowUri + * @property {boolean|null} [includeReferencedFlows] ExportFlowRequest includeReferencedFlows + */ + + /** + * Constructs a new ExportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportFlowRequest. + * @implements IExportFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportFlowRequest=} [properties] Properties to set + */ + function ExportFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @instance + */ + ExportFlowRequest.prototype.name = ""; + + /** + * ExportFlowRequest flowUri. + * @member {string} flowUri + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @instance + */ + ExportFlowRequest.prototype.flowUri = ""; + + /** + * ExportFlowRequest includeReferencedFlows. + * @member {boolean} includeReferencedFlows + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @instance + */ + ExportFlowRequest.prototype.includeReferencedFlows = false; + + /** + * Creates a new ExportFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowRequest} ExportFlowRequest instance + */ + ExportFlowRequest.create = function create(properties) { + return new ExportFlowRequest(properties); + }; + + /** + * Encodes the specified ExportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportFlowRequest} message ExportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowRequest.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.flowUri != null && Object.hasOwnProperty.call(message, "flowUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowUri); + if (message.includeReferencedFlows != null && Object.hasOwnProperty.call(message, "includeReferencedFlows")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includeReferencedFlows); + return writer; + }; + + /** + * Encodes the specified ExportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportFlowRequest} message ExportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowRequest} ExportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flowUri = reader.string(); + break; + } + case 4: { + message.includeReferencedFlows = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowRequest} ExportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) + if (!$util.isString(message.flowUri)) + return "flowUri: string expected"; + if (message.includeReferencedFlows != null && message.hasOwnProperty("includeReferencedFlows")) + if (typeof message.includeReferencedFlows !== "boolean") + return "includeReferencedFlows: boolean expected"; + return null; + }; + + /** + * Creates an ExportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowRequest} ExportFlowRequest + */ + ExportFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.flowUri != null) + message.flowUri = String(object.flowUri); + if (object.includeReferencedFlows != null) + message.includeReferencedFlows = Boolean(object.includeReferencedFlows); + return message; + }; + + /** + * Creates a plain object from an ExportFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportFlowRequest} message ExportFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.flowUri = ""; + object.includeReferencedFlows = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) + object.flowUri = message.flowUri; + if (message.includeReferencedFlows != null && message.hasOwnProperty("includeReferencedFlows")) + object.includeReferencedFlows = message.includeReferencedFlows; + return object; + }; + + /** + * Converts this ExportFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @instance + * @returns {Object.} JSON object + */ + ExportFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportFlowRequest"; + }; + + return ExportFlowRequest; + })(); + + v3.ExportFlowResponse = (function() { + + /** + * Properties of an ExportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportFlowResponse + * @property {string|null} [flowUri] ExportFlowResponse flowUri + * @property {Uint8Array|null} [flowContent] ExportFlowResponse flowContent + */ + + /** + * Constructs a new ExportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportFlowResponse. + * @implements IExportFlowResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportFlowResponse=} [properties] Properties to set + */ + function ExportFlowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportFlowResponse flowUri. + * @member {string|null|undefined} flowUri + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @instance + */ + ExportFlowResponse.prototype.flowUri = null; + + /** + * ExportFlowResponse flowContent. + * @member {Uint8Array|null|undefined} flowContent + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @instance + */ + ExportFlowResponse.prototype.flowContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportFlowResponse flow. + * @member {"flowUri"|"flowContent"|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @instance + */ + Object.defineProperty(ExportFlowResponse.prototype, "flow", { + get: $util.oneOfGetter($oneOfFields = ["flowUri", "flowContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportFlowResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportFlowResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowResponse} ExportFlowResponse instance + */ + ExportFlowResponse.create = function create(properties) { + return new ExportFlowResponse(properties); + }; + + /** + * Encodes the specified ExportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportFlowResponse} message ExportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flowUri != null && Object.hasOwnProperty.call(message, "flowUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flowUri); + if (message.flowContent != null && Object.hasOwnProperty.call(message, "flowContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.flowContent); + return writer; + }; + + /** + * Encodes the specified ExportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportFlowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportFlowResponse} message ExportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowResponse} ExportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportFlowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flowUri = reader.string(); + break; + } + case 2: { + message.flowContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowResponse} ExportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportFlowResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportFlowResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + properties.flow = 1; + if (!$util.isString(message.flowUri)) + return "flowUri: string expected"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + if (properties.flow === 1) + return "flow: multiple values"; + properties.flow = 1; + if (!(message.flowContent && typeof message.flowContent.length === "number" || $util.isString(message.flowContent))) + return "flowContent: buffer expected"; + } + return null; + }; + + /** + * Creates an ExportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportFlowResponse} ExportFlowResponse + */ + ExportFlowResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportFlowResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportFlowResponse(); + if (object.flowUri != null) + message.flowUri = String(object.flowUri); + if (object.flowContent != null) + if (typeof object.flowContent === "string") + $util.base64.decode(object.flowContent, message.flowContent = $util.newBuffer($util.base64.length(object.flowContent)), 0); + else if (object.flowContent.length >= 0) + message.flowContent = object.flowContent; + return message; + }; + + /** + * Creates a plain object from an ExportFlowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportFlowResponse} message ExportFlowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportFlowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + object.flowUri = message.flowUri; + if (options.oneofs) + object.flow = "flowUri"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + object.flowContent = options.bytes === String ? $util.base64.encode(message.flowContent, 0, message.flowContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.flowContent) : message.flowContent; + if (options.oneofs) + object.flow = "flowContent"; + } + return object; + }; + + /** + * Converts this ExportFlowResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @instance + * @returns {Object.} JSON object + */ + ExportFlowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportFlowResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportFlowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportFlowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportFlowResponse"; + }; + + return ExportFlowResponse; + })(); + + /** + * ImportStrategy enum. + * @name google.cloud.dialogflow.cx.v3.ImportStrategy + * @enum {number} + * @property {number} IMPORT_STRATEGY_UNSPECIFIED=0 IMPORT_STRATEGY_UNSPECIFIED value + * @property {number} IMPORT_STRATEGY_CREATE_NEW=1 IMPORT_STRATEGY_CREATE_NEW value + * @property {number} IMPORT_STRATEGY_REPLACE=2 IMPORT_STRATEGY_REPLACE value + * @property {number} IMPORT_STRATEGY_KEEP=3 IMPORT_STRATEGY_KEEP value + * @property {number} IMPORT_STRATEGY_MERGE=4 IMPORT_STRATEGY_MERGE value + * @property {number} IMPORT_STRATEGY_THROW_ERROR=5 IMPORT_STRATEGY_THROW_ERROR value + */ + v3.ImportStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPORT_STRATEGY_CREATE_NEW"] = 1; + values[valuesById[2] = "IMPORT_STRATEGY_REPLACE"] = 2; + values[valuesById[3] = "IMPORT_STRATEGY_KEEP"] = 3; + values[valuesById[4] = "IMPORT_STRATEGY_MERGE"] = 4; + values[valuesById[5] = "IMPORT_STRATEGY_THROW_ERROR"] = 5; + return values; + })(); + + v3.Pages = (function() { + + /** + * Constructs a new Pages service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Pages + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Pages(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Pages.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Pages; + + /** + * Creates new Pages service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Pages} RPC service. Useful where requests and/or responses are streamed. + */ + Pages.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|listPages}. + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @typedef ListPagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListPagesResponse} [response] ListPagesResponse + */ + + /** + * Calls ListPages. + * @function listPages + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListPagesRequest} request ListPagesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Pages.ListPagesCallback} callback Node-style callback called with the error, if any, and ListPagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.listPages = function listPages(request, callback) { + return this.rpcCall(listPages, $root.google.cloud.dialogflow.cx.v3.ListPagesRequest, $root.google.cloud.dialogflow.cx.v3.ListPagesResponse, request, callback); + }, "name", { value: "ListPages" }); + + /** + * Calls ListPages. + * @function listPages + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListPagesRequest} request ListPagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|getPage}. + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @typedef GetPageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Page} [response] Page + */ + + /** + * Calls GetPage. + * @function getPage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetPageRequest} request GetPageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Pages.GetPageCallback} callback Node-style callback called with the error, if any, and Page + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.getPage = function getPage(request, callback) { + return this.rpcCall(getPage, $root.google.cloud.dialogflow.cx.v3.GetPageRequest, $root.google.cloud.dialogflow.cx.v3.Page, request, callback); + }, "name", { value: "GetPage" }); + + /** + * Calls GetPage. + * @function getPage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetPageRequest} request GetPageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|createPage}. + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @typedef CreatePageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Page} [response] Page + */ + + /** + * Calls CreatePage. + * @function createPage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreatePageRequest} request CreatePageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Pages.CreatePageCallback} callback Node-style callback called with the error, if any, and Page + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.createPage = function createPage(request, callback) { + return this.rpcCall(createPage, $root.google.cloud.dialogflow.cx.v3.CreatePageRequest, $root.google.cloud.dialogflow.cx.v3.Page, request, callback); + }, "name", { value: "CreatePage" }); + + /** + * Calls CreatePage. + * @function createPage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreatePageRequest} request CreatePageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|updatePage}. + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @typedef UpdatePageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Page} [response] Page + */ + + /** + * Calls UpdatePage. + * @function updatePage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdatePageRequest} request UpdatePageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Pages.UpdatePageCallback} callback Node-style callback called with the error, if any, and Page + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.updatePage = function updatePage(request, callback) { + return this.rpcCall(updatePage, $root.google.cloud.dialogflow.cx.v3.UpdatePageRequest, $root.google.cloud.dialogflow.cx.v3.Page, request, callback); + }, "name", { value: "UpdatePage" }); + + /** + * Calls UpdatePage. + * @function updatePage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdatePageRequest} request UpdatePageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Pages|deletePage}. + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @typedef DeletePageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePage. + * @function deletePage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeletePageRequest} request DeletePageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Pages.DeletePageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.deletePage = function deletePage(request, callback) { + return this.rpcCall(deletePage, $root.google.cloud.dialogflow.cx.v3.DeletePageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePage" }); + + /** + * Calls DeletePage. + * @function deletePage + * @memberof google.cloud.dialogflow.cx.v3.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeletePageRequest} request DeletePageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Pages; + })(); + + v3.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPage + * @property {string|null} [name] Page name + * @property {string|null} [displayName] Page displayName + * @property {string|null} [description] Page description + * @property {google.cloud.dialogflow.cx.v3.IFulfillment|null} [entryFulfillment] Page entryFulfillment + * @property {google.cloud.dialogflow.cx.v3.IForm|null} [form] Page form + * @property {Array.|null} [transitionRouteGroups] Page transitionRouteGroups + * @property {Array.|null} [transitionRoutes] Page transitionRoutes + * @property {Array.|null} [eventHandlers] Page eventHandlers + * @property {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null} [advancedSettings] Page advancedSettings + * @property {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null} [knowledgeConnectorSettings] Page knowledgeConnectorSettings + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.transitionRouteGroups = []; + this.transitionRoutes = []; + this.eventHandlers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Page name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.name = ""; + + /** + * Page displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.displayName = ""; + + /** + * Page description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.description = ""; + + /** + * Page entryFulfillment. + * @member {google.cloud.dialogflow.cx.v3.IFulfillment|null|undefined} entryFulfillment + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.entryFulfillment = null; + + /** + * Page form. + * @member {google.cloud.dialogflow.cx.v3.IForm|null|undefined} form + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.form = null; + + /** + * Page transitionRouteGroups. + * @member {Array.} transitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.transitionRouteGroups = $util.emptyArray; + + /** + * Page transitionRoutes. + * @member {Array.} transitionRoutes + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.transitionRoutes = $util.emptyArray; + + /** + * Page eventHandlers. + * @member {Array.} eventHandlers + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.eventHandlers = $util.emptyArray; + + /** + * Page advancedSettings. + * @member {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.advancedSettings = null; + + /** + * Page knowledgeConnectorSettings. + * @member {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings|null|undefined} knowledgeConnectorSettings + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + */ + Page.prototype.knowledgeConnectorSettings = null; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {google.cloud.dialogflow.cx.v3.IPage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {google.cloud.dialogflow.cx.v3.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.form != null && Object.hasOwnProperty.call(message, "form")) + $root.google.cloud.dialogflow.cx.v3.Form.encode(message.form, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.entryFulfillment != null && Object.hasOwnProperty.call(message, "entryFulfillment")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.encode(message.entryFulfillment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.transitionRoutes != null && message.transitionRoutes.length) + for (var i = 0; i < message.transitionRoutes.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TransitionRoute.encode(message.transitionRoutes[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.eventHandlers != null && message.eventHandlers.length) + for (var i = 0; i < message.eventHandlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3.EventHandler.encode(message.eventHandlers[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.transitionRouteGroups != null && message.transitionRouteGroups.length) + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.transitionRouteGroups[i]); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.knowledgeConnectorSettings != null && Object.hasOwnProperty.call(message, "knowledgeConnectorSettings")) + $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.encode(message.knowledgeConnectorSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.description); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {google.cloud.dialogflow.cx.v3.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 19: { + message.description = reader.string(); + break; + } + case 7: { + message.entryFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.form = $root.google.cloud.dialogflow.cx.v3.Form.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + if (!(message.transitionRouteGroups && message.transitionRouteGroups.length)) + message.transitionRouteGroups = []; + message.transitionRouteGroups.push(reader.string()); + break; + } + case 9: { + if (!(message.transitionRoutes && message.transitionRoutes.length)) + message.transitionRoutes = []; + message.transitionRoutes.push($root.google.cloud.dialogflow.cx.v3.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.eventHandlers && message.eventHandlers.length)) + message.eventHandlers = []; + message.eventHandlers.push($root.google.cloud.dialogflow.cx.v3.EventHandler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 13: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.entryFulfillment != null && message.hasOwnProperty("entryFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.verify(message.entryFulfillment, long + 1); + if (error) + return "entryFulfillment." + error; + } + if (message.form != null && message.hasOwnProperty("form")) { + var error = $root.google.cloud.dialogflow.cx.v3.Form.verify(message.form, long + 1); + if (error) + return "form." + error; + } + if (message.transitionRouteGroups != null && message.hasOwnProperty("transitionRouteGroups")) { + if (!Array.isArray(message.transitionRouteGroups)) + return "transitionRouteGroups: array expected"; + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + if (!$util.isString(message.transitionRouteGroups[i])) + return "transitionRouteGroups: string[] expected"; + } + if (message.transitionRoutes != null && message.hasOwnProperty("transitionRoutes")) { + if (!Array.isArray(message.transitionRoutes)) + return "transitionRoutes: array expected"; + for (var i = 0; i < message.transitionRoutes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.verify(message.transitionRoutes[i], long + 1); + if (error) + return "transitionRoutes." + error; + } + } + if (message.eventHandlers != null && message.hasOwnProperty("eventHandlers")) { + if (!Array.isArray(message.eventHandlers)) + return "eventHandlers: array expected"; + for (var i = 0; i < message.eventHandlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.EventHandler.verify(message.eventHandlers[i], long + 1); + if (error) + return "eventHandlers." + error; + } + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.verify(message.knowledgeConnectorSettings, long + 1); + if (error) + return "knowledgeConnectorSettings." + error; + } + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Page} Page + */ + Page.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Page) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Page(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.entryFulfillment != null) { + if (typeof object.entryFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.entryFulfillment: object expected"); + message.entryFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.fromObject(object.entryFulfillment, long + 1); + } + if (object.form != null) { + if (typeof object.form !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.form: object expected"); + message.form = $root.google.cloud.dialogflow.cx.v3.Form.fromObject(object.form, long + 1); + } + if (object.transitionRouteGroups) { + if (!Array.isArray(object.transitionRouteGroups)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.transitionRouteGroups: array expected"); + message.transitionRouteGroups = []; + for (var i = 0; i < object.transitionRouteGroups.length; ++i) + message.transitionRouteGroups[i] = String(object.transitionRouteGroups[i]); + } + if (object.transitionRoutes) { + if (!Array.isArray(object.transitionRoutes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.transitionRoutes: array expected"); + message.transitionRoutes = []; + for (var i = 0; i < object.transitionRoutes.length; ++i) { + if (typeof object.transitionRoutes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.transitionRoutes: object expected"); + message.transitionRoutes[i] = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.fromObject(object.transitionRoutes[i], long + 1); + } + } + if (object.eventHandlers) { + if (!Array.isArray(object.eventHandlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.eventHandlers: array expected"); + message.eventHandlers = []; + for (var i = 0; i < object.eventHandlers.length; ++i) { + if (typeof object.eventHandlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.eventHandlers: object expected"); + message.eventHandlers[i] = $root.google.cloud.dialogflow.cx.v3.EventHandler.fromObject(object.eventHandlers[i], long + 1); + } + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.knowledgeConnectorSettings != null) { + if (typeof object.knowledgeConnectorSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Page.knowledgeConnectorSettings: object expected"); + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.fromObject(object.knowledgeConnectorSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {google.cloud.dialogflow.cx.v3.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.transitionRoutes = []; + object.eventHandlers = []; + object.transitionRouteGroups = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.form = null; + object.entryFulfillment = null; + object.advancedSettings = null; + object.knowledgeConnectorSettings = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.form != null && message.hasOwnProperty("form")) + object.form = $root.google.cloud.dialogflow.cx.v3.Form.toObject(message.form, options); + if (message.entryFulfillment != null && message.hasOwnProperty("entryFulfillment")) + object.entryFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.toObject(message.entryFulfillment, options); + if (message.transitionRoutes && message.transitionRoutes.length) { + object.transitionRoutes = []; + for (var j = 0; j < message.transitionRoutes.length; ++j) + object.transitionRoutes[j] = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.toObject(message.transitionRoutes[j], options); + } + if (message.eventHandlers && message.eventHandlers.length) { + object.eventHandlers = []; + for (var j = 0; j < message.eventHandlers.length; ++j) + object.eventHandlers[j] = $root.google.cloud.dialogflow.cx.v3.EventHandler.toObject(message.eventHandlers[j], options); + } + if (message.transitionRouteGroups && message.transitionRouteGroups.length) { + object.transitionRouteGroups = []; + for (var j = 0; j < message.transitionRouteGroups.length; ++j) + object.transitionRouteGroups[j] = message.transitionRouteGroups[j]; + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) + object.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.toObject(message.knowledgeConnectorSettings, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Page + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Page + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Page.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Page"; + }; + + return Page; + })(); + + v3.Form = (function() { + + /** + * Properties of a Form. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IForm + * @property {Array.|null} [parameters] Form parameters + */ + + /** + * Constructs a new Form. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Form. + * @implements IForm + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IForm=} [properties] Properties to set + */ + function Form(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Form parameters. + * @member {Array.} parameters + * @memberof google.cloud.dialogflow.cx.v3.Form + * @instance + */ + Form.prototype.parameters = $util.emptyArray; + + /** + * Creates a new Form instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {google.cloud.dialogflow.cx.v3.IForm=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Form} Form instance + */ + Form.create = function create(properties) { + return new Form(properties); + }; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {google.cloud.dialogflow.cx.v3.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Form.Parameter.encode(message.parameters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {google.cloud.dialogflow.cx.v3.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Form message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Form(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.dialogflow.cx.v3.Form.Parameter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Form message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Form.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Form.Parameter.verify(message.parameters[i], long + 1); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a Form message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Form} Form + */ + Form.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Form) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Form(); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.parameters: object expected"); + message.parameters[i] = $root.google.cloud.dialogflow.cx.v3.Form.Parameter.fromObject(object.parameters[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {google.cloud.dialogflow.cx.v3.Form} message Form + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Form.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.dialogflow.cx.v3.Form.Parameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this Form to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Form + * @instance + * @returns {Object.} JSON object + */ + Form.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Form + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Form + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Form.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Form"; + }; + + Form.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.cloud.dialogflow.cx.v3.Form + * @interface IParameter + * @property {string|null} [displayName] Parameter displayName + * @property {boolean|null} [required] Parameter required + * @property {string|null} [entityType] Parameter entityType + * @property {boolean|null} [isList] Parameter isList + * @property {google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior|null} [fillBehavior] Parameter fillBehavior + * @property {google.protobuf.IValue|null} [defaultValue] Parameter defaultValue + * @property {boolean|null} [redact] Parameter redact + * @property {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null} [advancedSettings] Parameter advancedSettings + */ + + /** + * Constructs a new Parameter. + * @memberof google.cloud.dialogflow.cx.v3.Form + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Form.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.displayName = ""; + + /** + * Parameter required. + * @member {boolean} required + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.required = false; + + /** + * Parameter entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.entityType = ""; + + /** + * Parameter isList. + * @member {boolean} isList + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.isList = false; + + /** + * Parameter fillBehavior. + * @member {google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior|null|undefined} fillBehavior + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.fillBehavior = null; + + /** + * Parameter defaultValue. + * @member {google.protobuf.IValue|null|undefined} defaultValue + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.defaultValue = null; + + /** + * Parameter redact. + * @member {boolean} redact + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.redact = false; + + /** + * Parameter advancedSettings. + * @member {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + */ + Parameter.prototype.advancedSettings = null; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.IParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.required); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityType); + if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isList); + if (message.fillBehavior != null && Object.hasOwnProperty.call(message, "fillBehavior")) + $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.encode(message.fillBehavior, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + $root.google.protobuf.Value.encode(message.defaultValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.redact != null && Object.hasOwnProperty.call(message, "redact")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.redact); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Form.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.required = reader.bool(); + break; + } + case 3: { + message.entityType = reader.string(); + break; + } + case 4: { + message.isList = reader.bool(); + break; + } + case 7: { + message.fillBehavior = $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.defaultValue = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.redact = reader.bool(); + break; + } + case 12: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.isList != null && message.hasOwnProperty("isList")) + if (typeof message.isList !== "boolean") + return "isList: boolean expected"; + if (message.fillBehavior != null && message.hasOwnProperty("fillBehavior")) { + var error = $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.verify(message.fillBehavior, long + 1); + if (error) + return "fillBehavior." + error; + } + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) { + var error = $root.google.protobuf.Value.verify(message.defaultValue, long + 1); + if (error) + return "defaultValue." + error; + } + if (message.redact != null && message.hasOwnProperty("redact")) + if (typeof message.redact !== "boolean") + return "redact: boolean expected"; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Form.Parameter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Form.Parameter(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.required != null) + message.required = Boolean(object.required); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.isList != null) + message.isList = Boolean(object.isList); + if (object.fillBehavior != null) { + if (typeof object.fillBehavior !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.Parameter.fillBehavior: object expected"); + message.fillBehavior = $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.fromObject(object.fillBehavior, long + 1); + } + if (object.defaultValue != null) { + if (typeof object.defaultValue !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.Parameter.defaultValue: object expected"); + message.defaultValue = $root.google.protobuf.Value.fromObject(object.defaultValue, long + 1); + } + if (object.redact != null) + message.redact = Boolean(object.redact); + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.Parameter.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.required = false; + object.entityType = ""; + object.isList = false; + object.fillBehavior = null; + object.defaultValue = null; + object.redact = false; + object.advancedSettings = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.isList != null && message.hasOwnProperty("isList")) + object.isList = message.isList; + if (message.fillBehavior != null && message.hasOwnProperty("fillBehavior")) + object.fillBehavior = $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.toObject(message.fillBehavior, options); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = $root.google.protobuf.Value.toObject(message.defaultValue, options); + if (message.redact != null && message.hasOwnProperty("redact")) + object.redact = message.redact; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.toObject(message.advancedSettings, options); + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Form.Parameter"; + }; + + Parameter.FillBehavior = (function() { + + /** + * Properties of a FillBehavior. + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @interface IFillBehavior + * @property {google.cloud.dialogflow.cx.v3.IFulfillment|null} [initialPromptFulfillment] FillBehavior initialPromptFulfillment + * @property {Array.|null} [repromptEventHandlers] FillBehavior repromptEventHandlers + */ + + /** + * Constructs a new FillBehavior. + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter + * @classdesc Represents a FillBehavior. + * @implements IFillBehavior + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior=} [properties] Properties to set + */ + function FillBehavior(properties) { + this.repromptEventHandlers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FillBehavior initialPromptFulfillment. + * @member {google.cloud.dialogflow.cx.v3.IFulfillment|null|undefined} initialPromptFulfillment + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @instance + */ + FillBehavior.prototype.initialPromptFulfillment = null; + + /** + * FillBehavior repromptEventHandlers. + * @member {Array.} repromptEventHandlers + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @instance + */ + FillBehavior.prototype.repromptEventHandlers = $util.emptyArray; + + /** + * Creates a new FillBehavior instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior} FillBehavior instance + */ + FillBehavior.create = function create(properties) { + return new FillBehavior(properties); + }; + + /** + * Encodes the specified FillBehavior message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior} message FillBehavior message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FillBehavior.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPromptFulfillment != null && Object.hasOwnProperty.call(message, "initialPromptFulfillment")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.encode(message.initialPromptFulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.repromptEventHandlers != null && message.repromptEventHandlers.length) + for (var i = 0; i < message.repromptEventHandlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3.EventHandler.encode(message.repromptEventHandlers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FillBehavior message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.Parameter.IFillBehavior} message FillBehavior message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FillBehavior.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FillBehavior message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior} FillBehavior + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FillBehavior.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.initialPromptFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.repromptEventHandlers && message.repromptEventHandlers.length)) + message.repromptEventHandlers = []; + message.repromptEventHandlers.push($root.google.cloud.dialogflow.cx.v3.EventHandler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FillBehavior message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior} FillBehavior + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FillBehavior.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FillBehavior message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FillBehavior.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.initialPromptFulfillment != null && message.hasOwnProperty("initialPromptFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.verify(message.initialPromptFulfillment, long + 1); + if (error) + return "initialPromptFulfillment." + error; + } + if (message.repromptEventHandlers != null && message.hasOwnProperty("repromptEventHandlers")) { + if (!Array.isArray(message.repromptEventHandlers)) + return "repromptEventHandlers: array expected"; + for (var i = 0; i < message.repromptEventHandlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.EventHandler.verify(message.repromptEventHandlers[i], long + 1); + if (error) + return "repromptEventHandlers." + error; + } + } + return null; + }; + + /** + * Creates a FillBehavior message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior} FillBehavior + */ + FillBehavior.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior(); + if (object.initialPromptFulfillment != null) { + if (typeof object.initialPromptFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.initialPromptFulfillment: object expected"); + message.initialPromptFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.fromObject(object.initialPromptFulfillment, long + 1); + } + if (object.repromptEventHandlers) { + if (!Array.isArray(object.repromptEventHandlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.repromptEventHandlers: array expected"); + message.repromptEventHandlers = []; + for (var i = 0; i < object.repromptEventHandlers.length; ++i) { + if (typeof object.repromptEventHandlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior.repromptEventHandlers: object expected"); + message.repromptEventHandlers[i] = $root.google.cloud.dialogflow.cx.v3.EventHandler.fromObject(object.repromptEventHandlers[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FillBehavior message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior} message FillBehavior + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FillBehavior.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.repromptEventHandlers = []; + if (options.defaults) + object.initialPromptFulfillment = null; + if (message.initialPromptFulfillment != null && message.hasOwnProperty("initialPromptFulfillment")) + object.initialPromptFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.toObject(message.initialPromptFulfillment, options); + if (message.repromptEventHandlers && message.repromptEventHandlers.length) { + object.repromptEventHandlers = []; + for (var j = 0; j < message.repromptEventHandlers.length; ++j) + object.repromptEventHandlers[j] = $root.google.cloud.dialogflow.cx.v3.EventHandler.toObject(message.repromptEventHandlers[j], options); + } + return object; + }; + + /** + * Converts this FillBehavior to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @instance + * @returns {Object.} JSON object + */ + FillBehavior.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FillBehavior + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FillBehavior.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior"; + }; + + return FillBehavior; + })(); + + return Parameter; + })(); + + return Form; + })(); + + v3.EventHandler = (function() { + + /** + * Properties of an EventHandler. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IEventHandler + * @property {string|null} [name] EventHandler name + * @property {string|null} [event] EventHandler event + * @property {google.cloud.dialogflow.cx.v3.IFulfillment|null} [triggerFulfillment] EventHandler triggerFulfillment + * @property {string|null} [targetPage] EventHandler targetPage + * @property {string|null} [targetFlow] EventHandler targetFlow + * @property {string|null} [targetPlaybook] EventHandler targetPlaybook + */ + + /** + * Constructs a new EventHandler. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an EventHandler. + * @implements IEventHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IEventHandler=} [properties] Properties to set + */ + function EventHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventHandler name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + */ + EventHandler.prototype.name = ""; + + /** + * EventHandler event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + */ + EventHandler.prototype.event = ""; + + /** + * EventHandler triggerFulfillment. + * @member {google.cloud.dialogflow.cx.v3.IFulfillment|null|undefined} triggerFulfillment + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + */ + EventHandler.prototype.triggerFulfillment = null; + + /** + * EventHandler targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + */ + EventHandler.prototype.targetPage = null; + + /** + * EventHandler targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + */ + EventHandler.prototype.targetFlow = null; + + /** + * EventHandler targetPlaybook. + * @member {string|null|undefined} targetPlaybook + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + */ + EventHandler.prototype.targetPlaybook = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EventHandler target. + * @member {"targetPage"|"targetFlow"|"targetPlaybook"|undefined} target + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + */ + Object.defineProperty(EventHandler.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow", "targetPlaybook"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EventHandler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.IEventHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.EventHandler} EventHandler instance + */ + EventHandler.create = function create(properties) { + return new EventHandler(properties); + }; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventHandler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetFlow); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.event); + if (message.triggerFulfillment != null && Object.hasOwnProperty.call(message, "triggerFulfillment")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.encode(message.triggerFulfillment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.targetPlaybook != null && Object.hasOwnProperty.call(message, "targetPlaybook")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.targetPlaybook); + return writer; + }; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.EventHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 4: { + message.event = reader.string(); + break; + } + case 5: { + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.targetPage = reader.string(); + break; + } + case 3: { + message.targetFlow = reader.string(); + break; + } + case 7: { + message.targetPlaybook = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventHandler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventHandler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.verify(message.triggerFulfillment, long + 1); + if (error) + return "triggerFulfillment." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.target = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + if (message.targetPlaybook != null && message.hasOwnProperty("targetPlaybook")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetPlaybook)) + return "targetPlaybook: string expected"; + } + return null; + }; + + /** + * Creates an EventHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.EventHandler} EventHandler + */ + EventHandler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.EventHandler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.EventHandler(); + if (object.name != null) + message.name = String(object.name); + if (object.event != null) + message.event = String(object.event); + if (object.triggerFulfillment != null) { + if (typeof object.triggerFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.EventHandler.triggerFulfillment: object expected"); + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.fromObject(object.triggerFulfillment, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + if (object.targetPlaybook != null) + message.targetPlaybook = String(object.targetPlaybook); + return message; + }; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.EventHandler} message EventHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.event = ""; + object.triggerFulfillment = null; + object.name = ""; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.target = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.target = "targetFlow"; + } + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) + object.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.toObject(message.triggerFulfillment, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.targetPlaybook != null && message.hasOwnProperty("targetPlaybook")) { + object.targetPlaybook = message.targetPlaybook; + if (options.oneofs) + object.target = "targetPlaybook"; + } + return object; + }; + + /** + * Converts this EventHandler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @instance + * @returns {Object.} JSON object + */ + EventHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventHandler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.EventHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.EventHandler"; + }; + + return EventHandler; + })(); + + v3.TransitionRoute = (function() { + + /** + * Properties of a TransitionRoute. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITransitionRoute + * @property {string|null} [name] TransitionRoute name + * @property {string|null} [description] TransitionRoute description + * @property {string|null} [intent] TransitionRoute intent + * @property {string|null} [condition] TransitionRoute condition + * @property {google.cloud.dialogflow.cx.v3.IFulfillment|null} [triggerFulfillment] TransitionRoute triggerFulfillment + * @property {string|null} [targetPage] TransitionRoute targetPage + * @property {string|null} [targetFlow] TransitionRoute targetFlow + */ + + /** + * Constructs a new TransitionRoute. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TransitionRoute. + * @implements ITransitionRoute + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITransitionRoute=} [properties] Properties to set + */ + function TransitionRoute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionRoute name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + TransitionRoute.prototype.name = ""; + + /** + * TransitionRoute description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + TransitionRoute.prototype.description = ""; + + /** + * TransitionRoute intent. + * @member {string} intent + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + TransitionRoute.prototype.intent = ""; + + /** + * TransitionRoute condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + TransitionRoute.prototype.condition = ""; + + /** + * TransitionRoute triggerFulfillment. + * @member {google.cloud.dialogflow.cx.v3.IFulfillment|null|undefined} triggerFulfillment + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + TransitionRoute.prototype.triggerFulfillment = null; + + /** + * TransitionRoute targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + TransitionRoute.prototype.targetPage = null; + + /** + * TransitionRoute targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + TransitionRoute.prototype.targetFlow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransitionRoute target. + * @member {"targetPage"|"targetFlow"|undefined} target + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + */ + Object.defineProperty(TransitionRoute.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransitionRoute instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRoute=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionRoute} TransitionRoute instance + */ + TransitionRoute.create = function create(properties) { + return new TransitionRoute(properties); + }; + + /** + * Encodes the specified TransitionRoute message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRoute} message TransitionRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRoute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intent); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.condition); + if (message.triggerFulfillment != null && Object.hasOwnProperty.call(message, "triggerFulfillment")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.encode(message.triggerFulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetFlow); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified TransitionRoute message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRoute} message TransitionRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionRoute} TransitionRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRoute.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionRoute(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 1: { + message.intent = reader.string(); + break; + } + case 2: { + message.condition = reader.string(); + break; + } + case 3: { + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.targetPage = reader.string(); + break; + } + case 5: { + message.targetFlow = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionRoute} TransitionRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionRoute message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionRoute.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.intent != null && message.hasOwnProperty("intent")) + if (!$util.isString(message.intent)) + return "intent: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.verify(message.triggerFulfillment, long + 1); + if (error) + return "triggerFulfillment." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.target = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + return null; + }; + + /** + * Creates a TransitionRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionRoute} TransitionRoute + */ + TransitionRoute.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionRoute) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionRoute(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.intent != null) + message.intent = String(object.intent); + if (object.condition != null) + message.condition = String(object.condition); + if (object.triggerFulfillment != null) { + if (typeof object.triggerFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRoute.triggerFulfillment: object expected"); + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.fromObject(object.triggerFulfillment, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + return message; + }; + + /** + * Creates a plain object from a TransitionRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRoute} message TransitionRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = ""; + object.condition = ""; + object.triggerFulfillment = null; + object.name = ""; + object.description = ""; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = message.intent; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) + object.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.toObject(message.triggerFulfillment, options); + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.target = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.target = "targetFlow"; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this TransitionRoute to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @instance + * @returns {Object.} JSON object + */ + TransitionRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionRoute + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionRoute"; + }; + + return TransitionRoute; + })(); + + v3.ListPagesRequest = (function() { + + /** + * Properties of a ListPagesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListPagesRequest + * @property {string|null} [parent] ListPagesRequest parent + * @property {string|null} [languageCode] ListPagesRequest languageCode + * @property {number|null} [pageSize] ListPagesRequest pageSize + * @property {string|null} [pageToken] ListPagesRequest pageToken + */ + + /** + * Constructs a new ListPagesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListPagesRequest. + * @implements IListPagesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListPagesRequest=} [properties] Properties to set + */ + function ListPagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPagesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.parent = ""; + + /** + * ListPagesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.languageCode = ""; + + /** + * ListPagesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.pageSize = 0; + + /** + * ListPagesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPagesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListPagesRequest} ListPagesRequest instance + */ + ListPagesRequest.create = function create(properties) { + return new ListPagesRequest(properties); + }; + + /** + * Encodes the specified ListPagesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPagesRequest} message ListPagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPagesRequest} message ListPagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListPagesRequest} ListPagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListPagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListPagesRequest} ListPagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPagesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPagesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: 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"; + return null; + }; + + /** + * Creates a ListPagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListPagesRequest} ListPagesRequest + */ + ListPagesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListPagesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListPagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListPagesRequest} message ListPagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListPagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPagesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListPagesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListPagesRequest"; + }; + + return ListPagesRequest; + })(); + + v3.ListPagesResponse = (function() { + + /** + * Properties of a ListPagesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListPagesResponse + * @property {Array.|null} [pages] ListPagesResponse pages + * @property {string|null} [nextPageToken] ListPagesResponse nextPageToken + */ + + /** + * Constructs a new ListPagesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListPagesResponse. + * @implements IListPagesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListPagesResponse=} [properties] Properties to set + */ + function ListPagesResponse(properties) { + this.pages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPagesResponse pages. + * @member {Array.} pages + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @instance + */ + ListPagesResponse.prototype.pages = $util.emptyArray; + + /** + * ListPagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @instance + */ + ListPagesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPagesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListPagesResponse} ListPagesResponse instance + */ + ListPagesResponse.create = function create(properties) { + return new ListPagesResponse(properties); + }; + + /** + * Encodes the specified ListPagesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPagesResponse} message ListPagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Page.encode(message.pages[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 ListPagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPagesResponse} message ListPagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListPagesResponse} ListPagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListPagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.dialogflow.cx.v3.Page.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListPagesResponse} ListPagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPagesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPagesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Page.verify(message.pages[i], long + 1); + if (error) + return "pages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListPagesResponse} ListPagesResponse + */ + ListPagesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListPagesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListPagesResponse(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListPagesResponse.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListPagesResponse.pages: object expected"); + message.pages[i] = $root.google.cloud.dialogflow.cx.v3.Page.fromObject(object.pages[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListPagesResponse} message ListPagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.dialogflow.cx.v3.Page.toObject(message.pages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListPagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPagesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListPagesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListPagesResponse"; + }; + + return ListPagesResponse; + })(); + + v3.GetPageRequest = (function() { + + /** + * Properties of a GetPageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetPageRequest + * @property {string|null} [name] GetPageRequest name + * @property {string|null} [languageCode] GetPageRequest languageCode + */ + + /** + * Constructs a new GetPageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetPageRequest. + * @implements IGetPageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetPageRequest=} [properties] Properties to set + */ + function GetPageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPageRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @instance + */ + GetPageRequest.prototype.name = ""; + + /** + * GetPageRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @instance + */ + GetPageRequest.prototype.languageCode = ""; + + /** + * Creates a new GetPageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetPageRequest} GetPageRequest instance + */ + GetPageRequest.create = function create(properties) { + return new GetPageRequest(properties); + }; + + /** + * Encodes the specified GetPageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPageRequest} message GetPageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPageRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetPageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPageRequest} message GetPageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetPageRequest} GetPageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetPageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetPageRequest} GetPageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetPageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetPageRequest} GetPageRequest + */ + GetPageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetPageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetPageRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetPageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetPageRequest} message GetPageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetPageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @instance + * @returns {Object.} JSON object + */ + GetPageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetPageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetPageRequest"; + }; + + return GetPageRequest; + })(); + + v3.CreatePageRequest = (function() { + + /** + * Properties of a CreatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreatePageRequest + * @property {string|null} [parent] CreatePageRequest parent + * @property {google.cloud.dialogflow.cx.v3.IPage|null} [page] CreatePageRequest page + * @property {string|null} [languageCode] CreatePageRequest languageCode + */ + + /** + * Constructs a new CreatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreatePageRequest. + * @implements ICreatePageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreatePageRequest=} [properties] Properties to set + */ + function CreatePageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePageRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @instance + */ + CreatePageRequest.prototype.parent = ""; + + /** + * CreatePageRequest page. + * @member {google.cloud.dialogflow.cx.v3.IPage|null|undefined} page + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @instance + */ + CreatePageRequest.prototype.page = null; + + /** + * CreatePageRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @instance + */ + CreatePageRequest.prototype.languageCode = ""; + + /** + * Creates a new CreatePageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreatePageRequest} CreatePageRequest instance + */ + CreatePageRequest.create = function create(properties) { + return new CreatePageRequest(properties); + }; + + /** + * Encodes the specified CreatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePageRequest} message CreatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePageRequest.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.page != null && Object.hasOwnProperty.call(message, "page")) + $root.google.cloud.dialogflow.cx.v3.Page.encode(message.page, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePageRequest} message CreatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreatePageRequest} CreatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreatePageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.page = $root.google.cloud.dialogflow.cx.v3.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreatePageRequest} CreatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.page != null && message.hasOwnProperty("page")) { + var error = $root.google.cloud.dialogflow.cx.v3.Page.verify(message.page, long + 1); + if (error) + return "page." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreatePageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreatePageRequest} CreatePageRequest + */ + CreatePageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreatePageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreatePageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreatePageRequest.page: object expected"); + message.page = $root.google.cloud.dialogflow.cx.v3.Page.fromObject(object.page, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreatePageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreatePageRequest} message CreatePageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.page = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.page != null && message.hasOwnProperty("page")) + object.page = $root.google.cloud.dialogflow.cx.v3.Page.toObject(message.page, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreatePageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreatePageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreatePageRequest"; + }; + + return CreatePageRequest; + })(); + + v3.UpdatePageRequest = (function() { + + /** + * Properties of an UpdatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdatePageRequest + * @property {google.cloud.dialogflow.cx.v3.IPage|null} [page] UpdatePageRequest page + * @property {string|null} [languageCode] UpdatePageRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePageRequest updateMask + */ + + /** + * Constructs a new UpdatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdatePageRequest. + * @implements IUpdatePageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdatePageRequest=} [properties] Properties to set + */ + function UpdatePageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePageRequest page. + * @member {google.cloud.dialogflow.cx.v3.IPage|null|undefined} page + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @instance + */ + UpdatePageRequest.prototype.page = null; + + /** + * UpdatePageRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @instance + */ + UpdatePageRequest.prototype.languageCode = ""; + + /** + * UpdatePageRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @instance + */ + UpdatePageRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdatePageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdatePageRequest} UpdatePageRequest instance + */ + UpdatePageRequest.create = function create(properties) { + return new UpdatePageRequest(properties); + }; + + /** + * Encodes the specified UpdatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdatePageRequest} message UpdatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + $root.google.cloud.dialogflow.cx.v3.Page.encode(message.page, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdatePageRequest} message UpdatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdatePageRequest} UpdatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdatePageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page = $root.google.cloud.dialogflow.cx.v3.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdatePageRequest} UpdatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.page != null && message.hasOwnProperty("page")) { + var error = $root.google.cloud.dialogflow.cx.v3.Page.verify(message.page, long + 1); + if (error) + return "page." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdatePageRequest} UpdatePageRequest + */ + UpdatePageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdatePageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdatePageRequest(); + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdatePageRequest.page: object expected"); + message.page = $root.google.cloud.dialogflow.cx.v3.Page.fromObject(object.page, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdatePageRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdatePageRequest} message UpdatePageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.page = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.page != null && message.hasOwnProperty("page")) + object.page = $root.google.cloud.dialogflow.cx.v3.Page.toObject(message.page, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdatePageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdatePageRequest"; + }; + + return UpdatePageRequest; + })(); + + v3.DeletePageRequest = (function() { + + /** + * Properties of a DeletePageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeletePageRequest + * @property {string|null} [name] DeletePageRequest name + * @property {boolean|null} [force] DeletePageRequest force + */ + + /** + * Constructs a new DeletePageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeletePageRequest. + * @implements IDeletePageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeletePageRequest=} [properties] Properties to set + */ + function DeletePageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePageRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @instance + */ + DeletePageRequest.prototype.name = ""; + + /** + * DeletePageRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @instance + */ + DeletePageRequest.prototype.force = false; + + /** + * Creates a new DeletePageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeletePageRequest} DeletePageRequest instance + */ + DeletePageRequest.create = function create(properties) { + return new DeletePageRequest(properties); + }; + + /** + * Encodes the specified DeletePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePageRequest} message DeletePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePageRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeletePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePageRequest} message DeletePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeletePageRequest} DeletePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeletePageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeletePageRequest} DeletePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeletePageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeletePageRequest} DeletePageRequest + */ + DeletePageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeletePageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeletePageRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeletePageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeletePageRequest} message DeletePageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeletePageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeletePageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeletePageRequest"; + }; + + return DeletePageRequest; + })(); + + v3.KnowledgeConnectorSettings = (function() { + + /** + * Properties of a KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IKnowledgeConnectorSettings + * @property {boolean|null} [enabled] KnowledgeConnectorSettings enabled + * @property {google.cloud.dialogflow.cx.v3.IFulfillment|null} [triggerFulfillment] KnowledgeConnectorSettings triggerFulfillment + * @property {string|null} [targetPage] KnowledgeConnectorSettings targetPage + * @property {string|null} [targetFlow] KnowledgeConnectorSettings targetFlow + * @property {Array.|null} [dataStoreConnections] KnowledgeConnectorSettings dataStoreConnections + */ + + /** + * Constructs a new KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a KnowledgeConnectorSettings. + * @implements IKnowledgeConnectorSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings=} [properties] Properties to set + */ + function KnowledgeConnectorSettings(properties) { + this.dataStoreConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeConnectorSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.enabled = false; + + /** + * KnowledgeConnectorSettings triggerFulfillment. + * @member {google.cloud.dialogflow.cx.v3.IFulfillment|null|undefined} triggerFulfillment + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.triggerFulfillment = null; + + /** + * KnowledgeConnectorSettings targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.targetPage = null; + + /** + * KnowledgeConnectorSettings targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.targetFlow = null; + + /** + * KnowledgeConnectorSettings dataStoreConnections. + * @member {Array.} dataStoreConnections + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.dataStoreConnections = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KnowledgeConnectorSettings target. + * @member {"targetPage"|"targetFlow"|undefined} target + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @instance + */ + Object.defineProperty(KnowledgeConnectorSettings.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings} KnowledgeConnectorSettings instance + */ + KnowledgeConnectorSettings.create = function create(properties) { + return new KnowledgeConnectorSettings(properties); + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.triggerFulfillment != null && Object.hasOwnProperty.call(message, "triggerFulfillment")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.encode(message.triggerFulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetFlow); + if (message.dataStoreConnections != null && message.dataStoreConnections.length) + for (var i = 0; i < message.dataStoreConnections.length; ++i) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.encode(message.dataStoreConnections[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 3: { + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.targetPage = reader.string(); + break; + } + case 5: { + message.targetFlow = reader.string(); + break; + } + case 6: { + if (!(message.dataStoreConnections && message.dataStoreConnections.length)) + message.dataStoreConnections = []; + message.dataStoreConnections.push($root.google.cloud.dialogflow.cx.v3.DataStoreConnection.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeConnectorSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeConnectorSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.verify(message.triggerFulfillment, long + 1); + if (error) + return "triggerFulfillment." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.target = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + if (message.dataStoreConnections != null && message.hasOwnProperty("dataStoreConnections")) { + if (!Array.isArray(message.dataStoreConnections)) + return "dataStoreConnections: array expected"; + for (var i = 0; i < message.dataStoreConnections.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.verify(message.dataStoreConnections[i], long + 1); + if (error) + return "dataStoreConnections." + error; + } + } + return null; + }; + + /** + * Creates a KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings} KnowledgeConnectorSettings + */ + KnowledgeConnectorSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.triggerFulfillment != null) { + if (typeof object.triggerFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.triggerFulfillment: object expected"); + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.fromObject(object.triggerFulfillment, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + if (object.dataStoreConnections) { + if (!Array.isArray(object.dataStoreConnections)) + throw TypeError(".google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.dataStoreConnections: array expected"); + message.dataStoreConnections = []; + for (var i = 0; i < object.dataStoreConnections.length; ++i) { + if (typeof object.dataStoreConnections[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings.dataStoreConnections: object expected"); + message.dataStoreConnections[i] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.fromObject(object.dataStoreConnections[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings} message KnowledgeConnectorSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeConnectorSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStoreConnections = []; + if (options.defaults) { + object.enabled = false; + object.triggerFulfillment = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) + object.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.toObject(message.triggerFulfillment, options); + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.target = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.target = "targetFlow"; + } + if (message.dataStoreConnections && message.dataStoreConnections.length) { + object.dataStoreConnections = []; + for (var j = 0; j < message.dataStoreConnections.length; ++j) + object.dataStoreConnections[j] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.toObject(message.dataStoreConnections[j], options); + } + return object; + }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @instance + * @returns {Object.} JSON object + */ + KnowledgeConnectorSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KnowledgeConnectorSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings"; + }; + + return KnowledgeConnectorSettings; + })(); + + v3.DataStoreConnection = (function() { + + /** + * Properties of a DataStoreConnection. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDataStoreConnection + * @property {google.cloud.dialogflow.cx.v3.DataStoreType|null} [dataStoreType] DataStoreConnection dataStoreType + * @property {string|null} [dataStore] DataStoreConnection dataStore + * @property {google.cloud.dialogflow.cx.v3.DocumentProcessingMode|null} [documentProcessingMode] DataStoreConnection documentProcessingMode + */ + + /** + * Constructs a new DataStoreConnection. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DataStoreConnection. + * @implements IDataStoreConnection + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnection=} [properties] Properties to set + */ + function DataStoreConnection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreConnection dataStoreType. + * @member {google.cloud.dialogflow.cx.v3.DataStoreType} dataStoreType + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @instance + */ + DataStoreConnection.prototype.dataStoreType = 0; + + /** + * DataStoreConnection dataStore. + * @member {string} dataStore + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @instance + */ + DataStoreConnection.prototype.dataStore = ""; + + /** + * DataStoreConnection documentProcessingMode. + * @member {google.cloud.dialogflow.cx.v3.DocumentProcessingMode} documentProcessingMode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @instance + */ + DataStoreConnection.prototype.documentProcessingMode = 0; + + /** + * Creates a new DataStoreConnection instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnection=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnection} DataStoreConnection instance + */ + DataStoreConnection.create = function create(properties) { + return new DataStoreConnection(properties); + }; + + /** + * Encodes the specified DataStoreConnection message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnection.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnection} message DataStoreConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStoreType != null && Object.hasOwnProperty.call(message, "dataStoreType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dataStoreType); + if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataStore); + if (message.documentProcessingMode != null && Object.hasOwnProperty.call(message, "documentProcessingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.documentProcessingMode); + return writer; + }; + + /** + * Encodes the specified DataStoreConnection message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnection} message DataStoreConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnection} DataStoreConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnection.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataStoreType = reader.int32(); + break; + } + case 2: { + message.dataStore = reader.string(); + break; + } + case 4: { + message.documentProcessingMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnection} DataStoreConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreConnection message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreConnection.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStoreType != null && message.hasOwnProperty("dataStoreType")) + switch (message.dataStoreType) { + default: + return "dataStoreType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + if (!$util.isString(message.dataStore)) + return "dataStore: string expected"; + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + switch (message.documentProcessingMode) { + default: + return "documentProcessingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DataStoreConnection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnection} DataStoreConnection + */ + DataStoreConnection.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnection) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnection(); + switch (object.dataStoreType) { + default: + if (typeof object.dataStoreType === "number") { + message.dataStoreType = object.dataStoreType; + break; + } + break; + case "DATA_STORE_TYPE_UNSPECIFIED": + case 0: + message.dataStoreType = 0; + break; + case "PUBLIC_WEB": + case 1: + message.dataStoreType = 1; + break; + case "UNSTRUCTURED": + case 2: + message.dataStoreType = 2; + break; + case "STRUCTURED": + case 3: + message.dataStoreType = 3; + break; + } + if (object.dataStore != null) + message.dataStore = String(object.dataStore); + switch (object.documentProcessingMode) { + default: + if (typeof object.documentProcessingMode === "number") { + message.documentProcessingMode = object.documentProcessingMode; + break; + } + break; + case "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": + case 0: + message.documentProcessingMode = 0; + break; + case "DOCUMENTS": + case 1: + message.documentProcessingMode = 1; + break; + case "CHUNKS": + case 2: + message.documentProcessingMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataStoreConnection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnection} message DataStoreConnection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreConnection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataStoreType = options.enums === String ? "DATA_STORE_TYPE_UNSPECIFIED" : 0; + object.dataStore = ""; + object.documentProcessingMode = options.enums === String ? "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" : 0; + } + if (message.dataStoreType != null && message.hasOwnProperty("dataStoreType")) + object.dataStoreType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DataStoreType[message.dataStoreType] === undefined ? message.dataStoreType : $root.google.cloud.dialogflow.cx.v3.DataStoreType[message.dataStoreType] : message.dataStoreType; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + object.dataStore = message.dataStore; + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + object.documentProcessingMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DocumentProcessingMode[message.documentProcessingMode] === undefined ? message.documentProcessingMode : $root.google.cloud.dialogflow.cx.v3.DocumentProcessingMode[message.documentProcessingMode] : message.documentProcessingMode; + return object; + }; + + /** + * Converts this DataStoreConnection to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @instance + * @returns {Object.} JSON object + */ + DataStoreConnection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreConnection + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreConnection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnection"; + }; + + return DataStoreConnection; + })(); + + /** + * DataStoreType enum. + * @name google.cloud.dialogflow.cx.v3.DataStoreType + * @enum {number} + * @property {number} DATA_STORE_TYPE_UNSPECIFIED=0 DATA_STORE_TYPE_UNSPECIFIED value + * @property {number} PUBLIC_WEB=1 PUBLIC_WEB value + * @property {number} UNSTRUCTURED=2 UNSTRUCTURED value + * @property {number} STRUCTURED=3 STRUCTURED value + */ + v3.DataStoreType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_STORE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PUBLIC_WEB"] = 1; + values[valuesById[2] = "UNSTRUCTURED"] = 2; + values[valuesById[3] = "STRUCTURED"] = 3; + return values; + })(); + + v3.DataStoreConnectionSignals = (function() { + + /** + * Properties of a DataStoreConnectionSignals. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDataStoreConnectionSignals + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals|null} [rewriterModelCallSignals] DataStoreConnectionSignals rewriterModelCallSignals + * @property {string|null} [rewrittenQuery] DataStoreConnectionSignals rewrittenQuery + * @property {Array.|null} [searchSnippets] DataStoreConnectionSignals searchSnippets + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null} [answerGenerationModelCallSignals] DataStoreConnectionSignals answerGenerationModelCallSignals + * @property {string|null} [answer] DataStoreConnectionSignals answer + * @property {Array.|null} [answerParts] DataStoreConnectionSignals answerParts + * @property {Array.|null} [citedSnippets] DataStoreConnectionSignals citedSnippets + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals|null} [groundingSignals] DataStoreConnectionSignals groundingSignals + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals|null} [safetySignals] DataStoreConnectionSignals safetySignals + */ + + /** + * Constructs a new DataStoreConnectionSignals. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DataStoreConnectionSignals. + * @implements IDataStoreConnectionSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals=} [properties] Properties to set + */ + function DataStoreConnectionSignals(properties) { + this.searchSnippets = []; + this.answerParts = []; + this.citedSnippets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreConnectionSignals rewriterModelCallSignals. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals|null|undefined} rewriterModelCallSignals + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.rewriterModelCallSignals = null; + + /** + * DataStoreConnectionSignals rewrittenQuery. + * @member {string} rewrittenQuery + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.rewrittenQuery = ""; + + /** + * DataStoreConnectionSignals searchSnippets. + * @member {Array.} searchSnippets + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.searchSnippets = $util.emptyArray; + + /** + * DataStoreConnectionSignals answerGenerationModelCallSignals. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null|undefined} answerGenerationModelCallSignals + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.answerGenerationModelCallSignals = null; + + /** + * DataStoreConnectionSignals answer. + * @member {string} answer + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.answer = ""; + + /** + * DataStoreConnectionSignals answerParts. + * @member {Array.} answerParts + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.answerParts = $util.emptyArray; + + /** + * DataStoreConnectionSignals citedSnippets. + * @member {Array.} citedSnippets + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.citedSnippets = $util.emptyArray; + + /** + * DataStoreConnectionSignals groundingSignals. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals|null|undefined} groundingSignals + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.groundingSignals = null; + + /** + * DataStoreConnectionSignals safetySignals. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals|null|undefined} safetySignals + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.safetySignals = null; + + /** + * Creates a new DataStoreConnectionSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals} DataStoreConnectionSignals instance + */ + DataStoreConnectionSignals.create = function create(properties) { + return new DataStoreConnectionSignals(properties); + }; + + /** + * Encodes the specified DataStoreConnectionSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals} message DataStoreConnectionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnectionSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rewriterModelCallSignals != null && Object.hasOwnProperty.call(message, "rewriterModelCallSignals")) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.encode(message.rewriterModelCallSignals, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rewrittenQuery != null && Object.hasOwnProperty.call(message, "rewrittenQuery")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rewrittenQuery); + if (message.searchSnippets != null && message.searchSnippets.length) + for (var i = 0; i < message.searchSnippets.length; ++i) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.encode(message.searchSnippets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.answerGenerationModelCallSignals != null && Object.hasOwnProperty.call(message, "answerGenerationModelCallSignals")) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.encode(message.answerGenerationModelCallSignals, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.answer); + if (message.answerParts != null && message.answerParts.length) + for (var i = 0; i < message.answerParts.length; ++i) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.encode(message.answerParts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.citedSnippets != null && message.citedSnippets.length) + for (var i = 0; i < message.citedSnippets.length; ++i) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.encode(message.citedSnippets[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.groundingSignals != null && Object.hasOwnProperty.call(message, "groundingSignals")) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.encode(message.groundingSignals, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.safetySignals != null && Object.hasOwnProperty.call(message, "safetySignals")) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.encode(message.safetySignals, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreConnectionSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals} message DataStoreConnectionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnectionSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals} DataStoreConnectionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnectionSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rewriterModelCallSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.rewrittenQuery = reader.string(); + break; + } + case 3: { + if (!(message.searchSnippets && message.searchSnippets.length)) + message.searchSnippets = []; + message.searchSnippets.push($root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.answerGenerationModelCallSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.answer = reader.string(); + break; + } + case 6: { + if (!(message.answerParts && message.answerParts.length)) + message.answerParts = []; + message.answerParts.push($root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.citedSnippets && message.citedSnippets.length)) + message.citedSnippets = []; + message.citedSnippets.push($root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.groundingSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.safetySignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals} DataStoreConnectionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnectionSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreConnectionSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreConnectionSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rewriterModelCallSignals != null && message.hasOwnProperty("rewriterModelCallSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.verify(message.rewriterModelCallSignals, long + 1); + if (error) + return "rewriterModelCallSignals." + error; + } + if (message.rewrittenQuery != null && message.hasOwnProperty("rewrittenQuery")) + if (!$util.isString(message.rewrittenQuery)) + return "rewrittenQuery: string expected"; + if (message.searchSnippets != null && message.hasOwnProperty("searchSnippets")) { + if (!Array.isArray(message.searchSnippets)) + return "searchSnippets: array expected"; + for (var i = 0; i < message.searchSnippets.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.verify(message.searchSnippets[i], long + 1); + if (error) + return "searchSnippets." + error; + } + } + if (message.answerGenerationModelCallSignals != null && message.hasOwnProperty("answerGenerationModelCallSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify(message.answerGenerationModelCallSignals, long + 1); + if (error) + return "answerGenerationModelCallSignals." + error; + } + if (message.answer != null && message.hasOwnProperty("answer")) + if (!$util.isString(message.answer)) + return "answer: string expected"; + if (message.answerParts != null && message.hasOwnProperty("answerParts")) { + if (!Array.isArray(message.answerParts)) + return "answerParts: array expected"; + for (var i = 0; i < message.answerParts.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.verify(message.answerParts[i], long + 1); + if (error) + return "answerParts." + error; + } + } + if (message.citedSnippets != null && message.hasOwnProperty("citedSnippets")) { + if (!Array.isArray(message.citedSnippets)) + return "citedSnippets: array expected"; + for (var i = 0; i < message.citedSnippets.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.verify(message.citedSnippets[i], long + 1); + if (error) + return "citedSnippets." + error; + } + } + if (message.groundingSignals != null && message.hasOwnProperty("groundingSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.verify(message.groundingSignals, long + 1); + if (error) + return "groundingSignals." + error; + } + if (message.safetySignals != null && message.hasOwnProperty("safetySignals")) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.verify(message.safetySignals, long + 1); + if (error) + return "safetySignals." + error; + } + return null; + }; + + /** + * Creates a DataStoreConnectionSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals} DataStoreConnectionSignals + */ + DataStoreConnectionSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals(); + if (object.rewriterModelCallSignals != null) { + if (typeof object.rewriterModelCallSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.rewriterModelCallSignals: object expected"); + message.rewriterModelCallSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.fromObject(object.rewriterModelCallSignals, long + 1); + } + if (object.rewrittenQuery != null) + message.rewrittenQuery = String(object.rewrittenQuery); + if (object.searchSnippets) { + if (!Array.isArray(object.searchSnippets)) + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.searchSnippets: array expected"); + message.searchSnippets = []; + for (var i = 0; i < object.searchSnippets.length; ++i) { + if (typeof object.searchSnippets[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.searchSnippets: object expected"); + message.searchSnippets[i] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.fromObject(object.searchSnippets[i], long + 1); + } + } + if (object.answerGenerationModelCallSignals != null) { + if (typeof object.answerGenerationModelCallSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.answerGenerationModelCallSignals: object expected"); + message.answerGenerationModelCallSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.fromObject(object.answerGenerationModelCallSignals, long + 1); + } + if (object.answer != null) + message.answer = String(object.answer); + if (object.answerParts) { + if (!Array.isArray(object.answerParts)) + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.answerParts: array expected"); + message.answerParts = []; + for (var i = 0; i < object.answerParts.length; ++i) { + if (typeof object.answerParts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.answerParts: object expected"); + message.answerParts[i] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.fromObject(object.answerParts[i], long + 1); + } + } + if (object.citedSnippets) { + if (!Array.isArray(object.citedSnippets)) + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.citedSnippets: array expected"); + message.citedSnippets = []; + for (var i = 0; i < object.citedSnippets.length; ++i) { + if (typeof object.citedSnippets[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.citedSnippets: object expected"); + message.citedSnippets[i] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.fromObject(object.citedSnippets[i], long + 1); + } + } + if (object.groundingSignals != null) { + if (typeof object.groundingSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.groundingSignals: object expected"); + message.groundingSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.fromObject(object.groundingSignals, long + 1); + } + if (object.safetySignals != null) { + if (typeof object.safetySignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.safetySignals: object expected"); + message.safetySignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.fromObject(object.safetySignals, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreConnectionSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals} message DataStoreConnectionSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreConnectionSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.searchSnippets = []; + object.answerParts = []; + object.citedSnippets = []; + } + if (options.defaults) { + object.rewriterModelCallSignals = null; + object.rewrittenQuery = ""; + object.answerGenerationModelCallSignals = null; + object.answer = ""; + object.groundingSignals = null; + object.safetySignals = null; + } + if (message.rewriterModelCallSignals != null && message.hasOwnProperty("rewriterModelCallSignals")) + object.rewriterModelCallSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.toObject(message.rewriterModelCallSignals, options); + if (message.rewrittenQuery != null && message.hasOwnProperty("rewrittenQuery")) + object.rewrittenQuery = message.rewrittenQuery; + if (message.searchSnippets && message.searchSnippets.length) { + object.searchSnippets = []; + for (var j = 0; j < message.searchSnippets.length; ++j) + object.searchSnippets[j] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.toObject(message.searchSnippets[j], options); + } + if (message.answerGenerationModelCallSignals != null && message.hasOwnProperty("answerGenerationModelCallSignals")) + object.answerGenerationModelCallSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.toObject(message.answerGenerationModelCallSignals, options); + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = message.answer; + if (message.answerParts && message.answerParts.length) { + object.answerParts = []; + for (var j = 0; j < message.answerParts.length; ++j) + object.answerParts[j] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.toObject(message.answerParts[j], options); + } + if (message.citedSnippets && message.citedSnippets.length) { + object.citedSnippets = []; + for (var j = 0; j < message.citedSnippets.length; ++j) + object.citedSnippets[j] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.toObject(message.citedSnippets[j], options); + } + if (message.groundingSignals != null && message.hasOwnProperty("groundingSignals")) + object.groundingSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.toObject(message.groundingSignals, options); + if (message.safetySignals != null && message.hasOwnProperty("safetySignals")) + object.safetySignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.toObject(message.safetySignals, options); + return object; + }; + + /** + * Converts this DataStoreConnectionSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @instance + * @returns {Object.} JSON object + */ + DataStoreConnectionSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreConnectionSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreConnectionSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals"; + }; + + DataStoreConnectionSignals.RewriterModelCallSignals = (function() { + + /** + * Properties of a RewriterModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @interface IRewriterModelCallSignals + * @property {string|null} [renderedPrompt] RewriterModelCallSignals renderedPrompt + * @property {string|null} [modelOutput] RewriterModelCallSignals modelOutput + * @property {string|null} [model] RewriterModelCallSignals model + */ + + /** + * Constructs a new RewriterModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @classdesc Represents a RewriterModelCallSignals. + * @implements IRewriterModelCallSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals=} [properties] Properties to set + */ + function RewriterModelCallSignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RewriterModelCallSignals renderedPrompt. + * @member {string} renderedPrompt + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + */ + RewriterModelCallSignals.prototype.renderedPrompt = ""; + + /** + * RewriterModelCallSignals modelOutput. + * @member {string} modelOutput + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + */ + RewriterModelCallSignals.prototype.modelOutput = ""; + + /** + * RewriterModelCallSignals model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + */ + RewriterModelCallSignals.prototype.model = ""; + + /** + * Creates a new RewriterModelCallSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals instance + */ + RewriterModelCallSignals.create = function create(properties) { + return new RewriterModelCallSignals(properties); + }; + + /** + * Encodes the specified RewriterModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals} message RewriterModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterModelCallSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderedPrompt != null && Object.hasOwnProperty.call(message, "renderedPrompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedPrompt); + if (message.modelOutput != null && Object.hasOwnProperty.call(message, "modelOutput")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelOutput); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified RewriterModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IRewriterModelCallSignals} message RewriterModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterModelCallSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterModelCallSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.renderedPrompt = reader.string(); + break; + } + case 2: { + message.modelOutput = reader.string(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterModelCallSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RewriterModelCallSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RewriterModelCallSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + if (!$util.isString(message.renderedPrompt)) + return "renderedPrompt: string expected"; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + if (!$util.isString(message.modelOutput)) + return "modelOutput: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a RewriterModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals + */ + RewriterModelCallSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals(); + if (object.renderedPrompt != null) + message.renderedPrompt = String(object.renderedPrompt); + if (object.modelOutput != null) + message.modelOutput = String(object.modelOutput); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a RewriterModelCallSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals} message RewriterModelCallSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RewriterModelCallSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderedPrompt = ""; + object.modelOutput = ""; + object.model = ""; + } + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + object.renderedPrompt = message.renderedPrompt; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + object.modelOutput = message.modelOutput; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this RewriterModelCallSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + * @returns {Object.} JSON object + */ + RewriterModelCallSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RewriterModelCallSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RewriterModelCallSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals"; + }; + + return RewriterModelCallSignals; + })(); + + DataStoreConnectionSignals.SearchSnippet = (function() { + + /** + * Properties of a SearchSnippet. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @interface ISearchSnippet + * @property {string|null} [documentTitle] SearchSnippet documentTitle + * @property {string|null} [documentUri] SearchSnippet documentUri + * @property {string|null} [text] SearchSnippet text + * @property {google.protobuf.IStruct|null} [metadata] SearchSnippet metadata + */ + + /** + * Constructs a new SearchSnippet. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @classdesc Represents a SearchSnippet. + * @implements ISearchSnippet + * @constructor + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet=} [properties] Properties to set + */ + function SearchSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchSnippet documentTitle. + * @member {string} documentTitle + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.documentTitle = ""; + + /** + * SearchSnippet documentUri. + * @member {string} documentUri + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.documentUri = ""; + + /** + * SearchSnippet text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.text = ""; + + /** + * SearchSnippet metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.metadata = null; + + /** + * Creates a new SearchSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet} SearchSnippet instance + */ + SearchSnippet.create = function create(properties) { + return new SearchSnippet(properties); + }; + + /** + * Encodes the specified SearchSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet} message SearchSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSnippet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentTitle != null && Object.hasOwnProperty.call(message, "documentTitle")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentTitle); + if (message.documentUri != null && Object.hasOwnProperty.call(message, "documentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentUri); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet} message SearchSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet} SearchSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSnippet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentTitle = reader.string(); + break; + } + case 2: { + message.documentUri = reader.string(); + break; + } + case 3: { + message.text = reader.string(); + break; + } + case 5: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet} SearchSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchSnippet message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchSnippet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.documentTitle != null && message.hasOwnProperty("documentTitle")) + if (!$util.isString(message.documentTitle)) + return "documentTitle: string expected"; + if (message.documentUri != null && message.hasOwnProperty("documentUri")) + if (!$util.isString(message.documentUri)) + return "documentUri: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a SearchSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet} SearchSnippet + */ + SearchSnippet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet(); + if (object.documentTitle != null) + message.documentTitle = String(object.documentTitle); + if (object.documentUri != null) + message.documentUri = String(object.documentUri); + if (object.text != null) + message.text = String(object.text); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SearchSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet} message SearchSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentTitle = ""; + object.documentUri = ""; + object.text = ""; + object.metadata = null; + } + if (message.documentTitle != null && message.hasOwnProperty("documentTitle")) + object.documentTitle = message.documentTitle; + if (message.documentUri != null && message.hasOwnProperty("documentUri")) + object.documentUri = message.documentUri; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this SearchSnippet to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @instance + * @returns {Object.} JSON object + */ + SearchSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchSnippet + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet"; + }; + + return SearchSnippet; + })(); + + DataStoreConnectionSignals.AnswerGenerationModelCallSignals = (function() { + + /** + * Properties of an AnswerGenerationModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @interface IAnswerGenerationModelCallSignals + * @property {string|null} [renderedPrompt] AnswerGenerationModelCallSignals renderedPrompt + * @property {string|null} [modelOutput] AnswerGenerationModelCallSignals modelOutput + * @property {string|null} [model] AnswerGenerationModelCallSignals model + */ + + /** + * Constructs a new AnswerGenerationModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @classdesc Represents an AnswerGenerationModelCallSignals. + * @implements IAnswerGenerationModelCallSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals=} [properties] Properties to set + */ + function AnswerGenerationModelCallSignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerGenerationModelCallSignals renderedPrompt. + * @member {string} renderedPrompt + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + */ + AnswerGenerationModelCallSignals.prototype.renderedPrompt = ""; + + /** + * AnswerGenerationModelCallSignals modelOutput. + * @member {string} modelOutput + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + */ + AnswerGenerationModelCallSignals.prototype.modelOutput = ""; + + /** + * AnswerGenerationModelCallSignals model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + */ + AnswerGenerationModelCallSignals.prototype.model = ""; + + /** + * Creates a new AnswerGenerationModelCallSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals instance + */ + AnswerGenerationModelCallSignals.create = function create(properties) { + return new AnswerGenerationModelCallSignals(properties); + }; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals} message AnswerGenerationModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerGenerationModelCallSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderedPrompt != null && Object.hasOwnProperty.call(message, "renderedPrompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedPrompt); + if (message.modelOutput != null && Object.hasOwnProperty.call(message, "modelOutput")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelOutput); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals} message AnswerGenerationModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerGenerationModelCallSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerGenerationModelCallSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.renderedPrompt = reader.string(); + break; + } + case 2: { + message.modelOutput = reader.string(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerGenerationModelCallSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerGenerationModelCallSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerGenerationModelCallSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + if (!$util.isString(message.renderedPrompt)) + return "renderedPrompt: string expected"; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + if (!$util.isString(message.modelOutput)) + return "modelOutput: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an AnswerGenerationModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals + */ + AnswerGenerationModelCallSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals(); + if (object.renderedPrompt != null) + message.renderedPrompt = String(object.renderedPrompt); + if (object.modelOutput != null) + message.modelOutput = String(object.modelOutput); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an AnswerGenerationModelCallSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} message AnswerGenerationModelCallSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerGenerationModelCallSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderedPrompt = ""; + object.modelOutput = ""; + object.model = ""; + } + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + object.renderedPrompt = message.renderedPrompt; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + object.modelOutput = message.modelOutput; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this AnswerGenerationModelCallSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + * @returns {Object.} JSON object + */ + AnswerGenerationModelCallSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerGenerationModelCallSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerGenerationModelCallSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals"; + }; + + return AnswerGenerationModelCallSignals; + })(); + + DataStoreConnectionSignals.AnswerPart = (function() { + + /** + * Properties of an AnswerPart. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @interface IAnswerPart + * @property {string|null} [text] AnswerPart text + * @property {Array.|null} [supportingIndices] AnswerPart supportingIndices + */ + + /** + * Constructs a new AnswerPart. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @classdesc Represents an AnswerPart. + * @implements IAnswerPart + * @constructor + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart=} [properties] Properties to set + */ + function AnswerPart(properties) { + this.supportingIndices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerPart text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @instance + */ + AnswerPart.prototype.text = ""; + + /** + * AnswerPart supportingIndices. + * @member {Array.} supportingIndices + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @instance + */ + AnswerPart.prototype.supportingIndices = $util.emptyArray; + + /** + * Creates a new AnswerPart instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart} AnswerPart instance + */ + AnswerPart.create = function create(properties) { + return new AnswerPart(properties); + }; + + /** + * Encodes the specified AnswerPart message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart} message AnswerPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerPart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.supportingIndices != null && message.supportingIndices.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.supportingIndices.length; ++i) + writer.int32(message.supportingIndices[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AnswerPart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IAnswerPart} message AnswerPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerPart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerPart message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart} AnswerPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerPart.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.supportingIndices && message.supportingIndices.length)) + message.supportingIndices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportingIndices.push(reader.int32()); + } else + message.supportingIndices.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerPart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart} AnswerPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerPart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerPart message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerPart.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.supportingIndices != null && message.hasOwnProperty("supportingIndices")) { + if (!Array.isArray(message.supportingIndices)) + return "supportingIndices: array expected"; + for (var i = 0; i < message.supportingIndices.length; ++i) + if (!$util.isInteger(message.supportingIndices[i])) + return "supportingIndices: integer[] expected"; + } + return null; + }; + + /** + * Creates an AnswerPart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart} AnswerPart + */ + AnswerPart.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart(); + if (object.text != null) + message.text = String(object.text); + if (object.supportingIndices) { + if (!Array.isArray(object.supportingIndices)) + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart.supportingIndices: array expected"); + message.supportingIndices = []; + for (var i = 0; i < object.supportingIndices.length; ++i) + message.supportingIndices[i] = object.supportingIndices[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an AnswerPart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart} message AnswerPart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerPart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportingIndices = []; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.supportingIndices && message.supportingIndices.length) { + object.supportingIndices = []; + for (var j = 0; j < message.supportingIndices.length; ++j) + object.supportingIndices[j] = message.supportingIndices[j]; + } + return object; + }; + + /** + * Converts this AnswerPart to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @instance + * @returns {Object.} JSON object + */ + AnswerPart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerPart + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerPart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart"; + }; + + return AnswerPart; + })(); + + DataStoreConnectionSignals.CitedSnippet = (function() { + + /** + * Properties of a CitedSnippet. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @interface ICitedSnippet + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet|null} [searchSnippet] CitedSnippet searchSnippet + * @property {number|null} [snippetIndex] CitedSnippet snippetIndex + */ + + /** + * Constructs a new CitedSnippet. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @classdesc Represents a CitedSnippet. + * @implements ICitedSnippet + * @constructor + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet=} [properties] Properties to set + */ + function CitedSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CitedSnippet searchSnippet. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISearchSnippet|null|undefined} searchSnippet + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @instance + */ + CitedSnippet.prototype.searchSnippet = null; + + /** + * CitedSnippet snippetIndex. + * @member {number} snippetIndex + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @instance + */ + CitedSnippet.prototype.snippetIndex = 0; + + /** + * Creates a new CitedSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet} CitedSnippet instance + */ + CitedSnippet.create = function create(properties) { + return new CitedSnippet(properties); + }; + + /** + * Encodes the specified CitedSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet} message CitedSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedSnippet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchSnippet != null && Object.hasOwnProperty.call(message, "searchSnippet")) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.encode(message.searchSnippet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.snippetIndex != null && Object.hasOwnProperty.call(message, "snippetIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.snippetIndex); + return writer; + }; + + /** + * Encodes the specified CitedSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ICitedSnippet} message CitedSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet} CitedSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedSnippet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.searchSnippet = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.snippetIndex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet} CitedSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CitedSnippet message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CitedSnippet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.searchSnippet != null && message.hasOwnProperty("searchSnippet")) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.verify(message.searchSnippet, long + 1); + if (error) + return "searchSnippet." + error; + } + if (message.snippetIndex != null && message.hasOwnProperty("snippetIndex")) + if (!$util.isInteger(message.snippetIndex)) + return "snippetIndex: integer expected"; + return null; + }; + + /** + * Creates a CitedSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet} CitedSnippet + */ + CitedSnippet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet(); + if (object.searchSnippet != null) { + if (typeof object.searchSnippet !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet.searchSnippet: object expected"); + message.searchSnippet = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.fromObject(object.searchSnippet, long + 1); + } + if (object.snippetIndex != null) + message.snippetIndex = object.snippetIndex | 0; + return message; + }; + + /** + * Creates a plain object from a CitedSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet} message CitedSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitedSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.searchSnippet = null; + object.snippetIndex = 0; + } + if (message.searchSnippet != null && message.hasOwnProperty("searchSnippet")) + object.searchSnippet = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet.toObject(message.searchSnippet, options); + if (message.snippetIndex != null && message.hasOwnProperty("snippetIndex")) + object.snippetIndex = message.snippetIndex; + return object; + }; + + /** + * Converts this CitedSnippet to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @instance + * @returns {Object.} JSON object + */ + CitedSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitedSnippet + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitedSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet"; + }; + + return CitedSnippet; + })(); + + DataStoreConnectionSignals.GroundingSignals = (function() { + + /** + * Properties of a GroundingSignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @interface IGroundingSignals + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|null} [decision] GroundingSignals decision + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|null} [score] GroundingSignals score + */ + + /** + * Constructs a new GroundingSignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @classdesc Represents a GroundingSignals. + * @implements IGroundingSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals=} [properties] Properties to set + */ + function GroundingSignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingSignals decision. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision} decision + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @instance + */ + GroundingSignals.prototype.decision = 0; + + /** + * GroundingSignals score. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket} score + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @instance + */ + GroundingSignals.prototype.score = 0; + + /** + * Creates a new GroundingSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals} GroundingSignals instance + */ + GroundingSignals.create = function create(properties) { + return new GroundingSignals(properties); + }; + + /** + * Encodes the specified GroundingSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals} message GroundingSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.decision != null && Object.hasOwnProperty.call(message, "decision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.decision); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.score); + return writer; + }; + + /** + * Encodes the specified GroundingSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.IGroundingSignals} message GroundingSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals} GroundingSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.decision = reader.int32(); + break; + } + case 2: { + message.score = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals} GroundingSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.decision != null && message.hasOwnProperty("decision")) + switch (message.decision) { + default: + return "decision: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.score != null && message.hasOwnProperty("score")) + switch (message.score) { + default: + return "score: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a GroundingSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals} GroundingSignals + */ + GroundingSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals(); + switch (object.decision) { + default: + if (typeof object.decision === "number") { + message.decision = object.decision; + break; + } + break; + case "GROUNDING_DECISION_UNSPECIFIED": + case 0: + message.decision = 0; + break; + case "ACCEPTED_BY_GROUNDING": + case 1: + message.decision = 1; + break; + case "REJECTED_BY_GROUNDING": + case 2: + message.decision = 2; + break; + } + switch (object.score) { + default: + if (typeof object.score === "number") { + message.score = object.score; + break; + } + break; + case "GROUNDING_SCORE_BUCKET_UNSPECIFIED": + case 0: + message.score = 0; + break; + case "VERY_LOW": + case 1: + message.score = 1; + break; + case "LOW": + case 3: + message.score = 3; + break; + case "MEDIUM": + case 4: + message.score = 4; + break; + case "HIGH": + case 5: + message.score = 5; + break; + case "VERY_HIGH": + case 6: + message.score = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a GroundingSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals} message GroundingSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.decision = options.enums === String ? "GROUNDING_DECISION_UNSPECIFIED" : 0; + object.score = options.enums === String ? "GROUNDING_SCORE_BUCKET_UNSPECIFIED" : 0; + } + if (message.decision != null && message.hasOwnProperty("decision")) + object.decision = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision[message.decision] === undefined ? message.decision : $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision[message.decision] : message.decision; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket[message.score] === undefined ? message.score : $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket[message.score] : message.score; + return object; + }; + + /** + * Converts this GroundingSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @instance + * @returns {Object.} JSON object + */ + GroundingSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals"; + }; + + /** + * GroundingDecision enum. + * @name google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision + * @enum {number} + * @property {number} GROUNDING_DECISION_UNSPECIFIED=0 GROUNDING_DECISION_UNSPECIFIED value + * @property {number} ACCEPTED_BY_GROUNDING=1 ACCEPTED_BY_GROUNDING value + * @property {number} REJECTED_BY_GROUNDING=2 REJECTED_BY_GROUNDING value + */ + GroundingSignals.GroundingDecision = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUNDING_DECISION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCEPTED_BY_GROUNDING"] = 1; + values[valuesById[2] = "REJECTED_BY_GROUNDING"] = 2; + return values; + })(); + + /** + * GroundingScoreBucket enum. + * @name google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket + * @enum {number} + * @property {number} GROUNDING_SCORE_BUCKET_UNSPECIFIED=0 GROUNDING_SCORE_BUCKET_UNSPECIFIED value + * @property {number} VERY_LOW=1 VERY_LOW value + * @property {number} LOW=3 LOW value + * @property {number} MEDIUM=4 MEDIUM value + * @property {number} HIGH=5 HIGH value + * @property {number} VERY_HIGH=6 VERY_HIGH value + */ + GroundingSignals.GroundingScoreBucket = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUNDING_SCORE_BUCKET_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_LOW"] = 1; + values[valuesById[3] = "LOW"] = 3; + values[valuesById[4] = "MEDIUM"] = 4; + values[valuesById[5] = "HIGH"] = 5; + values[valuesById[6] = "VERY_HIGH"] = 6; + return values; + })(); + + return GroundingSignals; + })(); + + DataStoreConnectionSignals.SafetySignals = (function() { + + /** + * Properties of a SafetySignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @interface ISafetySignals + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision|null} [decision] SafetySignals decision + * @property {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|null} [bannedPhraseMatch] SafetySignals bannedPhraseMatch + * @property {string|null} [matchedBannedPhrase] SafetySignals matchedBannedPhrase + */ + + /** + * Constructs a new SafetySignals. + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals + * @classdesc Represents a SafetySignals. + * @implements ISafetySignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals=} [properties] Properties to set + */ + function SafetySignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySignals decision. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision} decision + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @instance + */ + SafetySignals.prototype.decision = 0; + + /** + * SafetySignals bannedPhraseMatch. + * @member {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch} bannedPhraseMatch + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @instance + */ + SafetySignals.prototype.bannedPhraseMatch = 0; + + /** + * SafetySignals matchedBannedPhrase. + * @member {string} matchedBannedPhrase + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @instance + */ + SafetySignals.prototype.matchedBannedPhrase = ""; + + /** + * Creates a new SafetySignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals} SafetySignals instance + */ + SafetySignals.create = function create(properties) { + return new SafetySignals(properties); + }; + + /** + * Encodes the specified SafetySignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals} message SafetySignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.decision != null && Object.hasOwnProperty.call(message, "decision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.decision); + if (message.bannedPhraseMatch != null && Object.hasOwnProperty.call(message, "bannedPhraseMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bannedPhraseMatch); + if (message.matchedBannedPhrase != null && Object.hasOwnProperty.call(message, "matchedBannedPhrase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.matchedBannedPhrase); + return writer; + }; + + /** + * Encodes the specified SafetySignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.ISafetySignals} message SafetySignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals} SafetySignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.decision = reader.int32(); + break; + } + case 2: { + message.bannedPhraseMatch = reader.int32(); + break; + } + case 3: { + message.matchedBannedPhrase = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals} SafetySignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.decision != null && message.hasOwnProperty("decision")) + switch (message.decision) { + default: + return "decision: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.bannedPhraseMatch != null && message.hasOwnProperty("bannedPhraseMatch")) + switch (message.bannedPhraseMatch) { + default: + return "bannedPhraseMatch: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.matchedBannedPhrase != null && message.hasOwnProperty("matchedBannedPhrase")) + if (!$util.isString(message.matchedBannedPhrase)) + return "matchedBannedPhrase: string expected"; + return null; + }; + + /** + * Creates a SafetySignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals} SafetySignals + */ + SafetySignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals(); + switch (object.decision) { + default: + if (typeof object.decision === "number") { + message.decision = object.decision; + break; + } + break; + case "SAFETY_DECISION_UNSPECIFIED": + case 0: + message.decision = 0; + break; + case "ACCEPTED_BY_SAFETY_CHECK": + case 1: + message.decision = 1; + break; + case "REJECTED_BY_SAFETY_CHECK": + case 2: + message.decision = 2; + break; + } + switch (object.bannedPhraseMatch) { + default: + if (typeof object.bannedPhraseMatch === "number") { + message.bannedPhraseMatch = object.bannedPhraseMatch; + break; + } + break; + case "BANNED_PHRASE_MATCH_UNSPECIFIED": + case 0: + message.bannedPhraseMatch = 0; + break; + case "BANNED_PHRASE_MATCH_NONE": + case 1: + message.bannedPhraseMatch = 1; + break; + case "BANNED_PHRASE_MATCH_QUERY": + case 2: + message.bannedPhraseMatch = 2; + break; + case "BANNED_PHRASE_MATCH_RESPONSE": + case 3: + message.bannedPhraseMatch = 3; + break; + } + if (object.matchedBannedPhrase != null) + message.matchedBannedPhrase = String(object.matchedBannedPhrase); + return message; + }; + + /** + * Creates a plain object from a SafetySignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals} message SafetySignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.decision = options.enums === String ? "SAFETY_DECISION_UNSPECIFIED" : 0; + object.bannedPhraseMatch = options.enums === String ? "BANNED_PHRASE_MATCH_UNSPECIFIED" : 0; + object.matchedBannedPhrase = ""; + } + if (message.decision != null && message.hasOwnProperty("decision")) + object.decision = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision[message.decision] === undefined ? message.decision : $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision[message.decision] : message.decision; + if (message.bannedPhraseMatch != null && message.hasOwnProperty("bannedPhraseMatch")) + object.bannedPhraseMatch = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch[message.bannedPhraseMatch] === undefined ? message.bannedPhraseMatch : $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch[message.bannedPhraseMatch] : message.bannedPhraseMatch; + if (message.matchedBannedPhrase != null && message.hasOwnProperty("matchedBannedPhrase")) + object.matchedBannedPhrase = message.matchedBannedPhrase; + return object; + }; + + /** + * Converts this SafetySignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @instance + * @returns {Object.} JSON object + */ + SafetySignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals"; + }; + + /** + * SafetyDecision enum. + * @name google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision + * @enum {number} + * @property {number} SAFETY_DECISION_UNSPECIFIED=0 SAFETY_DECISION_UNSPECIFIED value + * @property {number} ACCEPTED_BY_SAFETY_CHECK=1 ACCEPTED_BY_SAFETY_CHECK value + * @property {number} REJECTED_BY_SAFETY_CHECK=2 REJECTED_BY_SAFETY_CHECK value + */ + SafetySignals.SafetyDecision = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAFETY_DECISION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCEPTED_BY_SAFETY_CHECK"] = 1; + values[valuesById[2] = "REJECTED_BY_SAFETY_CHECK"] = 2; + return values; + })(); + + /** + * BannedPhraseMatch enum. + * @name google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch + * @enum {number} + * @property {number} BANNED_PHRASE_MATCH_UNSPECIFIED=0 BANNED_PHRASE_MATCH_UNSPECIFIED value + * @property {number} BANNED_PHRASE_MATCH_NONE=1 BANNED_PHRASE_MATCH_NONE value + * @property {number} BANNED_PHRASE_MATCH_QUERY=2 BANNED_PHRASE_MATCH_QUERY value + * @property {number} BANNED_PHRASE_MATCH_RESPONSE=3 BANNED_PHRASE_MATCH_RESPONSE value + */ + SafetySignals.BannedPhraseMatch = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BANNED_PHRASE_MATCH_UNSPECIFIED"] = 0; + values[valuesById[1] = "BANNED_PHRASE_MATCH_NONE"] = 1; + values[valuesById[2] = "BANNED_PHRASE_MATCH_QUERY"] = 2; + values[valuesById[3] = "BANNED_PHRASE_MATCH_RESPONSE"] = 3; + return values; + })(); + + return SafetySignals; + })(); + + return DataStoreConnectionSignals; + })(); + + /** + * DocumentProcessingMode enum. + * @name google.cloud.dialogflow.cx.v3.DocumentProcessingMode + * @enum {number} + * @property {number} DOCUMENT_PROCESSING_MODE_UNSPECIFIED=0 DOCUMENT_PROCESSING_MODE_UNSPECIFIED value + * @property {number} DOCUMENTS=1 DOCUMENTS value + * @property {number} CHUNKS=2 CHUNKS value + */ + v3.DocumentProcessingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_PROCESSING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOCUMENTS"] = 1; + values[valuesById[2] = "CHUNKS"] = 2; + return values; + })(); + + v3.Fulfillment = (function() { + + /** + * Properties of a Fulfillment. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFulfillment + * @property {Array.|null} [messages] Fulfillment messages + * @property {string|null} [webhook] Fulfillment webhook + * @property {boolean|null} [returnPartialResponses] Fulfillment returnPartialResponses + * @property {string|null} [tag] Fulfillment tag + * @property {Array.|null} [setParameterActions] Fulfillment setParameterActions + * @property {Array.|null} [conditionalCases] Fulfillment conditionalCases + * @property {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null} [advancedSettings] Fulfillment advancedSettings + * @property {boolean|null} [enableGenerativeFallback] Fulfillment enableGenerativeFallback + * @property {Array.|null} [generators] Fulfillment generators + */ + + /** + * Constructs a new Fulfillment. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Fulfillment. + * @implements IFulfillment + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFulfillment=} [properties] Properties to set + */ + function Fulfillment(properties) { + this.messages = []; + this.setParameterActions = []; + this.conditionalCases = []; + this.generators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Fulfillment messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.messages = $util.emptyArray; + + /** + * Fulfillment webhook. + * @member {string} webhook + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.webhook = ""; + + /** + * Fulfillment returnPartialResponses. + * @member {boolean} returnPartialResponses + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.returnPartialResponses = false; + + /** + * Fulfillment tag. + * @member {string} tag + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.tag = ""; + + /** + * Fulfillment setParameterActions. + * @member {Array.} setParameterActions + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.setParameterActions = $util.emptyArray; + + /** + * Fulfillment conditionalCases. + * @member {Array.} conditionalCases + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.conditionalCases = $util.emptyArray; + + /** + * Fulfillment advancedSettings. + * @member {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.advancedSettings = null; + + /** + * Fulfillment enableGenerativeFallback. + * @member {boolean} enableGenerativeFallback + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.enableGenerativeFallback = false; + + /** + * Fulfillment generators. + * @member {Array.} generators + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.generators = $util.emptyArray; + + /** + * Creates a new Fulfillment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment} Fulfillment instance + */ + Fulfillment.create = function create(properties) { + return new Fulfillment(properties); + }; + + /** + * Encodes the specified Fulfillment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillment} message Fulfillment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fulfillment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.webhook != null && Object.hasOwnProperty.call(message, "webhook")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.webhook); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tag); + if (message.setParameterActions != null && message.setParameterActions.length) + for (var i = 0; i < message.setParameterActions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.encode(message.setParameterActions[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.conditionalCases != null && message.conditionalCases.length) + for (var i = 0; i < message.conditionalCases.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.encode(message.conditionalCases[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.returnPartialResponses != null && Object.hasOwnProperty.call(message, "returnPartialResponses")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.returnPartialResponses); + if (message.enableGenerativeFallback != null && Object.hasOwnProperty.call(message, "enableGenerativeFallback")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableGenerativeFallback); + if (message.generators != null && message.generators.length) + for (var i = 0; i < message.generators.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.encode(message.generators[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Fulfillment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillment} message Fulfillment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fulfillment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fulfillment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment} Fulfillment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fulfillment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.cx.v3.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.webhook = reader.string(); + break; + } + case 8: { + message.returnPartialResponses = reader.bool(); + break; + } + case 3: { + message.tag = reader.string(); + break; + } + case 4: { + if (!(message.setParameterActions && message.setParameterActions.length)) + message.setParameterActions = []; + message.setParameterActions.push($root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.conditionalCases && message.conditionalCases.length)) + message.conditionalCases = []; + message.conditionalCases.push($root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.enableGenerativeFallback = reader.bool(); + break; + } + case 13: { + if (!(message.generators && message.generators.length)) + message.generators = []; + message.generators.push($root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Fulfillment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment} Fulfillment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fulfillment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fulfillment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fulfillment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.verify(message.messages[i], long + 1); + if (error) + return "messages." + error; + } + } + if (message.webhook != null && message.hasOwnProperty("webhook")) + if (!$util.isString(message.webhook)) + return "webhook: string expected"; + if (message.returnPartialResponses != null && message.hasOwnProperty("returnPartialResponses")) + if (typeof message.returnPartialResponses !== "boolean") + return "returnPartialResponses: boolean expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + if (message.setParameterActions != null && message.hasOwnProperty("setParameterActions")) { + if (!Array.isArray(message.setParameterActions)) + return "setParameterActions: array expected"; + for (var i = 0; i < message.setParameterActions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.verify(message.setParameterActions[i], long + 1); + if (error) + return "setParameterActions." + error; + } + } + if (message.conditionalCases != null && message.hasOwnProperty("conditionalCases")) { + if (!Array.isArray(message.conditionalCases)) + return "conditionalCases: array expected"; + for (var i = 0; i < message.conditionalCases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.verify(message.conditionalCases[i], long + 1); + if (error) + return "conditionalCases." + error; + } + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.enableGenerativeFallback != null && message.hasOwnProperty("enableGenerativeFallback")) + if (typeof message.enableGenerativeFallback !== "boolean") + return "enableGenerativeFallback: boolean expected"; + if (message.generators != null && message.hasOwnProperty("generators")) { + if (!Array.isArray(message.generators)) + return "generators: array expected"; + for (var i = 0; i < message.generators.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.verify(message.generators[i], long + 1); + if (error) + return "generators." + error; + } + } + return null; + }; + + /** + * Creates a Fulfillment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment} Fulfillment + */ + Fulfillment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Fulfillment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.fromObject(object.messages[i], long + 1); + } + } + if (object.webhook != null) + message.webhook = String(object.webhook); + if (object.returnPartialResponses != null) + message.returnPartialResponses = Boolean(object.returnPartialResponses); + if (object.tag != null) + message.tag = String(object.tag); + if (object.setParameterActions) { + if (!Array.isArray(object.setParameterActions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.setParameterActions: array expected"); + message.setParameterActions = []; + for (var i = 0; i < object.setParameterActions.length; ++i) { + if (typeof object.setParameterActions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.setParameterActions: object expected"); + message.setParameterActions[i] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.fromObject(object.setParameterActions[i], long + 1); + } + } + if (object.conditionalCases) { + if (!Array.isArray(object.conditionalCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.conditionalCases: array expected"); + message.conditionalCases = []; + for (var i = 0; i < object.conditionalCases.length; ++i) { + if (typeof object.conditionalCases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.conditionalCases: object expected"); + message.conditionalCases[i] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.fromObject(object.conditionalCases[i], long + 1); + } + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.enableGenerativeFallback != null) + message.enableGenerativeFallback = Boolean(object.enableGenerativeFallback); + if (object.generators) { + if (!Array.isArray(object.generators)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.generators: array expected"); + message.generators = []; + for (var i = 0; i < object.generators.length; ++i) { + if (typeof object.generators[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.generators: object expected"); + message.generators[i] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.fromObject(object.generators[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Fulfillment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment} message Fulfillment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fulfillment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.setParameterActions = []; + object.conditionalCases = []; + object.generators = []; + } + if (options.defaults) { + object.webhook = ""; + object.tag = ""; + object.advancedSettings = null; + object.returnPartialResponses = false; + object.enableGenerativeFallback = false; + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.toObject(message.messages[j], options); + } + if (message.webhook != null && message.hasOwnProperty("webhook")) + object.webhook = message.webhook; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.setParameterActions && message.setParameterActions.length) { + object.setParameterActions = []; + for (var j = 0; j < message.setParameterActions.length; ++j) + object.setParameterActions[j] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.toObject(message.setParameterActions[j], options); + } + if (message.conditionalCases && message.conditionalCases.length) { + object.conditionalCases = []; + for (var j = 0; j < message.conditionalCases.length; ++j) + object.conditionalCases[j] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.toObject(message.conditionalCases[j], options); + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.returnPartialResponses != null && message.hasOwnProperty("returnPartialResponses")) + object.returnPartialResponses = message.returnPartialResponses; + if (message.enableGenerativeFallback != null && message.hasOwnProperty("enableGenerativeFallback")) + object.enableGenerativeFallback = message.enableGenerativeFallback; + if (message.generators && message.generators.length) { + object.generators = []; + for (var j = 0; j < message.generators.length; ++j) + object.generators[j] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.toObject(message.generators[j], options); + } + return object; + }; + + /** + * Converts this Fulfillment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + * @returns {Object.} JSON object + */ + Fulfillment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Fulfillment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fulfillment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Fulfillment"; + }; + + Fulfillment.SetParameterAction = (function() { + + /** + * Properties of a SetParameterAction. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @interface ISetParameterAction + * @property {string|null} [parameter] SetParameterAction parameter + * @property {google.protobuf.IValue|null} [value] SetParameterAction value + */ + + /** + * Constructs a new SetParameterAction. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @classdesc Represents a SetParameterAction. + * @implements ISetParameterAction + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction=} [properties] Properties to set + */ + function SetParameterAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetParameterAction parameter. + * @member {string} parameter + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @instance + */ + SetParameterAction.prototype.parameter = ""; + + /** + * SetParameterAction value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @instance + */ + SetParameterAction.prototype.value = null; + + /** + * Creates a new SetParameterAction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction} SetParameterAction instance + */ + SetParameterAction.create = function create(properties) { + return new SetParameterAction(properties); + }; + + /** + * Encodes the specified SetParameterAction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction} message SetParameterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetParameterAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameter != null && Object.hasOwnProperty.call(message, "parameter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameter); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetParameterAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction} message SetParameterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetParameterAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction} SetParameterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetParameterAction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parameter = reader.string(); + break; + } + case 2: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction} SetParameterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetParameterAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetParameterAction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetParameterAction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameter != null && message.hasOwnProperty("parameter")) + if (!$util.isString(message.parameter)) + return "parameter: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value, long + 1); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a SetParameterAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction} SetParameterAction + */ + SetParameterAction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction(); + if (object.parameter != null) + message.parameter = String(object.parameter); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SetParameterAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction} message SetParameterAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetParameterAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parameter = ""; + object.value = null; + } + if (message.parameter != null && message.hasOwnProperty("parameter")) + object.parameter = message.parameter; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + return object; + }; + + /** + * Converts this SetParameterAction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @instance + * @returns {Object.} JSON object + */ + SetParameterAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetParameterAction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetParameterAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction"; + }; + + return SetParameterAction; + })(); + + Fulfillment.ConditionalCases = (function() { + + /** + * Properties of a ConditionalCases. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @interface IConditionalCases + * @property {Array.|null} [cases] ConditionalCases cases + */ + + /** + * Constructs a new ConditionalCases. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @classdesc Represents a ConditionalCases. + * @implements IConditionalCases + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases=} [properties] Properties to set + */ + function ConditionalCases(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionalCases cases. + * @member {Array.} cases + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @instance + */ + ConditionalCases.prototype.cases = $util.emptyArray; + + /** + * Creates a new ConditionalCases instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases} ConditionalCases instance + */ + ConditionalCases.create = function create(properties) { + return new ConditionalCases(properties); + }; + + /** + * Encodes the specified ConditionalCases message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases} message ConditionalCases message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalCases.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.encode(message.cases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionalCases message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases} message ConditionalCases message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalCases.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases} ConditionalCases + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalCases.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases} ConditionalCases + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalCases.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionalCases message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionalCases.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.verify(message.cases[i], long + 1); + if (error) + return "cases." + error; + } + } + return null; + }; + + /** + * Creates a ConditionalCases message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases} ConditionalCases + */ + ConditionalCases.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.cases: object expected"); + message.cases[i] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.fromObject(object.cases[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ConditionalCases message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases} message ConditionalCases + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionalCases.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.toObject(message.cases[j], options); + } + return object; + }; + + /** + * Converts this ConditionalCases to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @instance + * @returns {Object.} JSON object + */ + ConditionalCases.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionalCases + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionalCases.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases"; + }; + + ConditionalCases.Case = (function() { + + /** + * Properties of a Case. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @interface ICase + * @property {string|null} [condition] Case condition + * @property {Array.|null} [caseContent] Case caseContent + */ + + /** + * Constructs a new Case. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases + * @classdesc Represents a Case. + * @implements ICase + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase=} [properties] Properties to set + */ + function Case(properties) { + this.caseContent = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Case condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @instance + */ + Case.prototype.condition = ""; + + /** + * Case caseContent. + * @member {Array.} caseContent + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @instance + */ + Case.prototype.caseContent = $util.emptyArray; + + /** + * Creates a new Case instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case} Case instance + */ + Case.create = function create(properties) { + return new Case(properties); + }; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.caseContent != null && message.caseContent.length) + for (var i = 0; i < message.caseContent.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.encode(message.caseContent[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Case message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + if (!(message.caseContent && message.caseContent.length)) + message.caseContent = []; + message.caseContent.push($root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Case message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Case.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.caseContent != null && message.hasOwnProperty("caseContent")) { + if (!Array.isArray(message.caseContent)) + return "caseContent: array expected"; + for (var i = 0; i < message.caseContent.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.verify(message.caseContent[i], long + 1); + if (error) + return "caseContent." + error; + } + } + return null; + }; + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case} Case + */ + Case.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.caseContent) { + if (!Array.isArray(object.caseContent)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.caseContent: array expected"); + message.caseContent = []; + for (var i = 0; i < object.caseContent.length; ++i) { + if (typeof object.caseContent[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.caseContent: object expected"); + message.caseContent[i] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.fromObject(object.caseContent[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case} message Case + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Case.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caseContent = []; + if (options.defaults) + object.condition = ""; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.caseContent && message.caseContent.length) { + object.caseContent = []; + for (var j = 0; j < message.caseContent.length; ++j) + object.caseContent[j] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.toObject(message.caseContent[j], options); + } + return object; + }; + + /** + * Converts this Case to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @instance + * @returns {Object.} JSON object + */ + Case.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Case + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Case.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case"; + }; + + Case.CaseContent = (function() { + + /** + * Properties of a CaseContent. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @interface ICaseContent + * @property {google.cloud.dialogflow.cx.v3.IResponseMessage|null} [message] CaseContent message + * @property {google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases|null} [additionalCases] CaseContent additionalCases + */ + + /** + * Constructs a new CaseContent. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case + * @classdesc Represents a CaseContent. + * @implements ICaseContent + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent=} [properties] Properties to set + */ + function CaseContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseContent message. + * @member {google.cloud.dialogflow.cx.v3.IResponseMessage|null|undefined} message + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + */ + CaseContent.prototype.message = null; + + /** + * CaseContent additionalCases. + * @member {google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases|null|undefined} additionalCases + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + */ + CaseContent.prototype.additionalCases = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CaseContent casesOrMessage. + * @member {"message"|"additionalCases"|undefined} casesOrMessage + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + */ + Object.defineProperty(CaseContent.prototype, "casesOrMessage", { + get: $util.oneOfGetter($oneOfFields = ["message", "additionalCases"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CaseContent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent instance + */ + CaseContent.create = function create(properties) { + return new CaseContent(properties); + }; + + /** + * Encodes the specified CaseContent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent} message CaseContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.additionalCases != null && Object.hasOwnProperty.call(message, "additionalCases")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.encode(message.additionalCases, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CaseContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.ICaseContent} message CaseContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseContent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.additionalCases = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CaseContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseContent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseContent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.message != null && message.hasOwnProperty("message")) { + properties.casesOrMessage = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.verify(message.message, long + 1); + if (error) + return "message." + error; + } + } + if (message.additionalCases != null && message.hasOwnProperty("additionalCases")) { + if (properties.casesOrMessage === 1) + return "casesOrMessage: multiple values"; + properties.casesOrMessage = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.verify(message.additionalCases, long + 1); + if (error) + return "additionalCases." + error; + } + } + return null; + }; + + /** + * Creates a CaseContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent + */ + CaseContent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.message: object expected"); + message.message = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.fromObject(object.message, long + 1); + } + if (object.additionalCases != null) { + if (typeof object.additionalCases !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent.additionalCases: object expected"); + message.additionalCases = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.fromObject(object.additionalCases, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CaseContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent} message CaseContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.message != null && message.hasOwnProperty("message")) { + object.message = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.toObject(message.message, options); + if (options.oneofs) + object.casesOrMessage = "message"; + } + if (message.additionalCases != null && message.hasOwnProperty("additionalCases")) { + object.additionalCases = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.toObject(message.additionalCases, options); + if (options.oneofs) + object.casesOrMessage = "additionalCases"; + } + return object; + }; + + /** + * Converts this CaseContent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + * @returns {Object.} JSON object + */ + CaseContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseContent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent"; + }; + + return CaseContent; + })(); + + return Case; + })(); + + return ConditionalCases; + })(); + + Fulfillment.GeneratorSettings = (function() { + + /** + * Properties of a GeneratorSettings. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @interface IGeneratorSettings + * @property {string|null} [generator] GeneratorSettings generator + * @property {Object.|null} [inputParameters] GeneratorSettings inputParameters + * @property {string|null} [outputParameter] GeneratorSettings outputParameter + */ + + /** + * Constructs a new GeneratorSettings. + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @classdesc Represents a GeneratorSettings. + * @implements IGeneratorSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings=} [properties] Properties to set + */ + function GeneratorSettings(properties) { + this.inputParameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratorSettings generator. + * @member {string} generator + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @instance + */ + GeneratorSettings.prototype.generator = ""; + + /** + * GeneratorSettings inputParameters. + * @member {Object.} inputParameters + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @instance + */ + GeneratorSettings.prototype.inputParameters = $util.emptyObject; + + /** + * GeneratorSettings outputParameter. + * @member {string} outputParameter + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @instance + */ + GeneratorSettings.prototype.outputParameter = ""; + + /** + * Creates a new GeneratorSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings} GeneratorSettings instance + */ + GeneratorSettings.create = function create(properties) { + return new GeneratorSettings(properties); + }; + + /** + * Encodes the specified GeneratorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings} message GeneratorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratorSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generator != null && Object.hasOwnProperty.call(message, "generator")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.generator); + if (message.inputParameters != null && Object.hasOwnProperty.call(message, "inputParameters")) + for (var keys = Object.keys(message.inputParameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputParameters[keys[i]]).ldelim(); + if (message.outputParameter != null && Object.hasOwnProperty.call(message, "outputParameter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputParameter); + return writer; + }; + + /** + * Encodes the specified GeneratorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.IGeneratorSettings} message GeneratorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratorSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings} GeneratorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratorSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generator = reader.string(); + break; + } + case 2: { + if (message.inputParameters === $util.emptyObject) + message.inputParameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.inputParameters, key); + message.inputParameters[key] = value; + break; + } + case 3: { + message.outputParameter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings} GeneratorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratorSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratorSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratorSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generator != null && message.hasOwnProperty("generator")) + if (!$util.isString(message.generator)) + return "generator: string expected"; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + if (!$util.isObject(message.inputParameters)) + return "inputParameters: object expected"; + var key = Object.keys(message.inputParameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.inputParameters[key[i]])) + return "inputParameters: string{k:string} expected"; + } + if (message.outputParameter != null && message.hasOwnProperty("outputParameter")) + if (!$util.isString(message.outputParameter)) + return "outputParameter: string expected"; + return null; + }; + + /** + * Creates a GeneratorSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings} GeneratorSettings + */ + GeneratorSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings(); + if (object.generator != null) + message.generator = String(object.generator); + if (object.inputParameters) { + if (typeof object.inputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.inputParameters: object expected"); + message.inputParameters = {}; + for (var keys = Object.keys(object.inputParameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.inputParameters, keys[i]); + message.inputParameters[keys[i]] = String(object.inputParameters[keys[i]]); + } + } + if (object.outputParameter != null) + message.outputParameter = String(object.outputParameter); + return message; + }; + + /** + * Creates a plain object from a GeneratorSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings} message GeneratorSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratorSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.inputParameters = {}; + if (options.defaults) { + object.generator = ""; + object.outputParameter = ""; + } + if (message.generator != null && message.hasOwnProperty("generator")) + object.generator = message.generator; + var keys2; + if (message.inputParameters && (keys2 = Object.keys(message.inputParameters)).length) { + object.inputParameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.inputParameters, keys2[j]); + object.inputParameters[keys2[j]] = message.inputParameters[keys2[j]]; + } + } + if (message.outputParameter != null && message.hasOwnProperty("outputParameter")) + object.outputParameter = message.outputParameter; + return object; + }; + + /** + * Converts this GeneratorSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @instance + * @returns {Object.} JSON object + */ + GeneratorSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratorSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratorSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings"; + }; + + return GeneratorSettings; + })(); + + return Fulfillment; + })(); + + v3.ResponseMessage = (function() { + + /** + * Properties of a ResponseMessage. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IResponseMessage + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.IText|null} [text] ResponseMessage text + * @property {google.protobuf.IStruct|null} [payload] ResponseMessage payload + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess|null} [conversationSuccess] ResponseMessage conversationSuccess + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText|null} [outputAudioText] ResponseMessage outputAudioText + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff|null} [liveAgentHandoff] ResponseMessage liveAgentHandoff + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction|null} [endInteraction] ResponseMessage endInteraction + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio|null} [playAudio] ResponseMessage playAudio + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio|null} [mixedAudio] ResponseMessage mixedAudio + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall|null} [telephonyTransferCall] ResponseMessage telephonyTransferCall + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard|null} [knowledgeInfoCard] ResponseMessage knowledgeInfoCard + * @property {google.cloud.dialogflow.cx.v3.IToolCall|null} [toolCall] ResponseMessage toolCall + * @property {google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType|null} [responseType] ResponseMessage responseType + * @property {string|null} [channel] ResponseMessage channel + */ + + /** + * Constructs a new ResponseMessage. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ResponseMessage. + * @implements IResponseMessage + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IResponseMessage=} [properties] Properties to set + */ + function ResponseMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMessage text. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.IText|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.text = null; + + /** + * ResponseMessage payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.payload = null; + + /** + * ResponseMessage conversationSuccess. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess|null|undefined} conversationSuccess + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.conversationSuccess = null; + + /** + * ResponseMessage outputAudioText. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText|null|undefined} outputAudioText + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.outputAudioText = null; + + /** + * ResponseMessage liveAgentHandoff. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff|null|undefined} liveAgentHandoff + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.liveAgentHandoff = null; + + /** + * ResponseMessage endInteraction. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction|null|undefined} endInteraction + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.endInteraction = null; + + /** + * ResponseMessage playAudio. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio|null|undefined} playAudio + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.playAudio = null; + + /** + * ResponseMessage mixedAudio. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio|null|undefined} mixedAudio + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.mixedAudio = null; + + /** + * ResponseMessage telephonyTransferCall. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall|null|undefined} telephonyTransferCall + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.telephonyTransferCall = null; + + /** + * ResponseMessage knowledgeInfoCard. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard|null|undefined} knowledgeInfoCard + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.knowledgeInfoCard = null; + + /** + * ResponseMessage toolCall. + * @member {google.cloud.dialogflow.cx.v3.IToolCall|null|undefined} toolCall + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.toolCall = null; + + /** + * ResponseMessage responseType. + * @member {google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType} responseType + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.responseType = 0; + + /** + * ResponseMessage channel. + * @member {string} channel + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + ResponseMessage.prototype.channel = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResponseMessage message. + * @member {"text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"|"toolCall"|undefined} message + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + */ + Object.defineProperty(ResponseMessage.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["text", "payload", "conversationSuccess", "outputAudioText", "liveAgentHandoff", "endInteraction", "playAudio", "mixedAudio", "telephonyTransferCall", "knowledgeInfoCard", "toolCall"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponseMessage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.IResponseMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage} ResponseMessage instance + */ + ResponseMessage.create = function create(properties) { + return new ResponseMessage(properties); + }; + + /** + * Encodes the specified ResponseMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.IResponseMessage} message ResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.responseType); + if (message.outputAudioText != null && Object.hasOwnProperty.call(message, "outputAudioText")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.encode(message.outputAudioText, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.conversationSuccess != null && Object.hasOwnProperty.call(message, "conversationSuccess")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.encode(message.conversationSuccess, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.liveAgentHandoff != null && Object.hasOwnProperty.call(message, "liveAgentHandoff")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.encode(message.liveAgentHandoff, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.endInteraction != null && Object.hasOwnProperty.call(message, "endInteraction")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.encode(message.endInteraction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.playAudio != null && Object.hasOwnProperty.call(message, "playAudio")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.encode(message.playAudio, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.mixedAudio != null && Object.hasOwnProperty.call(message, "mixedAudio")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.encode(message.mixedAudio, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.telephonyTransferCall != null && Object.hasOwnProperty.call(message, "telephonyTransferCall")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.encode(message.telephonyTransferCall, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.channel); + if (message.knowledgeInfoCard != null && Object.hasOwnProperty.call(message, "knowledgeInfoCard")) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.encode(message.knowledgeInfoCard, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.dialogflow.cx.v3.ToolCall.encode(message.toolCall, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.IResponseMessage} message ResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage} ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.conversationSuccess = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.outputAudioText = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.liveAgentHandoff = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.endInteraction = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.playAudio = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.mixedAudio = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.telephonyTransferCall = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.toolCall = $root.google.cloud.dialogflow.cx.v3.ToolCall.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.responseType = reader.int32(); + break; + } + case 19: { + message.channel = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage} ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMessage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.verify(message.text, long + 1); + if (error) + return "text." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + } + if (message.conversationSuccess != null && message.hasOwnProperty("conversationSuccess")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.verify(message.conversationSuccess, long + 1); + if (error) + return "conversationSuccess." + error; + } + } + if (message.outputAudioText != null && message.hasOwnProperty("outputAudioText")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.verify(message.outputAudioText, long + 1); + if (error) + return "outputAudioText." + error; + } + } + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.verify(message.liveAgentHandoff, long + 1); + if (error) + return "liveAgentHandoff." + error; + } + } + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.verify(message.endInteraction, long + 1); + if (error) + return "endInteraction." + error; + } + } + if (message.playAudio != null && message.hasOwnProperty("playAudio")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.verify(message.playAudio, long + 1); + if (error) + return "playAudio." + error; + } + } + if (message.mixedAudio != null && message.hasOwnProperty("mixedAudio")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.verify(message.mixedAudio, long + 1); + if (error) + return "mixedAudio." + error; + } + } + if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.verify(message.telephonyTransferCall, long + 1); + if (error) + return "telephonyTransferCall." + error; + } + } + if (message.knowledgeInfoCard != null && message.hasOwnProperty("knowledgeInfoCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.verify(message.knowledgeInfoCard, long + 1); + if (error) + return "knowledgeInfoCard." + error; + } + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ToolCall.verify(message.toolCall, long + 1); + if (error) + return "toolCall." + error; + } + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + switch (message.responseType) { + default: + return "responseType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.channel != null && message.hasOwnProperty("channel")) + if (!$util.isString(message.channel)) + return "channel: string expected"; + return null; + }; + + /** + * Creates a ResponseMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage} ResponseMessage + */ + ResponseMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.text: object expected"); + message.text = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.fromObject(object.text, long + 1); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.conversationSuccess != null) { + if (typeof object.conversationSuccess !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.conversationSuccess: object expected"); + message.conversationSuccess = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.fromObject(object.conversationSuccess, long + 1); + } + if (object.outputAudioText != null) { + if (typeof object.outputAudioText !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.outputAudioText: object expected"); + message.outputAudioText = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.fromObject(object.outputAudioText, long + 1); + } + if (object.liveAgentHandoff != null) { + if (typeof object.liveAgentHandoff !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.liveAgentHandoff: object expected"); + message.liveAgentHandoff = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.fromObject(object.liveAgentHandoff, long + 1); + } + if (object.endInteraction != null) { + if (typeof object.endInteraction !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.endInteraction: object expected"); + message.endInteraction = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.fromObject(object.endInteraction, long + 1); + } + if (object.playAudio != null) { + if (typeof object.playAudio !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.playAudio: object expected"); + message.playAudio = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.fromObject(object.playAudio, long + 1); + } + if (object.mixedAudio != null) { + if (typeof object.mixedAudio !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.mixedAudio: object expected"); + message.mixedAudio = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.fromObject(object.mixedAudio, long + 1); + } + if (object.telephonyTransferCall != null) { + if (typeof object.telephonyTransferCall !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.telephonyTransferCall: object expected"); + message.telephonyTransferCall = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.fromObject(object.telephonyTransferCall, long + 1); + } + if (object.knowledgeInfoCard != null) { + if (typeof object.knowledgeInfoCard !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.knowledgeInfoCard: object expected"); + message.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.fromObject(object.knowledgeInfoCard, long + 1); + } + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.toolCall: object expected"); + message.toolCall = $root.google.cloud.dialogflow.cx.v3.ToolCall.fromObject(object.toolCall, long + 1); + } + switch (object.responseType) { + default: + if (typeof object.responseType === "number") { + message.responseType = object.responseType; + break; + } + break; + case "RESPONSE_TYPE_UNSPECIFIED": + case 0: + message.responseType = 0; + break; + case "ENTRY_PROMPT": + case 1: + message.responseType = 1; + break; + case "PARAMETER_PROMPT": + case 2: + message.responseType = 2; + break; + case "HANDLER_PROMPT": + case 3: + message.responseType = 3; + break; + } + if (object.channel != null) + message.channel = String(object.channel); + return message; + }; + + /** + * Creates a plain object from a ResponseMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage} message ResponseMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = options.enums === String ? "RESPONSE_TYPE_UNSPECIFIED" : 0; + object.channel = ""; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.toObject(message.text, options); + if (options.oneofs) + object.message = "text"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.message = "payload"; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType[message.responseType] === undefined ? message.responseType : $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType[message.responseType] : message.responseType; + if (message.outputAudioText != null && message.hasOwnProperty("outputAudioText")) { + object.outputAudioText = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.toObject(message.outputAudioText, options); + if (options.oneofs) + object.message = "outputAudioText"; + } + if (message.conversationSuccess != null && message.hasOwnProperty("conversationSuccess")) { + object.conversationSuccess = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.toObject(message.conversationSuccess, options); + if (options.oneofs) + object.message = "conversationSuccess"; + } + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) { + object.liveAgentHandoff = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.toObject(message.liveAgentHandoff, options); + if (options.oneofs) + object.message = "liveAgentHandoff"; + } + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) { + object.endInteraction = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.toObject(message.endInteraction, options); + if (options.oneofs) + object.message = "endInteraction"; + } + if (message.playAudio != null && message.hasOwnProperty("playAudio")) { + object.playAudio = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.toObject(message.playAudio, options); + if (options.oneofs) + object.message = "playAudio"; + } + if (message.mixedAudio != null && message.hasOwnProperty("mixedAudio")) { + object.mixedAudio = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.toObject(message.mixedAudio, options); + if (options.oneofs) + object.message = "mixedAudio"; + } + if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { + object.telephonyTransferCall = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.toObject(message.telephonyTransferCall, options); + if (options.oneofs) + object.message = "telephonyTransferCall"; + } + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = message.channel; + if (message.knowledgeInfoCard != null && message.hasOwnProperty("knowledgeInfoCard")) { + object.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.toObject(message.knowledgeInfoCard, options); + if (options.oneofs) + object.message = "knowledgeInfoCard"; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.dialogflow.cx.v3.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.message = "toolCall"; + } + return object; + }; + + /** + * Converts this ResponseMessage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @instance + * @returns {Object.} JSON object + */ + ResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseMessage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage"; + }; + + ResponseMessage.Text = (function() { + + /** + * Properties of a Text. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface IText + * @property {Array.|null} [text] Text text + * @property {boolean|null} [allowPlaybackInterruption] Text allowPlaybackInterruption + */ + + /** + * Constructs a new Text. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents a Text. + * @implements IText + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IText=} [properties] Properties to set + */ + function Text(properties) { + this.text = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Text text. + * @member {Array.} text + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @instance + */ + Text.prototype.text = $util.emptyArray; + + /** + * Text allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @instance + */ + Text.prototype.allowPlaybackInterruption = false; + + /** + * Creates a new Text instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.Text} Text instance + */ + Text.create = function create(properties) { + return new Text(properties); + }; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.Text.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.Text.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Text message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); + break; + } + case 2: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Text message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Text.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.Text} Text + */ + Text.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.Text.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); + } + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.Text} message Text + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Text.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.text = []; + if (options.defaults) + object.allowPlaybackInterruption = false; + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this Text to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @instance + * @returns {Object.} JSON object + */ + Text.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Text + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.Text + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Text.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.Text"; + }; + + return Text; + })(); + + ResponseMessage.LiveAgentHandoff = (function() { + + /** + * Properties of a LiveAgentHandoff. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface ILiveAgentHandoff + * @property {google.protobuf.IStruct|null} [metadata] LiveAgentHandoff metadata + */ + + /** + * Constructs a new LiveAgentHandoff. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents a LiveAgentHandoff. + * @implements ILiveAgentHandoff + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff=} [properties] Properties to set + */ + function LiveAgentHandoff(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LiveAgentHandoff metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @instance + */ + LiveAgentHandoff.prototype.metadata = null; + + /** + * Creates a new LiveAgentHandoff instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff instance + */ + LiveAgentHandoff.create = function create(properties) { + return new LiveAgentHandoff(properties); + }; + + /** + * Encodes the specified LiveAgentHandoff message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff} message LiveAgentHandoff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveAgentHandoff.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LiveAgentHandoff message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ILiveAgentHandoff} message LiveAgentHandoff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveAgentHandoff.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveAgentHandoff.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveAgentHandoff.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LiveAgentHandoff message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LiveAgentHandoff.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a LiveAgentHandoff message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + */ + LiveAgentHandoff.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LiveAgentHandoff message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff} message LiveAgentHandoff + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LiveAgentHandoff.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this LiveAgentHandoff to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @instance + * @returns {Object.} JSON object + */ + LiveAgentHandoff.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LiveAgentHandoff + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LiveAgentHandoff.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff"; + }; + + return LiveAgentHandoff; + })(); + + ResponseMessage.ConversationSuccess = (function() { + + /** + * Properties of a ConversationSuccess. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface IConversationSuccess + * @property {google.protobuf.IStruct|null} [metadata] ConversationSuccess metadata + */ + + /** + * Constructs a new ConversationSuccess. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents a ConversationSuccess. + * @implements IConversationSuccess + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess=} [properties] Properties to set + */ + function ConversationSuccess(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationSuccess metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @instance + */ + ConversationSuccess.prototype.metadata = null; + + /** + * Creates a new ConversationSuccess instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess} ConversationSuccess instance + */ + ConversationSuccess.create = function create(properties) { + return new ConversationSuccess(properties); + }; + + /** + * Encodes the specified ConversationSuccess message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess} message ConversationSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationSuccess.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConversationSuccess message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IConversationSuccess} message ConversationSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess} ConversationSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationSuccess.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess} ConversationSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationSuccess message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationSuccess.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ConversationSuccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess} ConversationSuccess + */ + ConversationSuccess.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConversationSuccess message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess} message ConversationSuccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationSuccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ConversationSuccess to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @instance + * @returns {Object.} JSON object + */ + ConversationSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationSuccess + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess"; + }; + + return ConversationSuccess; + })(); + + ResponseMessage.OutputAudioText = (function() { + + /** + * Properties of an OutputAudioText. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface IOutputAudioText + * @property {string|null} [text] OutputAudioText text + * @property {string|null} [ssml] OutputAudioText ssml + * @property {boolean|null} [allowPlaybackInterruption] OutputAudioText allowPlaybackInterruption + */ + + /** + * Constructs a new OutputAudioText. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents an OutputAudioText. + * @implements IOutputAudioText + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText=} [properties] Properties to set + */ + function OutputAudioText(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioText text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @instance + */ + OutputAudioText.prototype.text = null; + + /** + * OutputAudioText ssml. + * @member {string|null|undefined} ssml + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @instance + */ + OutputAudioText.prototype.ssml = null; + + /** + * OutputAudioText allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @instance + */ + OutputAudioText.prototype.allowPlaybackInterruption = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputAudioText source. + * @member {"text"|"ssml"|undefined} source + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @instance + */ + Object.defineProperty(OutputAudioText.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["text", "ssml"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputAudioText instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText} OutputAudioText instance + */ + OutputAudioText.create = function create(properties) { + return new OutputAudioText(properties); + }; + + /** + * Encodes the specified OutputAudioText message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText} message OutputAudioText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioText.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified OutputAudioText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IOutputAudioText} message OutputAudioText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioText.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText} OutputAudioText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioText.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.ssml = reader.string(); + break; + } + case 3: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText} OutputAudioText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioText.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioText message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioText.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.source = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.ssml != null && message.hasOwnProperty("ssml")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.ssml)) + return "ssml: string expected"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates an OutputAudioText message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText} OutputAudioText + */ + OutputAudioText.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText(); + if (object.text != null) + message.text = String(object.text); + if (object.ssml != null) + message.ssml = String(object.ssml); + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from an OutputAudioText message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText} message OutputAudioText + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioText.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.allowPlaybackInterruption = false; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.source = "text"; + } + if (message.ssml != null && message.hasOwnProperty("ssml")) { + object.ssml = message.ssml; + if (options.oneofs) + object.source = "ssml"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this OutputAudioText to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @instance + * @returns {Object.} JSON object + */ + OutputAudioText.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputAudioText + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputAudioText.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText"; + }; + + return OutputAudioText; + })(); + + ResponseMessage.EndInteraction = (function() { + + /** + * Properties of an EndInteraction. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface IEndInteraction + */ + + /** + * Constructs a new EndInteraction. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents an EndInteraction. + * @implements IEndInteraction + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction=} [properties] Properties to set + */ + function EndInteraction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new EndInteraction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction} EndInteraction instance + */ + EndInteraction.create = function create(properties) { + return new EndInteraction(properties); + }; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndInteraction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndInteraction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction} EndInteraction + */ + EndInteraction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction(); + }; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction} message EndInteraction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndInteraction.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EndInteraction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @instance + * @returns {Object.} JSON object + */ + EndInteraction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndInteraction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndInteraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction"; + }; + + return EndInteraction; + })(); + + ResponseMessage.PlayAudio = (function() { + + /** + * Properties of a PlayAudio. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface IPlayAudio + * @property {string|null} [audioUri] PlayAudio audioUri + * @property {boolean|null} [allowPlaybackInterruption] PlayAudio allowPlaybackInterruption + */ + + /** + * Constructs a new PlayAudio. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents a PlayAudio. + * @implements IPlayAudio + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio=} [properties] Properties to set + */ + function PlayAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlayAudio audioUri. + * @member {string} audioUri + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @instance + */ + PlayAudio.prototype.audioUri = ""; + + /** + * PlayAudio allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @instance + */ + PlayAudio.prototype.allowPlaybackInterruption = false; + + /** + * Creates a new PlayAudio instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio} PlayAudio instance + */ + PlayAudio.create = function create(properties) { + return new PlayAudio(properties); + }; + + /** + * Encodes the specified PlayAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio} message PlayAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlayAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioUri != null && Object.hasOwnProperty.call(message, "audioUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioUri); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified PlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IPlayAudio} message PlayAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlayAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlayAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio} PlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlayAudio.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioUri = reader.string(); + break; + } + case 2: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlayAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio} PlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlayAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlayAudio message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlayAudio.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioUri != null && message.hasOwnProperty("audioUri")) + if (!$util.isString(message.audioUri)) + return "audioUri: string expected"; + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates a PlayAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio} PlayAudio + */ + PlayAudio.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio(); + if (object.audioUri != null) + message.audioUri = String(object.audioUri); + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from a PlayAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio} message PlayAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlayAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioUri = ""; + object.allowPlaybackInterruption = false; + } + if (message.audioUri != null && message.hasOwnProperty("audioUri")) + object.audioUri = message.audioUri; + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this PlayAudio to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @instance + * @returns {Object.} JSON object + */ + PlayAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlayAudio + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlayAudio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio"; + }; + + return PlayAudio; + })(); + + ResponseMessage.MixedAudio = (function() { + + /** + * Properties of a MixedAudio. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface IMixedAudio + * @property {Array.|null} [segments] MixedAudio segments + */ + + /** + * Constructs a new MixedAudio. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents a MixedAudio. + * @implements IMixedAudio + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio=} [properties] Properties to set + */ + function MixedAudio(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MixedAudio segments. + * @member {Array.} segments + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @instance + */ + MixedAudio.prototype.segments = $util.emptyArray; + + /** + * Creates a new MixedAudio instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio} MixedAudio instance + */ + MixedAudio.create = function create(properties) { + return new MixedAudio(properties); + }; + + /** + * Encodes the specified MixedAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio} message MixedAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MixedAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.encode(message.segments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MixedAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IMixedAudio} message MixedAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MixedAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MixedAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio} MixedAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MixedAudio.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MixedAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio} MixedAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MixedAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MixedAudio message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MixedAudio.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.verify(message.segments[i], long + 1); + if (error) + return "segments." + error; + } + } + return null; + }; + + /** + * Creates a MixedAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio} MixedAudio + */ + MixedAudio.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio(); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.segments: object expected"); + message.segments[i] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.fromObject(object.segments[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a MixedAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio} message MixedAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MixedAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.toObject(message.segments[j], options); + } + return object; + }; + + /** + * Converts this MixedAudio to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @instance + * @returns {Object.} JSON object + */ + MixedAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MixedAudio + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MixedAudio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio"; + }; + + MixedAudio.Segment = (function() { + + /** + * Properties of a Segment. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @interface ISegment + * @property {Uint8Array|null} [audio] Segment audio + * @property {string|null} [uri] Segment uri + * @property {boolean|null} [allowPlaybackInterruption] Segment allowPlaybackInterruption + */ + + /** + * Constructs a new Segment. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio + * @classdesc Represents a Segment. + * @implements ISegment + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment=} [properties] Properties to set + */ + function Segment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Segment audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @instance + */ + Segment.prototype.audio = null; + + /** + * Segment uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @instance + */ + Segment.prototype.uri = null; + + /** + * Segment allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @instance + */ + Segment.prototype.allowPlaybackInterruption = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Segment content. + * @member {"audio"|"uri"|undefined} content + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @instance + */ + Object.defineProperty(Segment.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["audio", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Segment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment} Segment instance + */ + Segment.create = function create(properties) { + return new Segment(properties); + }; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.audio); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audio = reader.bytes(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Segment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Segment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.audio != null && message.hasOwnProperty("audio")) { + properties.content = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates a Segment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment} Segment + */ + Segment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment(); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.uri != null) + message.uri = String(object.uri); + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment} message Segment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Segment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.allowPlaybackInterruption = false; + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.content = "audio"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.content = "uri"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this Segment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @instance + * @returns {Object.} JSON object + */ + Segment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Segment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment"; + }; + + return Segment; + })(); + + return MixedAudio; + })(); + + ResponseMessage.TelephonyTransferCall = (function() { + + /** + * Properties of a TelephonyTransferCall. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface ITelephonyTransferCall + * @property {string|null} [phoneNumber] TelephonyTransferCall phoneNumber + */ + + /** + * Constructs a new TelephonyTransferCall. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents a TelephonyTransferCall. + * @implements ITelephonyTransferCall + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall=} [properties] Properties to set + */ + function TelephonyTransferCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TelephonyTransferCall phoneNumber. + * @member {string|null|undefined} phoneNumber + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @instance + */ + TelephonyTransferCall.prototype.phoneNumber = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TelephonyTransferCall endpoint. + * @member {"phoneNumber"|undefined} endpoint + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @instance + */ + Object.defineProperty(TelephonyTransferCall.prototype, "endpoint", { + get: $util.oneOfGetter($oneOfFields = ["phoneNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TelephonyTransferCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall instance + */ + TelephonyTransferCall.create = function create(properties) { + return new TelephonyTransferCall(properties); + }; + + /** + * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyTransferCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumber); + return writer; + }; + + /** + * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyTransferCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyTransferCall.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phoneNumber = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyTransferCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TelephonyTransferCall message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TelephonyTransferCall.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + properties.endpoint = 1; + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + } + return null; + }; + + /** + * Creates a TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall + */ + TelephonyTransferCall.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall(); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + return message; + }; + + /** + * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall} message TelephonyTransferCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TelephonyTransferCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + object.phoneNumber = message.phoneNumber; + if (options.oneofs) + object.endpoint = "phoneNumber"; + } + return object; + }; + + /** + * Converts this TelephonyTransferCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @instance + * @returns {Object.} JSON object + */ + TelephonyTransferCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TelephonyTransferCall + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TelephonyTransferCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall"; + }; + + return TelephonyTransferCall; + })(); + + ResponseMessage.KnowledgeInfoCard = (function() { + + /** + * Properties of a KnowledgeInfoCard. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @interface IKnowledgeInfoCard + */ + + /** + * Constructs a new KnowledgeInfoCard. + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage + * @classdesc Represents a KnowledgeInfoCard. + * @implements IKnowledgeInfoCard + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard=} [properties] Properties to set + */ + function KnowledgeInfoCard(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new KnowledgeInfoCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard instance + */ + KnowledgeInfoCard.create = function create(properties) { + return new KnowledgeInfoCard(properties); + }; + + /** + * Encodes the specified KnowledgeInfoCard message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard} message KnowledgeInfoCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeInfoCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified KnowledgeInfoCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.IKnowledgeInfoCard} message KnowledgeInfoCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeInfoCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeInfoCard.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeInfoCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeInfoCard message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeInfoCard.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a KnowledgeInfoCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard + */ + KnowledgeInfoCard.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard(); + }; + + /** + * Creates a plain object from a KnowledgeInfoCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard} message KnowledgeInfoCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeInfoCard.toObject = function toObject() { + return {}; + }; + + /** + * Converts this KnowledgeInfoCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @instance + * @returns {Object.} JSON object + */ + KnowledgeInfoCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KnowledgeInfoCard + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KnowledgeInfoCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard"; + }; + + return KnowledgeInfoCard; + })(); + + /** + * ResponseType enum. + * @name google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType + * @enum {number} + * @property {number} RESPONSE_TYPE_UNSPECIFIED=0 RESPONSE_TYPE_UNSPECIFIED value + * @property {number} ENTRY_PROMPT=1 ENTRY_PROMPT value + * @property {number} PARAMETER_PROMPT=2 PARAMETER_PROMPT value + * @property {number} HANDLER_PROMPT=3 HANDLER_PROMPT value + */ + ResponseMessage.ResponseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTRY_PROMPT"] = 1; + values[valuesById[2] = "PARAMETER_PROMPT"] = 2; + values[valuesById[3] = "HANDLER_PROMPT"] = 3; + return values; + })(); + + return ResponseMessage; + })(); + + v3.ToolCall = (function() { + + /** + * Properties of a ToolCall. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IToolCall + * @property {string|null} [tool] ToolCall tool + * @property {string|null} [action] ToolCall action + * @property {google.protobuf.IStruct|null} [inputParameters] ToolCall inputParameters + */ + + /** + * Constructs a new ToolCall. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ToolCall. + * @implements IToolCall + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IToolCall=} [properties] Properties to set + */ + function ToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCall tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @instance + */ + ToolCall.prototype.tool = ""; + + /** + * ToolCall action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @instance + */ + ToolCall.prototype.action = ""; + + /** + * ToolCall inputParameters. + * @member {google.protobuf.IStruct|null|undefined} inputParameters + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @instance + */ + ToolCall.prototype.inputParameters = null; + + /** + * Creates a new ToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ToolCall} ToolCall instance + */ + ToolCall.create = function create(properties) { + return new ToolCall(properties); + }; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.inputParameters != null && Object.hasOwnProperty.call(message, "inputParameters")) + $root.google.protobuf.Struct.encode(message.inputParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 3: { + message.inputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCall message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCall.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputParameters, long + 1); + if (error) + return "inputParameters." + error; + } + return null; + }; + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ToolCall} ToolCall + */ + ToolCall.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ToolCall) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ToolCall(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.action != null) + message.action = String(object.action); + if (object.inputParameters != null) { + if (typeof object.inputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolCall.inputParameters: object expected"); + message.inputParameters = $root.google.protobuf.Struct.fromObject(object.inputParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolCall} message ToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + object.inputParameters = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) + object.inputParameters = $root.google.protobuf.Struct.toObject(message.inputParameters, options); + return object; + }; + + /** + * Converts this ToolCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @instance + * @returns {Object.} JSON object + */ + ToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCall + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ToolCall"; + }; + + return ToolCall; + })(); + + v3.ToolCallResult = (function() { + + /** + * Properties of a ToolCallResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IToolCallResult + * @property {string|null} [tool] ToolCallResult tool + * @property {string|null} [action] ToolCallResult action + * @property {google.cloud.dialogflow.cx.v3.ToolCallResult.IError|null} [error] ToolCallResult error + * @property {google.protobuf.IStruct|null} [outputParameters] ToolCallResult outputParameters + */ + + /** + * Constructs a new ToolCallResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ToolCallResult. + * @implements IToolCallResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IToolCallResult=} [properties] Properties to set + */ + function ToolCallResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCallResult tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @instance + */ + ToolCallResult.prototype.tool = ""; + + /** + * ToolCallResult action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @instance + */ + ToolCallResult.prototype.action = ""; + + /** + * ToolCallResult error. + * @member {google.cloud.dialogflow.cx.v3.ToolCallResult.IError|null|undefined} error + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @instance + */ + ToolCallResult.prototype.error = null; + + /** + * ToolCallResult outputParameters. + * @member {google.protobuf.IStruct|null|undefined} outputParameters + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @instance + */ + ToolCallResult.prototype.outputParameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolCallResult result. + * @member {"error"|"outputParameters"|undefined} result + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @instance + */ + Object.defineProperty(ToolCallResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "outputParameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolCallResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolCallResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult} ToolCallResult instance + */ + ToolCallResult.create = function create(properties) { + return new ToolCallResult(properties); + }; + + /** + * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolCallResult} message ToolCallResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputParameters != null && Object.hasOwnProperty.call(message, "outputParameters")) + $root.google.protobuf.Struct.encode(message.outputParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolCallResult} message ToolCallResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult} ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ToolCallResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 3: { + message.error = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult} ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCallResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCallResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error.verify(message.error, long + 1); + if (error) + return "error." + error; + } + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Struct.verify(message.outputParameters, long + 1); + if (error) + return "outputParameters." + error; + } + } + return null; + }; + + /** + * Creates a ToolCallResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult} ToolCallResult + */ + ToolCallResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ToolCallResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ToolCallResult(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.action != null) + message.action = String(object.action); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolCallResult.error: object expected"); + message.error = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error.fromObject(object.error, long + 1); + } + if (object.outputParameters != null) { + if (typeof object.outputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolCallResult.outputParameters: object expected"); + message.outputParameters = $root.google.protobuf.Struct.fromObject(object.outputParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolCallResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolCallResult} message ToolCallResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCallResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + object.outputParameters = $root.google.protobuf.Struct.toObject(message.outputParameters, options); + if (options.oneofs) + object.result = "outputParameters"; + } + return object; + }; + + /** + * Converts this ToolCallResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @instance + * @returns {Object.} JSON object + */ + ToolCallResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCallResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCallResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ToolCallResult"; + }; + + ToolCallResult.Error = (function() { + + /** + * Properties of an Error. + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @interface IError + * @property {string|null} [message] Error message + */ + + /** + * Constructs a new Error. + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ToolCallResult.IError=} [properties] Properties to set + */ + function Error(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error message. + * @member {string} message + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @instance + */ + Error.prototype.message = ""; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolCallResult.IError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.Error.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolCallResult.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolCallResult.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolCallResult.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ToolCallResult.Error} Error + */ + Error.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ToolCallResult.Error(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolCallResult.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Error + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ToolCallResult.Error + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Error.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ToolCallResult.Error"; + }; + + return Error; + })(); + + return ToolCallResult; + })(); + + v3.ParameterDefinition = (function() { + + /** + * Properties of a ParameterDefinition. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IParameterDefinition + * @property {string|null} [name] ParameterDefinition name + * @property {google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType|null} [type] ParameterDefinition type + * @property {google.cloud.dialogflow.cx.v3.ITypeSchema|null} [typeSchema] ParameterDefinition typeSchema + * @property {string|null} [description] ParameterDefinition description + */ + + /** + * Constructs a new ParameterDefinition. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ParameterDefinition. + * @implements IParameterDefinition + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IParameterDefinition=} [properties] Properties to set + */ + function ParameterDefinition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterDefinition name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.name = ""; + + /** + * ParameterDefinition type. + * @member {google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType} type + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.type = 0; + + /** + * ParameterDefinition typeSchema. + * @member {google.cloud.dialogflow.cx.v3.ITypeSchema|null|undefined} typeSchema + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.typeSchema = null; + + /** + * ParameterDefinition description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.description = ""; + + /** + * Creates a new ParameterDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3.IParameterDefinition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ParameterDefinition} ParameterDefinition instance + */ + ParameterDefinition.create = function create(properties) { + return new ParameterDefinition(properties); + }; + + /** + * Encodes the specified ParameterDefinition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ParameterDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3.IParameterDefinition} message ParameterDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterDefinition.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.typeSchema != null && Object.hasOwnProperty.call(message, "typeSchema")) + $root.google.cloud.dialogflow.cx.v3.TypeSchema.encode(message.typeSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParameterDefinition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ParameterDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3.IParameterDefinition} message ParameterDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ParameterDefinition} ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ParameterDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 4: { + message.typeSchema = $root.google.cloud.dialogflow.cx.v3.TypeSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ParameterDefinition} ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterDefinition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.typeSchema != null && message.hasOwnProperty("typeSchema")) { + var error = $root.google.cloud.dialogflow.cx.v3.TypeSchema.verify(message.typeSchema, long + 1); + if (error) + return "typeSchema." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a ParameterDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ParameterDefinition} ParameterDefinition + */ + ParameterDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ParameterDefinition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ParameterDefinition(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "PARAMETER_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "NUMBER": + case 2: + message.type = 2; + break; + case "BOOLEAN": + case 3: + message.type = 3; + break; + case "NULL": + case 4: + message.type = 4; + break; + case "OBJECT": + case 5: + message.type = 5; + break; + case "LIST": + case 6: + message.type = 6; + break; + } + if (object.typeSchema != null) { + if (typeof object.typeSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ParameterDefinition.typeSchema: object expected"); + message.typeSchema = $root.google.cloud.dialogflow.cx.v3.TypeSchema.fromObject(object.typeSchema, long + 1); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a ParameterDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3.ParameterDefinition} message ParameterDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterDefinition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "PARAMETER_TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.typeSchema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.typeSchema != null && message.hasOwnProperty("typeSchema")) + object.typeSchema = $root.google.cloud.dialogflow.cx.v3.TypeSchema.toObject(message.typeSchema, options); + return object; + }; + + /** + * Converts this ParameterDefinition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @instance + * @returns {Object.} JSON object + */ + ParameterDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterDefinition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ParameterDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ParameterDefinition"; + }; + + /** + * ParameterType enum. + * @name google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType + * @enum {number} + * @property {number} PARAMETER_TYPE_UNSPECIFIED=0 PARAMETER_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} NUMBER=2 NUMBER value + * @property {number} BOOLEAN=3 BOOLEAN value + * @property {number} NULL=4 NULL value + * @property {number} OBJECT=5 OBJECT value + * @property {number} LIST=6 LIST value + */ + ParameterDefinition.ParameterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARAMETER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "NUMBER"] = 2; + values[valuesById[3] = "BOOLEAN"] = 3; + values[valuesById[4] = "NULL"] = 4; + values[valuesById[5] = "OBJECT"] = 5; + values[valuesById[6] = "LIST"] = 6; + return values; + })(); + + return ParameterDefinition; + })(); + + v3.TypeSchema = (function() { + + /** + * Properties of a TypeSchema. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITypeSchema + * @property {google.cloud.dialogflow.cx.v3.IInlineSchema|null} [inlineSchema] TypeSchema inlineSchema + * @property {google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference|null} [schemaReference] TypeSchema schemaReference + */ + + /** + * Constructs a new TypeSchema. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TypeSchema. + * @implements ITypeSchema + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITypeSchema=} [properties] Properties to set + */ + function TypeSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypeSchema inlineSchema. + * @member {google.cloud.dialogflow.cx.v3.IInlineSchema|null|undefined} inlineSchema + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @instance + */ + TypeSchema.prototype.inlineSchema = null; + + /** + * TypeSchema schemaReference. + * @member {google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference|null|undefined} schemaReference + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @instance + */ + TypeSchema.prototype.schemaReference = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TypeSchema schema. + * @member {"inlineSchema"|"schemaReference"|undefined} schema + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @instance + */ + Object.defineProperty(TypeSchema.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["inlineSchema", "schemaReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TypeSchema instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.ITypeSchema=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema} TypeSchema instance + */ + TypeSchema.create = function create(properties) { + return new TypeSchema(properties); + }; + + /** + * Encodes the specified TypeSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.ITypeSchema} message TypeSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inlineSchema != null && Object.hasOwnProperty.call(message, "inlineSchema")) + $root.google.cloud.dialogflow.cx.v3.InlineSchema.encode(message.inlineSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.schemaReference != null && Object.hasOwnProperty.call(message, "schemaReference")) + $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.encode(message.schemaReference, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TypeSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.ITypeSchema} message TypeSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema} TypeSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TypeSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inlineSchema = $root.google.cloud.dialogflow.cx.v3.InlineSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.schemaReference = $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TypeSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema} TypeSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeSchema message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.inlineSchema != null && message.hasOwnProperty("inlineSchema")) { + properties.schema = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.InlineSchema.verify(message.inlineSchema, long + 1); + if (error) + return "inlineSchema." + error; + } + } + if (message.schemaReference != null && message.hasOwnProperty("schemaReference")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.verify(message.schemaReference, long + 1); + if (error) + return "schemaReference." + error; + } + } + return null; + }; + + /** + * Creates a TypeSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema} TypeSchema + */ + TypeSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TypeSchema) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TypeSchema(); + if (object.inlineSchema != null) { + if (typeof object.inlineSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TypeSchema.inlineSchema: object expected"); + message.inlineSchema = $root.google.cloud.dialogflow.cx.v3.InlineSchema.fromObject(object.inlineSchema, long + 1); + } + if (object.schemaReference != null) { + if (typeof object.schemaReference !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TypeSchema.schemaReference: object expected"); + message.schemaReference = $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.fromObject(object.schemaReference, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TypeSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.TypeSchema} message TypeSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.inlineSchema != null && message.hasOwnProperty("inlineSchema")) { + object.inlineSchema = $root.google.cloud.dialogflow.cx.v3.InlineSchema.toObject(message.inlineSchema, options); + if (options.oneofs) + object.schema = "inlineSchema"; + } + if (message.schemaReference != null && message.hasOwnProperty("schemaReference")) { + object.schemaReference = $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.toObject(message.schemaReference, options); + if (options.oneofs) + object.schema = "schemaReference"; + } + return object; + }; + + /** + * Converts this TypeSchema to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @instance + * @returns {Object.} JSON object + */ + TypeSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TypeSchema + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TypeSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TypeSchema"; + }; + + TypeSchema.SchemaReference = (function() { + + /** + * Properties of a SchemaReference. + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @interface ISchemaReference + * @property {string|null} [tool] SchemaReference tool + * @property {string|null} [schema] SchemaReference schema + */ + + /** + * Constructs a new SchemaReference. + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema + * @classdesc Represents a SchemaReference. + * @implements ISchemaReference + * @constructor + * @param {google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference=} [properties] Properties to set + */ + function SchemaReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchemaReference tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @instance + */ + SchemaReference.prototype.tool = ""; + + /** + * SchemaReference schema. + * @member {string} schema + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @instance + */ + SchemaReference.prototype.schema = ""; + + /** + * Creates a new SchemaReference instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference} SchemaReference instance + */ + SchemaReference.create = function create(properties) { + return new SchemaReference(properties); + }; + + /** + * Encodes the specified SchemaReference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference} message SchemaReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schema); + return writer; + }; + + /** + * Encodes the specified SchemaReference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3.TypeSchema.ISchemaReference} message SchemaReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference} SchemaReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.schema = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference} SchemaReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaReference message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + return null; + }; + + /** + * Creates a SchemaReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference} SchemaReference + */ + SchemaReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.schema != null) + message.schema = String(object.schema); + return message; + }; + + /** + * Creates a plain object from a SchemaReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference} message SchemaReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.schema = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + return object; + }; + + /** + * Converts this SchemaReference to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @instance + * @returns {Object.} JSON object + */ + SchemaReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaReference + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference"; + }; + + return SchemaReference; + })(); + + return TypeSchema; + })(); + + v3.InlineSchema = (function() { + + /** + * Properties of an InlineSchema. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IInlineSchema + * @property {google.cloud.dialogflow.cx.v3.DataType|null} [type] InlineSchema type + * @property {google.cloud.dialogflow.cx.v3.ITypeSchema|null} [items] InlineSchema items + */ + + /** + * Constructs a new InlineSchema. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an InlineSchema. + * @implements IInlineSchema + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IInlineSchema=} [properties] Properties to set + */ + function InlineSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSchema type. + * @member {google.cloud.dialogflow.cx.v3.DataType} type + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @instance + */ + InlineSchema.prototype.type = 0; + + /** + * InlineSchema items. + * @member {google.cloud.dialogflow.cx.v3.ITypeSchema|null|undefined} items + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @instance + */ + InlineSchema.prototype.items = null; + + /** + * Creates a new InlineSchema instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineSchema=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.InlineSchema} InlineSchema instance + */ + InlineSchema.create = function create(properties) { + return new InlineSchema(properties); + }; + + /** + * Encodes the specified InlineSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineSchema} message InlineSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + $root.google.cloud.dialogflow.cx.v3.TypeSchema.encode(message.items, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InlineSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineSchema} message InlineSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.InlineSchema} InlineSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.InlineSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.items = $root.google.cloud.dialogflow.cx.v3.TypeSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.InlineSchema} InlineSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSchema message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + break; + } + if (message.items != null && message.hasOwnProperty("items")) { + var error = $root.google.cloud.dialogflow.cx.v3.TypeSchema.verify(message.items, long + 1); + if (error) + return "items." + error; + } + return null; + }; + + /** + * Creates an InlineSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.InlineSchema} InlineSchema + */ + InlineSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.InlineSchema) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.InlineSchema(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "NUMBER": + case 2: + message.type = 2; + break; + case "BOOLEAN": + case 3: + message.type = 3; + break; + case "ARRAY": + case 6: + message.type = 6; + break; + } + if (object.items != null) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.InlineSchema.items: object expected"); + message.items = $root.google.cloud.dialogflow.cx.v3.TypeSchema.fromObject(object.items, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an InlineSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3.InlineSchema} message InlineSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.items = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DataType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3.DataType[message.type] : message.type; + if (message.items != null && message.hasOwnProperty("items")) + object.items = $root.google.cloud.dialogflow.cx.v3.TypeSchema.toObject(message.items, options); + return object; + }; + + /** + * Converts this InlineSchema to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @instance + * @returns {Object.} JSON object + */ + InlineSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSchema + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.InlineSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.InlineSchema"; + }; + + return InlineSchema; + })(); + + /** + * DataType enum. + * @name google.cloud.dialogflow.cx.v3.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} NUMBER=2 NUMBER value + * @property {number} BOOLEAN=3 BOOLEAN value + * @property {number} ARRAY=6 ARRAY value + */ + v3.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "NUMBER"] = 2; + values[valuesById[3] = "BOOLEAN"] = 3; + values[valuesById[6] = "ARRAY"] = 6; + return values; + })(); + + v3.ValidationMessage = (function() { + + /** + * Properties of a ValidationMessage. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IValidationMessage + * @property {google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType|null} [resourceType] ValidationMessage resourceType + * @property {Array.|null} [resources] ValidationMessage resources + * @property {Array.|null} [resourceNames] ValidationMessage resourceNames + * @property {google.cloud.dialogflow.cx.v3.ValidationMessage.Severity|null} [severity] ValidationMessage severity + * @property {string|null} [detail] ValidationMessage detail + */ + + /** + * Constructs a new ValidationMessage. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ValidationMessage. + * @implements IValidationMessage + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IValidationMessage=} [properties] Properties to set + */ + function ValidationMessage(properties) { + this.resources = []; + this.resourceNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidationMessage resourceType. + * @member {google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType} resourceType + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @instance + */ + ValidationMessage.prototype.resourceType = 0; + + /** + * ValidationMessage resources. + * @member {Array.} resources + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @instance + */ + ValidationMessage.prototype.resources = $util.emptyArray; + + /** + * ValidationMessage resourceNames. + * @member {Array.} resourceNames + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @instance + */ + ValidationMessage.prototype.resourceNames = $util.emptyArray; + + /** + * ValidationMessage severity. + * @member {google.cloud.dialogflow.cx.v3.ValidationMessage.Severity} severity + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @instance + */ + ValidationMessage.prototype.severity = 0; + + /** + * ValidationMessage detail. + * @member {string} detail + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @instance + */ + ValidationMessage.prototype.detail = ""; + + /** + * Creates a new ValidationMessage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidationMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ValidationMessage} ValidationMessage instance + */ + ValidationMessage.create = function create(properties) { + return new ValidationMessage(properties); + }; + + /** + * Encodes the specified ValidationMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidationMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidationMessage} message ValidationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.resourceType); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resources[i]); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.severity); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.detail); + if (message.resourceNames != null && message.resourceNames.length) + for (var i = 0; i < message.resourceNames.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ResourceName.encode(message.resourceNames[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidationMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ValidationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.IValidationMessage} message ValidationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ValidationMessage} ValidationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ValidationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resourceType = reader.int32(); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 6: { + if (!(message.resourceNames && message.resourceNames.length)) + message.resourceNames = []; + message.resourceNames.push($root.google.cloud.dialogflow.cx.v3.ResourceName.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.severity = reader.int32(); + break; + } + case 4: { + message.detail = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ValidationMessage} ValidationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidationMessage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidationMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + case 8: + case 9: + case 10: + case 11: + case 3: + case 12: + case 4: + case 5: + case 6: + case 13: + case 7: + case 14: + break; + } + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.resourceNames != null && message.hasOwnProperty("resourceNames")) { + if (!Array.isArray(message.resourceNames)) + return "resourceNames: array expected"; + for (var i = 0; i < message.resourceNames.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ResourceName.verify(message.resourceNames[i], long + 1); + if (error) + return "resourceNames." + error; + } + } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a ValidationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ValidationMessage} ValidationMessage + */ + ValidationMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ValidationMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ValidationMessage(); + switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "AGENT": + case 1: + message.resourceType = 1; + break; + case "INTENT": + case 2: + message.resourceType = 2; + break; + case "INTENT_TRAINING_PHRASE": + case 8: + message.resourceType = 8; + break; + case "INTENT_PARAMETER": + case 9: + message.resourceType = 9; + break; + case "INTENTS": + case 10: + message.resourceType = 10; + break; + case "INTENT_TRAINING_PHRASES": + case 11: + message.resourceType = 11; + break; + case "ENTITY_TYPE": + case 3: + message.resourceType = 3; + break; + case "ENTITY_TYPES": + case 12: + message.resourceType = 12; + break; + case "WEBHOOK": + case 4: + message.resourceType = 4; + break; + case "FLOW": + case 5: + message.resourceType = 5; + break; + case "PAGE": + case 6: + message.resourceType = 6; + break; + case "PAGES": + case 13: + message.resourceType = 13; + break; + case "TRANSITION_ROUTE_GROUP": + case 7: + message.resourceType = 7; + break; + case "AGENT_TRANSITION_ROUTE_GROUP": + case 14: + message.resourceType = 14; + break; + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ValidationMessage.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.resourceNames) { + if (!Array.isArray(object.resourceNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ValidationMessage.resourceNames: array expected"); + message.resourceNames = []; + for (var i = 0; i < object.resourceNames.length; ++i) { + if (typeof object.resourceNames[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ValidationMessage.resourceNames: object expected"); + message.resourceNames[i] = $root.google.cloud.dialogflow.cx.v3.ResourceName.fromObject(object.resourceNames[i], long + 1); + } + } + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "INFO": + case 1: + message.severity = 1; + break; + case "WARNING": + case 2: + message.severity = 2; + break; + case "ERROR": + case 3: + message.severity = 3; + break; + } + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a ValidationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3.ValidationMessage} message ValidationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.resourceNames = []; + } + if (options.defaults) { + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.detail = ""; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType[message.resourceType] : message.resourceType; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ValidationMessage.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.dialogflow.cx.v3.ValidationMessage.Severity[message.severity] : message.severity; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + if (message.resourceNames && message.resourceNames.length) { + object.resourceNames = []; + for (var j = 0; j < message.resourceNames.length; ++j) + object.resourceNames[j] = $root.google.cloud.dialogflow.cx.v3.ResourceName.toObject(message.resourceNames[j], options); + } + return object; + }; + + /** + * Converts this ValidationMessage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @instance + * @returns {Object.} JSON object + */ + ValidationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidationMessage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ValidationMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ValidationMessage"; + }; + + /** + * ResourceType enum. + * @name google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} AGENT=1 AGENT value + * @property {number} INTENT=2 INTENT value + * @property {number} INTENT_TRAINING_PHRASE=8 INTENT_TRAINING_PHRASE value + * @property {number} INTENT_PARAMETER=9 INTENT_PARAMETER value + * @property {number} INTENTS=10 INTENTS value + * @property {number} INTENT_TRAINING_PHRASES=11 INTENT_TRAINING_PHRASES value + * @property {number} ENTITY_TYPE=3 ENTITY_TYPE value + * @property {number} ENTITY_TYPES=12 ENTITY_TYPES value + * @property {number} WEBHOOK=4 WEBHOOK value + * @property {number} FLOW=5 FLOW value + * @property {number} PAGE=6 PAGE value + * @property {number} PAGES=13 PAGES value + * @property {number} TRANSITION_ROUTE_GROUP=7 TRANSITION_ROUTE_GROUP value + * @property {number} AGENT_TRANSITION_ROUTE_GROUP=14 AGENT_TRANSITION_ROUTE_GROUP value + */ + ValidationMessage.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGENT"] = 1; + values[valuesById[2] = "INTENT"] = 2; + values[valuesById[8] = "INTENT_TRAINING_PHRASE"] = 8; + values[valuesById[9] = "INTENT_PARAMETER"] = 9; + values[valuesById[10] = "INTENTS"] = 10; + values[valuesById[11] = "INTENT_TRAINING_PHRASES"] = 11; + values[valuesById[3] = "ENTITY_TYPE"] = 3; + values[valuesById[12] = "ENTITY_TYPES"] = 12; + values[valuesById[4] = "WEBHOOK"] = 4; + values[valuesById[5] = "FLOW"] = 5; + values[valuesById[6] = "PAGE"] = 6; + values[valuesById[13] = "PAGES"] = 13; + values[valuesById[7] = "TRANSITION_ROUTE_GROUP"] = 7; + values[valuesById[14] = "AGENT_TRANSITION_ROUTE_GROUP"] = 14; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.dialogflow.cx.v3.ValidationMessage.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} INFO=1 INFO value + * @property {number} WARNING=2 WARNING value + * @property {number} ERROR=3 ERROR value + */ + ValidationMessage.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFO"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return ValidationMessage; + })(); + + v3.ResourceName = (function() { + + /** + * Properties of a ResourceName. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IResourceName + * @property {string|null} [name] ResourceName name + * @property {string|null} [displayName] ResourceName displayName + */ + + /** + * Constructs a new ResourceName. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ResourceName. + * @implements IResourceName + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IResourceName=} [properties] Properties to set + */ + function ResourceName(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceName name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @instance + */ + ResourceName.prototype.name = ""; + + /** + * ResourceName displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @instance + */ + ResourceName.prototype.displayName = ""; + + /** + * Creates a new ResourceName instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3.IResourceName=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ResourceName} ResourceName instance + */ + ResourceName.create = function create(properties) { + return new ResourceName(properties); + }; + + /** + * Encodes the specified ResourceName message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResourceName.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3.IResourceName} message ResourceName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceName.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ResourceName message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ResourceName.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3.IResourceName} message ResourceName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceName.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceName message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ResourceName} ResourceName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceName.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ResourceName(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceName message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ResourceName} ResourceName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceName.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceName message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceName.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ResourceName message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ResourceName} ResourceName + */ + ResourceName.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ResourceName) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ResourceName(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ResourceName message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3.ResourceName} message ResourceName + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceName.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ResourceName to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @instance + * @returns {Object.} JSON object + */ + ResourceName.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceName + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ResourceName + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ResourceName"; + }; + + return ResourceName; + })(); + + v3.GenerativeSettings = (function() { + + /** + * Properties of a GenerativeSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGenerativeSettings + * @property {string|null} [name] GenerativeSettings name + * @property {google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings|null} [fallbackSettings] GenerativeSettings fallbackSettings + * @property {google.cloud.dialogflow.cx.v3.ISafetySettings|null} [generativeSafetySettings] GenerativeSettings generativeSafetySettings + * @property {google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings|null} [knowledgeConnectorSettings] GenerativeSettings knowledgeConnectorSettings + * @property {string|null} [languageCode] GenerativeSettings languageCode + * @property {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null} [llmModelSettings] GenerativeSettings llmModelSettings + */ + + /** + * Constructs a new GenerativeSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GenerativeSettings. + * @implements IGenerativeSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGenerativeSettings=} [properties] Properties to set + */ + function GenerativeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerativeSettings name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.name = ""; + + /** + * GenerativeSettings fallbackSettings. + * @member {google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings|null|undefined} fallbackSettings + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.fallbackSettings = null; + + /** + * GenerativeSettings generativeSafetySettings. + * @member {google.cloud.dialogflow.cx.v3.ISafetySettings|null|undefined} generativeSafetySettings + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.generativeSafetySettings = null; + + /** + * GenerativeSettings knowledgeConnectorSettings. + * @member {google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings|null|undefined} knowledgeConnectorSettings + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.knowledgeConnectorSettings = null; + + /** + * GenerativeSettings languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.languageCode = ""; + + /** + * GenerativeSettings llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.llmModelSettings = null; + + /** + * Creates a new GenerativeSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IGenerativeSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings} GenerativeSettings instance + */ + GenerativeSettings.create = function create(properties) { + return new GenerativeSettings(properties); + }; + + /** + * Encodes the specified GenerativeSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IGenerativeSettings} message GenerativeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fallbackSettings != null && Object.hasOwnProperty.call(message, "fallbackSettings")) + $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.encode(message.fallbackSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.generativeSafetySettings != null && Object.hasOwnProperty.call(message, "generativeSafetySettings")) + $root.google.cloud.dialogflow.cx.v3.SafetySettings.encode(message.generativeSafetySettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + if (message.knowledgeConnectorSettings != null && Object.hasOwnProperty.call(message, "knowledgeConnectorSettings")) + $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.encode(message.knowledgeConnectorSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerativeSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.IGenerativeSettings} message GenerativeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings} GenerativeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.name = reader.string(); + break; + } + case 1: { + message.fallbackSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.generativeSafetySettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.languageCode = reader.string(); + break; + } + case 8: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings} GenerativeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerativeSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerativeSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fallbackSettings != null && message.hasOwnProperty("fallbackSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.verify(message.fallbackSettings, long + 1); + if (error) + return "fallbackSettings." + error; + } + if (message.generativeSafetySettings != null && message.hasOwnProperty("generativeSafetySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SafetySettings.verify(message.generativeSafetySettings, long + 1); + if (error) + return "generativeSafetySettings." + error; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.verify(message.knowledgeConnectorSettings, long + 1); + if (error) + return "knowledgeConnectorSettings." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + return null; + }; + + /** + * Creates a GenerativeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings} GenerativeSettings + */ + GenerativeSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GenerativeSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.fallbackSettings != null) { + if (typeof object.fallbackSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.GenerativeSettings.fallbackSettings: object expected"); + message.fallbackSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.fromObject(object.fallbackSettings, long + 1); + } + if (object.generativeSafetySettings != null) { + if (typeof object.generativeSafetySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.GenerativeSettings.generativeSafetySettings: object expected"); + message.generativeSafetySettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.fromObject(object.generativeSafetySettings, long + 1); + } + if (object.knowledgeConnectorSettings != null) { + if (typeof object.knowledgeConnectorSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.GenerativeSettings.knowledgeConnectorSettings: object expected"); + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.fromObject(object.knowledgeConnectorSettings, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.GenerativeSettings.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GenerativeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings} message GenerativeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerativeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fallbackSettings = null; + object.generativeSafetySettings = null; + object.languageCode = ""; + object.name = ""; + object.knowledgeConnectorSettings = null; + object.llmModelSettings = null; + } + if (message.fallbackSettings != null && message.hasOwnProperty("fallbackSettings")) + object.fallbackSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.toObject(message.fallbackSettings, options); + if (message.generativeSafetySettings != null && message.hasOwnProperty("generativeSafetySettings")) + object.generativeSafetySettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.toObject(message.generativeSafetySettings, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) + object.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.toObject(message.knowledgeConnectorSettings, options); + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.toObject(message.llmModelSettings, options); + return object; + }; + + /** + * Converts this GenerativeSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @instance + * @returns {Object.} JSON object + */ + GenerativeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerativeSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerativeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GenerativeSettings"; + }; + + GenerativeSettings.FallbackSettings = (function() { + + /** + * Properties of a FallbackSettings. + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @interface IFallbackSettings + * @property {string|null} [selectedPrompt] FallbackSettings selectedPrompt + * @property {Array.|null} [promptTemplates] FallbackSettings promptTemplates + */ + + /** + * Constructs a new FallbackSettings. + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @classdesc Represents a FallbackSettings. + * @implements IFallbackSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings=} [properties] Properties to set + */ + function FallbackSettings(properties) { + this.promptTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FallbackSettings selectedPrompt. + * @member {string} selectedPrompt + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @instance + */ + FallbackSettings.prototype.selectedPrompt = ""; + + /** + * FallbackSettings promptTemplates. + * @member {Array.} promptTemplates + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @instance + */ + FallbackSettings.prototype.promptTemplates = $util.emptyArray; + + /** + * Creates a new FallbackSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings} FallbackSettings instance + */ + FallbackSettings.create = function create(properties) { + return new FallbackSettings(properties); + }; + + /** + * Encodes the specified FallbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings} message FallbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedPrompt != null && Object.hasOwnProperty.call(message, "selectedPrompt")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.selectedPrompt); + if (message.promptTemplates != null && message.promptTemplates.length) + for (var i = 0; i < message.promptTemplates.length; ++i) + $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.encode(message.promptTemplates[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FallbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IFallbackSettings} message FallbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings} FallbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.selectedPrompt = reader.string(); + break; + } + case 4: { + if (!(message.promptTemplates && message.promptTemplates.length)) + message.promptTemplates = []; + message.promptTemplates.push($root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings} FallbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FallbackSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FallbackSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.selectedPrompt != null && message.hasOwnProperty("selectedPrompt")) + if (!$util.isString(message.selectedPrompt)) + return "selectedPrompt: string expected"; + if (message.promptTemplates != null && message.hasOwnProperty("promptTemplates")) { + if (!Array.isArray(message.promptTemplates)) + return "promptTemplates: array expected"; + for (var i = 0; i < message.promptTemplates.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.verify(message.promptTemplates[i], long + 1); + if (error) + return "promptTemplates." + error; + } + } + return null; + }; + + /** + * Creates a FallbackSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings} FallbackSettings + */ + FallbackSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings(); + if (object.selectedPrompt != null) + message.selectedPrompt = String(object.selectedPrompt); + if (object.promptTemplates) { + if (!Array.isArray(object.promptTemplates)) + throw TypeError(".google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.promptTemplates: array expected"); + message.promptTemplates = []; + for (var i = 0; i < object.promptTemplates.length; ++i) { + if (typeof object.promptTemplates[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.promptTemplates: object expected"); + message.promptTemplates[i] = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.fromObject(object.promptTemplates[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FallbackSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings} message FallbackSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FallbackSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.promptTemplates = []; + if (options.defaults) + object.selectedPrompt = ""; + if (message.selectedPrompt != null && message.hasOwnProperty("selectedPrompt")) + object.selectedPrompt = message.selectedPrompt; + if (message.promptTemplates && message.promptTemplates.length) { + object.promptTemplates = []; + for (var j = 0; j < message.promptTemplates.length; ++j) + object.promptTemplates[j] = $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.toObject(message.promptTemplates[j], options); + } + return object; + }; + + /** + * Converts this FallbackSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @instance + * @returns {Object.} JSON object + */ + FallbackSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FallbackSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FallbackSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings"; + }; + + FallbackSettings.PromptTemplate = (function() { + + /** + * Properties of a PromptTemplate. + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @interface IPromptTemplate + * @property {string|null} [displayName] PromptTemplate displayName + * @property {string|null} [promptText] PromptTemplate promptText + * @property {boolean|null} [frozen] PromptTemplate frozen + */ + + /** + * Constructs a new PromptTemplate. + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings + * @classdesc Represents a PromptTemplate. + * @implements IPromptTemplate + * @constructor + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate=} [properties] Properties to set + */ + function PromptTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptTemplate displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + */ + PromptTemplate.prototype.displayName = ""; + + /** + * PromptTemplate promptText. + * @member {string} promptText + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + */ + PromptTemplate.prototype.promptText = ""; + + /** + * PromptTemplate frozen. + * @member {boolean} frozen + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + */ + PromptTemplate.prototype.frozen = false; + + /** + * Creates a new PromptTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate instance + */ + PromptTemplate.create = function create(properties) { + return new PromptTemplate(properties); + }; + + /** + * Encodes the specified PromptTemplate message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate} message PromptTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.promptText != null && Object.hasOwnProperty.call(message, "promptText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.promptText); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified PromptTemplate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.IPromptTemplate} message PromptTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptTemplate.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.promptText = reader.string(); + break; + } + case 3: { + message.frozen = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptTemplate message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptTemplate.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.promptText != null && message.hasOwnProperty("promptText")) + if (!$util.isString(message.promptText)) + return "promptText: string expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a PromptTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate + */ + PromptTemplate.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.promptText != null) + message.promptText = String(object.promptText); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a PromptTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate} message PromptTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.promptText = ""; + object.frozen = false; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.promptText != null && message.hasOwnProperty("promptText")) + object.promptText = message.promptText; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this PromptTemplate to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + * @returns {Object.} JSON object + */ + PromptTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptTemplate + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate"; + }; + + return PromptTemplate; + })(); + + return FallbackSettings; + })(); + + GenerativeSettings.KnowledgeConnectorSettings = (function() { + + /** + * Properties of a KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @interface IKnowledgeConnectorSettings + * @property {string|null} [business] KnowledgeConnectorSettings business + * @property {string|null} [agent] KnowledgeConnectorSettings agent + * @property {string|null} [agentIdentity] KnowledgeConnectorSettings agentIdentity + * @property {string|null} [businessDescription] KnowledgeConnectorSettings businessDescription + * @property {string|null} [agentScope] KnowledgeConnectorSettings agentScope + * @property {boolean|null} [disableDataStoreFallback] KnowledgeConnectorSettings disableDataStoreFallback + */ + + /** + * Constructs a new KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings + * @classdesc Represents a KnowledgeConnectorSettings. + * @implements IKnowledgeConnectorSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings=} [properties] Properties to set + */ + function KnowledgeConnectorSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeConnectorSettings business. + * @member {string} business + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.business = ""; + + /** + * KnowledgeConnectorSettings agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.agent = ""; + + /** + * KnowledgeConnectorSettings agentIdentity. + * @member {string} agentIdentity + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.agentIdentity = ""; + + /** + * KnowledgeConnectorSettings businessDescription. + * @member {string} businessDescription + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.businessDescription = ""; + + /** + * KnowledgeConnectorSettings agentScope. + * @member {string} agentScope + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.agentScope = ""; + + /** + * KnowledgeConnectorSettings disableDataStoreFallback. + * @member {boolean} disableDataStoreFallback + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.disableDataStoreFallback = false; + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings instance + */ + KnowledgeConnectorSettings.create = function create(properties) { + return new KnowledgeConnectorSettings(properties); + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.business != null && Object.hasOwnProperty.call(message, "business")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.business); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agent); + if (message.agentIdentity != null && Object.hasOwnProperty.call(message, "agentIdentity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentIdentity); + if (message.businessDescription != null && Object.hasOwnProperty.call(message, "businessDescription")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.businessDescription); + if (message.agentScope != null && Object.hasOwnProperty.call(message, "agentScope")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.agentScope); + if (message.disableDataStoreFallback != null && Object.hasOwnProperty.call(message, "disableDataStoreFallback")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.disableDataStoreFallback); + return writer; + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.business = reader.string(); + break; + } + case 2: { + message.agent = reader.string(); + break; + } + case 3: { + message.agentIdentity = reader.string(); + break; + } + case 4: { + message.businessDescription = reader.string(); + break; + } + case 5: { + message.agentScope = reader.string(); + break; + } + case 8: { + message.disableDataStoreFallback = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeConnectorSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeConnectorSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.business != null && message.hasOwnProperty("business")) + if (!$util.isString(message.business)) + return "business: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.agentIdentity != null && message.hasOwnProperty("agentIdentity")) + if (!$util.isString(message.agentIdentity)) + return "agentIdentity: string expected"; + if (message.businessDescription != null && message.hasOwnProperty("businessDescription")) + if (!$util.isString(message.businessDescription)) + return "businessDescription: string expected"; + if (message.agentScope != null && message.hasOwnProperty("agentScope")) + if (!$util.isString(message.agentScope)) + return "agentScope: string expected"; + if (message.disableDataStoreFallback != null && message.hasOwnProperty("disableDataStoreFallback")) + if (typeof message.disableDataStoreFallback !== "boolean") + return "disableDataStoreFallback: boolean expected"; + return null; + }; + + /** + * Creates a KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings + */ + KnowledgeConnectorSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings(); + if (object.business != null) + message.business = String(object.business); + if (object.agent != null) + message.agent = String(object.agent); + if (object.agentIdentity != null) + message.agentIdentity = String(object.agentIdentity); + if (object.businessDescription != null) + message.businessDescription = String(object.businessDescription); + if (object.agentScope != null) + message.agentScope = String(object.agentScope); + if (object.disableDataStoreFallback != null) + message.disableDataStoreFallback = Boolean(object.disableDataStoreFallback); + return message; + }; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings} message KnowledgeConnectorSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeConnectorSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.business = ""; + object.agent = ""; + object.agentIdentity = ""; + object.businessDescription = ""; + object.agentScope = ""; + object.disableDataStoreFallback = false; + } + if (message.business != null && message.hasOwnProperty("business")) + object.business = message.business; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + if (message.agentIdentity != null && message.hasOwnProperty("agentIdentity")) + object.agentIdentity = message.agentIdentity; + if (message.businessDescription != null && message.hasOwnProperty("businessDescription")) + object.businessDescription = message.businessDescription; + if (message.agentScope != null && message.hasOwnProperty("agentScope")) + object.agentScope = message.agentScope; + if (message.disableDataStoreFallback != null && message.hasOwnProperty("disableDataStoreFallback")) + object.disableDataStoreFallback = message.disableDataStoreFallback; + return object; + }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @instance + * @returns {Object.} JSON object + */ + KnowledgeConnectorSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KnowledgeConnectorSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings"; + }; + + return KnowledgeConnectorSettings; + })(); + + return GenerativeSettings; + })(); + + v3.LlmModelSettings = (function() { + + /** + * Properties of a LlmModelSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ILlmModelSettings + * @property {string|null} [model] LlmModelSettings model + * @property {string|null} [promptText] LlmModelSettings promptText + */ + + /** + * Constructs a new LlmModelSettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a LlmModelSettings. + * @implements ILlmModelSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ILlmModelSettings=} [properties] Properties to set + */ + function LlmModelSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmModelSettings model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @instance + */ + LlmModelSettings.prototype.model = ""; + + /** + * LlmModelSettings promptText. + * @member {string} promptText + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @instance + */ + LlmModelSettings.prototype.promptText = ""; + + /** + * Creates a new LlmModelSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ILlmModelSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.LlmModelSettings} LlmModelSettings instance + */ + LlmModelSettings.create = function create(properties) { + return new LlmModelSettings(properties); + }; + + /** + * Encodes the specified LlmModelSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LlmModelSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ILlmModelSettings} message LlmModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmModelSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.promptText != null && Object.hasOwnProperty.call(message, "promptText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.promptText); + return writer; + }; + + /** + * Encodes the specified LlmModelSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LlmModelSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ILlmModelSettings} message LlmModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmModelSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.LlmModelSettings} LlmModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmModelSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.LlmModelSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.promptText = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.LlmModelSettings} LlmModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmModelSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmModelSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmModelSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.promptText != null && message.hasOwnProperty("promptText")) + if (!$util.isString(message.promptText)) + return "promptText: string expected"; + return null; + }; + + /** + * Creates a LlmModelSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.LlmModelSettings} LlmModelSettings + */ + LlmModelSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.LlmModelSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.LlmModelSettings(); + if (object.model != null) + message.model = String(object.model); + if (object.promptText != null) + message.promptText = String(object.promptText); + return message; + }; + + /** + * Creates a plain object from a LlmModelSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.LlmModelSettings} message LlmModelSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmModelSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.promptText = ""; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.promptText != null && message.hasOwnProperty("promptText")) + object.promptText = message.promptText; + return object; + }; + + /** + * Converts this LlmModelSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @instance + * @returns {Object.} JSON object + */ + LlmModelSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmModelSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.LlmModelSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmModelSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.LlmModelSettings"; + }; + + return LlmModelSettings; + })(); + + v3.SafetySettings = (function() { + + /** + * Properties of a SafetySettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISafetySettings + * @property {google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy|null} [defaultBannedPhraseMatchStrategy] SafetySettings defaultBannedPhraseMatchStrategy + * @property {Array.|null} [bannedPhrases] SafetySettings bannedPhrases + * @property {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null} [raiSettings] SafetySettings raiSettings + * @property {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null} [defaultRaiSettings] SafetySettings defaultRaiSettings + * @property {google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings|null} [promptSecuritySettings] SafetySettings promptSecuritySettings + */ + + /** + * Constructs a new SafetySettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SafetySettings. + * @implements ISafetySettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISafetySettings=} [properties] Properties to set + */ + function SafetySettings(properties) { + this.bannedPhrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySettings defaultBannedPhraseMatchStrategy. + * @member {google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy} defaultBannedPhraseMatchStrategy + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @instance + */ + SafetySettings.prototype.defaultBannedPhraseMatchStrategy = 0; + + /** + * SafetySettings bannedPhrases. + * @member {Array.} bannedPhrases + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @instance + */ + SafetySettings.prototype.bannedPhrases = $util.emptyArray; + + /** + * SafetySettings raiSettings. + * @member {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null|undefined} raiSettings + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @instance + */ + SafetySettings.prototype.raiSettings = null; + + /** + * SafetySettings defaultRaiSettings. + * @member {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings|null|undefined} defaultRaiSettings + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @instance + */ + SafetySettings.prototype.defaultRaiSettings = null; + + /** + * SafetySettings promptSecuritySettings. + * @member {google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings|null|undefined} promptSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @instance + */ + SafetySettings.prototype.promptSecuritySettings = null; + + /** + * Creates a new SafetySettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISafetySettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings} SafetySettings instance + */ + SafetySettings.create = function create(properties) { + return new SafetySettings(properties); + }; + + /** + * Encodes the specified SafetySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISafetySettings} message SafetySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bannedPhrases != null && message.bannedPhrases.length) + for (var i = 0; i < message.bannedPhrases.length; ++i) + $root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.encode(message.bannedPhrases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.raiSettings != null && Object.hasOwnProperty.call(message, "raiSettings")) + $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.encode(message.raiSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.defaultRaiSettings != null && Object.hasOwnProperty.call(message, "defaultRaiSettings")) + $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.encode(message.defaultRaiSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaultBannedPhraseMatchStrategy != null && Object.hasOwnProperty.call(message, "defaultBannedPhraseMatchStrategy")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.defaultBannedPhraseMatchStrategy); + if (message.promptSecuritySettings != null && Object.hasOwnProperty.call(message, "promptSecuritySettings")) + $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.encode(message.promptSecuritySettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SafetySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISafetySettings} message SafetySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings} SafetySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.defaultBannedPhraseMatchStrategy = reader.int32(); + break; + } + case 1: { + if (!(message.bannedPhrases && message.bannedPhrases.length)) + message.bannedPhrases = []; + message.bannedPhrases.push($root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.raiSettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.defaultRaiSettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.promptSecuritySettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings} SafetySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.defaultBannedPhraseMatchStrategy != null && message.hasOwnProperty("defaultBannedPhraseMatchStrategy")) + switch (message.defaultBannedPhraseMatchStrategy) { + default: + return "defaultBannedPhraseMatchStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.bannedPhrases != null && message.hasOwnProperty("bannedPhrases")) { + if (!Array.isArray(message.bannedPhrases)) + return "bannedPhrases: array expected"; + for (var i = 0; i < message.bannedPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.verify(message.bannedPhrases[i], long + 1); + if (error) + return "bannedPhrases." + error; + } + } + if (message.raiSettings != null && message.hasOwnProperty("raiSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.verify(message.raiSettings, long + 1); + if (error) + return "raiSettings." + error; + } + if (message.defaultRaiSettings != null && message.hasOwnProperty("defaultRaiSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.verify(message.defaultRaiSettings, long + 1); + if (error) + return "defaultRaiSettings." + error; + } + if (message.promptSecuritySettings != null && message.hasOwnProperty("promptSecuritySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.verify(message.promptSecuritySettings, long + 1); + if (error) + return "promptSecuritySettings." + error; + } + return null; + }; + + /** + * Creates a SafetySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings} SafetySettings + */ + SafetySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SafetySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings(); + switch (object.defaultBannedPhraseMatchStrategy) { + default: + if (typeof object.defaultBannedPhraseMatchStrategy === "number") { + message.defaultBannedPhraseMatchStrategy = object.defaultBannedPhraseMatchStrategy; + break; + } + break; + case "PHRASE_MATCH_STRATEGY_UNSPECIFIED": + case 0: + message.defaultBannedPhraseMatchStrategy = 0; + break; + case "PARTIAL_MATCH": + case 1: + message.defaultBannedPhraseMatchStrategy = 1; + break; + case "WORD_MATCH": + case 2: + message.defaultBannedPhraseMatchStrategy = 2; + break; + } + if (object.bannedPhrases) { + if (!Array.isArray(object.bannedPhrases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.SafetySettings.bannedPhrases: array expected"); + message.bannedPhrases = []; + for (var i = 0; i < object.bannedPhrases.length; ++i) { + if (typeof object.bannedPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SafetySettings.bannedPhrases: object expected"); + message.bannedPhrases[i] = $root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.fromObject(object.bannedPhrases[i], long + 1); + } + } + if (object.raiSettings != null) { + if (typeof object.raiSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SafetySettings.raiSettings: object expected"); + message.raiSettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.fromObject(object.raiSettings, long + 1); + } + if (object.defaultRaiSettings != null) { + if (typeof object.defaultRaiSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SafetySettings.defaultRaiSettings: object expected"); + message.defaultRaiSettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.fromObject(object.defaultRaiSettings, long + 1); + } + if (object.promptSecuritySettings != null) { + if (typeof object.promptSecuritySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SafetySettings.promptSecuritySettings: object expected"); + message.promptSecuritySettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.fromObject(object.promptSecuritySettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SafetySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings} message SafetySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bannedPhrases = []; + if (options.defaults) { + object.raiSettings = null; + object.defaultRaiSettings = null; + object.defaultBannedPhraseMatchStrategy = options.enums === String ? "PHRASE_MATCH_STRATEGY_UNSPECIFIED" : 0; + object.promptSecuritySettings = null; + } + if (message.bannedPhrases && message.bannedPhrases.length) { + object.bannedPhrases = []; + for (var j = 0; j < message.bannedPhrases.length; ++j) + object.bannedPhrases[j] = $root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.toObject(message.bannedPhrases[j], options); + } + if (message.raiSettings != null && message.hasOwnProperty("raiSettings")) + object.raiSettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.toObject(message.raiSettings, options); + if (message.defaultRaiSettings != null && message.hasOwnProperty("defaultRaiSettings")) + object.defaultRaiSettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.toObject(message.defaultRaiSettings, options); + if (message.defaultBannedPhraseMatchStrategy != null && message.hasOwnProperty("defaultBannedPhraseMatchStrategy")) + object.defaultBannedPhraseMatchStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy[message.defaultBannedPhraseMatchStrategy] === undefined ? message.defaultBannedPhraseMatchStrategy : $root.google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy[message.defaultBannedPhraseMatchStrategy] : message.defaultBannedPhraseMatchStrategy; + if (message.promptSecuritySettings != null && message.hasOwnProperty("promptSecuritySettings")) + object.promptSecuritySettings = $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.toObject(message.promptSecuritySettings, options); + return object; + }; + + /** + * Converts this SafetySettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @instance + * @returns {Object.} JSON object + */ + SafetySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SafetySettings"; + }; + + SafetySettings.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @interface IPhrase + * @property {string|null} [text] Phrase text + * @property {string|null} [languageCode] Phrase languageCode + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @instance + */ + Phrase.prototype.text = ""; + + /** + * Phrase languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @instance + */ + Phrase.prototype.languageCode = ""; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase(); + if (object.text != null) + message.text = String(object.text); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.languageCode = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SafetySettings.Phrase"; + }; + + return Phrase; + })(); + + /** + * PhraseMatchStrategy enum. + * @name google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy + * @enum {number} + * @property {number} PHRASE_MATCH_STRATEGY_UNSPECIFIED=0 PHRASE_MATCH_STRATEGY_UNSPECIFIED value + * @property {number} PARTIAL_MATCH=1 PARTIAL_MATCH value + * @property {number} WORD_MATCH=2 WORD_MATCH value + */ + SafetySettings.PhraseMatchStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PHRASE_MATCH_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARTIAL_MATCH"] = 1; + values[valuesById[2] = "WORD_MATCH"] = 2; + return values; + })(); + + SafetySettings.RaiSettings = (function() { + + /** + * Properties of a RaiSettings. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @interface IRaiSettings + * @property {Array.|null} [categoryFilters] RaiSettings categoryFilters + */ + + /** + * Constructs a new RaiSettings. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @classdesc Represents a RaiSettings. + * @implements IRaiSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings=} [properties] Properties to set + */ + function RaiSettings(properties) { + this.categoryFilters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RaiSettings categoryFilters. + * @member {Array.} categoryFilters + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @instance + */ + RaiSettings.prototype.categoryFilters = $util.emptyArray; + + /** + * Creates a new RaiSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings} RaiSettings instance + */ + RaiSettings.create = function create(properties) { + return new RaiSettings(properties); + }; + + /** + * Encodes the specified RaiSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings} message RaiSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RaiSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.categoryFilters != null && message.categoryFilters.length) + for (var i = 0; i < message.categoryFilters.length; ++i) + $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.encode(message.categoryFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RaiSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IRaiSettings} message RaiSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RaiSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RaiSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings} RaiSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RaiSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.categoryFilters && message.categoryFilters.length)) + message.categoryFilters = []; + message.categoryFilters.push($root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RaiSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings} RaiSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RaiSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RaiSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RaiSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.categoryFilters != null && message.hasOwnProperty("categoryFilters")) { + if (!Array.isArray(message.categoryFilters)) + return "categoryFilters: array expected"; + for (var i = 0; i < message.categoryFilters.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.verify(message.categoryFilters[i], long + 1); + if (error) + return "categoryFilters." + error; + } + } + return null; + }; + + /** + * Creates a RaiSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings} RaiSettings + */ + RaiSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings(); + if (object.categoryFilters) { + if (!Array.isArray(object.categoryFilters)) + throw TypeError(".google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.categoryFilters: array expected"); + message.categoryFilters = []; + for (var i = 0; i < object.categoryFilters.length; ++i) { + if (typeof object.categoryFilters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.categoryFilters: object expected"); + message.categoryFilters[i] = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.fromObject(object.categoryFilters[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a RaiSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings} message RaiSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RaiSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.categoryFilters = []; + if (message.categoryFilters && message.categoryFilters.length) { + object.categoryFilters = []; + for (var j = 0; j < message.categoryFilters.length; ++j) + object.categoryFilters[j] = $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.toObject(message.categoryFilters[j], options); + } + return object; + }; + + /** + * Converts this RaiSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @instance + * @returns {Object.} JSON object + */ + RaiSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RaiSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RaiSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings"; + }; + + /** + * SafetyFilterLevel enum. + * @name google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel + * @enum {number} + * @property {number} SAFETY_FILTER_LEVEL_UNSPECIFIED=0 SAFETY_FILTER_LEVEL_UNSPECIFIED value + * @property {number} BLOCK_NONE=1 BLOCK_NONE value + * @property {number} BLOCK_FEW=2 BLOCK_FEW value + * @property {number} BLOCK_SOME=3 BLOCK_SOME value + * @property {number} BLOCK_MOST=4 BLOCK_MOST value + */ + RaiSettings.SafetyFilterLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAFETY_FILTER_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK_NONE"] = 1; + values[valuesById[2] = "BLOCK_FEW"] = 2; + values[valuesById[3] = "BLOCK_SOME"] = 3; + values[valuesById[4] = "BLOCK_MOST"] = 4; + return values; + })(); + + /** + * SafetyCategory enum. + * @name google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory + * @enum {number} + * @property {number} SAFETY_CATEGORY_UNSPECIFIED=0 SAFETY_CATEGORY_UNSPECIFIED value + * @property {number} DANGEROUS_CONTENT=1 DANGEROUS_CONTENT value + * @property {number} HATE_SPEECH=2 HATE_SPEECH value + * @property {number} HARASSMENT=3 HARASSMENT value + * @property {number} SEXUALLY_EXPLICIT_CONTENT=4 SEXUALLY_EXPLICIT_CONTENT value + */ + RaiSettings.SafetyCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAFETY_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DANGEROUS_CONTENT"] = 1; + values[valuesById[2] = "HATE_SPEECH"] = 2; + values[valuesById[3] = "HARASSMENT"] = 3; + values[valuesById[4] = "SEXUALLY_EXPLICIT_CONTENT"] = 4; + return values; + })(); + + RaiSettings.CategoryFilter = (function() { + + /** + * Properties of a CategoryFilter. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @interface ICategoryFilter + * @property {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory|null} [category] CategoryFilter category + * @property {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel|null} [filterLevel] CategoryFilter filterLevel + */ + + /** + * Constructs a new CategoryFilter. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings + * @classdesc Represents a CategoryFilter. + * @implements ICategoryFilter + * @constructor + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter=} [properties] Properties to set + */ + function CategoryFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoryFilter category. + * @member {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory} category + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @instance + */ + CategoryFilter.prototype.category = 0; + + /** + * CategoryFilter filterLevel. + * @member {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel} filterLevel + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @instance + */ + CategoryFilter.prototype.filterLevel = 0; + + /** + * Creates a new CategoryFilter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter instance + */ + CategoryFilter.create = function create(properties) { + return new CategoryFilter(properties); + }; + + /** + * Encodes the specified CategoryFilter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter} message CategoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.filterLevel != null && Object.hasOwnProperty.call(message, "filterLevel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.filterLevel); + return writer; + }; + + /** + * Encodes the specified CategoryFilter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.ICategoryFilter} message CategoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryFilter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.category = reader.int32(); + break; + } + case 2: { + message.filterLevel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoryFilter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoryFilter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.filterLevel != null && message.hasOwnProperty("filterLevel")) + switch (message.filterLevel) { + default: + return "filterLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a CategoryFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter + */ + CategoryFilter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "SAFETY_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "DANGEROUS_CONTENT": + case 1: + message.category = 1; + break; + case "HATE_SPEECH": + case 2: + message.category = 2; + break; + case "HARASSMENT": + case 3: + message.category = 3; + break; + case "SEXUALLY_EXPLICIT_CONTENT": + case 4: + message.category = 4; + break; + } + switch (object.filterLevel) { + default: + if (typeof object.filterLevel === "number") { + message.filterLevel = object.filterLevel; + break; + } + break; + case "SAFETY_FILTER_LEVEL_UNSPECIFIED": + case 0: + message.filterLevel = 0; + break; + case "BLOCK_NONE": + case 1: + message.filterLevel = 1; + break; + case "BLOCK_FEW": + case 2: + message.filterLevel = 2; + break; + case "BLOCK_SOME": + case 3: + message.filterLevel = 3; + break; + case "BLOCK_MOST": + case 4: + message.filterLevel = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a CategoryFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter} message CategoryFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoryFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "SAFETY_CATEGORY_UNSPECIFIED" : 0; + object.filterLevel = options.enums === String ? "SAFETY_FILTER_LEVEL_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory[message.category] === undefined ? message.category : $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory[message.category] : message.category; + if (message.filterLevel != null && message.hasOwnProperty("filterLevel")) + object.filterLevel = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel[message.filterLevel] === undefined ? message.filterLevel : $root.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel[message.filterLevel] : message.filterLevel; + return object; + }; + + /** + * Converts this CategoryFilter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @instance + * @returns {Object.} JSON object + */ + CategoryFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoryFilter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoryFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter"; + }; + + return CategoryFilter; + })(); + + return RaiSettings; + })(); + + SafetySettings.PromptSecuritySettings = (function() { + + /** + * Properties of a PromptSecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @interface IPromptSecuritySettings + * @property {boolean|null} [enablePromptSecurity] PromptSecuritySettings enablePromptSecurity + */ + + /** + * Constructs a new PromptSecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings + * @classdesc Represents a PromptSecuritySettings. + * @implements IPromptSecuritySettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings=} [properties] Properties to set + */ + function PromptSecuritySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptSecuritySettings enablePromptSecurity. + * @member {boolean} enablePromptSecurity + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @instance + */ + PromptSecuritySettings.prototype.enablePromptSecurity = false; + + /** + * Creates a new PromptSecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings} PromptSecuritySettings instance + */ + PromptSecuritySettings.create = function create(properties) { + return new PromptSecuritySettings(properties); + }; + + /** + * Encodes the specified PromptSecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings} message PromptSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptSecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePromptSecurity != null && Object.hasOwnProperty.call(message, "enablePromptSecurity")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePromptSecurity); + return writer; + }; + + /** + * Encodes the specified PromptSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.IPromptSecuritySettings} message PromptSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptSecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings} PromptSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptSecuritySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enablePromptSecurity = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings} PromptSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptSecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptSecuritySettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptSecuritySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enablePromptSecurity != null && message.hasOwnProperty("enablePromptSecurity")) + if (typeof message.enablePromptSecurity !== "boolean") + return "enablePromptSecurity: boolean expected"; + return null; + }; + + /** + * Creates a PromptSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings} PromptSecuritySettings + */ + PromptSecuritySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings(); + if (object.enablePromptSecurity != null) + message.enablePromptSecurity = Boolean(object.enablePromptSecurity); + return message; + }; + + /** + * Creates a plain object from a PromptSecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings} message PromptSecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptSecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enablePromptSecurity = false; + if (message.enablePromptSecurity != null && message.hasOwnProperty("enablePromptSecurity")) + object.enablePromptSecurity = message.enablePromptSecurity; + return object; + }; + + /** + * Converts this PromptSecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @instance + * @returns {Object.} JSON object + */ + PromptSecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptSecuritySettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptSecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings"; + }; + + return PromptSecuritySettings; + })(); + + return SafetySettings; + })(); + + v3.Changelogs = (function() { + + /** + * Constructs a new Changelogs service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Changelogs + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Changelogs(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Changelogs.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Changelogs; + + /** + * Creates new Changelogs service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Changelogs + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Changelogs} RPC service. Useful where requests and/or responses are streamed. + */ + Changelogs.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Changelogs|listChangelogs}. + * @memberof google.cloud.dialogflow.cx.v3.Changelogs + * @typedef ListChangelogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListChangelogsResponse} [response] ListChangelogsResponse + */ + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.dialogflow.cx.v3.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogsCallback} callback Node-style callback called with the error, if any, and ListChangelogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Changelogs.prototype.listChangelogs = function listChangelogs(request, callback) { + return this.rpcCall(listChangelogs, $root.google.cloud.dialogflow.cx.v3.ListChangelogsRequest, $root.google.cloud.dialogflow.cx.v3.ListChangelogsResponse, request, callback); + }, "name", { value: "ListChangelogs" }); + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.dialogflow.cx.v3.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Changelogs|getChangelog}. + * @memberof google.cloud.dialogflow.cx.v3.Changelogs + * @typedef GetChangelogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Changelog} [response] Changelog + */ + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.dialogflow.cx.v3.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Changelogs.GetChangelogCallback} callback Node-style callback called with the error, if any, and Changelog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Changelogs.prototype.getChangelog = function getChangelog(request, callback) { + return this.rpcCall(getChangelog, $root.google.cloud.dialogflow.cx.v3.GetChangelogRequest, $root.google.cloud.dialogflow.cx.v3.Changelog, request, callback); + }, "name", { value: "GetChangelog" }); + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.dialogflow.cx.v3.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Changelogs; + })(); + + v3.ListChangelogsRequest = (function() { + + /** + * Properties of a ListChangelogsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListChangelogsRequest + * @property {string|null} [parent] ListChangelogsRequest parent + * @property {string|null} [filter] ListChangelogsRequest filter + * @property {number|null} [pageSize] ListChangelogsRequest pageSize + * @property {string|null} [pageToken] ListChangelogsRequest pageToken + */ + + /** + * Constructs a new ListChangelogsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListChangelogsRequest. + * @implements IListChangelogsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsRequest=} [properties] Properties to set + */ + function ListChangelogsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.parent = ""; + + /** + * ListChangelogsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.filter = ""; + + /** + * ListChangelogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageSize = 0; + + /** + * ListChangelogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsRequest} ListChangelogsRequest instance + */ + ListChangelogsRequest.create = function create(properties) { + return new ListChangelogsRequest(properties); + }; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.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"; + return null; + }; + + /** + * Creates a ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsRequest} ListChangelogsRequest + */ + ListChangelogsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListChangelogsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListChangelogsRequest} message ListChangelogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListChangelogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListChangelogsRequest"; + }; + + return ListChangelogsRequest; + })(); + + v3.ListChangelogsResponse = (function() { + + /** + * Properties of a ListChangelogsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListChangelogsResponse + * @property {Array.|null} [changelogs] ListChangelogsResponse changelogs + * @property {string|null} [nextPageToken] ListChangelogsResponse nextPageToken + */ + + /** + * Constructs a new ListChangelogsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListChangelogsResponse. + * @implements IListChangelogsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsResponse=} [properties] Properties to set + */ + function ListChangelogsResponse(properties) { + this.changelogs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsResponse changelogs. + * @member {Array.} changelogs + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.changelogs = $util.emptyArray; + + /** + * ListChangelogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsResponse} ListChangelogsResponse instance + */ + ListChangelogsResponse.create = function create(properties) { + return new ListChangelogsResponse(properties); + }; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.changelogs != null && message.changelogs.length) + for (var i = 0; i < message.changelogs.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Changelog.encode(message.changelogs[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 ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListChangelogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListChangelogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.changelogs && message.changelogs.length)) + message.changelogs = []; + message.changelogs.push($root.google.cloud.dialogflow.cx.v3.Changelog.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.changelogs != null && message.hasOwnProperty("changelogs")) { + if (!Array.isArray(message.changelogs)) + return "changelogs: array expected"; + for (var i = 0; i < message.changelogs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Changelog.verify(message.changelogs[i], long + 1); + if (error) + return "changelogs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListChangelogsResponse} ListChangelogsResponse + */ + ListChangelogsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListChangelogsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListChangelogsResponse(); + if (object.changelogs) { + if (!Array.isArray(object.changelogs)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListChangelogsResponse.changelogs: array expected"); + message.changelogs = []; + for (var i = 0; i < object.changelogs.length; ++i) { + if (typeof object.changelogs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListChangelogsResponse.changelogs: object expected"); + message.changelogs[i] = $root.google.cloud.dialogflow.cx.v3.Changelog.fromObject(object.changelogs[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListChangelogsResponse} message ListChangelogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.changelogs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.changelogs && message.changelogs.length) { + object.changelogs = []; + for (var j = 0; j < message.changelogs.length; ++j) + object.changelogs[j] = $root.google.cloud.dialogflow.cx.v3.Changelog.toObject(message.changelogs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListChangelogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListChangelogsResponse"; + }; + + return ListChangelogsResponse; + })(); + + v3.GetChangelogRequest = (function() { + + /** + * Properties of a GetChangelogRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetChangelogRequest + * @property {string|null} [name] GetChangelogRequest name + */ + + /** + * Constructs a new GetChangelogRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetChangelogRequest. + * @implements IGetChangelogRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetChangelogRequest=} [properties] Properties to set + */ + function GetChangelogRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChangelogRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @instance + */ + GetChangelogRequest.prototype.name = ""; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetChangelogRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetChangelogRequest} GetChangelogRequest instance + */ + GetChangelogRequest.create = function create(properties) { + return new GetChangelogRequest(properties); + }; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetChangelogRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.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 GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetChangelogRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetChangelogRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChangelogRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChangelogRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetChangelogRequest} GetChangelogRequest + */ + GetChangelogRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetChangelogRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetChangelogRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetChangelogRequest} message GetChangelogRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChangelogRequest.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 GetChangelogRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @instance + * @returns {Object.} JSON object + */ + GetChangelogRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChangelogRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetChangelogRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChangelogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetChangelogRequest"; + }; + + return GetChangelogRequest; + })(); + + v3.Changelog = (function() { + + /** + * Properties of a Changelog. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IChangelog + * @property {string|null} [name] Changelog name + * @property {string|null} [userEmail] Changelog userEmail + * @property {string|null} [displayName] Changelog displayName + * @property {string|null} [action] Changelog action + * @property {string|null} [type] Changelog type + * @property {string|null} [resource] Changelog resource + * @property {google.protobuf.ITimestamp|null} [createTime] Changelog createTime + * @property {string|null} [languageCode] Changelog languageCode + */ + + /** + * Constructs a new Changelog. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Changelog. + * @implements IChangelog + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IChangelog=} [properties] Properties to set + */ + function Changelog(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Changelog name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.name = ""; + + /** + * Changelog userEmail. + * @member {string} userEmail + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.userEmail = ""; + + /** + * Changelog displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.displayName = ""; + + /** + * Changelog action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.action = ""; + + /** + * Changelog type. + * @member {string} type + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.type = ""; + + /** + * Changelog resource. + * @member {string} resource + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.resource = ""; + + /** + * Changelog createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.createTime = null; + + /** + * Changelog languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + */ + Changelog.prototype.languageCode = ""; + + /** + * Creates a new Changelog instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3.IChangelog=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Changelog} Changelog instance + */ + Changelog.create = function create(properties) { + return new Changelog(properties); + }; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Changelog.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.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.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userEmail); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.type); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.action); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Changelog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Changelog(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userEmail = reader.string(); + break; + } + case 7: { + message.displayName = reader.string(); + break; + } + case 11: { + message.action = reader.string(); + break; + } + case 8: { + message.type = reader.string(); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Changelog message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Changelog.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + if (!$util.isString(message.userEmail)) + return "userEmail: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Changelog} Changelog + */ + Changelog.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Changelog) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Changelog(); + if (object.name != null) + message.name = String(object.name); + if (object.userEmail != null) + message.userEmail = String(object.userEmail); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.action != null) + message.action = String(object.action); + if (object.type != null) + message.type = String(object.type); + if (object.resource != null) + message.resource = String(object.resource); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Changelog.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3.Changelog} message Changelog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Changelog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.userEmail = ""; + object.resource = ""; + object.createTime = null; + object.displayName = ""; + object.type = ""; + object.action = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + object.userEmail = message.userEmail; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Changelog to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @instance + * @returns {Object.} JSON object + */ + Changelog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Changelog + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Changelog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Changelog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Changelog"; + }; + + return Changelog; + })(); + + v3.CodeBlock = (function() { + + /** + * Properties of a CodeBlock. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICodeBlock + * @property {string|null} [code] CodeBlock code + */ + + /** + * Constructs a new CodeBlock. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CodeBlock. + * @implements ICodeBlock + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICodeBlock=} [properties] Properties to set + */ + function CodeBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeBlock code. + * @member {string} code + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @instance + */ + CodeBlock.prototype.code = ""; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.ICodeBlock=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CodeBlock} CodeBlock instance + */ + CodeBlock.create = function create(properties) { + return new CodeBlock(properties); + }; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CodeBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); + return writer; + }; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CodeBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CodeBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeBlock message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeBlock.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; + return null; + }; + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CodeBlock} CodeBlock + */ + CodeBlock.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CodeBlock) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CodeBlock(); + if (object.code != null) + message.code = String(object.code); + return message; + }; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.CodeBlock} message CodeBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.code = ""; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + return object; + }; + + /** + * Converts this CodeBlock to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @instance + * @returns {Object.} JSON object + */ + CodeBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeBlock + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CodeBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CodeBlock"; + }; + + return CodeBlock; + })(); + + v3.Deployments = (function() { + + /** + * Constructs a new Deployments service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Deployments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Deployments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Deployments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Deployments; + + /** + * Creates new Deployments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Deployments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Deployments} RPC service. Useful where requests and/or responses are streamed. + */ + Deployments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Deployments|listDeployments}. + * @memberof google.cloud.dialogflow.cx.v3.Deployments + * @typedef ListDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListDeploymentsResponse} [response] ListDeploymentsResponse + */ + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.dialogflow.cx.v3.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Deployments.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Deployments.prototype.listDeployments = function listDeployments(request, callback) { + return this.rpcCall(listDeployments, $root.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest, $root.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse, request, callback); + }, "name", { value: "ListDeployments" }); + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.dialogflow.cx.v3.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Deployments|getDeployment}. + * @memberof google.cloud.dialogflow.cx.v3.Deployments + * @typedef GetDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Deployment} [response] Deployment + */ + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.dialogflow.cx.v3.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Deployments.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Deployments.prototype.getDeployment = function getDeployment(request, callback) { + return this.rpcCall(getDeployment, $root.google.cloud.dialogflow.cx.v3.GetDeploymentRequest, $root.google.cloud.dialogflow.cx.v3.Deployment, request, callback); + }, "name", { value: "GetDeployment" }); + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.dialogflow.cx.v3.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Deployments; + })(); + + v3.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {string|null} [flowVersion] Deployment flowVersion + * @property {google.cloud.dialogflow.cx.v3.Deployment.State|null} [state] Deployment state + * @property {google.cloud.dialogflow.cx.v3.Deployment.IResult|null} [result] Deployment result + * @property {google.protobuf.ITimestamp|null} [startTime] Deployment startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Deployment endTime + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment flowVersion. + * @member {string} flowVersion + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @instance + */ + Deployment.prototype.flowVersion = ""; + + /** + * Deployment state. + * @member {google.cloud.dialogflow.cx.v3.Deployment.State} state + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @instance + */ + Deployment.prototype.state = 0; + + /** + * Deployment result. + * @member {google.cloud.dialogflow.cx.v3.Deployment.IResult|null|undefined} result + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @instance + */ + Deployment.prototype.result = null; + + /** + * Deployment startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @instance + */ + Deployment.prototype.startTime = null; + + /** + * Deployment endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @instance + */ + Deployment.prototype.endTime = null; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.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.flowVersion != null && Object.hasOwnProperty.call(message, "flowVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowVersion); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.dialogflow.cx.v3.Deployment.Result.encode(message.result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Deployment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flowVersion = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.result = $root.google.cloud.dialogflow.cx.v3.Deployment.Result.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + if (!$util.isString(message.flowVersion)) + return "flowVersion: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.dialogflow.cx.v3.Deployment.Result.verify(message.result, long + 1); + if (error) + return "result." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Deployment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Deployment(); + if (object.name != null) + message.name = String(object.name); + if (object.flowVersion != null) + message.flowVersion = String(object.flowVersion); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Deployment.result: object expected"); + message.result = $root.google.cloud.dialogflow.cx.v3.Deployment.Result.fromObject(object.result, long + 1); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Deployment.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Deployment.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.flowVersion = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.result = null; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + object.flowVersion = message.flowVersion; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Deployment.State[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3.Deployment.State[message.state] : message.state; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.dialogflow.cx.v3.Deployment.Result.toObject(message.result, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Deployment"; + }; + + /** + * State enum. + * @name google.cloud.dialogflow.cx.v3.Deployment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + Deployment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + Deployment.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @interface IResult + * @property {Array.|null} [deploymentTestResults] Result deploymentTestResults + * @property {string|null} [experiment] Result experiment + */ + + /** + * Constructs a new Result. + * @memberof google.cloud.dialogflow.cx.v3.Deployment + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Deployment.IResult=} [properties] Properties to set + */ + function Result(properties) { + this.deploymentTestResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Result deploymentTestResults. + * @member {Array.} deploymentTestResults + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @instance + */ + Result.prototype.deploymentTestResults = $util.emptyArray; + + /** + * Result experiment. + * @member {string} experiment + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @instance + */ + Result.prototype.experiment = ""; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Deployment.IResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Deployment.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.Result.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Deployment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deploymentTestResults != null && message.deploymentTestResults.length) + for (var i = 0; i < message.deploymentTestResults.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deploymentTestResults[i]); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.experiment); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Deployment.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Deployment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Deployment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Deployment.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deploymentTestResults && message.deploymentTestResults.length)) + message.deploymentTestResults = []; + message.deploymentTestResults.push(reader.string()); + break; + } + case 2: { + message.experiment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Deployment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deploymentTestResults != null && message.hasOwnProperty("deploymentTestResults")) { + if (!Array.isArray(message.deploymentTestResults)) + return "deploymentTestResults: array expected"; + for (var i = 0; i < message.deploymentTestResults.length; ++i) + if (!$util.isString(message.deploymentTestResults[i])) + return "deploymentTestResults: string[] expected"; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + if (!$util.isString(message.experiment)) + return "experiment: string expected"; + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Deployment.Result} Result + */ + Result.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Deployment.Result) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Deployment.Result(); + if (object.deploymentTestResults) { + if (!Array.isArray(object.deploymentTestResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Deployment.Result.deploymentTestResults: array expected"); + message.deploymentTestResults = []; + for (var i = 0; i < object.deploymentTestResults.length; ++i) + message.deploymentTestResults[i] = String(object.deploymentTestResults[i]); + } + if (object.experiment != null) + message.experiment = String(object.experiment); + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Deployment.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deploymentTestResults = []; + if (options.defaults) + object.experiment = ""; + if (message.deploymentTestResults && message.deploymentTestResults.length) { + object.deploymentTestResults = []; + for (var j = 0; j < message.deploymentTestResults.length; ++j) + object.deploymentTestResults[j] = message.deploymentTestResults[j]; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = message.experiment; + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Result + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Deployment.Result + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Result.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Deployment.Result"; + }; + + return Result; + })(); + + return Deployment; + })(); + + v3.ListDeploymentsRequest = (function() { + + /** + * Properties of a ListDeploymentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListDeploymentsRequest + * @property {string|null} [parent] ListDeploymentsRequest parent + * @property {number|null} [pageSize] ListDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListDeploymentsRequest pageToken + */ + + /** + * Constructs a new ListDeploymentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListDeploymentsRequest. + * @implements IListDeploymentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsRequest=} [properties] Properties to set + */ + function ListDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.parent = ""; + + /** + * ListDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsRequest} ListDeploymentsRequest instance + */ + ListDeploymentsRequest.create = function create(properties) { + return new ListDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsRequest} ListDeploymentsRequest + */ + ListDeploymentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListDeploymentsRequest} message ListDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListDeploymentsRequest"; + }; + + return ListDeploymentsRequest; + })(); + + v3.ListDeploymentsResponse = (function() { + + /** + * Properties of a ListDeploymentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListDeploymentsResponse + * @property {Array.|null} [deployments] ListDeploymentsResponse deployments + * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListDeploymentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListDeploymentsResponse. + * @implements IListDeploymentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsResponse=} [properties] Properties to set + */ + function ListDeploymentsResponse(properties) { + this.deployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsResponse deployments. + * @member {Array.} deployments + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.deployments = $util.emptyArray; + + /** + * ListDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsResponse} ListDeploymentsResponse instance + */ + ListDeploymentsResponse.create = function create(properties) { + return new ListDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push($root.google.cloud.dialogflow.cx.v3.Deployment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Deployment.verify(message.deployments[i], long + 1); + if (error) + return "deployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListDeploymentsResponse} ListDeploymentsResponse + */ + ListDeploymentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse(); + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListDeploymentsResponse.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) { + if (typeof object.deployments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListDeploymentsResponse.deployments: object expected"); + message.deployments[i] = $root.google.cloud.dialogflow.cx.v3.Deployment.fromObject(object.deployments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListDeploymentsResponse} message ListDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = $root.google.cloud.dialogflow.cx.v3.Deployment.toObject(message.deployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListDeploymentsResponse"; + }; + + return ListDeploymentsResponse; + })(); + + v3.GetDeploymentRequest = (function() { + + /** + * Properties of a GetDeploymentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetDeploymentRequest + * @property {string|null} [name] GetDeploymentRequest name + */ + + /** + * Constructs a new GetDeploymentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetDeploymentRequest. + * @implements IGetDeploymentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetDeploymentRequest=} [properties] Properties to set + */ + function GetDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @instance + */ + GetDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetDeploymentRequest} GetDeploymentRequest instance + */ + GetDeploymentRequest.create = function create(properties) { + return new GetDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeploymentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeploymentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetDeploymentRequest} GetDeploymentRequest + */ + GetDeploymentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetDeploymentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetDeploymentRequest} message GetDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeploymentRequest.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 GetDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetDeploymentRequest"; + }; + + return GetDeploymentRequest; + })(); + + v3.EntityTypes = (function() { + + /** + * Constructs a new EntityTypes service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an EntityTypes + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function EntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EntityTypes; + + /** + * Creates new EntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {EntityTypes} RPC service. Useful where requests and/or responses are streamed. + */ + EntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|getEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @typedef GetEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.EntityType} [response] EntityType + */ + + /** + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.getEntityType = function getEntityType(request, callback) { + return this.rpcCall(getEntityType, $root.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3.EntityType, request, callback); + }, "name", { value: "GetEntityType" }); + + /** + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|createEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @typedef CreateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.EntityType} [response] EntityType + */ + + /** + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.createEntityType = function createEntityType(request, callback) { + return this.rpcCall(createEntityType, $root.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3.EntityType, request, callback); + }, "name", { value: "CreateEntityType" }); + + /** + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|updateEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @typedef UpdateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.EntityType} [response] EntityType + */ + + /** + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.updateEntityType = function updateEntityType(request, callback) { + return this.rpcCall(updateEntityType, $root.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3.EntityType, request, callback); + }, "name", { value: "UpdateEntityType" }); + + /** + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|deleteEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @typedef DeleteEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.deleteEntityType = function deleteEntityType(request, callback) { + return this.rpcCall(deleteEntityType, $root.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEntityType" }); + + /** + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|listEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @typedef ListEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListEntityTypesResponse} [response] ListEntityTypesResponse + */ + + /** + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypesCallback} callback Node-style callback called with the error, if any, and ListEntityTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.listEntityTypes = function listEntityTypes(request, callback) { + return this.rpcCall(listEntityTypes, $root.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest, $root.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse, request, callback); + }, "name", { value: "ListEntityTypes" }); + + /** + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|exportEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @typedef ExportEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportEntityTypes. + * @function exportEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest} request ExportEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.exportEntityTypes = function exportEntityTypes(request, callback) { + return this.rpcCall(exportEntityTypes, $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportEntityTypes" }); + + /** + * Calls ExportEntityTypes. + * @function exportEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest} request ExportEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.EntityTypes|importEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @typedef ImportEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportEntityTypes. + * @function importEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest} request ImportEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.importEntityTypes = function importEntityTypes(request, callback) { + return this.rpcCall(importEntityTypes, $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportEntityTypes" }); + + /** + * Calls ImportEntityTypes. + * @function importEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest} request ImportEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EntityTypes; + })(); + + v3.EntityType = (function() { + + /** + * Properties of an EntityType. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IEntityType + * @property {string|null} [name] EntityType name + * @property {string|null} [displayName] EntityType displayName + * @property {google.cloud.dialogflow.cx.v3.EntityType.Kind|null} [kind] EntityType kind + * @property {google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode|null} [autoExpansionMode] EntityType autoExpansionMode + * @property {Array.|null} [entities] EntityType entities + * @property {Array.|null} [excludedPhrases] EntityType excludedPhrases + * @property {boolean|null} [enableFuzzyExtraction] EntityType enableFuzzyExtraction + * @property {boolean|null} [redact] EntityType redact + */ + + /** + * Constructs a new EntityType. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an EntityType. + * @implements IEntityType + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IEntityType=} [properties] Properties to set + */ + function EntityType(properties) { + this.entities = []; + this.excludedPhrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.name = ""; + + /** + * EntityType displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.displayName = ""; + + /** + * EntityType kind. + * @member {google.cloud.dialogflow.cx.v3.EntityType.Kind} kind + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.kind = 0; + + /** + * EntityType autoExpansionMode. + * @member {google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode} autoExpansionMode + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.autoExpansionMode = 0; + + /** + * EntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.entities = $util.emptyArray; + + /** + * EntityType excludedPhrases. + * @member {Array.} excludedPhrases + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.excludedPhrases = $util.emptyArray; + + /** + * EntityType enableFuzzyExtraction. + * @member {boolean} enableFuzzyExtraction + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.enableFuzzyExtraction = false; + + /** + * EntityType redact. + * @member {boolean} redact + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + */ + EntityType.prototype.redact = false; + + /** + * Creates a new EntityType instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.IEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.EntityType} EntityType instance + */ + EntityType.create = function create(properties) { + return new EntityType(properties); + }; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); + if (message.autoExpansionMode != null && Object.hasOwnProperty.call(message, "autoExpansionMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoExpansionMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.excludedPhrases != null && message.excludedPhrases.length) + for (var i = 0; i < message.excludedPhrases.length; ++i) + $root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.encode(message.excludedPhrases[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.enableFuzzyExtraction != null && Object.hasOwnProperty.call(message, "enableFuzzyExtraction")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFuzzyExtraction); + if (message.redact != null && Object.hasOwnProperty.call(message, "redact")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.redact); + return writer; + }; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.EntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.kind = reader.int32(); + break; + } + case 4: { + message.autoExpansionMode = reader.int32(); + break; + } + case 5: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.cx.v3.EntityType.Entity.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.excludedPhrases && message.excludedPhrases.length)) + message.excludedPhrases = []; + message.excludedPhrases.push($root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.enableFuzzyExtraction = reader.bool(); + break; + } + case 9: { + message.redact = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityType message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + switch (message.autoExpansionMode) { + default: + return "autoExpansionMode: enum value expected"; + case 0: + case 1: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.verify(message.entities[i], long + 1); + if (error) + return "entities." + error; + } + } + if (message.excludedPhrases != null && message.hasOwnProperty("excludedPhrases")) { + if (!Array.isArray(message.excludedPhrases)) + return "excludedPhrases: array expected"; + for (var i = 0; i < message.excludedPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.verify(message.excludedPhrases[i], long + 1); + if (error) + return "excludedPhrases." + error; + } + } + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + if (typeof message.enableFuzzyExtraction !== "boolean") + return "enableFuzzyExtraction: boolean expected"; + if (message.redact != null && message.hasOwnProperty("redact")) + if (typeof message.redact !== "boolean") + return "redact: boolean expected"; + return null; + }; + + /** + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.EntityType} EntityType + */ + EntityType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.EntityType) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.EntityType(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "KIND_MAP": + case 1: + message.kind = 1; + break; + case "KIND_LIST": + case 2: + message.kind = 2; + break; + case "KIND_REGEXP": + case 3: + message.kind = 3; + break; + } + switch (object.autoExpansionMode) { + default: + if (typeof object.autoExpansionMode === "number") { + message.autoExpansionMode = object.autoExpansionMode; + break; + } + break; + case "AUTO_EXPANSION_MODE_UNSPECIFIED": + case 0: + message.autoExpansionMode = 0; + break; + case "AUTO_EXPANSION_MODE_DEFAULT": + case 1: + message.autoExpansionMode = 1; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.cx.v3.EntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.EntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.fromObject(object.entities[i], long + 1); + } + } + if (object.excludedPhrases) { + if (!Array.isArray(object.excludedPhrases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.EntityType.excludedPhrases: array expected"); + message.excludedPhrases = []; + for (var i = 0; i < object.excludedPhrases.length; ++i) { + if (typeof object.excludedPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.EntityType.excludedPhrases: object expected"); + message.excludedPhrases[i] = $root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.fromObject(object.excludedPhrases[i], long + 1); + } + } + if (object.enableFuzzyExtraction != null) + message.enableFuzzyExtraction = Boolean(object.enableFuzzyExtraction); + if (object.redact != null) + message.redact = Boolean(object.redact); + return message; + }; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType} message EntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.entities = []; + object.excludedPhrases = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.autoExpansionMode = options.enums === String ? "AUTO_EXPANSION_MODE_UNSPECIFIED" : 0; + object.enableFuzzyExtraction = false; + object.redact = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.EntityType.Kind[message.kind] === undefined ? message.kind : $root.google.cloud.dialogflow.cx.v3.EntityType.Kind[message.kind] : message.kind; + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + object.autoExpansionMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode[message.autoExpansionMode] === undefined ? message.autoExpansionMode : $root.google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode[message.autoExpansionMode] : message.autoExpansionMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.excludedPhrases && message.excludedPhrases.length) { + object.excludedPhrases = []; + for (var j = 0; j < message.excludedPhrases.length; ++j) + object.excludedPhrases[j] = $root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.toObject(message.excludedPhrases[j], options); + } + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + object.enableFuzzyExtraction = message.enableFuzzyExtraction; + if (message.redact != null && message.hasOwnProperty("redact")) + object.redact = message.redact; + return object; + }; + + /** + * Converts this EntityType to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @instance + * @returns {Object.} JSON object + */ + EntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityType + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.EntityType"; + }; + + /** + * Kind enum. + * @name google.cloud.dialogflow.cx.v3.EntityType.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} KIND_MAP=1 KIND_MAP value + * @property {number} KIND_LIST=2 KIND_LIST value + * @property {number} KIND_REGEXP=3 KIND_REGEXP value + */ + EntityType.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "KIND_MAP"] = 1; + values[valuesById[2] = "KIND_LIST"] = 2; + values[valuesById[3] = "KIND_REGEXP"] = 3; + return values; + })(); + + /** + * AutoExpansionMode enum. + * @name google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode + * @enum {number} + * @property {number} AUTO_EXPANSION_MODE_UNSPECIFIED=0 AUTO_EXPANSION_MODE_UNSPECIFIED value + * @property {number} AUTO_EXPANSION_MODE_DEFAULT=1 AUTO_EXPANSION_MODE_DEFAULT value + */ + EntityType.AutoExpansionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTO_EXPANSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO_EXPANSION_MODE_DEFAULT"] = 1; + return values; + })(); + + EntityType.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @interface IEntity + * @property {string|null} [value] Entity value + * @property {Array.|null} [synonyms] Entity synonyms + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.dialogflow.cx.v3.EntityType.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + this.synonyms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity value. + * @member {string} value + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @instance + */ + Entity.prototype.value = ""; + + /** + * Entity synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @instance + */ + Entity.prototype.synonyms = $util.emptyArray; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.IEntity=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.EntityType.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.EntityType.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.EntityType.Entity} Entity + */ + Entity.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.EntityType.Entity) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.EntityType.Entity(); + if (object.value != null) + message.value = String(object.value); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.dialogflow.cx.v3.EntityType.Entity.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.EntityType.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.EntityType.Entity"; + }; + + return Entity; + })(); + + EntityType.ExcludedPhrase = (function() { + + /** + * Properties of an ExcludedPhrase. + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @interface IExcludedPhrase + * @property {string|null} [value] ExcludedPhrase value + */ + + /** + * Constructs a new ExcludedPhrase. + * @memberof google.cloud.dialogflow.cx.v3.EntityType + * @classdesc Represents an ExcludedPhrase. + * @implements IExcludedPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase=} [properties] Properties to set + */ + function ExcludedPhrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExcludedPhrase value. + * @member {string} value + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @instance + */ + ExcludedPhrase.prototype.value = ""; + + /** + * Creates a new ExcludedPhrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase} ExcludedPhrase instance + */ + ExcludedPhrase.create = function create(properties) { + return new ExcludedPhrase(properties); + }; + + /** + * Encodes the specified ExcludedPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase} message ExcludedPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludedPhrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified ExcludedPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.IExcludedPhrase} message ExcludedPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludedPhrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase} ExcludedPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludedPhrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase} ExcludedPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludedPhrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExcludedPhrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExcludedPhrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an ExcludedPhrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase} ExcludedPhrase + */ + ExcludedPhrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an ExcludedPhrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase} message ExcludedPhrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExcludedPhrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ExcludedPhrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @instance + * @returns {Object.} JSON object + */ + ExcludedPhrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExcludedPhrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExcludedPhrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase"; + }; + + return ExcludedPhrase; + })(); + + return EntityType; + })(); + + v3.ExportEntityTypesRequest = (function() { + + /** + * Properties of an ExportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportEntityTypesRequest + * @property {string|null} [parent] ExportEntityTypesRequest parent + * @property {Array.|null} [entityTypes] ExportEntityTypesRequest entityTypes + * @property {string|null} [entityTypesUri] ExportEntityTypesRequest entityTypesUri + * @property {boolean|null} [entityTypesContentInline] ExportEntityTypesRequest entityTypesContentInline + * @property {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat|null} [dataFormat] ExportEntityTypesRequest dataFormat + * @property {string|null} [languageCode] ExportEntityTypesRequest languageCode + */ + + /** + * Constructs a new ExportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportEntityTypesRequest. + * @implements IExportEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest=} [properties] Properties to set + */ + function ExportEntityTypesRequest(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.parent = ""; + + /** + * ExportEntityTypesRequest entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.entityTypes = $util.emptyArray; + + /** + * ExportEntityTypesRequest entityTypesUri. + * @member {string|null|undefined} entityTypesUri + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.entityTypesUri = null; + + /** + * ExportEntityTypesRequest entityTypesContentInline. + * @member {boolean|null|undefined} entityTypesContentInline + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.entityTypesContentInline = null; + + /** + * ExportEntityTypesRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.dataFormat = 0; + + /** + * ExportEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportEntityTypesRequest destination. + * @member {"entityTypesUri"|"entityTypesContentInline"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + */ + Object.defineProperty(ExportEntityTypesRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["entityTypesUri", "entityTypesContentInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest} ExportEntityTypesRequest instance + */ + ExportEntityTypesRequest.create = function create(properties) { + return new ExportEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ExportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest} message ExportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesRequest.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.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypes[i]); + if (message.entityTypesUri != null && Object.hasOwnProperty.call(message, "entityTypesUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityTypesUri); + if (message.entityTypesContentInline != null && Object.hasOwnProperty.call(message, "entityTypesContentInline")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.entityTypesContentInline); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.dataFormat); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ExportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest} message ExportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest} ExportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push(reader.string()); + break; + } + case 3: { + message.entityTypesUri = reader.string(); + break; + } + case 4: { + message.entityTypesContentInline = reader.bool(); + break; + } + case 5: { + message.dataFormat = reader.int32(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest} ExportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) + if (!$util.isString(message.entityTypes[i])) + return "entityTypes: string[] expected"; + } + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + properties.destination = 1; + if (!$util.isString(message.entityTypesUri)) + return "entityTypesUri: string expected"; + } + if (message.entityTypesContentInline != null && message.hasOwnProperty("entityTypesContentInline")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (typeof message.entityTypesContentInline !== "boolean") + return "entityTypesContentInline: boolean expected"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 5: + break; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an ExportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest} ExportEntityTypesRequest + */ + ExportEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) + message.entityTypes[i] = String(object.entityTypes[i]); + } + if (object.entityTypesUri != null) + message.entityTypesUri = String(object.entityTypesUri); + if (object.entityTypesContentInline != null) + message.entityTypesContentInline = Boolean(object.entityTypesContentInline); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON_PACKAGE": + case 5: + message.dataFormat = 5; + break; + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an ExportEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest} message ExportEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) { + object.parent = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = message.entityTypes[j]; + } + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + object.entityTypesUri = message.entityTypesUri; + if (options.oneofs) + object.destination = "entityTypesUri"; + } + if (message.entityTypesContentInline != null && message.hasOwnProperty("entityTypesContentInline")) { + object.entityTypesContentInline = message.entityTypesContentInline; + if (options.oneofs) + object.destination = "entityTypesContentInline"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat[message.dataFormat] : message.dataFormat; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ExportEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON_PACKAGE=5 JSON_PACKAGE value + */ + ExportEntityTypesRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[5] = "JSON_PACKAGE"] = 5; + return values; + })(); + + return ExportEntityTypesRequest; + })(); + + v3.ExportEntityTypesResponse = (function() { + + /** + * Properties of an ExportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportEntityTypesResponse + * @property {string|null} [entityTypesUri] ExportEntityTypesResponse entityTypesUri + * @property {google.cloud.dialogflow.cx.v3.IInlineDestination|null} [entityTypesContent] ExportEntityTypesResponse entityTypesContent + */ + + /** + * Constructs a new ExportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportEntityTypesResponse. + * @implements IExportEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse=} [properties] Properties to set + */ + function ExportEntityTypesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEntityTypesResponse entityTypesUri. + * @member {string|null|undefined} entityTypesUri + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @instance + */ + ExportEntityTypesResponse.prototype.entityTypesUri = null; + + /** + * ExportEntityTypesResponse entityTypesContent. + * @member {google.cloud.dialogflow.cx.v3.IInlineDestination|null|undefined} entityTypesContent + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @instance + */ + ExportEntityTypesResponse.prototype.entityTypesContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportEntityTypesResponse exportedEntityTypes. + * @member {"entityTypesUri"|"entityTypesContent"|undefined} exportedEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @instance + */ + Object.defineProperty(ExportEntityTypesResponse.prototype, "exportedEntityTypes", { + get: $util.oneOfGetter($oneOfFields = ["entityTypesUri", "entityTypesContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse} ExportEntityTypesResponse instance + */ + ExportEntityTypesResponse.create = function create(properties) { + return new ExportEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ExportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse} message ExportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypesUri != null && Object.hasOwnProperty.call(message, "entityTypesUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityTypesUri); + if (message.entityTypesContent != null && Object.hasOwnProperty.call(message, "entityTypesContent")) + $root.google.cloud.dialogflow.cx.v3.InlineDestination.encode(message.entityTypesContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse} message ExportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse} ExportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityTypesUri = reader.string(); + break; + } + case 2: { + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3.InlineDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse} ExportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + properties.exportedEntityTypes = 1; + if (!$util.isString(message.entityTypesUri)) + return "entityTypesUri: string expected"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + if (properties.exportedEntityTypes === 1) + return "exportedEntityTypes: multiple values"; + properties.exportedEntityTypes = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.InlineDestination.verify(message.entityTypesContent, long + 1); + if (error) + return "entityTypesContent." + error; + } + } + return null; + }; + + /** + * Creates an ExportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse} ExportEntityTypesResponse + */ + ExportEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse(); + if (object.entityTypesUri != null) + message.entityTypesUri = String(object.entityTypesUri); + if (object.entityTypesContent != null) { + if (typeof object.entityTypesContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse.entityTypesContent: object expected"); + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3.InlineDestination.fromObject(object.entityTypesContent, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExportEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse} message ExportEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + object.entityTypesUri = message.entityTypesUri; + if (options.oneofs) + object.exportedEntityTypes = "entityTypesUri"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + object.entityTypesContent = $root.google.cloud.dialogflow.cx.v3.InlineDestination.toObject(message.entityTypesContent, options); + if (options.oneofs) + object.exportedEntityTypes = "entityTypesContent"; + } + return object; + }; + + /** + * Converts this ExportEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ExportEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse"; + }; + + return ExportEntityTypesResponse; + })(); + + v3.ExportEntityTypesMetadata = (function() { + + /** + * Properties of an ExportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportEntityTypesMetadata + */ + + /** + * Constructs a new ExportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportEntityTypesMetadata. + * @implements IExportEntityTypesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata=} [properties] Properties to set + */ + function ExportEntityTypesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportEntityTypesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata} ExportEntityTypesMetadata instance + */ + ExportEntityTypesMetadata.create = function create(properties) { + return new ExportEntityTypesMetadata(properties); + }; + + /** + * Encodes the specified ExportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata} message ExportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata} message ExportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata} ExportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata} ExportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEntityTypesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntityTypesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata} ExportEntityTypesMetadata + */ + ExportEntityTypesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata(); + }; + + /** + * Creates a plain object from an ExportEntityTypesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata} message ExportEntityTypesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntityTypesMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportEntityTypesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportEntityTypesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEntityTypesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEntityTypesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata"; + }; + + return ExportEntityTypesMetadata; + })(); + + v3.ImportEntityTypesRequest = (function() { + + /** + * Properties of an ImportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportEntityTypesRequest + * @property {string|null} [parent] ImportEntityTypesRequest parent + * @property {string|null} [entityTypesUri] ImportEntityTypesRequest entityTypesUri + * @property {google.cloud.dialogflow.cx.v3.IInlineSource|null} [entityTypesContent] ImportEntityTypesRequest entityTypesContent + * @property {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption|null} [mergeOption] ImportEntityTypesRequest mergeOption + * @property {string|null} [targetEntityType] ImportEntityTypesRequest targetEntityType + */ + + /** + * Constructs a new ImportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportEntityTypesRequest. + * @implements IImportEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest=} [properties] Properties to set + */ + function ImportEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.parent = ""; + + /** + * ImportEntityTypesRequest entityTypesUri. + * @member {string|null|undefined} entityTypesUri + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.entityTypesUri = null; + + /** + * ImportEntityTypesRequest entityTypesContent. + * @member {google.cloud.dialogflow.cx.v3.IInlineSource|null|undefined} entityTypesContent + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.entityTypesContent = null; + + /** + * ImportEntityTypesRequest mergeOption. + * @member {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption} mergeOption + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.mergeOption = 0; + + /** + * ImportEntityTypesRequest targetEntityType. + * @member {string} targetEntityType + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.targetEntityType = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportEntityTypesRequest entityTypes. + * @member {"entityTypesUri"|"entityTypesContent"|undefined} entityTypes + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @instance + */ + Object.defineProperty(ImportEntityTypesRequest.prototype, "entityTypes", { + get: $util.oneOfGetter($oneOfFields = ["entityTypesUri", "entityTypesContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest} ImportEntityTypesRequest instance + */ + ImportEntityTypesRequest.create = function create(properties) { + return new ImportEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ImportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest} message ImportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesRequest.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.entityTypesUri != null && Object.hasOwnProperty.call(message, "entityTypesUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypesUri); + if (message.entityTypesContent != null && Object.hasOwnProperty.call(message, "entityTypesContent")) + $root.google.cloud.dialogflow.cx.v3.InlineSource.encode(message.entityTypesContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mergeOption != null && Object.hasOwnProperty.call(message, "mergeOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mergeOption); + if (message.targetEntityType != null && Object.hasOwnProperty.call(message, "targetEntityType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetEntityType); + return writer; + }; + + /** + * Encodes the specified ImportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest} message ImportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest} ImportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.entityTypesUri = reader.string(); + break; + } + case 3: { + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3.InlineSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.mergeOption = reader.int32(); + break; + } + case 5: { + message.targetEntityType = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest} ImportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + properties.entityTypes = 1; + if (!$util.isString(message.entityTypesUri)) + return "entityTypesUri: string expected"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + if (properties.entityTypes === 1) + return "entityTypes: multiple values"; + properties.entityTypes = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.InlineSource.verify(message.entityTypesContent, long + 1); + if (error) + return "entityTypesContent." + error; + } + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + switch (message.mergeOption) { + default: + return "mergeOption: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.targetEntityType != null && message.hasOwnProperty("targetEntityType")) + if (!$util.isString(message.targetEntityType)) + return "targetEntityType: string expected"; + return null; + }; + + /** + * Creates an ImportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest} ImportEntityTypesRequest + */ + ImportEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypesUri != null) + message.entityTypesUri = String(object.entityTypesUri); + if (object.entityTypesContent != null) { + if (typeof object.entityTypesContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entityTypesContent: object expected"); + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3.InlineSource.fromObject(object.entityTypesContent, long + 1); + } + switch (object.mergeOption) { + default: + if (typeof object.mergeOption === "number") { + message.mergeOption = object.mergeOption; + break; + } + break; + case "MERGE_OPTION_UNSPECIFIED": + case 0: + message.mergeOption = 0; + break; + case "REPLACE": + case 1: + message.mergeOption = 1; + break; + case "MERGE": + case 2: + message.mergeOption = 2; + break; + case "RENAME": + case 3: + message.mergeOption = 3; + break; + case "REPORT_CONFLICT": + case 4: + message.mergeOption = 4; + break; + case "KEEP": + case 5: + message.mergeOption = 5; + break; + } + if (object.targetEntityType != null) + message.targetEntityType = String(object.targetEntityType); + return message; + }; + + /** + * Creates a plain object from an ImportEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest} message ImportEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mergeOption = options.enums === String ? "MERGE_OPTION_UNSPECIFIED" : 0; + object.targetEntityType = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + object.entityTypesUri = message.entityTypesUri; + if (options.oneofs) + object.entityTypes = "entityTypesUri"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + object.entityTypesContent = $root.google.cloud.dialogflow.cx.v3.InlineSource.toObject(message.entityTypesContent, options); + if (options.oneofs) + object.entityTypes = "entityTypesContent"; + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + object.mergeOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption[message.mergeOption] === undefined ? message.mergeOption : $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption[message.mergeOption] : message.mergeOption; + if (message.targetEntityType != null && message.hasOwnProperty("targetEntityType")) + object.targetEntityType = message.targetEntityType; + return object; + }; + + /** + * Converts this ImportEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest"; + }; + + /** + * MergeOption enum. + * @name google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption + * @enum {number} + * @property {number} MERGE_OPTION_UNSPECIFIED=0 MERGE_OPTION_UNSPECIFIED value + * @property {number} REPLACE=1 REPLACE value + * @property {number} MERGE=2 MERGE value + * @property {number} RENAME=3 RENAME value + * @property {number} REPORT_CONFLICT=4 REPORT_CONFLICT value + * @property {number} KEEP=5 KEEP value + */ + ImportEntityTypesRequest.MergeOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MERGE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "REPLACE"] = 1; + values[valuesById[2] = "MERGE"] = 2; + values[valuesById[3] = "RENAME"] = 3; + values[valuesById[4] = "REPORT_CONFLICT"] = 4; + values[valuesById[5] = "KEEP"] = 5; + return values; + })(); + + return ImportEntityTypesRequest; + })(); + + v3.ImportEntityTypesResponse = (function() { + + /** + * Properties of an ImportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportEntityTypesResponse + * @property {Array.|null} [entityTypes] ImportEntityTypesResponse entityTypes + * @property {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources|null} [conflictingResources] ImportEntityTypesResponse conflictingResources + */ + + /** + * Constructs a new ImportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportEntityTypesResponse. + * @implements IImportEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse=} [properties] Properties to set + */ + function ImportEntityTypesResponse(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @instance + */ + ImportEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + + /** + * ImportEntityTypesResponse conflictingResources. + * @member {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources|null|undefined} conflictingResources + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @instance + */ + ImportEntityTypesResponse.prototype.conflictingResources = null; + + /** + * Creates a new ImportEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse} ImportEntityTypesResponse instance + */ + ImportEntityTypesResponse.create = function create(properties) { + return new ImportEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ImportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse} message ImportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityTypes[i]); + if (message.conflictingResources != null && Object.hasOwnProperty.call(message, "conflictingResources")) + $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.encode(message.conflictingResources, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse} message ImportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse} ImportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push(reader.string()); + break; + } + case 2: { + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse} ImportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) + if (!$util.isString(message.entityTypes[i])) + return "entityTypes: string[] expected"; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) { + var error = $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.verify(message.conflictingResources, long + 1); + if (error) + return "conflictingResources." + error; + } + return null; + }; + + /** + * Creates an ImportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse} ImportEntityTypesResponse + */ + ImportEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) + message.entityTypes[i] = String(object.entityTypes[i]); + } + if (object.conflictingResources != null) { + if (typeof object.conflictingResources !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.conflictingResources: object expected"); + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.fromObject(object.conflictingResources, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse} message ImportEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) + object.conflictingResources = null; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = message.entityTypes[j]; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) + object.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.toObject(message.conflictingResources, options); + return object; + }; + + /** + * Converts this ImportEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ImportEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse"; + }; + + ImportEntityTypesResponse.ConflictingResources = (function() { + + /** + * Properties of a ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @interface IConflictingResources + * @property {Array.|null} [entityTypeDisplayNames] ConflictingResources entityTypeDisplayNames + * @property {Array.|null} [entityDisplayNames] ConflictingResources entityDisplayNames + */ + + /** + * Constructs a new ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse + * @classdesc Represents a ConflictingResources. + * @implements IConflictingResources + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources=} [properties] Properties to set + */ + function ConflictingResources(properties) { + this.entityTypeDisplayNames = []; + this.entityDisplayNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConflictingResources entityTypeDisplayNames. + * @member {Array.} entityTypeDisplayNames + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.entityTypeDisplayNames = $util.emptyArray; + + /** + * ConflictingResources entityDisplayNames. + * @member {Array.} entityDisplayNames + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.entityDisplayNames = $util.emptyArray; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources} ConflictingResources instance + */ + ConflictingResources.create = function create(properties) { + return new ConflictingResources(properties); + }; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypeDisplayNames != null && message.entityTypeDisplayNames.length) + for (var i = 0; i < message.entityTypeDisplayNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityTypeDisplayNames[i]); + if (message.entityDisplayNames != null && message.entityDisplayNames.length) + for (var i = 0; i < message.entityDisplayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityDisplayNames[i]); + return writer; + }; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entityTypeDisplayNames && message.entityTypeDisplayNames.length)) + message.entityTypeDisplayNames = []; + message.entityTypeDisplayNames.push(reader.string()); + break; + } + case 2: { + if (!(message.entityDisplayNames && message.entityDisplayNames.length)) + message.entityDisplayNames = []; + message.entityDisplayNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConflictingResources message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConflictingResources.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityTypeDisplayNames != null && message.hasOwnProperty("entityTypeDisplayNames")) { + if (!Array.isArray(message.entityTypeDisplayNames)) + return "entityTypeDisplayNames: array expected"; + for (var i = 0; i < message.entityTypeDisplayNames.length; ++i) + if (!$util.isString(message.entityTypeDisplayNames[i])) + return "entityTypeDisplayNames: string[] expected"; + } + if (message.entityDisplayNames != null && message.hasOwnProperty("entityDisplayNames")) { + if (!Array.isArray(message.entityDisplayNames)) + return "entityDisplayNames: array expected"; + for (var i = 0; i < message.entityDisplayNames.length; ++i) + if (!$util.isString(message.entityDisplayNames[i])) + return "entityDisplayNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources} ConflictingResources + */ + ConflictingResources.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources(); + if (object.entityTypeDisplayNames) { + if (!Array.isArray(object.entityTypeDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.entityTypeDisplayNames: array expected"); + message.entityTypeDisplayNames = []; + for (var i = 0; i < object.entityTypeDisplayNames.length; ++i) + message.entityTypeDisplayNames[i] = String(object.entityTypeDisplayNames[i]); + } + if (object.entityDisplayNames) { + if (!Array.isArray(object.entityDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources.entityDisplayNames: array expected"); + message.entityDisplayNames = []; + for (var i = 0; i < object.entityDisplayNames.length; ++i) + message.entityDisplayNames[i] = String(object.entityDisplayNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources} message ConflictingResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConflictingResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.entityTypeDisplayNames = []; + object.entityDisplayNames = []; + } + if (message.entityTypeDisplayNames && message.entityTypeDisplayNames.length) { + object.entityTypeDisplayNames = []; + for (var j = 0; j < message.entityTypeDisplayNames.length; ++j) + object.entityTypeDisplayNames[j] = message.entityTypeDisplayNames[j]; + } + if (message.entityDisplayNames && message.entityDisplayNames.length) { + object.entityDisplayNames = []; + for (var j = 0; j < message.entityDisplayNames.length; ++j) + object.entityDisplayNames[j] = message.entityDisplayNames[j]; + } + return object; + }; + + /** + * Converts this ConflictingResources to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @instance + * @returns {Object.} JSON object + */ + ConflictingResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConflictingResources + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConflictingResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources"; + }; + + return ConflictingResources; + })(); + + return ImportEntityTypesResponse; + })(); + + v3.ImportEntityTypesMetadata = (function() { + + /** + * Properties of an ImportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportEntityTypesMetadata + */ + + /** + * Constructs a new ImportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportEntityTypesMetadata. + * @implements IImportEntityTypesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata=} [properties] Properties to set + */ + function ImportEntityTypesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ImportEntityTypesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata} ImportEntityTypesMetadata instance + */ + ImportEntityTypesMetadata.create = function create(properties) { + return new ImportEntityTypesMetadata(properties); + }; + + /** + * Encodes the specified ImportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata} message ImportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata} message ImportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata} ImportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata} ImportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEntityTypesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntityTypesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ImportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata} ImportEntityTypesMetadata + */ + ImportEntityTypesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata(); + }; + + /** + * Creates a plain object from an ImportEntityTypesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata} message ImportEntityTypesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntityTypesMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportEntityTypesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportEntityTypesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEntityTypesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEntityTypesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata"; + }; + + return ImportEntityTypesMetadata; + })(); + + v3.ListEntityTypesRequest = (function() { + + /** + * Properties of a ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListEntityTypesRequest + * @property {string|null} [parent] ListEntityTypesRequest parent + * @property {string|null} [languageCode] ListEntityTypesRequest languageCode + * @property {number|null} [pageSize] ListEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListEntityTypesRequest pageToken + */ + + /** + * Constructs a new ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListEntityTypesRequest. + * @implements IListEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesRequest=} [properties] Properties to set + */ + function ListEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.parent = ""; + + /** + * ListEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.languageCode = ""; + + /** + * ListEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.pageSize = 0; + + /** + * ListEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesRequest} ListEntityTypesRequest instance + */ + ListEntityTypesRequest.create = function create(properties) { + return new ListEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesRequest} ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesRequest} ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: 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"; + return null; + }; + + /** + * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesRequest} ListEntityTypesRequest + */ + ListEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListEntityTypesRequest} message ListEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListEntityTypesRequest"; + }; + + return ListEntityTypesRequest; + })(); + + v3.ListEntityTypesResponse = (function() { + + /** + * Properties of a ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListEntityTypesResponse + * @property {Array.|null} [entityTypes] ListEntityTypesResponse entityTypes + * @property {string|null} [nextPageToken] ListEntityTypesResponse nextPageToken + */ + + /** + * Constructs a new ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListEntityTypesResponse. + * @implements IListEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesResponse=} [properties] Properties to set + */ + function ListEntityTypesResponse(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @instance + */ + ListEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + + /** + * ListEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @instance + */ + ListEntityTypesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesResponse} ListEntityTypesResponse instance + */ + ListEntityTypesResponse.create = function create(properties) { + return new ListEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.cx.v3.EntityType.encode(message.entityTypes[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 ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesResponse} ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.cx.v3.EntityType.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesResponse} ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.EntityType.verify(message.entityTypes[i], long + 1); + if (error) + return "entityTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListEntityTypesResponse} ListEntityTypesResponse + */ + ListEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListEntityTypesResponse.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.cx.v3.EntityType.fromObject(object.entityTypes[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListEntityTypesResponse} message ListEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.cx.v3.EntityType.toObject(message.entityTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListEntityTypesResponse"; + }; + + return ListEntityTypesResponse; + })(); + + v3.GetEntityTypeRequest = (function() { + + /** + * Properties of a GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetEntityTypeRequest + * @property {string|null} [name] GetEntityTypeRequest name + * @property {string|null} [languageCode] GetEntityTypeRequest languageCode + */ + + /** + * Constructs a new GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetEntityTypeRequest. + * @implements IGetEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest=} [properties] Properties to set + */ + function GetEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @instance + */ + GetEntityTypeRequest.prototype.name = ""; + + /** + * GetEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @instance + */ + GetEntityTypeRequest.prototype.languageCode = ""; + + /** + * Creates a new GetEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetEntityTypeRequest} GetEntityTypeRequest instance + */ + GetEntityTypeRequest.create = function create(properties) { + return new GetEntityTypeRequest(properties); + }; + + /** + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityTypeRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetEntityTypeRequest} GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetEntityTypeRequest} GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetEntityTypeRequest} GetEntityTypeRequest + */ + GetEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetEntityTypeRequest} message GetEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetEntityTypeRequest"; + }; + + return GetEntityTypeRequest; + })(); + + v3.CreateEntityTypeRequest = (function() { + + /** + * Properties of a CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateEntityTypeRequest + * @property {string|null} [parent] CreateEntityTypeRequest parent + * @property {google.cloud.dialogflow.cx.v3.IEntityType|null} [entityType] CreateEntityTypeRequest entityType + * @property {string|null} [languageCode] CreateEntityTypeRequest languageCode + */ + + /** + * Constructs a new CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateEntityTypeRequest. + * @implements ICreateEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest=} [properties] Properties to set + */ + function CreateEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEntityTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.parent = ""; + + /** + * CreateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.cx.v3.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.entityType = null; + + /** + * CreateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest} CreateEntityTypeRequest instance + */ + CreateEntityTypeRequest.create = function create(properties) { + return new CreateEntityTypeRequest(properties); + }; + + /** + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityTypeRequest.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.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.cx.v3.EntityType.encode(message.entityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest} CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.entityType = $root.google.cloud.dialogflow.cx.v3.EntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest} CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.cx.v3.EntityType.verify(message.entityType, long + 1); + if (error) + return "entityType." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest} CreateEntityTypeRequest + */ + CreateEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.cx.v3.EntityType.fromObject(object.entityType, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest} message CreateEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.entityType = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.cx.v3.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest"; + }; + + return CreateEntityTypeRequest; + })(); + + v3.UpdateEntityTypeRequest = (function() { + + /** + * Properties of an UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateEntityTypeRequest + * @property {google.cloud.dialogflow.cx.v3.IEntityType|null} [entityType] UpdateEntityTypeRequest entityType + * @property {string|null} [languageCode] UpdateEntityTypeRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEntityTypeRequest updateMask + */ + + /** + * Constructs a new UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateEntityTypeRequest. + * @implements IUpdateEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest=} [properties] Properties to set + */ + function UpdateEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.cx.v3.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.entityType = null; + + /** + * UpdateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.languageCode = ""; + + /** + * UpdateEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest} UpdateEntityTypeRequest instance + */ + UpdateEntityTypeRequest.create = function create(properties) { + return new UpdateEntityTypeRequest(properties); + }; + + /** + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.cx.v3.EntityType.encode(message.entityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityType = $root.google.cloud.dialogflow.cx.v3.EntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.cx.v3.EntityType.verify(message.entityType, long + 1); + if (error) + return "entityType." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest} UpdateEntityTypeRequest + */ + UpdateEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest(); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.cx.v3.EntityType.fromObject(object.entityType, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest} message UpdateEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityType = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.cx.v3.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest"; + }; + + return UpdateEntityTypeRequest; + })(); + + v3.DeleteEntityTypeRequest = (function() { + + /** + * Properties of a DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteEntityTypeRequest + * @property {string|null} [name] DeleteEntityTypeRequest name + * @property {boolean|null} [force] DeleteEntityTypeRequest force + */ + + /** + * Constructs a new DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteEntityTypeRequest. + * @implements IDeleteEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest=} [properties] Properties to set + */ + function DeleteEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @instance + */ + DeleteEntityTypeRequest.prototype.name = ""; + + /** + * DeleteEntityTypeRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @instance + */ + DeleteEntityTypeRequest.prototype.force = false; + + /** + * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest} DeleteEntityTypeRequest instance + */ + DeleteEntityTypeRequest.create = function create(properties) { + return new DeleteEntityTypeRequest(properties); + }; + + /** + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityTypeRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest} DeleteEntityTypeRequest + */ + DeleteEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest} message DeleteEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest"; + }; + + return DeleteEntityTypeRequest; + })(); + + v3.InlineDestination = (function() { + + /** + * Properties of an InlineDestination. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IInlineDestination + * @property {Uint8Array|null} [content] InlineDestination content + */ + + /** + * Constructs a new InlineDestination. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an InlineDestination. + * @implements IInlineDestination + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IInlineDestination=} [properties] Properties to set + */ + function InlineDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineDestination content. + * @member {Uint8Array} content + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @instance + */ + InlineDestination.prototype.content = $util.newBuffer([]); + + /** + * Creates a new InlineDestination instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineDestination=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.InlineDestination} InlineDestination instance + */ + InlineDestination.create = function create(properties) { + return new InlineDestination(properties); + }; + + /** + * Encodes the specified InlineDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineDestination} message InlineDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified InlineDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineDestination} message InlineDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.InlineDestination} InlineDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineDestination.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.InlineDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InlineDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.InlineDestination} InlineDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineDestination message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineDestination.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + return null; + }; + + /** + * Creates an InlineDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.InlineDestination} InlineDestination + */ + InlineDestination.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.InlineDestination) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.InlineDestination(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an InlineDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3.InlineDestination} message InlineDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + return object; + }; + + /** + * Converts this InlineDestination to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @instance + * @returns {Object.} JSON object + */ + InlineDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineDestination + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.InlineDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.InlineDestination"; + }; + + return InlineDestination; + })(); + + v3.InlineSource = (function() { + + /** + * Properties of an InlineSource. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IInlineSource + * @property {Uint8Array|null} [content] InlineSource content + */ + + /** + * Constructs a new InlineSource. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an InlineSource. + * @implements IInlineSource + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IInlineSource=} [properties] Properties to set + */ + function InlineSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSource content. + * @member {Uint8Array} content + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @instance + */ + InlineSource.prototype.content = $util.newBuffer([]); + + /** + * Creates a new InlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.InlineSource} InlineSource instance + */ + InlineSource.create = function create(properties) { + return new InlineSource(properties); + }; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.InlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.InlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSource message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + return null; + }; + + /** + * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.InlineSource} InlineSource + */ + InlineSource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.InlineSource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.InlineSource(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3.InlineSource} message InlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + return object; + }; + + /** + * Converts this InlineSource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @instance + * @returns {Object.} JSON object + */ + InlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSource + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.InlineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.InlineSource"; + }; + + return InlineSource; + })(); + + v3.Environments = (function() { + + /** + * Constructs a new Environments service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Environments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Environments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; + + /** + * Creates new Environments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Environments} RPC service. Useful where requests and/or responses are streamed. + */ + Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|listEnvironments}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef ListEnvironmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + */ + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { + return this.rpcCall(listEnvironments, $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest, $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse, request, callback); + }, "name", { value: "ListEnvironments" }); + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|getEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef GetEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Environment} [response] Environment + */ + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.getEnvironment = function getEnvironment(request, callback) { + return this.rpcCall(getEnvironment, $root.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest, $root.google.cloud.dialogflow.cx.v3.Environment, request, callback); + }, "name", { value: "GetEnvironment" }); + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|createEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef CreateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.CreateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.createEnvironment = function createEnvironment(request, callback) { + return this.rpcCall(createEnvironment, $root.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEnvironment" }); + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|updateEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef UpdateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.updateEnvironment = function updateEnvironment(request, callback) { + return this.rpcCall(updateEnvironment, $root.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEnvironment" }); + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|deleteEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef DeleteEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.deleteEnvironment = function deleteEnvironment(request, callback) { + return this.rpcCall(deleteEnvironment, $root.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEnvironment" }); + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|lookupEnvironmentHistory}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef LookupEnvironmentHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse} [response] LookupEnvironmentHistoryResponse + */ + + /** + * Calls LookupEnvironmentHistory. + * @function lookupEnvironmentHistory + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest} request LookupEnvironmentHistoryRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistoryCallback} callback Node-style callback called with the error, if any, and LookupEnvironmentHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.lookupEnvironmentHistory = function lookupEnvironmentHistory(request, callback) { + return this.rpcCall(lookupEnvironmentHistory, $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest, $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse, request, callback); + }, "name", { value: "LookupEnvironmentHistory" }); + + /** + * Calls LookupEnvironmentHistory. + * @function lookupEnvironmentHistory + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest} request LookupEnvironmentHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|runContinuousTest}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef RunContinuousTestCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunContinuousTest. + * @function runContinuousTest + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} request RunContinuousTestRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.RunContinuousTestCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.runContinuousTest = function runContinuousTest(request, callback) { + return this.rpcCall(runContinuousTest, $root.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunContinuousTest" }); + + /** + * Calls RunContinuousTest. + * @function runContinuousTest + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} request RunContinuousTestRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|listContinuousTestResults}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef ListContinuousTestResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} [response] ListContinuousTestResultsResponse + */ + + /** + * Calls ListContinuousTestResults. + * @function listContinuousTestResults + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} request ListContinuousTestResultsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResultsCallback} callback Node-style callback called with the error, if any, and ListContinuousTestResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listContinuousTestResults = function listContinuousTestResults(request, callback) { + return this.rpcCall(listContinuousTestResults, $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest, $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse, request, callback); + }, "name", { value: "ListContinuousTestResults" }); + + /** + * Calls ListContinuousTestResults. + * @function listContinuousTestResults + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} request ListContinuousTestResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments|deployFlow}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef DeployFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployFlow. + * @function deployFlow + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowRequest} request DeployFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.DeployFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.deployFlow = function deployFlow(request, callback) { + return this.rpcCall(deployFlow, $root.google.cloud.dialogflow.cx.v3.DeployFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployFlow" }); + + /** + * Calls DeployFlow. + * @function deployFlow + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowRequest} request DeployFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Environments; + })(); + + v3.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {string|null} [displayName] Environment displayName + * @property {string|null} [description] Environment description + * @property {Array.|null} [versionConfigs] Environment versionConfigs + * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + * @property {google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig|null} [testCasesConfig] Environment testCasesConfig + * @property {google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig|null} [webhookConfig] Environment webhookConfig + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.versionConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + */ + Environment.prototype.name = ""; + + /** + * Environment displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + */ + Environment.prototype.displayName = ""; + + /** + * Environment description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + */ + Environment.prototype.description = ""; + + /** + * Environment versionConfigs. + * @member {Array.} versionConfigs + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + */ + Environment.prototype.versionConfigs = $util.emptyArray; + + /** + * Environment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + */ + Environment.prototype.updateTime = null; + + /** + * Environment testCasesConfig. + * @member {google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig|null|undefined} testCasesConfig + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + */ + Environment.prototype.testCasesConfig = null; + + /** + * Environment webhookConfig. + * @member {google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig|null|undefined} webhookConfig + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + */ + Environment.prototype.webhookConfig = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.versionConfigs != null && message.versionConfigs.length) + for (var i = 0; i < message.versionConfigs.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig.encode(message.versionConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.testCasesConfig != null && Object.hasOwnProperty.call(message, "testCasesConfig")) + $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.encode(message.testCasesConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.webhookConfig != null && Object.hasOwnProperty.call(message, "webhookConfig")) + $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.encode(message.webhookConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Environment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.versionConfigs && message.versionConfigs.length)) + message.versionConfigs = []; + message.versionConfigs.push($root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.testCasesConfig = $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.webhookConfig = $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.versionConfigs != null && message.hasOwnProperty("versionConfigs")) { + if (!Array.isArray(message.versionConfigs)) + return "versionConfigs: array expected"; + for (var i = 0; i < message.versionConfigs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig.verify(message.versionConfigs[i], long + 1); + if (error) + return "versionConfigs." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.testCasesConfig != null && message.hasOwnProperty("testCasesConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.verify(message.testCasesConfig, long + 1); + if (error) + return "testCasesConfig." + error; + } + if (message.webhookConfig != null && message.hasOwnProperty("webhookConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.verify(message.webhookConfig, long + 1); + if (error) + return "webhookConfig." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Environment} Environment + */ + Environment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Environment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.versionConfigs) { + if (!Array.isArray(object.versionConfigs)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.versionConfigs: array expected"); + message.versionConfigs = []; + for (var i = 0; i < object.versionConfigs.length; ++i) { + if (typeof object.versionConfigs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.versionConfigs: object expected"); + message.versionConfigs[i] = $root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig.fromObject(object.versionConfigs[i], long + 1); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.testCasesConfig != null) { + if (typeof object.testCasesConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.testCasesConfig: object expected"); + message.testCasesConfig = $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.fromObject(object.testCasesConfig, long + 1); + } + if (object.webhookConfig != null) { + if (typeof object.webhookConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.webhookConfig: object expected"); + message.webhookConfig = $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.fromObject(object.webhookConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionConfigs = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.updateTime = null; + object.testCasesConfig = null; + object.webhookConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.versionConfigs && message.versionConfigs.length) { + object.versionConfigs = []; + for (var j = 0; j < message.versionConfigs.length; ++j) + object.versionConfigs[j] = $root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig.toObject(message.versionConfigs[j], options); + } + if (message.testCasesConfig != null && message.hasOwnProperty("testCasesConfig")) + object.testCasesConfig = $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.toObject(message.testCasesConfig, options); + if (message.webhookConfig != null && message.hasOwnProperty("webhookConfig")) + object.webhookConfig = $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.toObject(message.webhookConfig, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Environment"; + }; + + Environment.VersionConfig = (function() { + + /** + * Properties of a VersionConfig. + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @interface IVersionConfig + * @property {string|null} [version] VersionConfig version + */ + + /** + * Constructs a new VersionConfig. + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @classdesc Represents a VersionConfig. + * @implements IVersionConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Environment.IVersionConfig=} [properties] Properties to set + */ + function VersionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionConfig version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @instance + */ + VersionConfig.prototype.version = ""; + + /** + * Creates a new VersionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.IVersionConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Environment.VersionConfig} VersionConfig instance + */ + VersionConfig.create = function create(properties) { + return new VersionConfig(properties); + }; + + /** + * Encodes the specified VersionConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.VersionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.IVersionConfig} message VersionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + return writer; + }; + + /** + * Encodes the specified VersionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.VersionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.IVersionConfig} message VersionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Environment.VersionConfig} VersionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VersionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Environment.VersionConfig} VersionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a VersionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Environment.VersionConfig} VersionConfig + */ + VersionConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Environment.VersionConfig(); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a VersionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.VersionConfig} message VersionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.version = ""; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this VersionConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @instance + * @returns {Object.} JSON object + */ + VersionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Environment.VersionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Environment.VersionConfig"; + }; + + return VersionConfig; + })(); + + Environment.TestCasesConfig = (function() { + + /** + * Properties of a TestCasesConfig. + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @interface ITestCasesConfig + * @property {Array.|null} [testCases] TestCasesConfig testCases + * @property {boolean|null} [enableContinuousRun] TestCasesConfig enableContinuousRun + * @property {boolean|null} [enablePredeploymentRun] TestCasesConfig enablePredeploymentRun + */ + + /** + * Constructs a new TestCasesConfig. + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @classdesc Represents a TestCasesConfig. + * @implements ITestCasesConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig=} [properties] Properties to set + */ + function TestCasesConfig(properties) { + this.testCases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCasesConfig testCases. + * @member {Array.} testCases + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @instance + */ + TestCasesConfig.prototype.testCases = $util.emptyArray; + + /** + * TestCasesConfig enableContinuousRun. + * @member {boolean} enableContinuousRun + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @instance + */ + TestCasesConfig.prototype.enableContinuousRun = false; + + /** + * TestCasesConfig enablePredeploymentRun. + * @member {boolean} enablePredeploymentRun + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @instance + */ + TestCasesConfig.prototype.enablePredeploymentRun = false; + + /** + * Creates a new TestCasesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig} TestCasesConfig instance + */ + TestCasesConfig.create = function create(properties) { + return new TestCasesConfig(properties); + }; + + /** + * Encodes the specified TestCasesConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig} message TestCasesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCasesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCases != null && message.testCases.length) + for (var i = 0; i < message.testCases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.testCases[i]); + if (message.enableContinuousRun != null && Object.hasOwnProperty.call(message, "enableContinuousRun")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableContinuousRun); + if (message.enablePredeploymentRun != null && Object.hasOwnProperty.call(message, "enablePredeploymentRun")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enablePredeploymentRun); + return writer; + }; + + /** + * Encodes the specified TestCasesConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.ITestCasesConfig} message TestCasesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCasesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig} TestCasesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCasesConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testCases && message.testCases.length)) + message.testCases = []; + message.testCases.push(reader.string()); + break; + } + case 2: { + message.enableContinuousRun = reader.bool(); + break; + } + case 3: { + message.enablePredeploymentRun = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig} TestCasesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCasesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCasesConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCasesConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCases != null && message.hasOwnProperty("testCases")) { + if (!Array.isArray(message.testCases)) + return "testCases: array expected"; + for (var i = 0; i < message.testCases.length; ++i) + if (!$util.isString(message.testCases[i])) + return "testCases: string[] expected"; + } + if (message.enableContinuousRun != null && message.hasOwnProperty("enableContinuousRun")) + if (typeof message.enableContinuousRun !== "boolean") + return "enableContinuousRun: boolean expected"; + if (message.enablePredeploymentRun != null && message.hasOwnProperty("enablePredeploymentRun")) + if (typeof message.enablePredeploymentRun !== "boolean") + return "enablePredeploymentRun: boolean expected"; + return null; + }; + + /** + * Creates a TestCasesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig} TestCasesConfig + */ + TestCasesConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig(); + if (object.testCases) { + if (!Array.isArray(object.testCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.testCases: array expected"); + message.testCases = []; + for (var i = 0; i < object.testCases.length; ++i) + message.testCases[i] = String(object.testCases[i]); + } + if (object.enableContinuousRun != null) + message.enableContinuousRun = Boolean(object.enableContinuousRun); + if (object.enablePredeploymentRun != null) + message.enablePredeploymentRun = Boolean(object.enablePredeploymentRun); + return message; + }; + + /** + * Creates a plain object from a TestCasesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig} message TestCasesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCasesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCases = []; + if (options.defaults) { + object.enableContinuousRun = false; + object.enablePredeploymentRun = false; + } + if (message.testCases && message.testCases.length) { + object.testCases = []; + for (var j = 0; j < message.testCases.length; ++j) + object.testCases[j] = message.testCases[j]; + } + if (message.enableContinuousRun != null && message.hasOwnProperty("enableContinuousRun")) + object.enableContinuousRun = message.enableContinuousRun; + if (message.enablePredeploymentRun != null && message.hasOwnProperty("enablePredeploymentRun")) + object.enablePredeploymentRun = message.enablePredeploymentRun; + return object; + }; + + /** + * Converts this TestCasesConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @instance + * @returns {Object.} JSON object + */ + TestCasesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCasesConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCasesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig"; + }; + + return TestCasesConfig; + })(); + + Environment.WebhookConfig = (function() { + + /** + * Properties of a WebhookConfig. + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @interface IWebhookConfig + * @property {Array.|null} [webhookOverrides] WebhookConfig webhookOverrides + */ + + /** + * Constructs a new WebhookConfig. + * @memberof google.cloud.dialogflow.cx.v3.Environment + * @classdesc Represents a WebhookConfig. + * @implements IWebhookConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig=} [properties] Properties to set + */ + function WebhookConfig(properties) { + this.webhookOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookConfig webhookOverrides. + * @member {Array.} webhookOverrides + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @instance + */ + WebhookConfig.prototype.webhookOverrides = $util.emptyArray; + + /** + * Creates a new WebhookConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Environment.WebhookConfig} WebhookConfig instance + */ + WebhookConfig.create = function create(properties) { + return new WebhookConfig(properties); + }; + + /** + * Encodes the specified WebhookConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig} message WebhookConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhookOverrides != null && message.webhookOverrides.length) + for (var i = 0; i < message.webhookOverrides.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Webhook.encode(message.webhookOverrides[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebhookConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.IWebhookConfig} message WebhookConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Environment.WebhookConfig} WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.webhookOverrides && message.webhookOverrides.length)) + message.webhookOverrides = []; + message.webhookOverrides.push($root.google.cloud.dialogflow.cx.v3.Webhook.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Environment.WebhookConfig} WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.webhookOverrides != null && message.hasOwnProperty("webhookOverrides")) { + if (!Array.isArray(message.webhookOverrides)) + return "webhookOverrides: array expected"; + for (var i = 0; i < message.webhookOverrides.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.verify(message.webhookOverrides[i], long + 1); + if (error) + return "webhookOverrides." + error; + } + } + return null; + }; + + /** + * Creates a WebhookConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Environment.WebhookConfig} WebhookConfig + */ + WebhookConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig(); + if (object.webhookOverrides) { + if (!Array.isArray(object.webhookOverrides)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.webhookOverrides: array expected"); + message.webhookOverrides = []; + for (var i = 0; i < object.webhookOverrides.length; ++i) { + if (typeof object.webhookOverrides[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Environment.WebhookConfig.webhookOverrides: object expected"); + message.webhookOverrides[i] = $root.google.cloud.dialogflow.cx.v3.Webhook.fromObject(object.webhookOverrides[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a WebhookConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Environment.WebhookConfig} message WebhookConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.webhookOverrides = []; + if (message.webhookOverrides && message.webhookOverrides.length) { + object.webhookOverrides = []; + for (var j = 0; j < message.webhookOverrides.length; ++j) + object.webhookOverrides[j] = $root.google.cloud.dialogflow.cx.v3.Webhook.toObject(message.webhookOverrides[j], options); + } + return object; + }; + + /** + * Converts this WebhookConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @instance + * @returns {Object.} JSON object + */ + WebhookConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Environment.WebhookConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Environment.WebhookConfig"; + }; + + return WebhookConfig; + })(); + + return Environment; + })(); + + v3.ListEnvironmentsRequest = (function() { + + /** + * Properties of a ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListEnvironmentsRequest + * @property {string|null} [parent] ListEnvironmentsRequest parent + * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize + * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken + */ + + /** + * Constructs a new ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListEnvironmentsRequest. + * @implements IListEnvironmentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest=} [properties] Properties to set + */ + function ListEnvironmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.parent = ""; + + /** + * ListEnvironmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageSize = 0; + + /** + * ListEnvironmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest} ListEnvironmentsRequest instance + */ + ListEnvironmentsRequest.create = function create(properties) { + return new ListEnvironmentsRequest(properties); + }; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest} ListEnvironmentsRequest + */ + ListEnvironmentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest} message ListEnvironmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEnvironmentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEnvironmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest"; + }; + + return ListEnvironmentsRequest; + })(); + + v3.ListEnvironmentsResponse = (function() { + + /** + * Properties of a ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListEnvironmentsResponse + * @property {Array.|null} [environments] ListEnvironmentsResponse environments + * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + */ + + /** + * Constructs a new ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListEnvironmentsResponse. + * @implements IListEnvironmentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse=} [properties] Properties to set + */ + function ListEnvironmentsResponse(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsResponse environments. + * @member {Array.} environments + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + + /** + * ListEnvironmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse} ListEnvironmentsResponse instance + */ + ListEnvironmentsResponse.create = function create(properties) { + return new ListEnvironmentsResponse(properties); + }; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Environment.encode(message.environments[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 ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.dialogflow.cx.v3.Environment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.verify(message.environments[i], long + 1); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse} ListEnvironmentsResponse + */ + ListEnvironmentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.dialogflow.cx.v3.Environment.fromObject(object.environments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.dialogflow.cx.v3.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEnvironmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse"; + }; + + return ListEnvironmentsResponse; + })(); + + v3.GetEnvironmentRequest = (function() { + + /** + * Properties of a GetEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetEnvironmentRequest + * @property {string|null} [name] GetEnvironmentRequest name + */ + + /** + * Constructs a new GetEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetEnvironmentRequest. + * @implements IGetEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest=} [properties] Properties to set + */ + function GetEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @instance + */ + GetEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetEnvironmentRequest} GetEnvironmentRequest instance + */ + GetEnvironmentRequest.create = function create(properties) { + return new GetEnvironmentRequest(properties); + }; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.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 GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetEnvironmentRequest} GetEnvironmentRequest + */ + GetEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetEnvironmentRequest} message GetEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEnvironmentRequest.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 GetEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetEnvironmentRequest"; + }; + + return GetEnvironmentRequest; + })(); + + v3.CreateEnvironmentRequest = (function() { + + /** + * Properties of a CreateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateEnvironmentRequest + * @property {string|null} [parent] CreateEnvironmentRequest parent + * @property {google.cloud.dialogflow.cx.v3.IEnvironment|null} [environment] CreateEnvironmentRequest environment + */ + + /** + * Constructs a new CreateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateEnvironmentRequest. + * @implements ICreateEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest=} [properties] Properties to set + */ + function CreateEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEnvironmentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.parent = ""; + + /** + * CreateEnvironmentRequest environment. + * @member {google.cloud.dialogflow.cx.v3.IEnvironment|null|undefined} environment + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.environment = null; + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest} CreateEnvironmentRequest instance + */ + CreateEnvironmentRequest.create = function create(properties) { + return new CreateEnvironmentRequest(properties); + }; + + /** + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dialogflow.cx.v3.Environment.encode(message.environment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest} CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.environment = $root.google.cloud.dialogflow.cx.v3.Environment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest} CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.verify(message.environment, long + 1); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest} CreateEnvironmentRequest + */ + CreateEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.dialogflow.cx.v3.Environment.fromObject(object.environment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest} message CreateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.environment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dialogflow.cx.v3.Environment.toObject(message.environment, options); + return object; + }; + + /** + * Converts this CreateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest"; + }; + + return CreateEnvironmentRequest; + })(); + + v3.UpdateEnvironmentRequest = (function() { + + /** + * Properties of an UpdateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateEnvironmentRequest + * @property {google.cloud.dialogflow.cx.v3.IEnvironment|null} [environment] UpdateEnvironmentRequest environment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnvironmentRequest updateMask + */ + + /** + * Constructs a new UpdateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateEnvironmentRequest. + * @implements IUpdateEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest=} [properties] Properties to set + */ + function UpdateEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEnvironmentRequest environment. + * @member {google.cloud.dialogflow.cx.v3.IEnvironment|null|undefined} environment + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.environment = null; + + /** + * UpdateEnvironmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest} UpdateEnvironmentRequest instance + */ + UpdateEnvironmentRequest.create = function create(properties) { + return new UpdateEnvironmentRequest(properties); + }; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dialogflow.cx.v3.Environment.encode(message.environment, 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 UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = $root.google.cloud.dialogflow.cx.v3.Environment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.verify(message.environment, long + 1); + if (error) + return "environment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest} UpdateEnvironmentRequest + */ + UpdateEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest(); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.dialogflow.cx.v3.Environment.fromObject(object.environment, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest} message UpdateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = null; + object.updateMask = null; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dialogflow.cx.v3.Environment.toObject(message.environment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest"; + }; + + return UpdateEnvironmentRequest; + })(); + + v3.DeleteEnvironmentRequest = (function() { + + /** + * Properties of a DeleteEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteEnvironmentRequest + * @property {string|null} [name] DeleteEnvironmentRequest name + */ + + /** + * Constructs a new DeleteEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteEnvironmentRequest. + * @implements IDeleteEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest=} [properties] Properties to set + */ + function DeleteEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @instance + */ + DeleteEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest} DeleteEnvironmentRequest instance + */ + DeleteEnvironmentRequest.create = function create(properties) { + return new DeleteEnvironmentRequest(properties); + }; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest} DeleteEnvironmentRequest + */ + DeleteEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest} message DeleteEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest"; + }; + + return DeleteEnvironmentRequest; + })(); + + v3.LookupEnvironmentHistoryRequest = (function() { + + /** + * Properties of a LookupEnvironmentHistoryRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ILookupEnvironmentHistoryRequest + * @property {string|null} [name] LookupEnvironmentHistoryRequest name + * @property {number|null} [pageSize] LookupEnvironmentHistoryRequest pageSize + * @property {string|null} [pageToken] LookupEnvironmentHistoryRequest pageToken + */ + + /** + * Constructs a new LookupEnvironmentHistoryRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a LookupEnvironmentHistoryRequest. + * @implements ILookupEnvironmentHistoryRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest=} [properties] Properties to set + */ + function LookupEnvironmentHistoryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LookupEnvironmentHistoryRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @instance + */ + LookupEnvironmentHistoryRequest.prototype.name = ""; + + /** + * LookupEnvironmentHistoryRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @instance + */ + LookupEnvironmentHistoryRequest.prototype.pageSize = 0; + + /** + * LookupEnvironmentHistoryRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @instance + */ + LookupEnvironmentHistoryRequest.prototype.pageToken = ""; + + /** + * Creates a new LookupEnvironmentHistoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest instance + */ + LookupEnvironmentHistoryRequest.create = function create(properties) { + return new LookupEnvironmentHistoryRequest(properties); + }; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest} message LookupEnvironmentHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryRequest.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.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); + return writer; + }; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest} message LookupEnvironmentHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupEnvironmentHistoryRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupEnvironmentHistoryRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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"; + return null; + }; + + /** + * Creates a LookupEnvironmentHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest + */ + LookupEnvironmentHistoryRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a LookupEnvironmentHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest} message LookupEnvironmentHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupEnvironmentHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this LookupEnvironmentHistoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + LookupEnvironmentHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupEnvironmentHistoryRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupEnvironmentHistoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest"; + }; + + return LookupEnvironmentHistoryRequest; + })(); + + v3.LookupEnvironmentHistoryResponse = (function() { + + /** + * Properties of a LookupEnvironmentHistoryResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ILookupEnvironmentHistoryResponse + * @property {Array.|null} [environments] LookupEnvironmentHistoryResponse environments + * @property {string|null} [nextPageToken] LookupEnvironmentHistoryResponse nextPageToken + */ + + /** + * Constructs a new LookupEnvironmentHistoryResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a LookupEnvironmentHistoryResponse. + * @implements ILookupEnvironmentHistoryResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse=} [properties] Properties to set + */ + function LookupEnvironmentHistoryResponse(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LookupEnvironmentHistoryResponse environments. + * @member {Array.} environments + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @instance + */ + LookupEnvironmentHistoryResponse.prototype.environments = $util.emptyArray; + + /** + * LookupEnvironmentHistoryResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @instance + */ + LookupEnvironmentHistoryResponse.prototype.nextPageToken = ""; + + /** + * Creates a new LookupEnvironmentHistoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse instance + */ + LookupEnvironmentHistoryResponse.create = function create(properties) { + return new LookupEnvironmentHistoryResponse(properties); + }; + + /** + * Encodes the specified LookupEnvironmentHistoryResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse} message LookupEnvironmentHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Environment.encode(message.environments[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 LookupEnvironmentHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse} message LookupEnvironmentHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.dialogflow.cx.v3.Environment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupEnvironmentHistoryResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupEnvironmentHistoryResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.verify(message.environments[i], long + 1); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a LookupEnvironmentHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse + */ + LookupEnvironmentHistoryResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.dialogflow.cx.v3.Environment.fromObject(object.environments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a LookupEnvironmentHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse} message LookupEnvironmentHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupEnvironmentHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.dialogflow.cx.v3.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this LookupEnvironmentHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + LookupEnvironmentHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupEnvironmentHistoryResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupEnvironmentHistoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse"; + }; + + return LookupEnvironmentHistoryResponse; + })(); + + v3.ContinuousTestResult = (function() { + + /** + * Properties of a ContinuousTestResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IContinuousTestResult + * @property {string|null} [name] ContinuousTestResult name + * @property {google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|null} [result] ContinuousTestResult result + * @property {Array.|null} [testCaseResults] ContinuousTestResult testCaseResults + * @property {google.protobuf.ITimestamp|null} [runTime] ContinuousTestResult runTime + */ + + /** + * Constructs a new ContinuousTestResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ContinuousTestResult. + * @implements IContinuousTestResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult=} [properties] Properties to set + */ + function ContinuousTestResult(properties) { + this.testCaseResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousTestResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.name = ""; + + /** + * ContinuousTestResult result. + * @member {google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult} result + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.result = 0; + + /** + * ContinuousTestResult testCaseResults. + * @member {Array.} testCaseResults + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.testCaseResults = $util.emptyArray; + + /** + * ContinuousTestResult runTime. + * @member {google.protobuf.ITimestamp|null|undefined} runTime + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.runTime = null; + + /** + * Creates a new ContinuousTestResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ContinuousTestResult} ContinuousTestResult instance + */ + ContinuousTestResult.create = function create(properties) { + return new ContinuousTestResult(properties); + }; + + /** + * Encodes the specified ContinuousTestResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult} message ContinuousTestResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousTestResult.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.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.result); + if (message.testCaseResults != null && message.testCaseResults.length) + for (var i = 0; i < message.testCaseResults.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.testCaseResults[i]); + if (message.runTime != null && Object.hasOwnProperty.call(message, "runTime")) + $root.google.protobuf.Timestamp.encode(message.runTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousTestResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult} message ContinuousTestResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousTestResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ContinuousTestResult} ContinuousTestResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousTestResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.result = reader.int32(); + break; + } + case 3: { + if (!(message.testCaseResults && message.testCaseResults.length)) + message.testCaseResults = []; + message.testCaseResults.push(reader.string()); + break; + } + case 4: { + message.runTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ContinuousTestResult} ContinuousTestResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousTestResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousTestResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousTestResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.testCaseResults != null && message.hasOwnProperty("testCaseResults")) { + if (!Array.isArray(message.testCaseResults)) + return "testCaseResults: array expected"; + for (var i = 0; i < message.testCaseResults.length; ++i) + if (!$util.isString(message.testCaseResults[i])) + return "testCaseResults: string[] expected"; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.runTime, long + 1); + if (error) + return "runTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousTestResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ContinuousTestResult} ContinuousTestResult + */ + ContinuousTestResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult(); + if (object.name != null) + message.name = String(object.name); + switch (object.result) { + default: + if (typeof object.result === "number") { + message.result = object.result; + break; + } + break; + case "AGGREGATED_TEST_RESULT_UNSPECIFIED": + case 0: + message.result = 0; + break; + case "PASSED": + case 1: + message.result = 1; + break; + case "FAILED": + case 2: + message.result = 2; + break; + } + if (object.testCaseResults) { + if (!Array.isArray(object.testCaseResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ContinuousTestResult.testCaseResults: array expected"); + message.testCaseResults = []; + for (var i = 0; i < object.testCaseResults.length; ++i) + message.testCaseResults[i] = String(object.testCaseResults[i]); + } + if (object.runTime != null) { + if (typeof object.runTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ContinuousTestResult.runTime: object expected"); + message.runTime = $root.google.protobuf.Timestamp.fromObject(object.runTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousTestResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ContinuousTestResult} message ContinuousTestResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousTestResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCaseResults = []; + if (options.defaults) { + object.name = ""; + object.result = options.enums === String ? "AGGREGATED_TEST_RESULT_UNSPECIFIED" : 0; + object.runTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult[message.result] === undefined ? message.result : $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult[message.result] : message.result; + if (message.testCaseResults && message.testCaseResults.length) { + object.testCaseResults = []; + for (var j = 0; j < message.testCaseResults.length; ++j) + object.testCaseResults[j] = message.testCaseResults[j]; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) + object.runTime = $root.google.protobuf.Timestamp.toObject(message.runTime, options); + return object; + }; + + /** + * Converts this ContinuousTestResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + * @returns {Object.} JSON object + */ + ContinuousTestResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousTestResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousTestResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ContinuousTestResult"; + }; + + /** + * AggregatedTestResult enum. + * @name google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult + * @enum {number} + * @property {number} AGGREGATED_TEST_RESULT_UNSPECIFIED=0 AGGREGATED_TEST_RESULT_UNSPECIFIED value + * @property {number} PASSED=1 PASSED value + * @property {number} FAILED=2 FAILED value + */ + ContinuousTestResult.AggregatedTestResult = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGGREGATED_TEST_RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PASSED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + return ContinuousTestResult; + })(); + + v3.RunContinuousTestRequest = (function() { + + /** + * Properties of a RunContinuousTestRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunContinuousTestRequest + * @property {string|null} [environment] RunContinuousTestRequest environment + */ + + /** + * Constructs a new RunContinuousTestRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunContinuousTestRequest. + * @implements IRunContinuousTestRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest=} [properties] Properties to set + */ + function RunContinuousTestRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunContinuousTestRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @instance + */ + RunContinuousTestRequest.prototype.environment = ""; + + /** + * Creates a new RunContinuousTestRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} RunContinuousTestRequest instance + */ + RunContinuousTestRequest.create = function create(properties) { + return new RunContinuousTestRequest(properties); + }; + + /** + * Encodes the specified RunContinuousTestRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} message RunContinuousTestRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} message RunContinuousTestRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} RunContinuousTestRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} RunContinuousTestRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + return null; + }; + + /** + * Creates a RunContinuousTestRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} RunContinuousTestRequest + */ + RunContinuousTestRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest(); + if (object.environment != null) + message.environment = String(object.environment); + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} message RunContinuousTestRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.environment = ""; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + return object; + }; + + /** + * Converts this RunContinuousTestRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunContinuousTestRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunContinuousTestRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RunContinuousTestRequest"; + }; + + return RunContinuousTestRequest; + })(); + + v3.RunContinuousTestResponse = (function() { + + /** + * Properties of a RunContinuousTestResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunContinuousTestResponse + * @property {google.cloud.dialogflow.cx.v3.IContinuousTestResult|null} [continuousTestResult] RunContinuousTestResponse continuousTestResult + */ + + /** + * Constructs a new RunContinuousTestResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunContinuousTestResponse. + * @implements IRunContinuousTestResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse=} [properties] Properties to set + */ + function RunContinuousTestResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunContinuousTestResponse continuousTestResult. + * @member {google.cloud.dialogflow.cx.v3.IContinuousTestResult|null|undefined} continuousTestResult + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @instance + */ + RunContinuousTestResponse.prototype.continuousTestResult = null; + + /** + * Creates a new RunContinuousTestResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} RunContinuousTestResponse instance + */ + RunContinuousTestResponse.create = function create(properties) { + return new RunContinuousTestResponse(properties); + }; + + /** + * Encodes the specified RunContinuousTestResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse} message RunContinuousTestResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuousTestResult != null && Object.hasOwnProperty.call(message, "continuousTestResult")) + $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.encode(message.continuousTestResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse} message RunContinuousTestResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} RunContinuousTestResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.continuousTestResult = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} RunContinuousTestResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.continuousTestResult != null && message.hasOwnProperty("continuousTestResult")) { + var error = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify(message.continuousTestResult, long + 1); + if (error) + return "continuousTestResult." + error; + } + return null; + }; + + /** + * Creates a RunContinuousTestResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} RunContinuousTestResponse + */ + RunContinuousTestResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse(); + if (object.continuousTestResult != null) { + if (typeof object.continuousTestResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.continuousTestResult: object expected"); + message.continuousTestResult = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.fromObject(object.continuousTestResult, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} message RunContinuousTestResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.continuousTestResult = null; + if (message.continuousTestResult != null && message.hasOwnProperty("continuousTestResult")) + object.continuousTestResult = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.toObject(message.continuousTestResult, options); + return object; + }; + + /** + * Converts this RunContinuousTestResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunContinuousTestResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunContinuousTestResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RunContinuousTestResponse"; + }; + + return RunContinuousTestResponse; + })(); + + v3.RunContinuousTestMetadata = (function() { + + /** + * Properties of a RunContinuousTestMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunContinuousTestMetadata + * @property {Array.|null} [errors] RunContinuousTestMetadata errors + */ + + /** + * Constructs a new RunContinuousTestMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunContinuousTestMetadata. + * @implements IRunContinuousTestMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata=} [properties] Properties to set + */ + function RunContinuousTestMetadata(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunContinuousTestMetadata errors. + * @member {Array.} errors + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @instance + */ + RunContinuousTestMetadata.prototype.errors = $util.emptyArray; + + /** + * Creates a new RunContinuousTestMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} RunContinuousTestMetadata instance + */ + RunContinuousTestMetadata.create = function create(properties) { + return new RunContinuousTestMetadata(properties); + }; + + /** + * Encodes the specified RunContinuousTestMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata} message RunContinuousTestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata} message RunContinuousTestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} RunContinuousTestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.dialogflow.cx.v3.TestError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} RunContinuousTestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestError.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a RunContinuousTestMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} RunContinuousTestMetadata + */ + RunContinuousTestMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.errors: object expected"); + message.errors[i] = $root.google.cloud.dialogflow.cx.v3.TestError.fromObject(object.errors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} message RunContinuousTestMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.dialogflow.cx.v3.TestError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this RunContinuousTestMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunContinuousTestMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunContinuousTestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata"; + }; + + return RunContinuousTestMetadata; + })(); + + v3.ListContinuousTestResultsRequest = (function() { + + /** + * Properties of a ListContinuousTestResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListContinuousTestResultsRequest + * @property {string|null} [parent] ListContinuousTestResultsRequest parent + * @property {number|null} [pageSize] ListContinuousTestResultsRequest pageSize + * @property {string|null} [pageToken] ListContinuousTestResultsRequest pageToken + */ + + /** + * Constructs a new ListContinuousTestResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListContinuousTestResultsRequest. + * @implements IListContinuousTestResultsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest=} [properties] Properties to set + */ + function ListContinuousTestResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContinuousTestResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.parent = ""; + + /** + * ListContinuousTestResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.pageSize = 0; + + /** + * ListContinuousTestResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListContinuousTestResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest instance + */ + ListContinuousTestResultsRequest.create = function create(properties) { + return new ListContinuousTestResultsRequest(properties); + }; + + /** + * Encodes the specified ListContinuousTestResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} message ListContinuousTestResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListContinuousTestResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} message ListContinuousTestResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContinuousTestResultsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContinuousTestResultsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListContinuousTestResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + */ + ListContinuousTestResultsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListContinuousTestResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} message ListContinuousTestResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContinuousTestResultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListContinuousTestResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListContinuousTestResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListContinuousTestResultsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContinuousTestResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest"; + }; + + return ListContinuousTestResultsRequest; + })(); + + v3.ListContinuousTestResultsResponse = (function() { + + /** + * Properties of a ListContinuousTestResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListContinuousTestResultsResponse + * @property {Array.|null} [continuousTestResults] ListContinuousTestResultsResponse continuousTestResults + * @property {string|null} [nextPageToken] ListContinuousTestResultsResponse nextPageToken + */ + + /** + * Constructs a new ListContinuousTestResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListContinuousTestResultsResponse. + * @implements IListContinuousTestResultsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse=} [properties] Properties to set + */ + function ListContinuousTestResultsResponse(properties) { + this.continuousTestResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContinuousTestResultsResponse continuousTestResults. + * @member {Array.} continuousTestResults + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @instance + */ + ListContinuousTestResultsResponse.prototype.continuousTestResults = $util.emptyArray; + + /** + * ListContinuousTestResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @instance + */ + ListContinuousTestResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListContinuousTestResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse instance + */ + ListContinuousTestResultsResponse.create = function create(properties) { + return new ListContinuousTestResultsResponse(properties); + }; + + /** + * Encodes the specified ListContinuousTestResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse} message ListContinuousTestResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuousTestResults != null && message.continuousTestResults.length) + for (var i = 0; i < message.continuousTestResults.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.encode(message.continuousTestResults[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 ListContinuousTestResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse} message ListContinuousTestResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.continuousTestResults && message.continuousTestResults.length)) + message.continuousTestResults = []; + message.continuousTestResults.push($root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContinuousTestResultsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContinuousTestResultsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.continuousTestResults != null && message.hasOwnProperty("continuousTestResults")) { + if (!Array.isArray(message.continuousTestResults)) + return "continuousTestResults: array expected"; + for (var i = 0; i < message.continuousTestResults.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify(message.continuousTestResults[i], long + 1); + if (error) + return "continuousTestResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListContinuousTestResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + */ + ListContinuousTestResultsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse(); + if (object.continuousTestResults) { + if (!Array.isArray(object.continuousTestResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.continuousTestResults: array expected"); + message.continuousTestResults = []; + for (var i = 0; i < object.continuousTestResults.length; ++i) { + if (typeof object.continuousTestResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.continuousTestResults: object expected"); + message.continuousTestResults[i] = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.fromObject(object.continuousTestResults[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListContinuousTestResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} message ListContinuousTestResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContinuousTestResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.continuousTestResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.continuousTestResults && message.continuousTestResults.length) { + object.continuousTestResults = []; + for (var j = 0; j < message.continuousTestResults.length; ++j) + object.continuousTestResults[j] = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.toObject(message.continuousTestResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListContinuousTestResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListContinuousTestResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListContinuousTestResultsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContinuousTestResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse"; + }; + + return ListContinuousTestResultsResponse; + })(); + + v3.DeployFlowRequest = (function() { + + /** + * Properties of a DeployFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeployFlowRequest + * @property {string|null} [environment] DeployFlowRequest environment + * @property {string|null} [flowVersion] DeployFlowRequest flowVersion + */ + + /** + * Constructs a new DeployFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeployFlowRequest. + * @implements IDeployFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowRequest=} [properties] Properties to set + */ + function DeployFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployFlowRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @instance + */ + DeployFlowRequest.prototype.environment = ""; + + /** + * DeployFlowRequest flowVersion. + * @member {string} flowVersion + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @instance + */ + DeployFlowRequest.prototype.flowVersion = ""; + + /** + * Creates a new DeployFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowRequest} DeployFlowRequest instance + */ + DeployFlowRequest.create = function create(properties) { + return new DeployFlowRequest(properties); + }; + + /** + * Encodes the specified DeployFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowRequest} message DeployFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.flowVersion != null && Object.hasOwnProperty.call(message, "flowVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowVersion); + return writer; + }; + + /** + * Encodes the specified DeployFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowRequest} message DeployFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowRequest} DeployFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeployFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.flowVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowRequest} DeployFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + if (!$util.isString(message.flowVersion)) + return "flowVersion: string expected"; + return null; + }; + + /** + * Creates a DeployFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowRequest} DeployFlowRequest + */ + DeployFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeployFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeployFlowRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.flowVersion != null) + message.flowVersion = String(object.flowVersion); + return message; + }; + + /** + * Creates a plain object from a DeployFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeployFlowRequest} message DeployFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.flowVersion = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + object.flowVersion = message.flowVersion; + return object; + }; + + /** + * Converts this DeployFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @instance + * @returns {Object.} JSON object + */ + DeployFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeployFlowRequest"; + }; + + return DeployFlowRequest; + })(); + + v3.DeployFlowResponse = (function() { + + /** + * Properties of a DeployFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeployFlowResponse + * @property {google.cloud.dialogflow.cx.v3.IEnvironment|null} [environment] DeployFlowResponse environment + * @property {string|null} [deployment] DeployFlowResponse deployment + */ + + /** + * Constructs a new DeployFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeployFlowResponse. + * @implements IDeployFlowResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowResponse=} [properties] Properties to set + */ + function DeployFlowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployFlowResponse environment. + * @member {google.cloud.dialogflow.cx.v3.IEnvironment|null|undefined} environment + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @instance + */ + DeployFlowResponse.prototype.environment = null; + + /** + * DeployFlowResponse deployment. + * @member {string} deployment + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @instance + */ + DeployFlowResponse.prototype.deployment = ""; + + /** + * Creates a new DeployFlowResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowResponse} DeployFlowResponse instance + */ + DeployFlowResponse.create = function create(properties) { + return new DeployFlowResponse(properties); + }; + + /** + * Encodes the specified DeployFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowResponse} message DeployFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dialogflow.cx.v3.Environment.encode(message.environment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); + return writer; + }; + + /** + * Encodes the specified DeployFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowResponse} message DeployFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowResponse} DeployFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeployFlowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = $root.google.cloud.dialogflow.cx.v3.Environment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.deployment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowResponse} DeployFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployFlowResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployFlowResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Environment.verify(message.environment, long + 1); + if (error) + return "environment." + error; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + return null; + }; + + /** + * Creates a DeployFlowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowResponse} DeployFlowResponse + */ + DeployFlowResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeployFlowResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeployFlowResponse(); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DeployFlowResponse.environment: object expected"); + message.environment = $root.google.cloud.dialogflow.cx.v3.Environment.fromObject(object.environment, long + 1); + } + if (object.deployment != null) + message.deployment = String(object.deployment); + return message; + }; + + /** + * Creates a plain object from a DeployFlowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.DeployFlowResponse} message DeployFlowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployFlowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = null; + object.deployment = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dialogflow.cx.v3.Environment.toObject(message.environment, options); + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + return object; + }; + + /** + * Converts this DeployFlowResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @instance + * @returns {Object.} JSON object + */ + DeployFlowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployFlowResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployFlowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeployFlowResponse"; + }; + + return DeployFlowResponse; + })(); + + v3.DeployFlowMetadata = (function() { + + /** + * Properties of a DeployFlowMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeployFlowMetadata + * @property {Array.|null} [testErrors] DeployFlowMetadata testErrors + */ + + /** + * Constructs a new DeployFlowMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeployFlowMetadata. + * @implements IDeployFlowMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowMetadata=} [properties] Properties to set + */ + function DeployFlowMetadata(properties) { + this.testErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployFlowMetadata testErrors. + * @member {Array.} testErrors + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @instance + */ + DeployFlowMetadata.prototype.testErrors = $util.emptyArray; + + /** + * Creates a new DeployFlowMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowMetadata} DeployFlowMetadata instance + */ + DeployFlowMetadata.create = function create(properties) { + return new DeployFlowMetadata(properties); + }; + + /** + * Encodes the specified DeployFlowMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowMetadata} message DeployFlowMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testErrors != null && message.testErrors.length) + for (var i = 0; i < message.testErrors.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestError.encode(message.testErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployFlowMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeployFlowMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeployFlowMetadata} message DeployFlowMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowMetadata} DeployFlowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeployFlowMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testErrors && message.testErrors.length)) + message.testErrors = []; + message.testErrors.push($root.google.cloud.dialogflow.cx.v3.TestError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowMetadata} DeployFlowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployFlowMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployFlowMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testErrors != null && message.hasOwnProperty("testErrors")) { + if (!Array.isArray(message.testErrors)) + return "testErrors: array expected"; + for (var i = 0; i < message.testErrors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestError.verify(message.testErrors[i], long + 1); + if (error) + return "testErrors." + error; + } + } + return null; + }; + + /** + * Creates a DeployFlowMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeployFlowMetadata} DeployFlowMetadata + */ + DeployFlowMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeployFlowMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeployFlowMetadata(); + if (object.testErrors) { + if (!Array.isArray(object.testErrors)) + throw TypeError(".google.cloud.dialogflow.cx.v3.DeployFlowMetadata.testErrors: array expected"); + message.testErrors = []; + for (var i = 0; i < object.testErrors.length; ++i) { + if (typeof object.testErrors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DeployFlowMetadata.testErrors: object expected"); + message.testErrors[i] = $root.google.cloud.dialogflow.cx.v3.TestError.fromObject(object.testErrors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a DeployFlowMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.DeployFlowMetadata} message DeployFlowMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployFlowMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testErrors = []; + if (message.testErrors && message.testErrors.length) { + object.testErrors = []; + for (var j = 0; j < message.testErrors.length; ++j) + object.testErrors[j] = $root.google.cloud.dialogflow.cx.v3.TestError.toObject(message.testErrors[j], options); + } + return object; + }; + + /** + * Converts this DeployFlowMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployFlowMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployFlowMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeployFlowMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployFlowMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeployFlowMetadata"; + }; + + return DeployFlowMetadata; + })(); + + v3.TestCases = (function() { + + /** + * Constructs a new TestCases service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TestCases + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TestCases(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TestCases.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TestCases; + + /** + * Creates new TestCases service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TestCases} RPC service. Useful where requests and/or responses are streamed. + */ + TestCases.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|listTestCases}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef ListTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListTestCasesResponse} [response] ListTestCasesResponse + */ + + /** + * Calls ListTestCases. + * @function listTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesRequest} request ListTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.ListTestCasesCallback} callback Node-style callback called with the error, if any, and ListTestCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.listTestCases = function listTestCases(request, callback) { + return this.rpcCall(listTestCases, $root.google.cloud.dialogflow.cx.v3.ListTestCasesRequest, $root.google.cloud.dialogflow.cx.v3.ListTestCasesResponse, request, callback); + }, "name", { value: "ListTestCases" }); + + /** + * Calls ListTestCases. + * @function listTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesRequest} request ListTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|batchDeleteTestCases}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef BatchDeleteTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls BatchDeleteTestCases. + * @function batchDeleteTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest} request BatchDeleteTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCasesCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.batchDeleteTestCases = function batchDeleteTestCases(request, callback) { + return this.rpcCall(batchDeleteTestCases, $root.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "BatchDeleteTestCases" }); + + /** + * Calls BatchDeleteTestCases. + * @function batchDeleteTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest} request BatchDeleteTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|getTestCase}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef GetTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.TestCase} [response] TestCase + */ + + /** + * Calls GetTestCase. + * @function getTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseRequest} request GetTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseCallback} callback Node-style callback called with the error, if any, and TestCase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.getTestCase = function getTestCase(request, callback) { + return this.rpcCall(getTestCase, $root.google.cloud.dialogflow.cx.v3.GetTestCaseRequest, $root.google.cloud.dialogflow.cx.v3.TestCase, request, callback); + }, "name", { value: "GetTestCase" }); + + /** + * Calls GetTestCase. + * @function getTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseRequest} request GetTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|createTestCase}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef CreateTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.TestCase} [response] TestCase + */ + + /** + * Calls CreateTestCase. + * @function createTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest} request CreateTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.CreateTestCaseCallback} callback Node-style callback called with the error, if any, and TestCase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.createTestCase = function createTestCase(request, callback) { + return this.rpcCall(createTestCase, $root.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest, $root.google.cloud.dialogflow.cx.v3.TestCase, request, callback); + }, "name", { value: "CreateTestCase" }); + + /** + * Calls CreateTestCase. + * @function createTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest} request CreateTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|updateTestCase}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef UpdateTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.TestCase} [response] TestCase + */ + + /** + * Calls UpdateTestCase. + * @function updateTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest} request UpdateTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCaseCallback} callback Node-style callback called with the error, if any, and TestCase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.updateTestCase = function updateTestCase(request, callback) { + return this.rpcCall(updateTestCase, $root.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest, $root.google.cloud.dialogflow.cx.v3.TestCase, request, callback); + }, "name", { value: "UpdateTestCase" }); + + /** + * Calls UpdateTestCase. + * @function updateTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest} request UpdateTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|runTestCase}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef RunTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunTestCase. + * @function runTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseRequest} request RunTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.RunTestCaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.runTestCase = function runTestCase(request, callback) { + return this.rpcCall(runTestCase, $root.google.cloud.dialogflow.cx.v3.RunTestCaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunTestCase" }); + + /** + * Calls RunTestCase. + * @function runTestCase + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseRequest} request RunTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|batchRunTestCases}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef BatchRunTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchRunTestCases. + * @function batchRunTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest} request BatchRunTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCasesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.batchRunTestCases = function batchRunTestCases(request, callback) { + return this.rpcCall(batchRunTestCases, $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchRunTestCases" }); + + /** + * Calls BatchRunTestCases. + * @function batchRunTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest} request BatchRunTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|calculateCoverage}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef CalculateCoverageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.CalculateCoverageResponse} [response] CalculateCoverageResponse + */ + + /** + * Calls CalculateCoverage. + * @function calculateCoverage + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest} request CalculateCoverageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverageCallback} callback Node-style callback called with the error, if any, and CalculateCoverageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.calculateCoverage = function calculateCoverage(request, callback) { + return this.rpcCall(calculateCoverage, $root.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest, $root.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse, request, callback); + }, "name", { value: "CalculateCoverage" }); + + /** + * Calls CalculateCoverage. + * @function calculateCoverage + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest} request CalculateCoverageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|importTestCases}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef ImportTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportTestCases. + * @function importTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesRequest} request ImportTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.ImportTestCasesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.importTestCases = function importTestCases(request, callback) { + return this.rpcCall(importTestCases, $root.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportTestCases" }); + + /** + * Calls ImportTestCases. + * @function importTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesRequest} request ImportTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|exportTestCases}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef ExportTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportTestCases. + * @function exportTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesRequest} request ExportTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.ExportTestCasesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.exportTestCases = function exportTestCases(request, callback) { + return this.rpcCall(exportTestCases, $root.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportTestCases" }); + + /** + * Calls ExportTestCases. + * @function exportTestCases + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesRequest} request ExportTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|listTestCaseResults}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef ListTestCaseResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse} [response] ListTestCaseResultsResponse + */ + + /** + * Calls ListTestCaseResults. + * @function listTestCaseResults + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest} request ListTestCaseResultsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResultsCallback} callback Node-style callback called with the error, if any, and ListTestCaseResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.listTestCaseResults = function listTestCaseResults(request, callback) { + return this.rpcCall(listTestCaseResults, $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest, $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse, request, callback); + }, "name", { value: "ListTestCaseResults" }); + + /** + * Calls ListTestCaseResults. + * @function listTestCaseResults + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest} request ListTestCaseResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TestCases|getTestCaseResult}. + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @typedef GetTestCaseResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.TestCaseResult} [response] TestCaseResult + */ + + /** + * Calls GetTestCaseResult. + * @function getTestCaseResult + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest} request GetTestCaseResultRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResultCallback} callback Node-style callback called with the error, if any, and TestCaseResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.getTestCaseResult = function getTestCaseResult(request, callback) { + return this.rpcCall(getTestCaseResult, $root.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest, $root.google.cloud.dialogflow.cx.v3.TestCaseResult, request, callback); + }, "name", { value: "GetTestCaseResult" }); + + /** + * Calls GetTestCaseResult. + * @function getTestCaseResult + * @memberof google.cloud.dialogflow.cx.v3.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest} request GetTestCaseResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TestCases; + })(); + + v3.TestCase = (function() { + + /** + * Properties of a TestCase. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITestCase + * @property {string|null} [name] TestCase name + * @property {Array.|null} [tags] TestCase tags + * @property {string|null} [displayName] TestCase displayName + * @property {string|null} [notes] TestCase notes + * @property {google.cloud.dialogflow.cx.v3.ITestConfig|null} [testConfig] TestCase testConfig + * @property {Array.|null} [testCaseConversationTurns] TestCase testCaseConversationTurns + * @property {google.protobuf.ITimestamp|null} [creationTime] TestCase creationTime + * @property {google.cloud.dialogflow.cx.v3.ITestCaseResult|null} [lastTestResult] TestCase lastTestResult + */ + + /** + * Constructs a new TestCase. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TestCase. + * @implements ITestCase + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITestCase=} [properties] Properties to set + */ + function TestCase(properties) { + this.tags = []; + this.testCaseConversationTurns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCase name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.name = ""; + + /** + * TestCase tags. + * @member {Array.} tags + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.tags = $util.emptyArray; + + /** + * TestCase displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.displayName = ""; + + /** + * TestCase notes. + * @member {string} notes + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.notes = ""; + + /** + * TestCase testConfig. + * @member {google.cloud.dialogflow.cx.v3.ITestConfig|null|undefined} testConfig + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.testConfig = null; + + /** + * TestCase testCaseConversationTurns. + * @member {Array.} testCaseConversationTurns + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.testCaseConversationTurns = $util.emptyArray; + + /** + * TestCase creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.creationTime = null; + + /** + * TestCase lastTestResult. + * @member {google.cloud.dialogflow.cx.v3.ITestCaseResult|null|undefined} lastTestResult + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + */ + TestCase.prototype.lastTestResult = null; + + /** + * Creates a new TestCase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TestCase} TestCase instance + */ + TestCase.create = function create(properties) { + return new TestCase(properties); + }; + + /** + * Encodes the specified TestCase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCase} message TestCase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCase.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.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tags[i]); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.notes != null && Object.hasOwnProperty.call(message, "notes")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.notes); + if (message.testCaseConversationTurns != null && message.testCaseConversationTurns.length) + for (var i = 0; i < message.testCaseConversationTurns.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ConversationTurn.encode(message.testCaseConversationTurns[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.lastTestResult != null && Object.hasOwnProperty.call(message, "lastTestResult")) + $root.google.cloud.dialogflow.cx.v3.TestCaseResult.encode(message.lastTestResult, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.testConfig != null && Object.hasOwnProperty.call(message, "testConfig")) + $root.google.cloud.dialogflow.cx.v3.TestConfig.encode(message.testConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestCase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCase} message TestCase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TestCase} TestCase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TestCase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.notes = reader.string(); + break; + } + case 13: { + message.testConfig = $root.google.cloud.dialogflow.cx.v3.TestConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.testCaseConversationTurns && message.testCaseConversationTurns.length)) + message.testCaseConversationTurns = []; + message.testCaseConversationTurns.push($root.google.cloud.dialogflow.cx.v3.ConversationTurn.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.lastTestResult = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TestCase} TestCase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.notes != null && message.hasOwnProperty("notes")) + if (!$util.isString(message.notes)) + return "notes: string expected"; + if (message.testConfig != null && message.hasOwnProperty("testConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.TestConfig.verify(message.testConfig, long + 1); + if (error) + return "testConfig." + error; + } + if (message.testCaseConversationTurns != null && message.hasOwnProperty("testCaseConversationTurns")) { + if (!Array.isArray(message.testCaseConversationTurns)) + return "testCaseConversationTurns: array expected"; + for (var i = 0; i < message.testCaseConversationTurns.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.verify(message.testCaseConversationTurns[i], long + 1); + if (error) + return "testCaseConversationTurns." + error; + } + } + if (message.creationTime != null && message.hasOwnProperty("creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime, long + 1); + if (error) + return "creationTime." + error; + } + if (message.lastTestResult != null && message.hasOwnProperty("lastTestResult")) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.verify(message.lastTestResult, long + 1); + if (error) + return "lastTestResult." + error; + } + return null; + }; + + /** + * Creates a TestCase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TestCase} TestCase + */ + TestCase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TestCase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TestCase(); + if (object.name != null) + message.name = String(object.name); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCase.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.notes != null) + message.notes = String(object.notes); + if (object.testConfig != null) { + if (typeof object.testConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCase.testConfig: object expected"); + message.testConfig = $root.google.cloud.dialogflow.cx.v3.TestConfig.fromObject(object.testConfig, long + 1); + } + if (object.testCaseConversationTurns) { + if (!Array.isArray(object.testCaseConversationTurns)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCase.testCaseConversationTurns: array expected"); + message.testCaseConversationTurns = []; + for (var i = 0; i < object.testCaseConversationTurns.length; ++i) { + if (typeof object.testCaseConversationTurns[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCase.testCaseConversationTurns: object expected"); + message.testCaseConversationTurns[i] = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.fromObject(object.testCaseConversationTurns[i], long + 1); + } + } + if (object.creationTime != null) { + if (typeof object.creationTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCase.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime, long + 1); + } + if (object.lastTestResult != null) { + if (typeof object.lastTestResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCase.lastTestResult: object expected"); + message.lastTestResult = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.fromObject(object.lastTestResult, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestCase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3.TestCase} message TestCase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tags = []; + object.testCaseConversationTurns = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.notes = ""; + object.creationTime = null; + object.lastTestResult = null; + object.testConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.notes != null && message.hasOwnProperty("notes")) + object.notes = message.notes; + if (message.testCaseConversationTurns && message.testCaseConversationTurns.length) { + object.testCaseConversationTurns = []; + for (var j = 0; j < message.testCaseConversationTurns.length; ++j) + object.testCaseConversationTurns[j] = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.toObject(message.testCaseConversationTurns[j], options); + } + if (message.creationTime != null && message.hasOwnProperty("creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); + if (message.lastTestResult != null && message.hasOwnProperty("lastTestResult")) + object.lastTestResult = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.toObject(message.lastTestResult, options); + if (message.testConfig != null && message.hasOwnProperty("testConfig")) + object.testConfig = $root.google.cloud.dialogflow.cx.v3.TestConfig.toObject(message.testConfig, options); + return object; + }; + + /** + * Converts this TestCase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @instance + * @returns {Object.} JSON object + */ + TestCase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TestCase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TestCase"; + }; + + return TestCase; + })(); + + v3.TestCaseResult = (function() { + + /** + * Properties of a TestCaseResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITestCaseResult + * @property {string|null} [name] TestCaseResult name + * @property {string|null} [environment] TestCaseResult environment + * @property {Array.|null} [conversationTurns] TestCaseResult conversationTurns + * @property {google.cloud.dialogflow.cx.v3.TestResult|null} [testResult] TestCaseResult testResult + * @property {google.protobuf.ITimestamp|null} [testTime] TestCaseResult testTime + */ + + /** + * Constructs a new TestCaseResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TestCaseResult. + * @implements ITestCaseResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITestCaseResult=} [properties] Properties to set + */ + function TestCaseResult(properties) { + this.conversationTurns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCaseResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @instance + */ + TestCaseResult.prototype.name = ""; + + /** + * TestCaseResult environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @instance + */ + TestCaseResult.prototype.environment = ""; + + /** + * TestCaseResult conversationTurns. + * @member {Array.} conversationTurns + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @instance + */ + TestCaseResult.prototype.conversationTurns = $util.emptyArray; + + /** + * TestCaseResult testResult. + * @member {google.cloud.dialogflow.cx.v3.TestResult} testResult + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @instance + */ + TestCaseResult.prototype.testResult = 0; + + /** + * TestCaseResult testTime. + * @member {google.protobuf.ITimestamp|null|undefined} testTime + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @instance + */ + TestCaseResult.prototype.testTime = null; + + /** + * Creates a new TestCaseResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCaseResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TestCaseResult} TestCaseResult instance + */ + TestCaseResult.create = function create(properties) { + return new TestCaseResult(properties); + }; + + /** + * Encodes the specified TestCaseResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCaseResult} message TestCaseResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseResult.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + if (message.conversationTurns != null && message.conversationTurns.length) + for (var i = 0; i < message.conversationTurns.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ConversationTurn.encode(message.conversationTurns[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.testResult != null && Object.hasOwnProperty.call(message, "testResult")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.testResult); + if (message.testTime != null && Object.hasOwnProperty.call(message, "testTime")) + $root.google.protobuf.Timestamp.encode(message.testTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestCaseResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCaseResult} message TestCaseResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TestCaseResult} TestCaseResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TestCaseResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.environment = reader.string(); + break; + } + case 3: { + if (!(message.conversationTurns && message.conversationTurns.length)) + message.conversationTurns = []; + message.conversationTurns.push($root.google.cloud.dialogflow.cx.v3.ConversationTurn.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.testResult = reader.int32(); + break; + } + case 5: { + message.testTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TestCaseResult} TestCaseResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCaseResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCaseResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.conversationTurns != null && message.hasOwnProperty("conversationTurns")) { + if (!Array.isArray(message.conversationTurns)) + return "conversationTurns: array expected"; + for (var i = 0; i < message.conversationTurns.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.verify(message.conversationTurns[i], long + 1); + if (error) + return "conversationTurns." + error; + } + } + if (message.testResult != null && message.hasOwnProperty("testResult")) + switch (message.testResult) { + default: + return "testResult: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.testTime != null && message.hasOwnProperty("testTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.testTime, long + 1); + if (error) + return "testTime." + error; + } + return null; + }; + + /** + * Creates a TestCaseResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TestCaseResult} TestCaseResult + */ + TestCaseResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TestCaseResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TestCaseResult(); + if (object.name != null) + message.name = String(object.name); + if (object.environment != null) + message.environment = String(object.environment); + if (object.conversationTurns) { + if (!Array.isArray(object.conversationTurns)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCaseResult.conversationTurns: array expected"); + message.conversationTurns = []; + for (var i = 0; i < object.conversationTurns.length; ++i) { + if (typeof object.conversationTurns[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCaseResult.conversationTurns: object expected"); + message.conversationTurns[i] = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.fromObject(object.conversationTurns[i], long + 1); + } + } + switch (object.testResult) { + default: + if (typeof object.testResult === "number") { + message.testResult = object.testResult; + break; + } + break; + case "TEST_RESULT_UNSPECIFIED": + case 0: + message.testResult = 0; + break; + case "PASSED": + case 1: + message.testResult = 1; + break; + case "FAILED": + case 2: + message.testResult = 2; + break; + } + if (object.testTime != null) { + if (typeof object.testTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCaseResult.testTime: object expected"); + message.testTime = $root.google.protobuf.Timestamp.fromObject(object.testTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestCaseResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3.TestCaseResult} message TestCaseResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCaseResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversationTurns = []; + if (options.defaults) { + object.name = ""; + object.environment = ""; + object.testResult = options.enums === String ? "TEST_RESULT_UNSPECIFIED" : 0; + object.testTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.conversationTurns && message.conversationTurns.length) { + object.conversationTurns = []; + for (var j = 0; j < message.conversationTurns.length; ++j) + object.conversationTurns[j] = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.toObject(message.conversationTurns[j], options); + } + if (message.testResult != null && message.hasOwnProperty("testResult")) + object.testResult = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.TestResult[message.testResult] === undefined ? message.testResult : $root.google.cloud.dialogflow.cx.v3.TestResult[message.testResult] : message.testResult; + if (message.testTime != null && message.hasOwnProperty("testTime")) + object.testTime = $root.google.protobuf.Timestamp.toObject(message.testTime, options); + return object; + }; + + /** + * Converts this TestCaseResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @instance + * @returns {Object.} JSON object + */ + TestCaseResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCaseResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TestCaseResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCaseResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TestCaseResult"; + }; + + return TestCaseResult; + })(); + + v3.TestConfig = (function() { + + /** + * Properties of a TestConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITestConfig + * @property {Array.|null} [trackingParameters] TestConfig trackingParameters + * @property {string|null} [flow] TestConfig flow + * @property {string|null} [page] TestConfig page + */ + + /** + * Constructs a new TestConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TestConfig. + * @implements ITestConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITestConfig=} [properties] Properties to set + */ + function TestConfig(properties) { + this.trackingParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestConfig trackingParameters. + * @member {Array.} trackingParameters + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @instance + */ + TestConfig.prototype.trackingParameters = $util.emptyArray; + + /** + * TestConfig flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @instance + */ + TestConfig.prototype.flow = ""; + + /** + * TestConfig page. + * @member {string} page + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @instance + */ + TestConfig.prototype.page = ""; + + /** + * Creates a new TestConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TestConfig} TestConfig instance + */ + TestConfig.create = function create(properties) { + return new TestConfig(properties); + }; + + /** + * Encodes the specified TestConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestConfig} message TestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackingParameters != null && message.trackingParameters.length) + for (var i = 0; i < message.trackingParameters.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackingParameters[i]); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flow); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.page); + return writer; + }; + + /** + * Encodes the specified TestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestConfig} message TestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TestConfig} TestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TestConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.trackingParameters && message.trackingParameters.length)) + message.trackingParameters = []; + message.trackingParameters.push(reader.string()); + break; + } + case 2: { + message.flow = reader.string(); + break; + } + case 3: { + message.page = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TestConfig} TestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackingParameters != null && message.hasOwnProperty("trackingParameters")) { + if (!Array.isArray(message.trackingParameters)) + return "trackingParameters: array expected"; + for (var i = 0; i < message.trackingParameters.length; ++i) + if (!$util.isString(message.trackingParameters[i])) + return "trackingParameters: string[] expected"; + } + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.page != null && message.hasOwnProperty("page")) + if (!$util.isString(message.page)) + return "page: string expected"; + return null; + }; + + /** + * Creates a TestConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TestConfig} TestConfig + */ + TestConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TestConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TestConfig(); + if (object.trackingParameters) { + if (!Array.isArray(object.trackingParameters)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TestConfig.trackingParameters: array expected"); + message.trackingParameters = []; + for (var i = 0; i < object.trackingParameters.length; ++i) + message.trackingParameters[i] = String(object.trackingParameters[i]); + } + if (object.flow != null) + message.flow = String(object.flow); + if (object.page != null) + message.page = String(object.page); + return message; + }; + + /** + * Creates a plain object from a TestConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.TestConfig} message TestConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.trackingParameters = []; + if (options.defaults) { + object.flow = ""; + object.page = ""; + } + if (message.trackingParameters && message.trackingParameters.length) { + object.trackingParameters = []; + for (var j = 0; j < message.trackingParameters.length; ++j) + object.trackingParameters[j] = message.trackingParameters[j]; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.page != null && message.hasOwnProperty("page")) + object.page = message.page; + return object; + }; + + /** + * Converts this TestConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @instance + * @returns {Object.} JSON object + */ + TestConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TestConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TestConfig"; + }; + + return TestConfig; + })(); + + v3.ConversationTurn = (function() { + + /** + * Properties of a ConversationTurn. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IConversationTurn + * @property {google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput|null} [userInput] ConversationTurn userInput + * @property {google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput|null} [virtualAgentOutput] ConversationTurn virtualAgentOutput + */ + + /** + * Constructs a new ConversationTurn. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ConversationTurn. + * @implements IConversationTurn + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IConversationTurn=} [properties] Properties to set + */ + function ConversationTurn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationTurn userInput. + * @member {google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput|null|undefined} userInput + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @instance + */ + ConversationTurn.prototype.userInput = null; + + /** + * ConversationTurn virtualAgentOutput. + * @member {google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput|null|undefined} virtualAgentOutput + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @instance + */ + ConversationTurn.prototype.virtualAgentOutput = null; + + /** + * Creates a new ConversationTurn instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3.IConversationTurn=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn} ConversationTurn instance + */ + ConversationTurn.create = function create(properties) { + return new ConversationTurn(properties); + }; + + /** + * Encodes the specified ConversationTurn message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3.IConversationTurn} message ConversationTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationTurn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userInput != null && Object.hasOwnProperty.call(message, "userInput")) + $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.encode(message.userInput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.virtualAgentOutput != null && Object.hasOwnProperty.call(message, "virtualAgentOutput")) + $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.encode(message.virtualAgentOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConversationTurn message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3.IConversationTurn} message ConversationTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationTurn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn} ConversationTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationTurn.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ConversationTurn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userInput = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.virtualAgentOutput = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn} ConversationTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationTurn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationTurn message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationTurn.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.userInput != null && message.hasOwnProperty("userInput")) { + var error = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.verify(message.userInput, long + 1); + if (error) + return "userInput." + error; + } + if (message.virtualAgentOutput != null && message.hasOwnProperty("virtualAgentOutput")) { + var error = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.verify(message.virtualAgentOutput, long + 1); + if (error) + return "virtualAgentOutput." + error; + } + return null; + }; + + /** + * Creates a ConversationTurn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn} ConversationTurn + */ + ConversationTurn.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ConversationTurn) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ConversationTurn(); + if (object.userInput != null) { + if (typeof object.userInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.userInput: object expected"); + message.userInput = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.fromObject(object.userInput, long + 1); + } + if (object.virtualAgentOutput != null) { + if (typeof object.virtualAgentOutput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.virtualAgentOutput: object expected"); + message.virtualAgentOutput = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.fromObject(object.virtualAgentOutput, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConversationTurn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn} message ConversationTurn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationTurn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userInput = null; + object.virtualAgentOutput = null; + } + if (message.userInput != null && message.hasOwnProperty("userInput")) + object.userInput = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.toObject(message.userInput, options); + if (message.virtualAgentOutput != null && message.hasOwnProperty("virtualAgentOutput")) + object.virtualAgentOutput = $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.toObject(message.virtualAgentOutput, options); + return object; + }; + + /** + * Converts this ConversationTurn to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @instance + * @returns {Object.} JSON object + */ + ConversationTurn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationTurn + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ConversationTurn"; + }; + + ConversationTurn.UserInput = (function() { + + /** + * Properties of a UserInput. + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @interface IUserInput + * @property {google.cloud.dialogflow.cx.v3.IQueryInput|null} [input] UserInput input + * @property {google.protobuf.IStruct|null} [injectedParameters] UserInput injectedParameters + * @property {boolean|null} [isWebhookEnabled] UserInput isWebhookEnabled + * @property {boolean|null} [enableSentimentAnalysis] UserInput enableSentimentAnalysis + */ + + /** + * Constructs a new UserInput. + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @classdesc Represents a UserInput. + * @implements IUserInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput=} [properties] Properties to set + */ + function UserInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserInput input. + * @member {google.cloud.dialogflow.cx.v3.IQueryInput|null|undefined} input + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.input = null; + + /** + * UserInput injectedParameters. + * @member {google.protobuf.IStruct|null|undefined} injectedParameters + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.injectedParameters = null; + + /** + * UserInput isWebhookEnabled. + * @member {boolean} isWebhookEnabled + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.isWebhookEnabled = false; + + /** + * UserInput enableSentimentAnalysis. + * @member {boolean} enableSentimentAnalysis + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.enableSentimentAnalysis = false; + + /** + * Creates a new UserInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput} UserInput instance + */ + UserInput.create = function create(properties) { + return new UserInput(properties); + }; + + /** + * Encodes the specified UserInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput} message UserInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.injectedParameters != null && Object.hasOwnProperty.call(message, "injectedParameters")) + $root.google.protobuf.Struct.encode(message.injectedParameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.isWebhookEnabled != null && Object.hasOwnProperty.call(message, "isWebhookEnabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isWebhookEnabled); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.cloud.dialogflow.cx.v3.QueryInput.encode(message.input, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.enableSentimentAnalysis != null && Object.hasOwnProperty.call(message, "enableSentimentAnalysis")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableSentimentAnalysis); + return writer; + }; + + /** + * Encodes the specified UserInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IUserInput} message UserInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput} UserInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.input = $root.google.cloud.dialogflow.cx.v3.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.injectedParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.isWebhookEnabled = reader.bool(); + break; + } + case 7: { + message.enableSentimentAnalysis = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UserInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput} UserInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryInput.verify(message.input, long + 1); + if (error) + return "input." + error; + } + if (message.injectedParameters != null && message.hasOwnProperty("injectedParameters")) { + var error = $root.google.protobuf.Struct.verify(message.injectedParameters, long + 1); + if (error) + return "injectedParameters." + error; + } + if (message.isWebhookEnabled != null && message.hasOwnProperty("isWebhookEnabled")) + if (typeof message.isWebhookEnabled !== "boolean") + return "isWebhookEnabled: boolean expected"; + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + if (typeof message.enableSentimentAnalysis !== "boolean") + return "enableSentimentAnalysis: boolean expected"; + return null; + }; + + /** + * Creates a UserInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput} UserInput + */ + UserInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput(); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.input: object expected"); + message.input = $root.google.cloud.dialogflow.cx.v3.QueryInput.fromObject(object.input, long + 1); + } + if (object.injectedParameters != null) { + if (typeof object.injectedParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput.injectedParameters: object expected"); + message.injectedParameters = $root.google.protobuf.Struct.fromObject(object.injectedParameters, long + 1); + } + if (object.isWebhookEnabled != null) + message.isWebhookEnabled = Boolean(object.isWebhookEnabled); + if (object.enableSentimentAnalysis != null) + message.enableSentimentAnalysis = Boolean(object.enableSentimentAnalysis); + return message; + }; + + /** + * Creates a plain object from a UserInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput} message UserInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.injectedParameters = null; + object.isWebhookEnabled = false; + object.input = null; + object.enableSentimentAnalysis = false; + } + if (message.injectedParameters != null && message.hasOwnProperty("injectedParameters")) + object.injectedParameters = $root.google.protobuf.Struct.toObject(message.injectedParameters, options); + if (message.isWebhookEnabled != null && message.hasOwnProperty("isWebhookEnabled")) + object.isWebhookEnabled = message.isWebhookEnabled; + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.cloud.dialogflow.cx.v3.QueryInput.toObject(message.input, options); + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + object.enableSentimentAnalysis = message.enableSentimentAnalysis; + return object; + }; + + /** + * Converts this UserInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @instance + * @returns {Object.} JSON object + */ + UserInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput"; + }; + + return UserInput; + })(); + + ConversationTurn.VirtualAgentOutput = (function() { + + /** + * Properties of a VirtualAgentOutput. + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @interface IVirtualAgentOutput + * @property {google.protobuf.IStruct|null} [sessionParameters] VirtualAgentOutput sessionParameters + * @property {Array.|null} [differences] VirtualAgentOutput differences + * @property {google.protobuf.IStruct|null} [diagnosticInfo] VirtualAgentOutput diagnosticInfo + * @property {google.cloud.dialogflow.cx.v3.IIntent|null} [triggeredIntent] VirtualAgentOutput triggeredIntent + * @property {google.cloud.dialogflow.cx.v3.IPage|null} [currentPage] VirtualAgentOutput currentPage + * @property {Array.|null} [textResponses] VirtualAgentOutput textResponses + * @property {google.rpc.IStatus|null} [status] VirtualAgentOutput status + */ + + /** + * Constructs a new VirtualAgentOutput. + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn + * @classdesc Represents a VirtualAgentOutput. + * @implements IVirtualAgentOutput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput=} [properties] Properties to set + */ + function VirtualAgentOutput(properties) { + this.differences = []; + this.textResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VirtualAgentOutput sessionParameters. + * @member {google.protobuf.IStruct|null|undefined} sessionParameters + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.sessionParameters = null; + + /** + * VirtualAgentOutput differences. + * @member {Array.} differences + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.differences = $util.emptyArray; + + /** + * VirtualAgentOutput diagnosticInfo. + * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.diagnosticInfo = null; + + /** + * VirtualAgentOutput triggeredIntent. + * @member {google.cloud.dialogflow.cx.v3.IIntent|null|undefined} triggeredIntent + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.triggeredIntent = null; + + /** + * VirtualAgentOutput currentPage. + * @member {google.cloud.dialogflow.cx.v3.IPage|null|undefined} currentPage + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.currentPage = null; + + /** + * VirtualAgentOutput textResponses. + * @member {Array.} textResponses + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.textResponses = $util.emptyArray; + + /** + * VirtualAgentOutput status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.status = null; + + /** + * Creates a new VirtualAgentOutput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput instance + */ + VirtualAgentOutput.create = function create(properties) { + return new VirtualAgentOutput(properties); + }; + + /** + * Encodes the specified VirtualAgentOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput} message VirtualAgentOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualAgentOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionParameters != null && Object.hasOwnProperty.call(message, "sessionParameters")) + $root.google.protobuf.Struct.encode(message.sessionParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.differences != null && message.differences.length) + for (var i = 0; i < message.differences.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestRunDifference.encode(message.differences[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.triggeredIntent != null && Object.hasOwnProperty.call(message, "triggeredIntent")) + $root.google.cloud.dialogflow.cx.v3.Intent.encode(message.triggeredIntent, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + $root.google.cloud.dialogflow.cx.v3.Page.encode(message.currentPage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.textResponses != null && message.textResponses.length) + for (var i = 0; i < message.textResponses.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.encode(message.textResponses[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VirtualAgentOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.IVirtualAgentOutput} message VirtualAgentOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualAgentOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualAgentOutput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.sessionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.differences && message.differences.length)) + message.differences = []; + message.differences.push($root.google.cloud.dialogflow.cx.v3.TestRunDifference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.triggeredIntent = $root.google.cloud.dialogflow.cx.v3.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.textResponses && message.textResponses.length)) + message.textResponses = []; + message.textResponses.push($root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualAgentOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VirtualAgentOutput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VirtualAgentOutput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sessionParameters != null && message.hasOwnProperty("sessionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.sessionParameters, long + 1); + if (error) + return "sessionParameters." + error; + } + if (message.differences != null && message.hasOwnProperty("differences")) { + if (!Array.isArray(message.differences)) + return "differences: array expected"; + for (var i = 0; i < message.differences.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestRunDifference.verify(message.differences[i], long + 1); + if (error) + return "differences." + error; + } + } + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo, long + 1); + if (error) + return "diagnosticInfo." + error; + } + if (message.triggeredIntent != null && message.hasOwnProperty("triggeredIntent")) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.verify(message.triggeredIntent, long + 1); + if (error) + return "triggeredIntent." + error; + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) { + var error = $root.google.cloud.dialogflow.cx.v3.Page.verify(message.currentPage, long + 1); + if (error) + return "currentPage." + error; + } + if (message.textResponses != null && message.hasOwnProperty("textResponses")) { + if (!Array.isArray(message.textResponses)) + return "textResponses: array expected"; + for (var i = 0; i < message.textResponses.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.verify(message.textResponses[i], long + 1); + if (error) + return "textResponses." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a VirtualAgentOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput + */ + VirtualAgentOutput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput(); + if (object.sessionParameters != null) { + if (typeof object.sessionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.sessionParameters: object expected"); + message.sessionParameters = $root.google.protobuf.Struct.fromObject(object.sessionParameters, long + 1); + } + if (object.differences) { + if (!Array.isArray(object.differences)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.differences: array expected"); + message.differences = []; + for (var i = 0; i < object.differences.length; ++i) { + if (typeof object.differences[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.differences: object expected"); + message.differences[i] = $root.google.cloud.dialogflow.cx.v3.TestRunDifference.fromObject(object.differences[i], long + 1); + } + } + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo, long + 1); + } + if (object.triggeredIntent != null) { + if (typeof object.triggeredIntent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.triggeredIntent: object expected"); + message.triggeredIntent = $root.google.cloud.dialogflow.cx.v3.Intent.fromObject(object.triggeredIntent, long + 1); + } + if (object.currentPage != null) { + if (typeof object.currentPage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.currentPage: object expected"); + message.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.fromObject(object.currentPage, long + 1); + } + if (object.textResponses) { + if (!Array.isArray(object.textResponses)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.textResponses: array expected"); + message.textResponses = []; + for (var i = 0; i < object.textResponses.length; ++i) { + if (typeof object.textResponses[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.textResponses: object expected"); + message.textResponses[i] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.fromObject(object.textResponses[i], long + 1); + } + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a VirtualAgentOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput} message VirtualAgentOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VirtualAgentOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.differences = []; + object.textResponses = []; + } + if (options.defaults) { + object.sessionParameters = null; + object.diagnosticInfo = null; + object.triggeredIntent = null; + object.currentPage = null; + object.status = null; + } + if (message.sessionParameters != null && message.hasOwnProperty("sessionParameters")) + object.sessionParameters = $root.google.protobuf.Struct.toObject(message.sessionParameters, options); + if (message.differences && message.differences.length) { + object.differences = []; + for (var j = 0; j < message.differences.length; ++j) + object.differences[j] = $root.google.cloud.dialogflow.cx.v3.TestRunDifference.toObject(message.differences[j], options); + } + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); + if (message.triggeredIntent != null && message.hasOwnProperty("triggeredIntent")) + object.triggeredIntent = $root.google.cloud.dialogflow.cx.v3.Intent.toObject(message.triggeredIntent, options); + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.toObject(message.currentPage, options); + if (message.textResponses && message.textResponses.length) { + object.textResponses = []; + for (var j = 0; j < message.textResponses.length; ++j) + object.textResponses[j] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.Text.toObject(message.textResponses[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this VirtualAgentOutput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @instance + * @returns {Object.} JSON object + */ + VirtualAgentOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VirtualAgentOutput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VirtualAgentOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput"; + }; + + return VirtualAgentOutput; + })(); + + return ConversationTurn; + })(); + + v3.TestRunDifference = (function() { + + /** + * Properties of a TestRunDifference. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITestRunDifference + * @property {google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType|null} [type] TestRunDifference type + * @property {string|null} [description] TestRunDifference description + */ + + /** + * Constructs a new TestRunDifference. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TestRunDifference. + * @implements ITestRunDifference + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITestRunDifference=} [properties] Properties to set + */ + function TestRunDifference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestRunDifference type. + * @member {google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType} type + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @instance + */ + TestRunDifference.prototype.type = 0; + + /** + * TestRunDifference description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @instance + */ + TestRunDifference.prototype.description = ""; + + /** + * Creates a new TestRunDifference instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestRunDifference=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TestRunDifference} TestRunDifference instance + */ + TestRunDifference.create = function create(properties) { + return new TestRunDifference(properties); + }; + + /** + * Encodes the specified TestRunDifference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestRunDifference.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestRunDifference} message TestRunDifference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestRunDifference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified TestRunDifference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestRunDifference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestRunDifference} message TestRunDifference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestRunDifference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TestRunDifference} TestRunDifference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestRunDifference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TestRunDifference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TestRunDifference} TestRunDifference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestRunDifference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestRunDifference message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestRunDifference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a TestRunDifference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TestRunDifference} TestRunDifference + */ + TestRunDifference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TestRunDifference) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TestRunDifference(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DIFF_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INTENT": + case 1: + message.type = 1; + break; + case "PAGE": + case 2: + message.type = 2; + break; + case "PARAMETERS": + case 3: + message.type = 3; + break; + case "UTTERANCE": + case 4: + message.type = 4; + break; + case "FLOW": + case 5: + message.type = 5; + break; + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a TestRunDifference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3.TestRunDifference} message TestRunDifference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestRunDifference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "DIFF_TYPE_UNSPECIFIED" : 0; + object.description = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this TestRunDifference to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @instance + * @returns {Object.} JSON object + */ + TestRunDifference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestRunDifference + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TestRunDifference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestRunDifference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TestRunDifference"; + }; + + /** + * DiffType enum. + * @name google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType + * @enum {number} + * @property {number} DIFF_TYPE_UNSPECIFIED=0 DIFF_TYPE_UNSPECIFIED value + * @property {number} INTENT=1 INTENT value + * @property {number} PAGE=2 PAGE value + * @property {number} PARAMETERS=3 PARAMETERS value + * @property {number} UTTERANCE=4 UTTERANCE value + * @property {number} FLOW=5 FLOW value + */ + TestRunDifference.DiffType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIFF_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT"] = 1; + values[valuesById[2] = "PAGE"] = 2; + values[valuesById[3] = "PARAMETERS"] = 3; + values[valuesById[4] = "UTTERANCE"] = 4; + values[valuesById[5] = "FLOW"] = 5; + return values; + })(); + + return TestRunDifference; + })(); + + v3.TransitionCoverage = (function() { + + /** + * Properties of a TransitionCoverage. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITransitionCoverage + * @property {Array.|null} [transitions] TransitionCoverage transitions + * @property {number|null} [coverageScore] TransitionCoverage coverageScore + */ + + /** + * Constructs a new TransitionCoverage. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TransitionCoverage. + * @implements ITransitionCoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITransitionCoverage=} [properties] Properties to set + */ + function TransitionCoverage(properties) { + this.transitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionCoverage transitions. + * @member {Array.} transitions + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @instance + */ + TransitionCoverage.prototype.transitions = $util.emptyArray; + + /** + * TransitionCoverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @instance + */ + TransitionCoverage.prototype.coverageScore = 0; + + /** + * Creates a new TransitionCoverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionCoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage} TransitionCoverage instance + */ + TransitionCoverage.create = function create(properties) { + return new TransitionCoverage(properties); + }; + + /** + * Encodes the specified TransitionCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionCoverage} message TransitionCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionCoverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitions != null && message.transitions.length) + for (var i = 0; i < message.transitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.encode(message.transitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified TransitionCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionCoverage} message TransitionCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionCoverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage} TransitionCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionCoverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionCoverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.transitions && message.transitions.length)) + message.transitions = []; + message.transitions.push($root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage} TransitionCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionCoverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionCoverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionCoverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitions != null && message.hasOwnProperty("transitions")) { + if (!Array.isArray(message.transitions)) + return "transitions: array expected"; + for (var i = 0; i < message.transitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.verify(message.transitions[i], long + 1); + if (error) + return "transitions." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates a TransitionCoverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage} TransitionCoverage + */ + TransitionCoverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionCoverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionCoverage(); + if (object.transitions) { + if (!Array.isArray(object.transitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.transitions: array expected"); + message.transitions = []; + for (var i = 0; i < object.transitions.length; ++i) { + if (typeof object.transitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.transitions: object expected"); + message.transitions[i] = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.fromObject(object.transitions[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from a TransitionCoverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage} message TransitionCoverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionCoverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitions = []; + if (options.defaults) + object.coverageScore = 0; + if (message.transitions && message.transitions.length) { + object.transitions = []; + for (var j = 0; j < message.transitions.length; ++j) + object.transitions[j] = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.toObject(message.transitions[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this TransitionCoverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @instance + * @returns {Object.} JSON object + */ + TransitionCoverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionCoverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionCoverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionCoverage"; + }; + + TransitionCoverage.TransitionNode = (function() { + + /** + * Properties of a TransitionNode. + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @interface ITransitionNode + * @property {google.cloud.dialogflow.cx.v3.IPage|null} [page] TransitionNode page + * @property {google.cloud.dialogflow.cx.v3.IFlow|null} [flow] TransitionNode flow + */ + + /** + * Constructs a new TransitionNode. + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @classdesc Represents a TransitionNode. + * @implements ITransitionNode + * @constructor + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode=} [properties] Properties to set + */ + function TransitionNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionNode page. + * @member {google.cloud.dialogflow.cx.v3.IPage|null|undefined} page + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @instance + */ + TransitionNode.prototype.page = null; + + /** + * TransitionNode flow. + * @member {google.cloud.dialogflow.cx.v3.IFlow|null|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @instance + */ + TransitionNode.prototype.flow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransitionNode kind. + * @member {"page"|"flow"|undefined} kind + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @instance + */ + Object.defineProperty(TransitionNode.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["page", "flow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransitionNode instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode} TransitionNode instance + */ + TransitionNode.create = function create(properties) { + return new TransitionNode(properties); + }; + + /** + * Encodes the specified TransitionNode message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode} message TransitionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + $root.google.cloud.dialogflow.cx.v3.Page.encode(message.page, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + $root.google.cloud.dialogflow.cx.v3.Flow.encode(message.flow, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitionNode message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode} message TransitionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode} TransitionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionNode.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page = $root.google.cloud.dialogflow.cx.v3.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.flow = $root.google.cloud.dialogflow.cx.v3.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode} TransitionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionNode message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionNode.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.page != null && message.hasOwnProperty("page")) { + properties.kind = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Page.verify(message.page, long + 1); + if (error) + return "page." + error; + } + } + if (message.flow != null && message.hasOwnProperty("flow")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Flow.verify(message.flow, long + 1); + if (error) + return "flow." + error; + } + } + return null; + }; + + /** + * Creates a TransitionNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode} TransitionNode + */ + TransitionNode.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode(); + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.page: object expected"); + message.page = $root.google.cloud.dialogflow.cx.v3.Page.fromObject(object.page, long + 1); + } + if (object.flow != null) { + if (typeof object.flow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.flow: object expected"); + message.flow = $root.google.cloud.dialogflow.cx.v3.Flow.fromObject(object.flow, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TransitionNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode} message TransitionNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.page != null && message.hasOwnProperty("page")) { + object.page = $root.google.cloud.dialogflow.cx.v3.Page.toObject(message.page, options); + if (options.oneofs) + object.kind = "page"; + } + if (message.flow != null && message.hasOwnProperty("flow")) { + object.flow = $root.google.cloud.dialogflow.cx.v3.Flow.toObject(message.flow, options); + if (options.oneofs) + object.kind = "flow"; + } + return object; + }; + + /** + * Converts this TransitionNode to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @instance + * @returns {Object.} JSON object + */ + TransitionNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionNode + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode"; + }; + + return TransitionNode; + })(); + + TransitionCoverage.Transition = (function() { + + /** + * Properties of a Transition. + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @interface ITransition + * @property {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null} [source] Transition source + * @property {number|null} [index] Transition index + * @property {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null} [target] Transition target + * @property {boolean|null} [covered] Transition covered + * @property {google.cloud.dialogflow.cx.v3.ITransitionRoute|null} [transitionRoute] Transition transitionRoute + * @property {google.cloud.dialogflow.cx.v3.IEventHandler|null} [eventHandler] Transition eventHandler + */ + + /** + * Constructs a new Transition. + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage + * @classdesc Represents a Transition. + * @implements ITransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition=} [properties] Properties to set + */ + function Transition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Transition source. + * @member {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null|undefined} source + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.source = null; + + /** + * Transition index. + * @member {number} index + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.index = 0; + + /** + * Transition target. + * @member {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransitionNode|null|undefined} target + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.target = null; + + /** + * Transition covered. + * @member {boolean} covered + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.covered = false; + + /** + * Transition transitionRoute. + * @member {google.cloud.dialogflow.cx.v3.ITransitionRoute|null|undefined} transitionRoute + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.transitionRoute = null; + + /** + * Transition eventHandler. + * @member {google.cloud.dialogflow.cx.v3.IEventHandler|null|undefined} eventHandler + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.eventHandler = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Transition detail. + * @member {"transitionRoute"|"eventHandler"|undefined} detail + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + */ + Object.defineProperty(Transition.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["transitionRoute", "eventHandler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Transition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition} Transition instance + */ + Transition.create = function create(properties) { + return new Transition(properties); + }; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.encode(message.target, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.covered != null && Object.hasOwnProperty.call(message, "covered")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.covered); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.index); + if (message.transitionRoute != null && Object.hasOwnProperty.call(message, "transitionRoute")) + $root.google.cloud.dialogflow.cx.v3.TransitionRoute.encode(message.transitionRoute, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.eventHandler != null && Object.hasOwnProperty.call(message, "eventHandler")) + $root.google.cloud.dialogflow.cx.v3.EventHandler.encode(message.eventHandler, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.index = reader.int32(); + break; + } + case 2: { + message.target = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.covered = reader.bool(); + break; + } + case 5: { + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.eventHandler = $root.google.cloud.dialogflow.cx.v3.EventHandler.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Transition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Transition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.verify(message.source, long + 1); + if (error) + return "source." + error; + } + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.verify(message.target, long + 1); + if (error) + return "target." + error; + } + if (message.covered != null && message.hasOwnProperty("covered")) + if (typeof message.covered !== "boolean") + return "covered: boolean expected"; + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) { + properties.detail = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.verify(message.transitionRoute, long + 1); + if (error) + return "transitionRoute." + error; + } + } + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.EventHandler.verify(message.eventHandler, long + 1); + if (error) + return "eventHandler." + error; + } + } + return null; + }; + + /** + * Creates a Transition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition} Transition + */ + Transition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.source: object expected"); + message.source = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.fromObject(object.source, long + 1); + } + if (object.index != null) + message.index = object.index | 0; + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.target: object expected"); + message.target = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.fromObject(object.target, long + 1); + } + if (object.covered != null) + message.covered = Boolean(object.covered); + if (object.transitionRoute != null) { + if (typeof object.transitionRoute !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.transitionRoute: object expected"); + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.fromObject(object.transitionRoute, long + 1); + } + if (object.eventHandler != null) { + if (typeof object.eventHandler !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition.eventHandler: object expected"); + message.eventHandler = $root.google.cloud.dialogflow.cx.v3.EventHandler.fromObject(object.eventHandler, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition} message Transition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Transition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.target = null; + object.covered = false; + object.index = 0; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.toObject(message.source, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode.toObject(message.target, options); + if (message.covered != null && message.hasOwnProperty("covered")) + object.covered = message.covered; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) { + object.transitionRoute = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.toObject(message.transitionRoute, options); + if (options.oneofs) + object.detail = "transitionRoute"; + } + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + object.eventHandler = $root.google.cloud.dialogflow.cx.v3.EventHandler.toObject(message.eventHandler, options); + if (options.oneofs) + object.detail = "eventHandler"; + } + return object; + }; + + /** + * Converts this Transition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @instance + * @returns {Object.} JSON object + */ + Transition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Transition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition"; + }; + + return Transition; + })(); + + return TransitionCoverage; + })(); + + v3.TransitionRouteGroupCoverage = (function() { + + /** + * Properties of a TransitionRouteGroupCoverage. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITransitionRouteGroupCoverage + * @property {Array.|null} [coverages] TransitionRouteGroupCoverage coverages + * @property {number|null} [coverageScore] TransitionRouteGroupCoverage coverageScore + */ + + /** + * Constructs a new TransitionRouteGroupCoverage. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TransitionRouteGroupCoverage. + * @implements ITransitionRouteGroupCoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage=} [properties] Properties to set + */ + function TransitionRouteGroupCoverage(properties) { + this.coverages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionRouteGroupCoverage coverages. + * @member {Array.} coverages + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @instance + */ + TransitionRouteGroupCoverage.prototype.coverages = $util.emptyArray; + + /** + * TransitionRouteGroupCoverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @instance + */ + TransitionRouteGroupCoverage.prototype.coverageScore = 0; + + /** + * Creates a new TransitionRouteGroupCoverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage instance + */ + TransitionRouteGroupCoverage.create = function create(properties) { + return new TransitionRouteGroupCoverage(properties); + }; + + /** + * Encodes the specified TransitionRouteGroupCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage} message TransitionRouteGroupCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroupCoverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coverages != null && message.coverages.length) + for (var i = 0; i < message.coverages.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.encode(message.coverages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified TransitionRouteGroupCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage} message TransitionRouteGroupCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroupCoverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroupCoverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.coverages && message.coverages.length)) + message.coverages = []; + message.coverages.push($root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroupCoverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionRouteGroupCoverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionRouteGroupCoverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.coverages != null && message.hasOwnProperty("coverages")) { + if (!Array.isArray(message.coverages)) + return "coverages: array expected"; + for (var i = 0; i < message.coverages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.verify(message.coverages[i], long + 1); + if (error) + return "coverages." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates a TransitionRouteGroupCoverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage + */ + TransitionRouteGroupCoverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage(); + if (object.coverages) { + if (!Array.isArray(object.coverages)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.coverages: array expected"); + message.coverages = []; + for (var i = 0; i < object.coverages.length; ++i) { + if (typeof object.coverages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.coverages: object expected"); + message.coverages[i] = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.fromObject(object.coverages[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from a TransitionRouteGroupCoverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage} message TransitionRouteGroupCoverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionRouteGroupCoverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coverages = []; + if (options.defaults) + object.coverageScore = 0; + if (message.coverages && message.coverages.length) { + object.coverages = []; + for (var j = 0; j < message.coverages.length; ++j) + object.coverages[j] = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.toObject(message.coverages[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this TransitionRouteGroupCoverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @instance + * @returns {Object.} JSON object + */ + TransitionRouteGroupCoverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionRouteGroupCoverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionRouteGroupCoverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage"; + }; + + TransitionRouteGroupCoverage.Coverage = (function() { + + /** + * Properties of a Coverage. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @interface ICoverage + * @property {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null} [routeGroup] Coverage routeGroup + * @property {Array.|null} [transitions] Coverage transitions + * @property {number|null} [coverageScore] Coverage coverageScore + */ + + /** + * Constructs a new Coverage. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage + * @classdesc Represents a Coverage. + * @implements ICoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage=} [properties] Properties to set + */ + function Coverage(properties) { + this.transitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Coverage routeGroup. + * @member {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null|undefined} routeGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @instance + */ + Coverage.prototype.routeGroup = null; + + /** + * Coverage transitions. + * @member {Array.} transitions + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @instance + */ + Coverage.prototype.transitions = $util.emptyArray; + + /** + * Coverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @instance + */ + Coverage.prototype.coverageScore = 0; + + /** + * Creates a new Coverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage} Coverage instance + */ + Coverage.create = function create(properties) { + return new Coverage(properties); + }; + + /** + * Encodes the specified Coverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage} message Coverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routeGroup != null && Object.hasOwnProperty.call(message, "routeGroup")) + $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.encode(message.routeGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transitions != null && message.transitions.length) + for (var i = 0; i < message.transitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.encode(message.transitions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified Coverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.ICoverage} message Coverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage} Coverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.routeGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.transitions && message.transitions.length)) + message.transitions = []; + message.transitions.push($root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Coverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage} Coverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.routeGroup != null && message.hasOwnProperty("routeGroup")) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify(message.routeGroup, long + 1); + if (error) + return "routeGroup." + error; + } + if (message.transitions != null && message.hasOwnProperty("transitions")) { + if (!Array.isArray(message.transitions)) + return "transitions: array expected"; + for (var i = 0; i < message.transitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.verify(message.transitions[i], long + 1); + if (error) + return "transitions." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates a Coverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage} Coverage + */ + Coverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage(); + if (object.routeGroup != null) { + if (typeof object.routeGroup !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.routeGroup: object expected"); + message.routeGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.fromObject(object.routeGroup, long + 1); + } + if (object.transitions) { + if (!Array.isArray(object.transitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.transitions: array expected"); + message.transitions = []; + for (var i = 0; i < object.transitions.length; ++i) { + if (typeof object.transitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.transitions: object expected"); + message.transitions[i] = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.fromObject(object.transitions[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from a Coverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage} message Coverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitions = []; + if (options.defaults) { + object.routeGroup = null; + object.coverageScore = 0; + } + if (message.routeGroup != null && message.hasOwnProperty("routeGroup")) + object.routeGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.toObject(message.routeGroup, options); + if (message.transitions && message.transitions.length) { + object.transitions = []; + for (var j = 0; j < message.transitions.length; ++j) + object.transitions[j] = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.toObject(message.transitions[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this Coverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @instance + * @returns {Object.} JSON object + */ + Coverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Coverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Coverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage"; + }; + + Coverage.Transition = (function() { + + /** + * Properties of a Transition. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @interface ITransition + * @property {google.cloud.dialogflow.cx.v3.ITransitionRoute|null} [transitionRoute] Transition transitionRoute + * @property {boolean|null} [covered] Transition covered + */ + + /** + * Constructs a new Transition. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage + * @classdesc Represents a Transition. + * @implements ITransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition=} [properties] Properties to set + */ + function Transition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Transition transitionRoute. + * @member {google.cloud.dialogflow.cx.v3.ITransitionRoute|null|undefined} transitionRoute + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @instance + */ + Transition.prototype.transitionRoute = null; + + /** + * Transition covered. + * @member {boolean} covered + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @instance + */ + Transition.prototype.covered = false; + + /** + * Creates a new Transition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition} Transition instance + */ + Transition.create = function create(properties) { + return new Transition(properties); + }; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitionRoute != null && Object.hasOwnProperty.call(message, "transitionRoute")) + $root.google.cloud.dialogflow.cx.v3.TransitionRoute.encode(message.transitionRoute, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.covered != null && Object.hasOwnProperty.call(message, "covered")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.covered); + return writer; + }; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.covered = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Transition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Transition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.verify(message.transitionRoute, long + 1); + if (error) + return "transitionRoute." + error; + } + if (message.covered != null && message.hasOwnProperty("covered")) + if (typeof message.covered !== "boolean") + return "covered: boolean expected"; + return null; + }; + + /** + * Creates a Transition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition} Transition + */ + Transition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition(); + if (object.transitionRoute != null) { + if (typeof object.transitionRoute !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition.transitionRoute: object expected"); + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.fromObject(object.transitionRoute, long + 1); + } + if (object.covered != null) + message.covered = Boolean(object.covered); + return message; + }; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition} message Transition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Transition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transitionRoute = null; + object.covered = false; + } + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) + object.transitionRoute = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.toObject(message.transitionRoute, options); + if (message.covered != null && message.hasOwnProperty("covered")) + object.covered = message.covered; + return object; + }; + + /** + * Converts this Transition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @instance + * @returns {Object.} JSON object + */ + Transition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Transition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition"; + }; + + return Transition; + })(); + + return Coverage; + })(); + + return TransitionRouteGroupCoverage; + })(); + + v3.IntentCoverage = (function() { + + /** + * Properties of an IntentCoverage. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IIntentCoverage + * @property {Array.|null} [intents] IntentCoverage intents + * @property {number|null} [coverageScore] IntentCoverage coverageScore + */ + + /** + * Constructs a new IntentCoverage. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an IntentCoverage. + * @implements IIntentCoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IIntentCoverage=} [properties] Properties to set + */ + function IntentCoverage(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentCoverage intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @instance + */ + IntentCoverage.prototype.intents = $util.emptyArray; + + /** + * IntentCoverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @instance + */ + IntentCoverage.prototype.coverageScore = 0; + + /** + * Creates a new IntentCoverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntentCoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage} IntentCoverage instance + */ + IntentCoverage.create = function create(properties) { + return new IntentCoverage(properties); + }; + + /** + * Encodes the specified IntentCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntentCoverage} message IntentCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentCoverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified IntentCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntentCoverage} message IntentCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentCoverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage} IntentCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentCoverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.IntentCoverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage} IntentCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentCoverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentCoverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentCoverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.verify(message.intents[i], long + 1); + if (error) + return "intents." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates an IntentCoverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage} IntentCoverage + */ + IntentCoverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.IntentCoverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.IntentCoverage(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3.IntentCoverage.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.IntentCoverage.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.fromObject(object.intents[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from an IntentCoverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3.IntentCoverage} message IntentCoverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentCoverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.coverageScore = 0; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.toObject(message.intents[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this IntentCoverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @instance + * @returns {Object.} JSON object + */ + IntentCoverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentCoverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentCoverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.IntentCoverage"; + }; + + IntentCoverage.Intent = (function() { + + /** + * Properties of an Intent. + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @interface IIntent + * @property {string|null} [intent] Intent intent + * @property {boolean|null} [covered] Intent covered + */ + + /** + * Constructs a new Intent. + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage + * @classdesc Represents an Intent. + * @implements IIntent + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent=} [properties] Properties to set + */ + function Intent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Intent intent. + * @member {string} intent + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @instance + */ + Intent.prototype.intent = ""; + + /** + * Intent covered. + * @member {boolean} covered + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @instance + */ + Intent.prototype.covered = false; + + /** + * Creates a new Intent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage.Intent} Intent instance + */ + Intent.create = function create(properties) { + return new Intent(properties); + }; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intent); + if (message.covered != null && Object.hasOwnProperty.call(message, "covered")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.covered); + return writer; + }; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentCoverage.Intent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.IntentCoverage.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = reader.string(); + break; + } + case 2: { + message.covered = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Intent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Intent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) + if (!$util.isString(message.intent)) + return "intent: string expected"; + if (message.covered != null && message.hasOwnProperty("covered")) + if (typeof message.covered !== "boolean") + return "covered: boolean expected"; + return null; + }; + + /** + * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.IntentCoverage.Intent} Intent + */ + Intent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent(); + if (object.intent != null) + message.intent = String(object.intent); + if (object.covered != null) + message.covered = Boolean(object.covered); + return message; + }; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.IntentCoverage.Intent} message Intent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Intent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = ""; + object.covered = false; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = message.intent; + if (message.covered != null && message.hasOwnProperty("covered")) + object.covered = message.covered; + return object; + }; + + /** + * Converts this Intent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @instance + * @returns {Object.} JSON object + */ + Intent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Intent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.IntentCoverage.Intent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Intent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.IntentCoverage.Intent"; + }; + + return Intent; + })(); + + return IntentCoverage; + })(); + + v3.CalculateCoverageRequest = (function() { + + /** + * Properties of a CalculateCoverageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICalculateCoverageRequest + * @property {string|null} [agent] CalculateCoverageRequest agent + * @property {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType|null} [type] CalculateCoverageRequest type + */ + + /** + * Constructs a new CalculateCoverageRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CalculateCoverageRequest. + * @implements ICalculateCoverageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest=} [properties] Properties to set + */ + function CalculateCoverageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CalculateCoverageRequest agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @instance + */ + CalculateCoverageRequest.prototype.agent = ""; + + /** + * CalculateCoverageRequest type. + * @member {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType} type + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @instance + */ + CalculateCoverageRequest.prototype.type = 0; + + /** + * Creates a new CalculateCoverageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest} CalculateCoverageRequest instance + */ + CalculateCoverageRequest.create = function create(properties) { + return new CalculateCoverageRequest(properties); + }; + + /** + * Encodes the specified CalculateCoverageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest} message CalculateCoverageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agent); + return writer; + }; + + /** + * Encodes the specified CalculateCoverageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest} message CalculateCoverageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest} CalculateCoverageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.agent = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest} CalculateCoverageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CalculateCoverageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CalculateCoverageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a CalculateCoverageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest} CalculateCoverageRequest + */ + CalculateCoverageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest(); + if (object.agent != null) + message.agent = String(object.agent); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COVERAGE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INTENT": + case 1: + message.type = 1; + break; + case "PAGE_TRANSITION": + case 2: + message.type = 2; + break; + case "TRANSITION_ROUTE_GROUP": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a CalculateCoverageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest} message CalculateCoverageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CalculateCoverageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "COVERAGE_TYPE_UNSPECIFIED" : 0; + object.agent = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType[message.type] : message.type; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; + + /** + * Converts this CalculateCoverageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @instance + * @returns {Object.} JSON object + */ + CalculateCoverageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CalculateCoverageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CalculateCoverageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CalculateCoverageRequest"; + }; + + /** + * CoverageType enum. + * @name google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType + * @enum {number} + * @property {number} COVERAGE_TYPE_UNSPECIFIED=0 COVERAGE_TYPE_UNSPECIFIED value + * @property {number} INTENT=1 INTENT value + * @property {number} PAGE_TRANSITION=2 PAGE_TRANSITION value + * @property {number} TRANSITION_ROUTE_GROUP=3 TRANSITION_ROUTE_GROUP value + */ + CalculateCoverageRequest.CoverageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COVERAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT"] = 1; + values[valuesById[2] = "PAGE_TRANSITION"] = 2; + values[valuesById[3] = "TRANSITION_ROUTE_GROUP"] = 3; + return values; + })(); + + return CalculateCoverageRequest; + })(); + + v3.CalculateCoverageResponse = (function() { + + /** + * Properties of a CalculateCoverageResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICalculateCoverageResponse + * @property {string|null} [agent] CalculateCoverageResponse agent + * @property {google.cloud.dialogflow.cx.v3.IIntentCoverage|null} [intentCoverage] CalculateCoverageResponse intentCoverage + * @property {google.cloud.dialogflow.cx.v3.ITransitionCoverage|null} [transitionCoverage] CalculateCoverageResponse transitionCoverage + * @property {google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage|null} [routeGroupCoverage] CalculateCoverageResponse routeGroupCoverage + */ + + /** + * Constructs a new CalculateCoverageResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CalculateCoverageResponse. + * @implements ICalculateCoverageResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse=} [properties] Properties to set + */ + function CalculateCoverageResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CalculateCoverageResponse agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.agent = ""; + + /** + * CalculateCoverageResponse intentCoverage. + * @member {google.cloud.dialogflow.cx.v3.IIntentCoverage|null|undefined} intentCoverage + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.intentCoverage = null; + + /** + * CalculateCoverageResponse transitionCoverage. + * @member {google.cloud.dialogflow.cx.v3.ITransitionCoverage|null|undefined} transitionCoverage + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.transitionCoverage = null; + + /** + * CalculateCoverageResponse routeGroupCoverage. + * @member {google.cloud.dialogflow.cx.v3.ITransitionRouteGroupCoverage|null|undefined} routeGroupCoverage + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.routeGroupCoverage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CalculateCoverageResponse coverageType. + * @member {"intentCoverage"|"transitionCoverage"|"routeGroupCoverage"|undefined} coverageType + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @instance + */ + Object.defineProperty(CalculateCoverageResponse.prototype, "coverageType", { + get: $util.oneOfGetter($oneOfFields = ["intentCoverage", "transitionCoverage", "routeGroupCoverage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CalculateCoverageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageResponse} CalculateCoverageResponse instance + */ + CalculateCoverageResponse.create = function create(properties) { + return new CalculateCoverageResponse(properties); + }; + + /** + * Encodes the specified CalculateCoverageResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse} message CalculateCoverageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentCoverage != null && Object.hasOwnProperty.call(message, "intentCoverage")) + $root.google.cloud.dialogflow.cx.v3.IntentCoverage.encode(message.intentCoverage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transitionCoverage != null && Object.hasOwnProperty.call(message, "transitionCoverage")) + $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.encode(message.transitionCoverage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.agent); + if (message.routeGroupCoverage != null && Object.hasOwnProperty.call(message, "routeGroupCoverage")) + $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.encode(message.routeGroupCoverage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CalculateCoverageResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CalculateCoverageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse} message CalculateCoverageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageResponse} CalculateCoverageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.agent = reader.string(); + break; + } + case 2: { + message.intentCoverage = $root.google.cloud.dialogflow.cx.v3.IntentCoverage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.transitionCoverage = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.routeGroupCoverage = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageResponse} CalculateCoverageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CalculateCoverageResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CalculateCoverageResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.intentCoverage != null && message.hasOwnProperty("intentCoverage")) { + properties.coverageType = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.IntentCoverage.verify(message.intentCoverage, long + 1); + if (error) + return "intentCoverage." + error; + } + } + if (message.transitionCoverage != null && message.hasOwnProperty("transitionCoverage")) { + if (properties.coverageType === 1) + return "coverageType: multiple values"; + properties.coverageType = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.verify(message.transitionCoverage, long + 1); + if (error) + return "transitionCoverage." + error; + } + } + if (message.routeGroupCoverage != null && message.hasOwnProperty("routeGroupCoverage")) { + if (properties.coverageType === 1) + return "coverageType: multiple values"; + properties.coverageType = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.verify(message.routeGroupCoverage, long + 1); + if (error) + return "routeGroupCoverage." + error; + } + } + return null; + }; + + /** + * Creates a CalculateCoverageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CalculateCoverageResponse} CalculateCoverageResponse + */ + CalculateCoverageResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse(); + if (object.agent != null) + message.agent = String(object.agent); + if (object.intentCoverage != null) { + if (typeof object.intentCoverage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CalculateCoverageResponse.intentCoverage: object expected"); + message.intentCoverage = $root.google.cloud.dialogflow.cx.v3.IntentCoverage.fromObject(object.intentCoverage, long + 1); + } + if (object.transitionCoverage != null) { + if (typeof object.transitionCoverage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CalculateCoverageResponse.transitionCoverage: object expected"); + message.transitionCoverage = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.fromObject(object.transitionCoverage, long + 1); + } + if (object.routeGroupCoverage != null) { + if (typeof object.routeGroupCoverage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CalculateCoverageResponse.routeGroupCoverage: object expected"); + message.routeGroupCoverage = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.fromObject(object.routeGroupCoverage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CalculateCoverageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.CalculateCoverageResponse} message CalculateCoverageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CalculateCoverageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agent = ""; + if (message.intentCoverage != null && message.hasOwnProperty("intentCoverage")) { + object.intentCoverage = $root.google.cloud.dialogflow.cx.v3.IntentCoverage.toObject(message.intentCoverage, options); + if (options.oneofs) + object.coverageType = "intentCoverage"; + } + if (message.transitionCoverage != null && message.hasOwnProperty("transitionCoverage")) { + object.transitionCoverage = $root.google.cloud.dialogflow.cx.v3.TransitionCoverage.toObject(message.transitionCoverage, options); + if (options.oneofs) + object.coverageType = "transitionCoverage"; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + if (message.routeGroupCoverage != null && message.hasOwnProperty("routeGroupCoverage")) { + object.routeGroupCoverage = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.toObject(message.routeGroupCoverage, options); + if (options.oneofs) + object.coverageType = "routeGroupCoverage"; + } + return object; + }; + + /** + * Converts this CalculateCoverageResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @instance + * @returns {Object.} JSON object + */ + CalculateCoverageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CalculateCoverageResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CalculateCoverageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CalculateCoverageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CalculateCoverageResponse"; + }; + + return CalculateCoverageResponse; + })(); + + v3.ListTestCasesRequest = (function() { + + /** + * Properties of a ListTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListTestCasesRequest + * @property {string|null} [parent] ListTestCasesRequest parent + * @property {number|null} [pageSize] ListTestCasesRequest pageSize + * @property {string|null} [pageToken] ListTestCasesRequest pageToken + * @property {google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView|null} [view] ListTestCasesRequest view + */ + + /** + * Constructs a new ListTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListTestCasesRequest. + * @implements IListTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesRequest=} [properties] Properties to set + */ + function ListTestCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.parent = ""; + + /** + * ListTestCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.pageSize = 0; + + /** + * ListTestCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.pageToken = ""; + + /** + * ListTestCasesRequest view. + * @member {google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView} view + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.view = 0; + + /** + * Creates a new ListTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesRequest} ListTestCasesRequest instance + */ + ListTestCasesRequest.create = function create(properties) { + return new ListTestCasesRequest(properties); + }; + + /** + * Encodes the specified ListTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesRequest} message ListTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesRequest} message ListTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesRequest} ListTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesRequest} ListTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesRequest} ListTestCasesRequest + */ + ListTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "TEST_CASE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListTestCasesRequest} message ListTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "TEST_CASE_VIEW_UNSPECIFIED" : 0; + } + 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.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView[message.view] === undefined ? message.view : $root.google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListTestCasesRequest"; + }; + + /** + * TestCaseView enum. + * @name google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView + * @enum {number} + * @property {number} TEST_CASE_VIEW_UNSPECIFIED=0 TEST_CASE_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + ListTestCasesRequest.TestCaseView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEST_CASE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return ListTestCasesRequest; + })(); + + v3.ListTestCasesResponse = (function() { + + /** + * Properties of a ListTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListTestCasesResponse + * @property {Array.|null} [testCases] ListTestCasesResponse testCases + * @property {string|null} [nextPageToken] ListTestCasesResponse nextPageToken + */ + + /** + * Constructs a new ListTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListTestCasesResponse. + * @implements IListTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesResponse=} [properties] Properties to set + */ + function ListTestCasesResponse(properties) { + this.testCases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCasesResponse testCases. + * @member {Array.} testCases + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @instance + */ + ListTestCasesResponse.prototype.testCases = $util.emptyArray; + + /** + * ListTestCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @instance + */ + ListTestCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesResponse} ListTestCasesResponse instance + */ + ListTestCasesResponse.create = function create(properties) { + return new ListTestCasesResponse(properties); + }; + + /** + * Encodes the specified ListTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesResponse} message ListTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCases != null && message.testCases.length) + for (var i = 0; i < message.testCases.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestCase.encode(message.testCases[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 ListTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCasesResponse} message ListTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesResponse} ListTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testCases && message.testCases.length)) + message.testCases = []; + message.testCases.push($root.google.cloud.dialogflow.cx.v3.TestCase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesResponse} ListTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCases != null && message.hasOwnProperty("testCases")) { + if (!Array.isArray(message.testCases)) + return "testCases: array expected"; + for (var i = 0; i < message.testCases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCase.verify(message.testCases[i], long + 1); + if (error) + return "testCases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListTestCasesResponse} ListTestCasesResponse + */ + ListTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListTestCasesResponse(); + if (object.testCases) { + if (!Array.isArray(object.testCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListTestCasesResponse.testCases: array expected"); + message.testCases = []; + for (var i = 0; i < object.testCases.length; ++i) { + if (typeof object.testCases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListTestCasesResponse.testCases: object expected"); + message.testCases[i] = $root.google.cloud.dialogflow.cx.v3.TestCase.fromObject(object.testCases[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListTestCasesResponse} message ListTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.testCases && message.testCases.length) { + object.testCases = []; + for (var j = 0; j < message.testCases.length; ++j) + object.testCases[j] = $root.google.cloud.dialogflow.cx.v3.TestCase.toObject(message.testCases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListTestCasesResponse"; + }; + + return ListTestCasesResponse; + })(); + + v3.BatchDeleteTestCasesRequest = (function() { + + /** + * Properties of a BatchDeleteTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IBatchDeleteTestCasesRequest + * @property {string|null} [parent] BatchDeleteTestCasesRequest parent + * @property {Array.|null} [names] BatchDeleteTestCasesRequest names + */ + + /** + * Constructs a new BatchDeleteTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a BatchDeleteTestCasesRequest. + * @implements IBatchDeleteTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest=} [properties] Properties to set + */ + function BatchDeleteTestCasesRequest(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @instance + */ + BatchDeleteTestCasesRequest.prototype.parent = ""; + + /** + * BatchDeleteTestCasesRequest names. + * @member {Array.} names + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @instance + */ + BatchDeleteTestCasesRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchDeleteTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest instance + */ + BatchDeleteTestCasesRequest.create = function create(properties) { + return new BatchDeleteTestCasesRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest} message BatchDeleteTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteTestCasesRequest.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.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest} message BatchDeleteTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest + */ + BatchDeleteTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest} message BatchDeleteTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest"; + }; + + return BatchDeleteTestCasesRequest; + })(); + + v3.CreateTestCaseRequest = (function() { + + /** + * Properties of a CreateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateTestCaseRequest + * @property {string|null} [parent] CreateTestCaseRequest parent + * @property {google.cloud.dialogflow.cx.v3.ITestCase|null} [testCase] CreateTestCaseRequest testCase + */ + + /** + * Constructs a new CreateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateTestCaseRequest. + * @implements ICreateTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest=} [properties] Properties to set + */ + function CreateTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTestCaseRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @instance + */ + CreateTestCaseRequest.prototype.parent = ""; + + /** + * CreateTestCaseRequest testCase. + * @member {google.cloud.dialogflow.cx.v3.ITestCase|null|undefined} testCase + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @instance + */ + CreateTestCaseRequest.prototype.testCase = null; + + /** + * Creates a new CreateTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateTestCaseRequest} CreateTestCaseRequest instance + */ + CreateTestCaseRequest.create = function create(properties) { + return new CreateTestCaseRequest(properties); + }; + + /** + * Encodes the specified CreateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest} message CreateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTestCaseRequest.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.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + $root.google.cloud.dialogflow.cx.v3.TestCase.encode(message.testCase, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest} message CreateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateTestCaseRequest} CreateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateTestCaseRequest} CreateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.testCase != null && message.hasOwnProperty("testCase")) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCase.verify(message.testCase, long + 1); + if (error) + return "testCase." + error; + } + return null; + }; + + /** + * Creates a CreateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateTestCaseRequest} CreateTestCaseRequest + */ + CreateTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.testCase != null) { + if (typeof object.testCase !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateTestCaseRequest.testCase: object expected"); + message.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.fromObject(object.testCase, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateTestCaseRequest} message CreateTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTestCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.testCase = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.toObject(message.testCase, options); + return object; + }; + + /** + * Converts this CreateTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateTestCaseRequest"; + }; + + return CreateTestCaseRequest; + })(); + + v3.UpdateTestCaseRequest = (function() { + + /** + * Properties of an UpdateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateTestCaseRequest + * @property {google.cloud.dialogflow.cx.v3.ITestCase|null} [testCase] UpdateTestCaseRequest testCase + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTestCaseRequest updateMask + */ + + /** + * Constructs a new UpdateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateTestCaseRequest. + * @implements IUpdateTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest=} [properties] Properties to set + */ + function UpdateTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTestCaseRequest testCase. + * @member {google.cloud.dialogflow.cx.v3.ITestCase|null|undefined} testCase + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @instance + */ + UpdateTestCaseRequest.prototype.testCase = null; + + /** + * UpdateTestCaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @instance + */ + UpdateTestCaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest} UpdateTestCaseRequest instance + */ + UpdateTestCaseRequest.create = function create(properties) { + return new UpdateTestCaseRequest(properties); + }; + + /** + * Encodes the specified UpdateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest} message UpdateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTestCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + $root.google.cloud.dialogflow.cx.v3.TestCase.encode(message.testCase, 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 UpdateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest} message UpdateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest} UpdateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest} UpdateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCase != null && message.hasOwnProperty("testCase")) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCase.verify(message.testCase, long + 1); + if (error) + return "testCase." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest} UpdateTestCaseRequest + */ + UpdateTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest(); + if (object.testCase != null) { + if (typeof object.testCase !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest.testCase: object expected"); + message.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.fromObject(object.testCase, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest} message UpdateTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTestCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testCase = null; + object.updateMask = null; + } + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.toObject(message.testCase, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest"; + }; + + return UpdateTestCaseRequest; + })(); + + v3.GetTestCaseRequest = (function() { + + /** + * Properties of a GetTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetTestCaseRequest + * @property {string|null} [name] GetTestCaseRequest name + */ + + /** + * Constructs a new GetTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetTestCaseRequest. + * @implements IGetTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseRequest=} [properties] Properties to set + */ + function GetTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTestCaseRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @instance + */ + GetTestCaseRequest.prototype.name = ""; + + /** + * Creates a new GetTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseRequest} GetTestCaseRequest instance + */ + GetTestCaseRequest.create = function create(properties) { + return new GetTestCaseRequest(properties); + }; + + /** + * Encodes the specified GetTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseRequest} message GetTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseRequest.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 GetTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseRequest} message GetTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseRequest} GetTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseRequest} GetTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseRequest} GetTestCaseRequest + */ + GetTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetTestCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetTestCaseRequest} message GetTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTestCaseRequest.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 GetTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetTestCaseRequest"; + }; + + return GetTestCaseRequest; + })(); + + v3.RunTestCaseRequest = (function() { + + /** + * Properties of a RunTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunTestCaseRequest + * @property {string|null} [name] RunTestCaseRequest name + * @property {string|null} [environment] RunTestCaseRequest environment + */ + + /** + * Constructs a new RunTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunTestCaseRequest. + * @implements IRunTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseRequest=} [properties] Properties to set + */ + function RunTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunTestCaseRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @instance + */ + RunTestCaseRequest.prototype.name = ""; + + /** + * RunTestCaseRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @instance + */ + RunTestCaseRequest.prototype.environment = ""; + + /** + * Creates a new RunTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseRequest} RunTestCaseRequest instance + */ + RunTestCaseRequest.create = function create(properties) { + return new RunTestCaseRequest(properties); + }; + + /** + * Encodes the specified RunTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseRequest} message RunTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + return writer; + }; + + /** + * Encodes the specified RunTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseRequest} message RunTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseRequest} RunTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RunTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.environment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseRequest} RunTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + return null; + }; + + /** + * Creates a RunTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseRequest} RunTestCaseRequest + */ + RunTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RunTestCaseRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.environment != null) + message.environment = String(object.environment); + return message; + }; + + /** + * Creates a plain object from a RunTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.RunTestCaseRequest} message RunTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunTestCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.environment = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + return object; + }; + + /** + * Converts this RunTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + RunTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RunTestCaseRequest"; + }; + + return RunTestCaseRequest; + })(); + + v3.RunTestCaseResponse = (function() { + + /** + * Properties of a RunTestCaseResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunTestCaseResponse + * @property {google.cloud.dialogflow.cx.v3.ITestCaseResult|null} [result] RunTestCaseResponse result + */ + + /** + * Constructs a new RunTestCaseResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunTestCaseResponse. + * @implements IRunTestCaseResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseResponse=} [properties] Properties to set + */ + function RunTestCaseResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunTestCaseResponse result. + * @member {google.cloud.dialogflow.cx.v3.ITestCaseResult|null|undefined} result + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @instance + */ + RunTestCaseResponse.prototype.result = null; + + /** + * Creates a new RunTestCaseResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseResponse} RunTestCaseResponse instance + */ + RunTestCaseResponse.create = function create(properties) { + return new RunTestCaseResponse(properties); + }; + + /** + * Encodes the specified RunTestCaseResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseResponse} message RunTestCaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.dialogflow.cx.v3.TestCaseResult.encode(message.result, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunTestCaseResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseResponse} message RunTestCaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseResponse} RunTestCaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RunTestCaseResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.result = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseResponse} RunTestCaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunTestCaseResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunTestCaseResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.verify(message.result, long + 1); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a RunTestCaseResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseResponse} RunTestCaseResponse + */ + RunTestCaseResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunTestCaseResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RunTestCaseResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RunTestCaseResponse.result: object expected"); + message.result = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.fromObject(object.result, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RunTestCaseResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.RunTestCaseResponse} message RunTestCaseResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunTestCaseResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.result = null; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.toObject(message.result, options); + return object; + }; + + /** + * Converts this RunTestCaseResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @instance + * @returns {Object.} JSON object + */ + RunTestCaseResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunTestCaseResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunTestCaseResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RunTestCaseResponse"; + }; + + return RunTestCaseResponse; + })(); + + v3.RunTestCaseMetadata = (function() { + + /** + * Properties of a RunTestCaseMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunTestCaseMetadata + */ + + /** + * Constructs a new RunTestCaseMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunTestCaseMetadata. + * @implements IRunTestCaseMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata=} [properties] Properties to set + */ + function RunTestCaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RunTestCaseMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseMetadata} RunTestCaseMetadata instance + */ + RunTestCaseMetadata.create = function create(properties) { + return new RunTestCaseMetadata(properties); + }; + + /** + * Encodes the specified RunTestCaseMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata} message RunTestCaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RunTestCaseMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunTestCaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata} message RunTestCaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseMetadata} RunTestCaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RunTestCaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseMetadata} RunTestCaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunTestCaseMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunTestCaseMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a RunTestCaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunTestCaseMetadata} RunTestCaseMetadata + */ + RunTestCaseMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunTestCaseMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.RunTestCaseMetadata(); + }; + + /** + * Creates a plain object from a RunTestCaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.RunTestCaseMetadata} message RunTestCaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunTestCaseMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RunTestCaseMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @instance + * @returns {Object.} JSON object + */ + RunTestCaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunTestCaseMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunTestCaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RunTestCaseMetadata"; + }; + + return RunTestCaseMetadata; + })(); + + v3.BatchRunTestCasesRequest = (function() { + + /** + * Properties of a BatchRunTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IBatchRunTestCasesRequest + * @property {string|null} [parent] BatchRunTestCasesRequest parent + * @property {string|null} [environment] BatchRunTestCasesRequest environment + * @property {Array.|null} [testCases] BatchRunTestCasesRequest testCases + */ + + /** + * Constructs a new BatchRunTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a BatchRunTestCasesRequest. + * @implements IBatchRunTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest=} [properties] Properties to set + */ + function BatchRunTestCasesRequest(properties) { + this.testCases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRunTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @instance + */ + BatchRunTestCasesRequest.prototype.parent = ""; + + /** + * BatchRunTestCasesRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @instance + */ + BatchRunTestCasesRequest.prototype.environment = ""; + + /** + * BatchRunTestCasesRequest testCases. + * @member {Array.} testCases + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @instance + */ + BatchRunTestCasesRequest.prototype.testCases = $util.emptyArray; + + /** + * Creates a new BatchRunTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest} BatchRunTestCasesRequest instance + */ + BatchRunTestCasesRequest.create = function create(properties) { + return new BatchRunTestCasesRequest(properties); + }; + + /** + * Encodes the specified BatchRunTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest} message BatchRunTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + if (message.testCases != null && message.testCases.length) + for (var i = 0; i < message.testCases.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.testCases[i]); + return writer; + }; + + /** + * Encodes the specified BatchRunTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest} message BatchRunTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest} BatchRunTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.environment = reader.string(); + break; + } + case 3: { + if (!(message.testCases && message.testCases.length)) + message.testCases = []; + message.testCases.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest} BatchRunTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.testCases != null && message.hasOwnProperty("testCases")) { + if (!Array.isArray(message.testCases)) + return "testCases: array expected"; + for (var i = 0; i < message.testCases.length; ++i) + if (!$util.isString(message.testCases[i])) + return "testCases: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchRunTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest} BatchRunTestCasesRequest + */ + BatchRunTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.environment != null) + message.environment = String(object.environment); + if (object.testCases) { + if (!Array.isArray(object.testCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest.testCases: array expected"); + message.testCases = []; + for (var i = 0; i < object.testCases.length; ++i) + message.testCases[i] = String(object.testCases[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchRunTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest} message BatchRunTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCases = []; + if (options.defaults) { + object.parent = ""; + object.environment = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.testCases && message.testCases.length) { + object.testCases = []; + for (var j = 0; j < message.testCases.length; ++j) + object.testCases[j] = message.testCases[j]; + } + return object; + }; + + /** + * Converts this BatchRunTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchRunTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest"; + }; + + return BatchRunTestCasesRequest; + })(); + + v3.BatchRunTestCasesResponse = (function() { + + /** + * Properties of a BatchRunTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IBatchRunTestCasesResponse + * @property {Array.|null} [results] BatchRunTestCasesResponse results + */ + + /** + * Constructs a new BatchRunTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a BatchRunTestCasesResponse. + * @implements IBatchRunTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse=} [properties] Properties to set + */ + function BatchRunTestCasesResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRunTestCasesResponse results. + * @member {Array.} results + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @instance + */ + BatchRunTestCasesResponse.prototype.results = $util.emptyArray; + + /** + * Creates a new BatchRunTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse} BatchRunTestCasesResponse instance + */ + BatchRunTestCasesResponse.create = function create(properties) { + return new BatchRunTestCasesResponse(properties); + }; + + /** + * Encodes the specified BatchRunTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse} message BatchRunTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestCaseResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRunTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse} message BatchRunTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse} BatchRunTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.dialogflow.cx.v3.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse} BatchRunTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.verify(message.results[i], long + 1); + if (error) + return "results." + error; + } + } + return null; + }; + + /** + * Creates a BatchRunTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse} BatchRunTestCasesResponse + */ + BatchRunTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse.results: object expected"); + message.results[i] = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.fromObject(object.results[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchRunTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse} message BatchRunTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.toObject(message.results[j], options); + } + return object; + }; + + /** + * Converts this BatchRunTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchRunTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse"; + }; + + return BatchRunTestCasesResponse; + })(); + + v3.BatchRunTestCasesMetadata = (function() { + + /** + * Properties of a BatchRunTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IBatchRunTestCasesMetadata + * @property {Array.|null} [errors] BatchRunTestCasesMetadata errors + */ + + /** + * Constructs a new BatchRunTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a BatchRunTestCasesMetadata. + * @implements IBatchRunTestCasesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata=} [properties] Properties to set + */ + function BatchRunTestCasesMetadata(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRunTestCasesMetadata errors. + * @member {Array.} errors + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @instance + */ + BatchRunTestCasesMetadata.prototype.errors = $util.emptyArray; + + /** + * Creates a new BatchRunTestCasesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata instance + */ + BatchRunTestCasesMetadata.create = function create(properties) { + return new BatchRunTestCasesMetadata(properties); + }; + + /** + * Encodes the specified BatchRunTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata} message BatchRunTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRunTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata} message BatchRunTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.dialogflow.cx.v3.TestError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunTestCasesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunTestCasesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestError.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a BatchRunTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata + */ + BatchRunTestCasesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata.errors: object expected"); + message.errors[i] = $root.google.cloud.dialogflow.cx.v3.TestError.fromObject(object.errors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchRunTestCasesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata} message BatchRunTestCasesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunTestCasesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.dialogflow.cx.v3.TestError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this BatchRunTestCasesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchRunTestCasesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunTestCasesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunTestCasesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata"; + }; + + return BatchRunTestCasesMetadata; + })(); + + v3.TestError = (function() { + + /** + * Properties of a TestError. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITestError + * @property {string|null} [testCase] TestError testCase + * @property {google.rpc.IStatus|null} [status] TestError status + * @property {google.protobuf.ITimestamp|null} [testTime] TestError testTime + */ + + /** + * Constructs a new TestError. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TestError. + * @implements ITestError + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITestError=} [properties] Properties to set + */ + function TestError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestError testCase. + * @member {string} testCase + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @instance + */ + TestError.prototype.testCase = ""; + + /** + * TestError status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @instance + */ + TestError.prototype.status = null; + + /** + * TestError testTime. + * @member {google.protobuf.ITimestamp|null|undefined} testTime + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @instance + */ + TestError.prototype.testTime = null; + + /** + * Creates a new TestError instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TestError} TestError instance + */ + TestError.create = function create(properties) { + return new TestError(properties); + }; + + /** + * Encodes the specified TestError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestError.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestError} message TestError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.testCase); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.testTime != null && Object.hasOwnProperty.call(message, "testTime")) + $root.google.protobuf.Timestamp.encode(message.testTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestError} message TestError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TestError} TestError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestError.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TestError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.testCase = reader.string(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.testTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TestError} TestError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestError message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestError.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCase != null && message.hasOwnProperty("testCase")) + if (!$util.isString(message.testCase)) + return "testCase: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + if (message.testTime != null && message.hasOwnProperty("testTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.testTime, long + 1); + if (error) + return "testTime." + error; + } + return null; + }; + + /** + * Creates a TestError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TestError} TestError + */ + TestError.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TestError) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TestError(); + if (object.testCase != null) + message.testCase = String(object.testCase); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestError.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); + } + if (object.testTime != null) { + if (typeof object.testTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestError.testTime: object expected"); + message.testTime = $root.google.protobuf.Timestamp.fromObject(object.testTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3.TestError} message TestError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testCase = ""; + object.status = null; + object.testTime = null; + } + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = message.testCase; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.testTime != null && message.hasOwnProperty("testTime")) + object.testTime = $root.google.protobuf.Timestamp.toObject(message.testTime, options); + return object; + }; + + /** + * Converts this TestError to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @instance + * @returns {Object.} JSON object + */ + TestError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestError + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TestError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TestError"; + }; + + return TestError; + })(); + + v3.ImportTestCasesRequest = (function() { + + /** + * Properties of an ImportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportTestCasesRequest + * @property {string|null} [parent] ImportTestCasesRequest parent + * @property {string|null} [gcsUri] ImportTestCasesRequest gcsUri + * @property {Uint8Array|null} [content] ImportTestCasesRequest content + */ + + /** + * Constructs a new ImportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportTestCasesRequest. + * @implements IImportTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesRequest=} [properties] Properties to set + */ + function ImportTestCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @instance + */ + ImportTestCasesRequest.prototype.parent = ""; + + /** + * ImportTestCasesRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @instance + */ + ImportTestCasesRequest.prototype.gcsUri = null; + + /** + * ImportTestCasesRequest content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @instance + */ + ImportTestCasesRequest.prototype.content = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportTestCasesRequest source. + * @member {"gcsUri"|"content"|undefined} source + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @instance + */ + Object.defineProperty(ImportTestCasesRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri", "content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesRequest} ImportTestCasesRequest instance + */ + ImportTestCasesRequest.create = function create(properties) { + return new ImportTestCasesRequest(properties); + }; + + /** + * Encodes the specified ImportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesRequest} message ImportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesRequest.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.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified ImportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesRequest} message ImportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesRequest} ImportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesRequest} ImportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.source = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + return null; + }; + + /** + * Creates an ImportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesRequest} ImportTestCasesRequest + */ + ImportTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an ImportTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportTestCasesRequest} message ImportTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.source = "gcsUri"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.source = "content"; + } + return object; + }; + + /** + * Converts this ImportTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportTestCasesRequest"; + }; + + return ImportTestCasesRequest; + })(); + + v3.ImportTestCasesResponse = (function() { + + /** + * Properties of an ImportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportTestCasesResponse + * @property {Array.|null} [names] ImportTestCasesResponse names + */ + + /** + * Constructs a new ImportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportTestCasesResponse. + * @implements IImportTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesResponse=} [properties] Properties to set + */ + function ImportTestCasesResponse(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTestCasesResponse names. + * @member {Array.} names + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @instance + */ + ImportTestCasesResponse.prototype.names = $util.emptyArray; + + /** + * Creates a new ImportTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesResponse} ImportTestCasesResponse instance + */ + ImportTestCasesResponse.create = function create(properties) { + return new ImportTestCasesResponse(properties); + }; + + /** + * Encodes the specified ImportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesResponse} message ImportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified ImportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesResponse} message ImportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesResponse} ImportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesResponse} ImportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates an ImportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesResponse} ImportTestCasesResponse + */ + ImportTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportTestCasesResponse(); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportTestCasesResponse.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from an ImportTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportTestCasesResponse} message ImportTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this ImportTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ImportTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportTestCasesResponse"; + }; + + return ImportTestCasesResponse; + })(); + + v3.ImportTestCasesMetadata = (function() { + + /** + * Properties of an ImportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportTestCasesMetadata + * @property {Array.|null} [errors] ImportTestCasesMetadata errors + */ + + /** + * Constructs a new ImportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportTestCasesMetadata. + * @implements IImportTestCasesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata=} [properties] Properties to set + */ + function ImportTestCasesMetadata(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTestCasesMetadata errors. + * @member {Array.} errors + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @instance + */ + ImportTestCasesMetadata.prototype.errors = $util.emptyArray; + + /** + * Creates a new ImportTestCasesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata} ImportTestCasesMetadata instance + */ + ImportTestCasesMetadata.create = function create(properties) { + return new ImportTestCasesMetadata(properties); + }; + + /** + * Encodes the specified ImportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata} message ImportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestCaseError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata} message ImportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata} ImportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.dialogflow.cx.v3.TestCaseError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata} ImportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTestCasesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTestCasesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCaseError.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates an ImportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata} ImportTestCasesMetadata + */ + ImportTestCasesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata.errors: object expected"); + message.errors[i] = $root.google.cloud.dialogflow.cx.v3.TestCaseError.fromObject(object.errors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportTestCasesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata} message ImportTestCasesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTestCasesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.dialogflow.cx.v3.TestCaseError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this ImportTestCasesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportTestCasesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportTestCasesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportTestCasesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata"; + }; + + return ImportTestCasesMetadata; + })(); + + v3.TestCaseError = (function() { + + /** + * Properties of a TestCaseError. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITestCaseError + * @property {google.cloud.dialogflow.cx.v3.ITestCase|null} [testCase] TestCaseError testCase + * @property {google.rpc.IStatus|null} [status] TestCaseError status + */ + + /** + * Constructs a new TestCaseError. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TestCaseError. + * @implements ITestCaseError + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITestCaseError=} [properties] Properties to set + */ + function TestCaseError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCaseError testCase. + * @member {google.cloud.dialogflow.cx.v3.ITestCase|null|undefined} testCase + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @instance + */ + TestCaseError.prototype.testCase = null; + + /** + * TestCaseError status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @instance + */ + TestCaseError.prototype.status = null; + + /** + * Creates a new TestCaseError instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCaseError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TestCaseError} TestCaseError instance + */ + TestCaseError.create = function create(properties) { + return new TestCaseError(properties); + }; + + /** + * Encodes the specified TestCaseError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseError.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCaseError} message TestCaseError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + $root.google.cloud.dialogflow.cx.v3.TestCase.encode(message.testCase, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestCaseError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TestCaseError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3.ITestCaseError} message TestCaseError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCaseError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TestCaseError} TestCaseError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseError.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TestCaseError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCaseError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TestCaseError} TestCaseError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCaseError message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCaseError.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCase != null && message.hasOwnProperty("testCase")) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCase.verify(message.testCase, long + 1); + if (error) + return "testCase." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a TestCaseError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TestCaseError} TestCaseError + */ + TestCaseError.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TestCaseError) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TestCaseError(); + if (object.testCase != null) { + if (typeof object.testCase !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCaseError.testCase: object expected"); + message.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.fromObject(object.testCase, long + 1); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TestCaseError.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestCaseError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3.TestCaseError} message TestCaseError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCaseError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testCase = null; + object.status = null; + } + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = $root.google.cloud.dialogflow.cx.v3.TestCase.toObject(message.testCase, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this TestCaseError to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @instance + * @returns {Object.} JSON object + */ + TestCaseError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCaseError + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TestCaseError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCaseError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TestCaseError"; + }; + + return TestCaseError; + })(); + + v3.ExportTestCasesRequest = (function() { + + /** + * Properties of an ExportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportTestCasesRequest + * @property {string|null} [parent] ExportTestCasesRequest parent + * @property {string|null} [gcsUri] ExportTestCasesRequest gcsUri + * @property {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat|null} [dataFormat] ExportTestCasesRequest dataFormat + * @property {string|null} [filter] ExportTestCasesRequest filter + */ + + /** + * Constructs a new ExportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportTestCasesRequest. + * @implements IExportTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesRequest=} [properties] Properties to set + */ + function ExportTestCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.parent = ""; + + /** + * ExportTestCasesRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.gcsUri = null; + + /** + * ExportTestCasesRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.dataFormat = 0; + + /** + * ExportTestCasesRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.filter = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportTestCasesRequest destination. + * @member {"gcsUri"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @instance + */ + Object.defineProperty(ExportTestCasesRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest} ExportTestCasesRequest instance + */ + ExportTestCasesRequest.create = function create(properties) { + return new ExportTestCasesRequest(properties); + }; + + /** + * Encodes the specified ExportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesRequest} message ExportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesRequest.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.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ExportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesRequest} message ExportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest} ExportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.dataFormat = reader.int32(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest} ExportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.destination = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates an ExportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest} ExportTestCasesRequest + */ + ExportTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON": + case 2: + message.dataFormat = 2; + break; + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from an ExportTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest} message ExportTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.destination = "gcsUri"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat[message.dataFormat] : message.dataFormat; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ExportTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportTestCasesRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON=2 JSON value + */ + ExportTestCasesRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); + + return ExportTestCasesRequest; + })(); + + v3.ExportTestCasesResponse = (function() { + + /** + * Properties of an ExportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportTestCasesResponse + * @property {string|null} [gcsUri] ExportTestCasesResponse gcsUri + * @property {Uint8Array|null} [content] ExportTestCasesResponse content + */ + + /** + * Constructs a new ExportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportTestCasesResponse. + * @implements IExportTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesResponse=} [properties] Properties to set + */ + function ExportTestCasesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportTestCasesResponse gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @instance + */ + ExportTestCasesResponse.prototype.gcsUri = null; + + /** + * ExportTestCasesResponse content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @instance + */ + ExportTestCasesResponse.prototype.content = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportTestCasesResponse destination. + * @member {"gcsUri"|"content"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @instance + */ + Object.defineProperty(ExportTestCasesResponse.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri", "content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesResponse} ExportTestCasesResponse instance + */ + ExportTestCasesResponse.create = function create(properties) { + return new ExportTestCasesResponse(properties); + }; + + /** + * Encodes the specified ExportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesResponse} message ExportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified ExportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesResponse} message ExportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesResponse} ExportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + case 2: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesResponse} ExportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.destination = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + return null; + }; + + /** + * Creates an ExportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesResponse} ExportTestCasesResponse + */ + ExportTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportTestCasesResponse(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an ExportTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportTestCasesResponse} message ExportTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.destination = "gcsUri"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.destination = "content"; + } + return object; + }; + + /** + * Converts this ExportTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ExportTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportTestCasesResponse"; + }; + + return ExportTestCasesResponse; + })(); + + v3.ExportTestCasesMetadata = (function() { + + /** + * Properties of an ExportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportTestCasesMetadata + */ + + /** + * Constructs a new ExportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportTestCasesMetadata. + * @implements IExportTestCasesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata=} [properties] Properties to set + */ + function ExportTestCasesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportTestCasesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata} ExportTestCasesMetadata instance + */ + ExportTestCasesMetadata.create = function create(properties) { + return new ExportTestCasesMetadata(properties); + }; + + /** + * Encodes the specified ExportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata} message ExportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata} message ExportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata} ExportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata} ExportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTestCasesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTestCasesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata} ExportTestCasesMetadata + */ + ExportTestCasesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata(); + }; + + /** + * Creates a plain object from an ExportTestCasesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata} message ExportTestCasesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTestCasesMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportTestCasesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportTestCasesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportTestCasesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTestCasesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata"; + }; + + return ExportTestCasesMetadata; + })(); + + v3.ListTestCaseResultsRequest = (function() { + + /** + * Properties of a ListTestCaseResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListTestCaseResultsRequest + * @property {string|null} [parent] ListTestCaseResultsRequest parent + * @property {number|null} [pageSize] ListTestCaseResultsRequest pageSize + * @property {string|null} [pageToken] ListTestCaseResultsRequest pageToken + * @property {string|null} [filter] ListTestCaseResultsRequest filter + */ + + /** + * Constructs a new ListTestCaseResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListTestCaseResultsRequest. + * @implements IListTestCaseResultsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest=} [properties] Properties to set + */ + function ListTestCaseResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCaseResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.parent = ""; + + /** + * ListTestCaseResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.pageSize = 0; + + /** + * ListTestCaseResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.pageToken = ""; + + /** + * ListTestCaseResultsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.filter = ""; + + /** + * Creates a new ListTestCaseResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest} ListTestCaseResultsRequest instance + */ + ListTestCaseResultsRequest.create = function create(properties) { + return new ListTestCaseResultsRequest(properties); + }; + + /** + * Encodes the specified ListTestCaseResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest} message ListTestCaseResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsRequest.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 ListTestCaseResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest} message ListTestCaseResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest} ListTestCaseResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest} ListTestCaseResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCaseResultsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCaseResultsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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 ListTestCaseResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest} ListTestCaseResultsRequest + */ + ListTestCaseResultsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(); + 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 ListTestCaseResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest} message ListTestCaseResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCaseResultsRequest.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 ListTestCaseResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTestCaseResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCaseResultsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCaseResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest"; + }; + + return ListTestCaseResultsRequest; + })(); + + v3.ListTestCaseResultsResponse = (function() { + + /** + * Properties of a ListTestCaseResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListTestCaseResultsResponse + * @property {Array.|null} [testCaseResults] ListTestCaseResultsResponse testCaseResults + * @property {string|null} [nextPageToken] ListTestCaseResultsResponse nextPageToken + */ + + /** + * Constructs a new ListTestCaseResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListTestCaseResultsResponse. + * @implements IListTestCaseResultsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse=} [properties] Properties to set + */ + function ListTestCaseResultsResponse(properties) { + this.testCaseResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCaseResultsResponse testCaseResults. + * @member {Array.} testCaseResults + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @instance + */ + ListTestCaseResultsResponse.prototype.testCaseResults = $util.emptyArray; + + /** + * ListTestCaseResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @instance + */ + ListTestCaseResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTestCaseResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse} ListTestCaseResultsResponse instance + */ + ListTestCaseResultsResponse.create = function create(properties) { + return new ListTestCaseResultsResponse(properties); + }; + + /** + * Encodes the specified ListTestCaseResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse} message ListTestCaseResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCaseResults != null && message.testCaseResults.length) + for (var i = 0; i < message.testCaseResults.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestCaseResult.encode(message.testCaseResults[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 ListTestCaseResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse} message ListTestCaseResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse} ListTestCaseResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testCaseResults && message.testCaseResults.length)) + message.testCaseResults = []; + message.testCaseResults.push($root.google.cloud.dialogflow.cx.v3.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse} ListTestCaseResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCaseResultsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCaseResultsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCaseResults != null && message.hasOwnProperty("testCaseResults")) { + if (!Array.isArray(message.testCaseResults)) + return "testCaseResults: array expected"; + for (var i = 0; i < message.testCaseResults.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.verify(message.testCaseResults[i], long + 1); + if (error) + return "testCaseResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTestCaseResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse} ListTestCaseResultsResponse + */ + ListTestCaseResultsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse(); + if (object.testCaseResults) { + if (!Array.isArray(object.testCaseResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse.testCaseResults: array expected"); + message.testCaseResults = []; + for (var i = 0; i < object.testCaseResults.length; ++i) { + if (typeof object.testCaseResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse.testCaseResults: object expected"); + message.testCaseResults[i] = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.fromObject(object.testCaseResults[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTestCaseResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse} message ListTestCaseResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCaseResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCaseResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.testCaseResults && message.testCaseResults.length) { + object.testCaseResults = []; + for (var j = 0; j < message.testCaseResults.length; ++j) + object.testCaseResults[j] = $root.google.cloud.dialogflow.cx.v3.TestCaseResult.toObject(message.testCaseResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTestCaseResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTestCaseResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCaseResultsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCaseResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse"; + }; + + return ListTestCaseResultsResponse; + })(); + + v3.GetTestCaseResultRequest = (function() { + + /** + * Properties of a GetTestCaseResultRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetTestCaseResultRequest + * @property {string|null} [name] GetTestCaseResultRequest name + */ + + /** + * Constructs a new GetTestCaseResultRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetTestCaseResultRequest. + * @implements IGetTestCaseResultRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest=} [properties] Properties to set + */ + function GetTestCaseResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTestCaseResultRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @instance + */ + GetTestCaseResultRequest.prototype.name = ""; + + /** + * Creates a new GetTestCaseResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest} GetTestCaseResultRequest instance + */ + GetTestCaseResultRequest.create = function create(properties) { + return new GetTestCaseResultRequest(properties); + }; + + /** + * Encodes the specified GetTestCaseResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest} message GetTestCaseResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseResultRequest.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 GetTestCaseResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest} message GetTestCaseResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest} GetTestCaseResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseResultRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest} GetTestCaseResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTestCaseResultRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTestCaseResultRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTestCaseResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest} GetTestCaseResultRequest + */ + GetTestCaseResultRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTestCaseResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest} message GetTestCaseResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTestCaseResultRequest.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 GetTestCaseResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetTestCaseResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTestCaseResultRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTestCaseResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest"; + }; + + return GetTestCaseResultRequest; + })(); + + /** + * TestResult enum. + * @name google.cloud.dialogflow.cx.v3.TestResult + * @enum {number} + * @property {number} TEST_RESULT_UNSPECIFIED=0 TEST_RESULT_UNSPECIFIED value + * @property {number} PASSED=1 PASSED value + * @property {number} FAILED=2 FAILED value + */ + v3.TestResult = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEST_RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PASSED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + v3.Intents = (function() { + + /** + * Constructs a new Intents service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Intents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Intents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Intents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Intents; + + /** + * Creates new Intents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Intents} RPC service. Useful where requests and/or responses are streamed. + */ + Intents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|listIntents}. + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @typedef ListIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListIntentsResponse} [response] ListIntentsResponse + */ + + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListIntentsRequest} request ListIntentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Intents.ListIntentsCallback} callback Node-style callback called with the error, if any, and ListIntentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.listIntents = function listIntents(request, callback) { + return this.rpcCall(listIntents, $root.google.cloud.dialogflow.cx.v3.ListIntentsRequest, $root.google.cloud.dialogflow.cx.v3.ListIntentsResponse, request, callback); + }, "name", { value: "ListIntents" }); + + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListIntentsRequest} request ListIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|getIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @typedef GetIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Intent} [response] Intent + */ + + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetIntentRequest} request GetIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Intents.GetIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.getIntent = function getIntent(request, callback) { + return this.rpcCall(getIntent, $root.google.cloud.dialogflow.cx.v3.GetIntentRequest, $root.google.cloud.dialogflow.cx.v3.Intent, request, callback); + }, "name", { value: "GetIntent" }); + + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetIntentRequest} request GetIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|createIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @typedef CreateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Intent} [response] Intent + */ + + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Intents.CreateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.createIntent = function createIntent(request, callback) { + return this.rpcCall(createIntent, $root.google.cloud.dialogflow.cx.v3.CreateIntentRequest, $root.google.cloud.dialogflow.cx.v3.Intent, request, callback); + }, "name", { value: "CreateIntent" }); + + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|updateIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @typedef UpdateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Intent} [response] Intent + */ + + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Intents.UpdateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.updateIntent = function updateIntent(request, callback) { + return this.rpcCall(updateIntent, $root.google.cloud.dialogflow.cx.v3.UpdateIntentRequest, $root.google.cloud.dialogflow.cx.v3.Intent, request, callback); + }, "name", { value: "UpdateIntent" }); + + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|deleteIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @typedef DeleteIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Intents.DeleteIntentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.deleteIntent = function deleteIntent(request, callback) { + return this.rpcCall(deleteIntent, $root.google.cloud.dialogflow.cx.v3.DeleteIntentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteIntent" }); + + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|importIntents}. + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @typedef ImportIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportIntents. + * @function importIntents + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsRequest} request ImportIntentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Intents.ImportIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.importIntents = function importIntents(request, callback) { + return this.rpcCall(importIntents, $root.google.cloud.dialogflow.cx.v3.ImportIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportIntents" }); + + /** + * Calls ImportIntents. + * @function importIntents + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsRequest} request ImportIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Intents|exportIntents}. + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @typedef ExportIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportIntents. + * @function exportIntents + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsRequest} request ExportIntentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Intents.ExportIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.exportIntents = function exportIntents(request, callback) { + return this.rpcCall(exportIntents, $root.google.cloud.dialogflow.cx.v3.ExportIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportIntents" }); + + /** + * Calls ExportIntents. + * @function exportIntents + * @memberof google.cloud.dialogflow.cx.v3.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsRequest} request ExportIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Intents; + })(); + + v3.Intent = (function() { + + /** + * Properties of an Intent. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IIntent + * @property {string|null} [name] Intent name + * @property {string|null} [displayName] Intent displayName + * @property {Array.|null} [trainingPhrases] Intent trainingPhrases + * @property {Array.|null} [parameters] Intent parameters + * @property {number|null} [priority] Intent priority + * @property {boolean|null} [isFallback] Intent isFallback + * @property {Object.|null} [labels] Intent labels + * @property {string|null} [description] Intent description + * @property {string|null} [dtmfPattern] Intent dtmfPattern + */ + + /** + * Constructs a new Intent. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Intent. + * @implements IIntent + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IIntent=} [properties] Properties to set + */ + function Intent(properties) { + this.trainingPhrases = []; + this.parameters = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Intent name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.name = ""; + + /** + * Intent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.displayName = ""; + + /** + * Intent trainingPhrases. + * @member {Array.} trainingPhrases + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.trainingPhrases = $util.emptyArray; + + /** + * Intent parameters. + * @member {Array.} parameters + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.parameters = $util.emptyArray; + + /** + * Intent priority. + * @member {number} priority + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.priority = 0; + + /** + * Intent isFallback. + * @member {boolean} isFallback + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.isFallback = false; + + /** + * Intent labels. + * @member {Object.} labels + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.labels = $util.emptyObject; + + /** + * Intent description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.description = ""; + + /** + * Intent dtmfPattern. + * @member {string} dtmfPattern + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + */ + Intent.prototype.dtmfPattern = ""; + + /** + * Creates a new Intent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Intent} Intent instance + */ + Intent.create = function create(properties) { + return new Intent(properties); + }; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.trainingPhrases != null && message.trainingPhrases.length) + for (var i = 0; i < message.trainingPhrases.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.encode(message.trainingPhrases[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Intent.Parameter.encode(message.parameters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.priority); + if (message.isFallback != null && Object.hasOwnProperty.call(message, "isFallback")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isFallback); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.dtmfPattern != null && Object.hasOwnProperty.call(message, "dtmfPattern")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.dtmfPattern); + return writer; + }; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Intent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.trainingPhrases && message.trainingPhrases.length)) + message.trainingPhrases = []; + message.trainingPhrases.push($root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.dialogflow.cx.v3.Intent.Parameter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.priority = reader.int32(); + break; + } + case 6: { + message.isFallback = reader.bool(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 16: { + message.dtmfPattern = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Intent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Intent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.trainingPhrases != null && message.hasOwnProperty("trainingPhrases")) { + if (!Array.isArray(message.trainingPhrases)) + return "trainingPhrases: array expected"; + for (var i = 0; i < message.trainingPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.verify(message.trainingPhrases[i], long + 1); + if (error) + return "trainingPhrases." + error; + } + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.Parameter.verify(message.parameters[i], long + 1); + if (error) + return "parameters." + error; + } + } + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + if (typeof message.isFallback !== "boolean") + return "isFallback: boolean expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dtmfPattern != null && message.hasOwnProperty("dtmfPattern")) + if (!$util.isString(message.dtmfPattern)) + return "dtmfPattern: string expected"; + return null; + }; + + /** + * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Intent} Intent + */ + Intent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Intent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Intent(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.trainingPhrases) { + if (!Array.isArray(object.trainingPhrases)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Intent.trainingPhrases: array expected"); + message.trainingPhrases = []; + for (var i = 0; i < object.trainingPhrases.length; ++i) { + if (typeof object.trainingPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Intent.trainingPhrases: object expected"); + message.trainingPhrases[i] = $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.fromObject(object.trainingPhrases[i], long + 1); + } + } + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Intent.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Intent.parameters: object expected"); + message.parameters[i] = $root.google.cloud.dialogflow.cx.v3.Intent.Parameter.fromObject(object.parameters[i], long + 1); + } + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.isFallback != null) + message.isFallback = Boolean(object.isFallback); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Intent.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.dtmfPattern != null) + message.dtmfPattern = String(object.dtmfPattern); + return message; + }; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent} message Intent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Intent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.trainingPhrases = []; + object.parameters = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.priority = 0; + object.isFallback = false; + object.description = ""; + object.dtmfPattern = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.trainingPhrases && message.trainingPhrases.length) { + object.trainingPhrases = []; + for (var j = 0; j < message.trainingPhrases.length; ++j) + object.trainingPhrases[j] = $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.toObject(message.trainingPhrases[j], options); + } + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.dialogflow.cx.v3.Intent.Parameter.toObject(message.parameters[j], options); + } + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = message.priority; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + object.isFallback = message.isFallback; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dtmfPattern != null && message.hasOwnProperty("dtmfPattern")) + object.dtmfPattern = message.dtmfPattern; + return object; + }; + + /** + * Converts this Intent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @instance + * @returns {Object.} JSON object + */ + Intent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Intent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Intent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Intent"; + }; + + Intent.TrainingPhrase = (function() { + + /** + * Properties of a TrainingPhrase. + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @interface ITrainingPhrase + * @property {string|null} [id] TrainingPhrase id + * @property {Array.|null} [parts] TrainingPhrase parts + * @property {number|null} [repeatCount] TrainingPhrase repeatCount + */ + + /** + * Constructs a new TrainingPhrase. + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @classdesc Represents a TrainingPhrase. + * @implements ITrainingPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase=} [properties] Properties to set + */ + function TrainingPhrase(properties) { + this.parts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainingPhrase id. + * @member {string} id + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.id = ""; + + /** + * TrainingPhrase parts. + * @member {Array.} parts + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.parts = $util.emptyArray; + + /** + * TrainingPhrase repeatCount. + * @member {number} repeatCount + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.repeatCount = 0; + + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase} TrainingPhrase instance + */ + TrainingPhrase.create = function create(properties) { + return new TrainingPhrase(properties); + }; + + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.encode(message.parts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.repeatCount != null && Object.hasOwnProperty.call(message, "repeatCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatCount); + return writer; + }; + + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.repeatCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainingPhrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainingPhrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.verify(message.parts[i], long + 1); + if (error) + return "parts." + error; + } + } + if (message.repeatCount != null && message.hasOwnProperty("repeatCount")) + if (!$util.isInteger(message.repeatCount)) + return "repeatCount: integer expected"; + return null; + }; + + /** + * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase} TrainingPhrase + */ + TrainingPhrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase(); + if (object.id != null) + message.id = String(object.id); + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.parts: object expected"); + message.parts[i] = $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.fromObject(object.parts[i], long + 1); + } + } + if (object.repeatCount != null) + message.repeatCount = object.repeatCount | 0; + return message; + }; + + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase} message TrainingPhrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainingPhrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) { + object.id = ""; + object.repeatCount = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.toObject(message.parts[j], options); + } + if (message.repeatCount != null && message.hasOwnProperty("repeatCount")) + object.repeatCount = message.repeatCount; + return object; + }; + + /** + * Converts this TrainingPhrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @instance + * @returns {Object.} JSON object + */ + TrainingPhrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainingPhrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainingPhrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase"; + }; + + TrainingPhrase.Part = (function() { + + /** + * Properties of a Part. + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @interface IPart + * @property {string|null} [text] Part text + * @property {string|null} [parameterId] Part parameterId + */ + + /** + * Constructs a new Part. + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.text = ""; + + /** + * Part parameterId. + * @member {string} parameterId + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.parameterId = ""; + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.parameterId != null && Object.hasOwnProperty.call(message, "parameterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parameterId); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.parameterId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.parameterId != null && message.hasOwnProperty("parameterId")) + if (!$util.isString(message.parameterId)) + return "parameterId: string expected"; + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part} Part + */ + Part.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part(); + if (object.text != null) + message.text = String(object.text); + if (object.parameterId != null) + message.parameterId = String(object.parameterId); + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.parameterId = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.parameterId != null && message.hasOwnProperty("parameterId")) + object.parameterId = message.parameterId; + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Part + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part"; + }; + + return Part; + })(); + + return TrainingPhrase; + })(); + + Intent.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @interface IParameter + * @property {string|null} [id] Parameter id + * @property {string|null} [entityType] Parameter entityType + * @property {boolean|null} [isList] Parameter isList + * @property {boolean|null} [redact] Parameter redact + */ + + /** + * Constructs a new Parameter. + * @memberof google.cloud.dialogflow.cx.v3.Intent + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Intent.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter id. + * @member {string} id + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @instance + */ + Parameter.prototype.id = ""; + + /** + * Parameter entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @instance + */ + Parameter.prototype.entityType = ""; + + /** + * Parameter isList. + * @member {boolean} isList + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @instance + */ + Parameter.prototype.isList = false; + + /** + * Parameter redact. + * @member {boolean} redact + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @instance + */ + Parameter.prototype.redact = false; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.IParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Intent.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.Parameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isList); + if (message.redact != null && Object.hasOwnProperty.call(message, "redact")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.redact); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Intent.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Intent.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.entityType = reader.string(); + break; + } + case 3: { + message.isList = reader.bool(); + break; + } + case 4: { + message.redact = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.isList != null && message.hasOwnProperty("isList")) + if (typeof message.isList !== "boolean") + return "isList: boolean expected"; + if (message.redact != null && message.hasOwnProperty("redact")) + if (typeof message.redact !== "boolean") + return "redact: boolean expected"; + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Intent.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Intent.Parameter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Intent.Parameter(); + if (object.id != null) + message.id = String(object.id); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.isList != null) + message.isList = Boolean(object.isList); + if (object.redact != null) + message.redact = Boolean(object.redact); + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Intent.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.entityType = ""; + object.isList = false; + object.redact = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.isList != null && message.hasOwnProperty("isList")) + object.isList = message.isList; + if (message.redact != null && message.hasOwnProperty("redact")) + object.redact = message.redact; + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Intent.Parameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Intent.Parameter"; + }; + + return Parameter; + })(); + + return Intent; + })(); + + v3.ListIntentsRequest = (function() { + + /** + * Properties of a ListIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListIntentsRequest + * @property {string|null} [parent] ListIntentsRequest parent + * @property {string|null} [languageCode] ListIntentsRequest languageCode + * @property {google.cloud.dialogflow.cx.v3.IntentView|null} [intentView] ListIntentsRequest intentView + * @property {number|null} [pageSize] ListIntentsRequest pageSize + * @property {string|null} [pageToken] ListIntentsRequest pageToken + */ + + /** + * Constructs a new ListIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListIntentsRequest. + * @implements IListIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListIntentsRequest=} [properties] Properties to set + */ + function ListIntentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.parent = ""; + + /** + * ListIntentsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.languageCode = ""; + + /** + * ListIntentsRequest intentView. + * @member {google.cloud.dialogflow.cx.v3.IntentView} intentView + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.intentView = 0; + + /** + * ListIntentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageSize = 0; + + /** + * ListIntentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsRequest} ListIntentsRequest instance + */ + ListIntentsRequest.create = function create(properties) { + return new ListIntentsRequest(properties); + }; + + /** + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.intentView); + return writer; + }; + + /** + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsRequest} ListIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 5: { + message.intentView = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsRequest} ListIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIntentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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"; + return null; + }; + + /** + * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsRequest} ListIntentsRequest + */ + ListIntentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListIntentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + default: + if (typeof object.intentView === "number") { + message.intentView = object.intentView; + break; + } + break; + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_PARTIAL": + case 1: + message.intentView = 1; + break; + case "INTENT_VIEW_FULL": + case 2: + message.intentView = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListIntentsRequest} message ListIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.IntentView[message.intentView] === undefined ? message.intentView : $root.google.cloud.dialogflow.cx.v3.IntentView[message.intentView] : message.intentView; + return object; + }; + + /** + * Converts this ListIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListIntentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListIntentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListIntentsRequest"; + }; + + return ListIntentsRequest; + })(); + + v3.ListIntentsResponse = (function() { + + /** + * Properties of a ListIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListIntentsResponse + * @property {Array.|null} [intents] ListIntentsResponse intents + * @property {string|null} [nextPageToken] ListIntentsResponse nextPageToken + */ + + /** + * Constructs a new ListIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListIntentsResponse. + * @implements IListIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListIntentsResponse=} [properties] Properties to set + */ + function ListIntentsResponse(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @instance + */ + ListIntentsResponse.prototype.intents = $util.emptyArray; + + /** + * ListIntentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @instance + */ + ListIntentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsResponse} ListIntentsResponse instance + */ + ListIntentsResponse.create = function create(properties) { + return new ListIntentsResponse(properties); + }; + + /** + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Intent.encode(message.intents[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 ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsResponse} ListIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.cx.v3.Intent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsResponse} ListIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIntentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.verify(message.intents[i], long + 1); + if (error) + return "intents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListIntentsResponse} ListIntentsResponse + */ + ListIntentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListIntentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListIntentsResponse.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.cx.v3.Intent.fromObject(object.intents[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListIntentsResponse} message ListIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.cx.v3.Intent.toObject(message.intents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListIntentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListIntentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListIntentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListIntentsResponse"; + }; + + return ListIntentsResponse; + })(); + + v3.GetIntentRequest = (function() { + + /** + * Properties of a GetIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetIntentRequest + * @property {string|null} [name] GetIntentRequest name + * @property {string|null} [languageCode] GetIntentRequest languageCode + */ + + /** + * Constructs a new GetIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetIntentRequest. + * @implements IGetIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetIntentRequest=} [properties] Properties to set + */ + function GetIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @instance + */ + GetIntentRequest.prototype.name = ""; + + /** + * GetIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @instance + */ + GetIntentRequest.prototype.languageCode = ""; + + /** + * Creates a new GetIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetIntentRequest} GetIntentRequest instance + */ + GetIntentRequest.create = function create(properties) { + return new GetIntentRequest(properties); + }; + + /** + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIntentRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetIntentRequest} GetIntentRequest + */ + GetIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetIntentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetIntentRequest} message GetIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @instance + * @returns {Object.} JSON object + */ + GetIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetIntentRequest"; + }; + + return GetIntentRequest; + })(); + + v3.CreateIntentRequest = (function() { + + /** + * Properties of a CreateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateIntentRequest + * @property {string|null} [parent] CreateIntentRequest parent + * @property {google.cloud.dialogflow.cx.v3.IIntent|null} [intent] CreateIntentRequest intent + * @property {string|null} [languageCode] CreateIntentRequest languageCode + */ + + /** + * Constructs a new CreateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateIntentRequest. + * @implements ICreateIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateIntentRequest=} [properties] Properties to set + */ + function CreateIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateIntentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.parent = ""; + + /** + * CreateIntentRequest intent. + * @member {google.cloud.dialogflow.cx.v3.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.intent = null; + + /** + * CreateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateIntentRequest} CreateIntentRequest instance + */ + CreateIntentRequest.create = function create(properties) { + return new CreateIntentRequest(properties); + }; + + /** + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIntentRequest.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.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3.Intent.encode(message.intent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateIntentRequest} CreateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateIntentRequest} CreateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateIntentRequest} CreateIntentRequest + */ + CreateIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateIntentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.fromObject(object.intent, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateIntentRequest} message CreateIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.intent = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateIntentRequest"; + }; + + return CreateIntentRequest; + })(); + + v3.UpdateIntentRequest = (function() { + + /** + * Properties of an UpdateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateIntentRequest + * @property {google.cloud.dialogflow.cx.v3.IIntent|null} [intent] UpdateIntentRequest intent + * @property {string|null} [languageCode] UpdateIntentRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateIntentRequest updateMask + */ + + /** + * Constructs a new UpdateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateIntentRequest. + * @implements IUpdateIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateIntentRequest=} [properties] Properties to set + */ + function UpdateIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateIntentRequest intent. + * @member {google.cloud.dialogflow.cx.v3.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.intent = null; + + /** + * UpdateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.languageCode = ""; + + /** + * UpdateIntentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateIntentRequest} UpdateIntentRequest instance + */ + UpdateIntentRequest.create = function create(properties) { + return new UpdateIntentRequest(properties); + }; + + /** + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateIntentRequest} UpdateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateIntentRequest} UpdateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateIntentRequest} UpdateIntentRequest + */ + UpdateIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateIntentRequest(); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.fromObject(object.intent, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateIntentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateIntentRequest} message UpdateIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateIntentRequest"; + }; + + return UpdateIntentRequest; + })(); + + v3.DeleteIntentRequest = (function() { + + /** + * Properties of a DeleteIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteIntentRequest + * @property {string|null} [name] DeleteIntentRequest name + */ + + /** + * Constructs a new DeleteIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteIntentRequest. + * @implements IDeleteIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteIntentRequest=} [properties] Properties to set + */ + function DeleteIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @instance + */ + DeleteIntentRequest.prototype.name = ""; + + /** + * Creates a new DeleteIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteIntentRequest} DeleteIntentRequest instance + */ + DeleteIntentRequest.create = function create(properties) { + return new DeleteIntentRequest(properties); + }; + + /** + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIntentRequest.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 DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteIntentRequest} DeleteIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteIntentRequest} DeleteIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteIntentRequest} DeleteIntentRequest + */ + DeleteIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteIntentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteIntentRequest} message DeleteIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteIntentRequest.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 DeleteIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteIntentRequest"; + }; + + return DeleteIntentRequest; + })(); + + /** + * IntentView enum. + * @name google.cloud.dialogflow.cx.v3.IntentView + * @enum {number} + * @property {number} INTENT_VIEW_UNSPECIFIED=0 INTENT_VIEW_UNSPECIFIED value + * @property {number} INTENT_VIEW_PARTIAL=1 INTENT_VIEW_PARTIAL value + * @property {number} INTENT_VIEW_FULL=2 INTENT_VIEW_FULL value + */ + v3.IntentView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTENT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT_VIEW_PARTIAL"] = 1; + values[valuesById[2] = "INTENT_VIEW_FULL"] = 2; + return values; + })(); + + v3.ImportIntentsRequest = (function() { + + /** + * Properties of an ImportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportIntentsRequest + * @property {string|null} [parent] ImportIntentsRequest parent + * @property {string|null} [intentsUri] ImportIntentsRequest intentsUri + * @property {google.cloud.dialogflow.cx.v3.IInlineSource|null} [intentsContent] ImportIntentsRequest intentsContent + * @property {google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption|null} [mergeOption] ImportIntentsRequest mergeOption + */ + + /** + * Constructs a new ImportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportIntentsRequest. + * @implements IImportIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsRequest=} [properties] Properties to set + */ + function ImportIntentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.parent = ""; + + /** + * ImportIntentsRequest intentsUri. + * @member {string|null|undefined} intentsUri + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.intentsUri = null; + + /** + * ImportIntentsRequest intentsContent. + * @member {google.cloud.dialogflow.cx.v3.IInlineSource|null|undefined} intentsContent + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.intentsContent = null; + + /** + * ImportIntentsRequest mergeOption. + * @member {google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption} mergeOption + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.mergeOption = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportIntentsRequest intents. + * @member {"intentsUri"|"intentsContent"|undefined} intents + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @instance + */ + Object.defineProperty(ImportIntentsRequest.prototype, "intents", { + get: $util.oneOfGetter($oneOfFields = ["intentsUri", "intentsContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsRequest} ImportIntentsRequest instance + */ + ImportIntentsRequest.create = function create(properties) { + return new ImportIntentsRequest(properties); + }; + + /** + * Encodes the specified ImportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsRequest} message ImportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsRequest.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.intentsUri != null && Object.hasOwnProperty.call(message, "intentsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intentsUri); + if (message.intentsContent != null && Object.hasOwnProperty.call(message, "intentsContent")) + $root.google.cloud.dialogflow.cx.v3.InlineSource.encode(message.intentsContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mergeOption != null && Object.hasOwnProperty.call(message, "mergeOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mergeOption); + return writer; + }; + + /** + * Encodes the specified ImportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsRequest} message ImportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsRequest} ImportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.intentsUri = reader.string(); + break; + } + case 3: { + message.intentsContent = $root.google.cloud.dialogflow.cx.v3.InlineSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.mergeOption = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsRequest} ImportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportIntentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + properties.intents = 1; + if (!$util.isString(message.intentsUri)) + return "intentsUri: string expected"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + if (properties.intents === 1) + return "intents: multiple values"; + properties.intents = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.InlineSource.verify(message.intentsContent, long + 1); + if (error) + return "intentsContent." + error; + } + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + switch (message.mergeOption) { + default: + return "mergeOption: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates an ImportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsRequest} ImportIntentsRequest + */ + ImportIntentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportIntentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intentsUri != null) + message.intentsUri = String(object.intentsUri); + if (object.intentsContent != null) { + if (typeof object.intentsContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportIntentsRequest.intentsContent: object expected"); + message.intentsContent = $root.google.cloud.dialogflow.cx.v3.InlineSource.fromObject(object.intentsContent, long + 1); + } + switch (object.mergeOption) { + default: + if (typeof object.mergeOption === "number") { + message.mergeOption = object.mergeOption; + break; + } + break; + case "MERGE_OPTION_UNSPECIFIED": + case 0: + message.mergeOption = 0; + break; + case "REJECT": + case 1: + message.mergeOption = 1; + break; + case "REPLACE": + case 2: + message.mergeOption = 2; + break; + case "MERGE": + case 3: + message.mergeOption = 3; + break; + case "RENAME": + case 4: + message.mergeOption = 4; + break; + case "REPORT_CONFLICT": + case 5: + message.mergeOption = 5; + break; + case "KEEP": + case 6: + message.mergeOption = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsRequest} message ImportIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mergeOption = options.enums === String ? "MERGE_OPTION_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + object.intentsUri = message.intentsUri; + if (options.oneofs) + object.intents = "intentsUri"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + object.intentsContent = $root.google.cloud.dialogflow.cx.v3.InlineSource.toObject(message.intentsContent, options); + if (options.oneofs) + object.intents = "intentsContent"; + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + object.mergeOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption[message.mergeOption] === undefined ? message.mergeOption : $root.google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption[message.mergeOption] : message.mergeOption; + return object; + }; + + /** + * Converts this ImportIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportIntentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportIntentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportIntentsRequest"; + }; + + /** + * MergeOption enum. + * @name google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption + * @enum {number} + * @property {number} MERGE_OPTION_UNSPECIFIED=0 MERGE_OPTION_UNSPECIFIED value + * @property {number} REJECT=1 REJECT value + * @property {number} REPLACE=2 REPLACE value + * @property {number} MERGE=3 MERGE value + * @property {number} RENAME=4 RENAME value + * @property {number} REPORT_CONFLICT=5 REPORT_CONFLICT value + * @property {number} KEEP=6 KEEP value + */ + ImportIntentsRequest.MergeOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MERGE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "REJECT"] = 1; + values[valuesById[2] = "REPLACE"] = 2; + values[valuesById[3] = "MERGE"] = 3; + values[valuesById[4] = "RENAME"] = 4; + values[valuesById[5] = "REPORT_CONFLICT"] = 5; + values[valuesById[6] = "KEEP"] = 6; + return values; + })(); + + return ImportIntentsRequest; + })(); + + v3.ImportIntentsResponse = (function() { + + /** + * Properties of an ImportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportIntentsResponse + * @property {Array.|null} [intents] ImportIntentsResponse intents + * @property {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources|null} [conflictingResources] ImportIntentsResponse conflictingResources + */ + + /** + * Constructs a new ImportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportIntentsResponse. + * @implements IImportIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsResponse=} [properties] Properties to set + */ + function ImportIntentsResponse(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @instance + */ + ImportIntentsResponse.prototype.intents = $util.emptyArray; + + /** + * ImportIntentsResponse conflictingResources. + * @member {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources|null|undefined} conflictingResources + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @instance + */ + ImportIntentsResponse.prototype.conflictingResources = null; + + /** + * Creates a new ImportIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse} ImportIntentsResponse instance + */ + ImportIntentsResponse.create = function create(properties) { + return new ImportIntentsResponse(properties); + }; + + /** + * Encodes the specified ImportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsResponse} message ImportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intents[i]); + if (message.conflictingResources != null && Object.hasOwnProperty.call(message, "conflictingResources")) + $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.encode(message.conflictingResources, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsResponse} message ImportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse} ImportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push(reader.string()); + break; + } + case 2: { + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse} ImportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportIntentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) + if (!$util.isString(message.intents[i])) + return "intents: string[] expected"; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) { + var error = $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.verify(message.conflictingResources, long + 1); + if (error) + return "conflictingResources." + error; + } + return null; + }; + + /** + * Creates an ImportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse} ImportIntentsResponse + */ + ImportIntentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) + message.intents[i] = String(object.intents[i]); + } + if (object.conflictingResources != null) { + if (typeof object.conflictingResources !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportIntentsResponse.conflictingResources: object expected"); + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.fromObject(object.conflictingResources, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsResponse} message ImportIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.conflictingResources = null; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = message.intents[j]; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) + object.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.toObject(message.conflictingResources, options); + return object; + }; + + /** + * Converts this ImportIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportIntentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportIntentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportIntentsResponse"; + }; + + ImportIntentsResponse.ConflictingResources = (function() { + + /** + * Properties of a ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @interface IConflictingResources + * @property {Array.|null} [intentDisplayNames] ConflictingResources intentDisplayNames + * @property {Array.|null} [entityDisplayNames] ConflictingResources entityDisplayNames + */ + + /** + * Constructs a new ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse + * @classdesc Represents a ConflictingResources. + * @implements IConflictingResources + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources=} [properties] Properties to set + */ + function ConflictingResources(properties) { + this.intentDisplayNames = []; + this.entityDisplayNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConflictingResources intentDisplayNames. + * @member {Array.} intentDisplayNames + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.intentDisplayNames = $util.emptyArray; + + /** + * ConflictingResources entityDisplayNames. + * @member {Array.} entityDisplayNames + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.entityDisplayNames = $util.emptyArray; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources} ConflictingResources instance + */ + ConflictingResources.create = function create(properties) { + return new ConflictingResources(properties); + }; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentDisplayNames != null && message.intentDisplayNames.length) + for (var i = 0; i < message.intentDisplayNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intentDisplayNames[i]); + if (message.entityDisplayNames != null && message.entityDisplayNames.length) + for (var i = 0; i < message.entityDisplayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityDisplayNames[i]); + return writer; + }; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intentDisplayNames && message.intentDisplayNames.length)) + message.intentDisplayNames = []; + message.intentDisplayNames.push(reader.string()); + break; + } + case 2: { + if (!(message.entityDisplayNames && message.entityDisplayNames.length)) + message.entityDisplayNames = []; + message.entityDisplayNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConflictingResources message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConflictingResources.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intentDisplayNames != null && message.hasOwnProperty("intentDisplayNames")) { + if (!Array.isArray(message.intentDisplayNames)) + return "intentDisplayNames: array expected"; + for (var i = 0; i < message.intentDisplayNames.length; ++i) + if (!$util.isString(message.intentDisplayNames[i])) + return "intentDisplayNames: string[] expected"; + } + if (message.entityDisplayNames != null && message.hasOwnProperty("entityDisplayNames")) { + if (!Array.isArray(message.entityDisplayNames)) + return "entityDisplayNames: array expected"; + for (var i = 0; i < message.entityDisplayNames.length; ++i) + if (!$util.isString(message.entityDisplayNames[i])) + return "entityDisplayNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources} ConflictingResources + */ + ConflictingResources.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources(); + if (object.intentDisplayNames) { + if (!Array.isArray(object.intentDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.intentDisplayNames: array expected"); + message.intentDisplayNames = []; + for (var i = 0; i < object.intentDisplayNames.length; ++i) + message.intentDisplayNames[i] = String(object.intentDisplayNames[i]); + } + if (object.entityDisplayNames) { + if (!Array.isArray(object.entityDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources.entityDisplayNames: array expected"); + message.entityDisplayNames = []; + for (var i = 0; i < object.entityDisplayNames.length; ++i) + message.entityDisplayNames[i] = String(object.entityDisplayNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources} message ConflictingResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConflictingResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.intentDisplayNames = []; + object.entityDisplayNames = []; + } + if (message.intentDisplayNames && message.intentDisplayNames.length) { + object.intentDisplayNames = []; + for (var j = 0; j < message.intentDisplayNames.length; ++j) + object.intentDisplayNames[j] = message.intentDisplayNames[j]; + } + if (message.entityDisplayNames && message.entityDisplayNames.length) { + object.entityDisplayNames = []; + for (var j = 0; j < message.entityDisplayNames.length; ++j) + object.entityDisplayNames[j] = message.entityDisplayNames[j]; + } + return object; + }; + + /** + * Converts this ConflictingResources to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @instance + * @returns {Object.} JSON object + */ + ConflictingResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConflictingResources + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConflictingResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources"; + }; + + return ConflictingResources; + })(); + + return ImportIntentsResponse; + })(); + + v3.ImportIntentsMetadata = (function() { + + /** + * Properties of an ImportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportIntentsMetadata + */ + + /** + * Constructs a new ImportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportIntentsMetadata. + * @implements IImportIntentsMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsMetadata=} [properties] Properties to set + */ + function ImportIntentsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ImportIntentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsMetadata} ImportIntentsMetadata instance + */ + ImportIntentsMetadata.create = function create(properties) { + return new ImportIntentsMetadata(properties); + }; + + /** + * Encodes the specified ImportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsMetadata} message ImportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportIntentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportIntentsMetadata} message ImportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsMetadata} ImportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportIntentsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsMetadata} ImportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportIntentsMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportIntentsMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ImportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportIntentsMetadata} ImportIntentsMetadata + */ + ImportIntentsMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportIntentsMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.ImportIntentsMetadata(); + }; + + /** + * Creates a plain object from an ImportIntentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsMetadata} message ImportIntentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportIntentsMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportIntentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportIntentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportIntentsMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportIntentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportIntentsMetadata"; + }; + + return ImportIntentsMetadata; + })(); + + v3.ExportIntentsRequest = (function() { + + /** + * Properties of an ExportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportIntentsRequest + * @property {string|null} [parent] ExportIntentsRequest parent + * @property {Array.|null} [intents] ExportIntentsRequest intents + * @property {string|null} [intentsUri] ExportIntentsRequest intentsUri + * @property {boolean|null} [intentsContentInline] ExportIntentsRequest intentsContentInline + * @property {google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat|null} [dataFormat] ExportIntentsRequest dataFormat + */ + + /** + * Constructs a new ExportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportIntentsRequest. + * @implements IExportIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsRequest=} [properties] Properties to set + */ + function ExportIntentsRequest(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.parent = ""; + + /** + * ExportIntentsRequest intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.intents = $util.emptyArray; + + /** + * ExportIntentsRequest intentsUri. + * @member {string|null|undefined} intentsUri + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.intentsUri = null; + + /** + * ExportIntentsRequest intentsContentInline. + * @member {boolean|null|undefined} intentsContentInline + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.intentsContentInline = null; + + /** + * ExportIntentsRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.dataFormat = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportIntentsRequest destination. + * @member {"intentsUri"|"intentsContentInline"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @instance + */ + Object.defineProperty(ExportIntentsRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["intentsUri", "intentsContentInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsRequest} ExportIntentsRequest instance + */ + ExportIntentsRequest.create = function create(properties) { + return new ExportIntentsRequest(properties); + }; + + /** + * Encodes the specified ExportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsRequest} message ExportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsRequest.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.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intents[i]); + if (message.intentsUri != null && Object.hasOwnProperty.call(message, "intentsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.intentsUri); + if (message.intentsContentInline != null && Object.hasOwnProperty.call(message, "intentsContentInline")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.intentsContentInline); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified ExportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsRequest} message ExportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsRequest} ExportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push(reader.string()); + break; + } + case 3: { + message.intentsUri = reader.string(); + break; + } + case 4: { + message.intentsContentInline = reader.bool(); + break; + } + case 5: { + message.dataFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsRequest} ExportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIntentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) + if (!$util.isString(message.intents[i])) + return "intents: string[] expected"; + } + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + properties.destination = 1; + if (!$util.isString(message.intentsUri)) + return "intentsUri: string expected"; + } + if (message.intentsContentInline != null && message.hasOwnProperty("intentsContentInline")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (typeof message.intentsContentInline !== "boolean") + return "intentsContentInline: boolean expected"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ExportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsRequest} ExportIntentsRequest + */ + ExportIntentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportIntentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ExportIntentsRequest.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) + message.intents[i] = String(object.intents[i]); + } + if (object.intentsUri != null) + message.intentsUri = String(object.intentsUri); + if (object.intentsContentInline != null) + message.intentsContentInline = Boolean(object.intentsContentInline); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON": + case 2: + message.dataFormat = 2; + break; + case "CSV": + case 3: + message.dataFormat = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExportIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportIntentsRequest} message ExportIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) { + object.parent = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = message.intents[j]; + } + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + object.intentsUri = message.intentsUri; + if (options.oneofs) + object.destination = "intentsUri"; + } + if (message.intentsContentInline != null && message.hasOwnProperty("intentsContentInline")) { + object.intentsContentInline = message.intentsContentInline; + if (options.oneofs) + object.destination = "intentsContentInline"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this ExportIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportIntentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIntentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportIntentsRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON=2 JSON value + * @property {number} CSV=3 CSV value + */ + ExportIntentsRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[2] = "JSON"] = 2; + values[valuesById[3] = "CSV"] = 3; + return values; + })(); + + return ExportIntentsRequest; + })(); + + v3.ExportIntentsResponse = (function() { + + /** + * Properties of an ExportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportIntentsResponse + * @property {string|null} [intentsUri] ExportIntentsResponse intentsUri + * @property {google.cloud.dialogflow.cx.v3.IInlineDestination|null} [intentsContent] ExportIntentsResponse intentsContent + */ + + /** + * Constructs a new ExportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportIntentsResponse. + * @implements IExportIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsResponse=} [properties] Properties to set + */ + function ExportIntentsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportIntentsResponse intentsUri. + * @member {string|null|undefined} intentsUri + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @instance + */ + ExportIntentsResponse.prototype.intentsUri = null; + + /** + * ExportIntentsResponse intentsContent. + * @member {google.cloud.dialogflow.cx.v3.IInlineDestination|null|undefined} intentsContent + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @instance + */ + ExportIntentsResponse.prototype.intentsContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportIntentsResponse intents. + * @member {"intentsUri"|"intentsContent"|undefined} intents + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @instance + */ + Object.defineProperty(ExportIntentsResponse.prototype, "intents", { + get: $util.oneOfGetter($oneOfFields = ["intentsUri", "intentsContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsResponse} ExportIntentsResponse instance + */ + ExportIntentsResponse.create = function create(properties) { + return new ExportIntentsResponse(properties); + }; + + /** + * Encodes the specified ExportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsResponse} message ExportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentsUri != null && Object.hasOwnProperty.call(message, "intentsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intentsUri); + if (message.intentsContent != null && Object.hasOwnProperty.call(message, "intentsContent")) + $root.google.cloud.dialogflow.cx.v3.InlineDestination.encode(message.intentsContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsResponse} message ExportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsResponse} ExportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intentsUri = reader.string(); + break; + } + case 2: { + message.intentsContent = $root.google.cloud.dialogflow.cx.v3.InlineDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsResponse} ExportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIntentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + properties.intents = 1; + if (!$util.isString(message.intentsUri)) + return "intentsUri: string expected"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + if (properties.intents === 1) + return "intents: multiple values"; + properties.intents = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.InlineDestination.verify(message.intentsContent, long + 1); + if (error) + return "intentsContent." + error; + } + } + return null; + }; + + /** + * Creates an ExportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsResponse} ExportIntentsResponse + */ + ExportIntentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportIntentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportIntentsResponse(); + if (object.intentsUri != null) + message.intentsUri = String(object.intentsUri); + if (object.intentsContent != null) { + if (typeof object.intentsContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ExportIntentsResponse.intentsContent: object expected"); + message.intentsContent = $root.google.cloud.dialogflow.cx.v3.InlineDestination.fromObject(object.intentsContent, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExportIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportIntentsResponse} message ExportIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + object.intentsUri = message.intentsUri; + if (options.oneofs) + object.intents = "intentsUri"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + object.intentsContent = $root.google.cloud.dialogflow.cx.v3.InlineDestination.toObject(message.intentsContent, options); + if (options.oneofs) + object.intents = "intentsContent"; + } + return object; + }; + + /** + * Converts this ExportIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportIntentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIntentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportIntentsResponse"; + }; + + return ExportIntentsResponse; + })(); + + v3.ExportIntentsMetadata = (function() { + + /** + * Properties of an ExportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportIntentsMetadata + */ + + /** + * Constructs a new ExportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportIntentsMetadata. + * @implements IExportIntentsMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsMetadata=} [properties] Properties to set + */ + function ExportIntentsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportIntentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsMetadata} ExportIntentsMetadata instance + */ + ExportIntentsMetadata.create = function create(properties) { + return new ExportIntentsMetadata(properties); + }; + + /** + * Encodes the specified ExportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsMetadata} message ExportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportIntentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportIntentsMetadata} message ExportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsMetadata} ExportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportIntentsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsMetadata} ExportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIntentsMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIntentsMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportIntentsMetadata} ExportIntentsMetadata + */ + ExportIntentsMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportIntentsMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.ExportIntentsMetadata(); + }; + + /** + * Creates a plain object from an ExportIntentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportIntentsMetadata} message ExportIntentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIntentsMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportIntentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportIntentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportIntentsMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIntentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportIntentsMetadata"; + }; + + return ExportIntentsMetadata; + })(); + + v3.Sessions = (function() { + + /** + * Constructs a new Sessions service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Sessions + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Sessions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Sessions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Sessions; + + /** + * Creates new Sessions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Sessions} RPC service. Useful where requests and/or responses are streamed. + */ + Sessions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|detectIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @typedef DetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.DetectIntentResponse} [response] DetectIntentResponse + */ + + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Sessions.DetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.detectIntent = function detectIntent(request, callback) { + return this.rpcCall(detectIntent, $root.google.cloud.dialogflow.cx.v3.DetectIntentRequest, $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse, request, callback); + }, "name", { value: "DetectIntent" }); + + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|serverStreamingDetectIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @typedef ServerStreamingDetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.DetectIntentResponse} [response] DetectIntentResponse + */ + + /** + * Calls ServerStreamingDetectIntent. + * @function serverStreamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Sessions.ServerStreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.serverStreamingDetectIntent = function serverStreamingDetectIntent(request, callback) { + return this.rpcCall(serverStreamingDetectIntent, $root.google.cloud.dialogflow.cx.v3.DetectIntentRequest, $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse, request, callback); + }, "name", { value: "ServerStreamingDetectIntent" }); + + /** + * Calls ServerStreamingDetectIntent. + * @function serverStreamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|streamingDetectIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @typedef StreamingDetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse} [response] StreamingDetectIntentResponse + */ + + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.streamingDetectIntent = function streamingDetectIntent(request, callback) { + return this.rpcCall(streamingDetectIntent, $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest, $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse, request, callback); + }, "name", { value: "StreamingDetectIntent" }); + + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|matchIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @typedef MatchIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.MatchIntentResponse} [response] MatchIntentResponse + */ + + /** + * Calls MatchIntent. + * @function matchIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentRequest} request MatchIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Sessions.MatchIntentCallback} callback Node-style callback called with the error, if any, and MatchIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.matchIntent = function matchIntent(request, callback) { + return this.rpcCall(matchIntent, $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest, $root.google.cloud.dialogflow.cx.v3.MatchIntentResponse, request, callback); + }, "name", { value: "MatchIntent" }); + + /** + * Calls MatchIntent. + * @function matchIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentRequest} request MatchIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|fulfillIntent}. + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @typedef FulfillIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.FulfillIntentResponse} [response] FulfillIntentResponse + */ + + /** + * Calls FulfillIntent. + * @function fulfillIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentRequest} request FulfillIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Sessions.FulfillIntentCallback} callback Node-style callback called with the error, if any, and FulfillIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.fulfillIntent = function fulfillIntent(request, callback) { + return this.rpcCall(fulfillIntent, $root.google.cloud.dialogflow.cx.v3.FulfillIntentRequest, $root.google.cloud.dialogflow.cx.v3.FulfillIntentResponse, request, callback); + }, "name", { value: "FulfillIntent" }); + + /** + * Calls FulfillIntent. + * @function fulfillIntent + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentRequest} request FulfillIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Sessions|submitAnswerFeedback}. + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @typedef SubmitAnswerFeedbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback} [response] AnswerFeedback + */ + + /** + * Calls SubmitAnswerFeedback. + * @function submitAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest} request SubmitAnswerFeedbackRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Sessions.SubmitAnswerFeedbackCallback} callback Node-style callback called with the error, if any, and AnswerFeedback + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.submitAnswerFeedback = function submitAnswerFeedback(request, callback) { + return this.rpcCall(submitAnswerFeedback, $root.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest, $root.google.cloud.dialogflow.cx.v3.AnswerFeedback, request, callback); + }, "name", { value: "SubmitAnswerFeedback" }); + + /** + * Calls SubmitAnswerFeedback. + * @function submitAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest} request SubmitAnswerFeedbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Sessions; + })(); + + v3.AnswerFeedback = (function() { + + /** + * Properties of an AnswerFeedback. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IAnswerFeedback + * @property {google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating|null} [rating] AnswerFeedback rating + * @property {google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason|null} [ratingReason] AnswerFeedback ratingReason + * @property {string|null} [customRating] AnswerFeedback customRating + */ + + /** + * Constructs a new AnswerFeedback. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an AnswerFeedback. + * @implements IAnswerFeedback + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IAnswerFeedback=} [properties] Properties to set + */ + function AnswerFeedback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerFeedback rating. + * @member {google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating} rating + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.rating = 0; + + /** + * AnswerFeedback ratingReason. + * @member {google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason|null|undefined} ratingReason + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.ratingReason = null; + + /** + * AnswerFeedback customRating. + * @member {string} customRating + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.customRating = ""; + + /** + * Creates a new AnswerFeedback instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3.IAnswerFeedback=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback} AnswerFeedback instance + */ + AnswerFeedback.create = function create(properties) { + return new AnswerFeedback(properties); + }; + + /** + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3.IAnswerFeedback} message AnswerFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rating); + if (message.ratingReason != null && Object.hasOwnProperty.call(message, "ratingReason")) + $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.encode(message.ratingReason, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.customRating != null && Object.hasOwnProperty.call(message, "customRating")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customRating); + return writer; + }; + + /** + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3.IAnswerFeedback} message AnswerFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback} AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedback.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AnswerFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rating = reader.int32(); + break; + } + case 2: { + message.ratingReason = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.customRating = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback} AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerFeedback message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerFeedback.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rating != null && message.hasOwnProperty("rating")) + switch (message.rating) { + default: + return "rating: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ratingReason != null && message.hasOwnProperty("ratingReason")) { + var error = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.verify(message.ratingReason, long + 1); + if (error) + return "ratingReason." + error; + } + if (message.customRating != null && message.hasOwnProperty("customRating")) + if (!$util.isString(message.customRating)) + return "customRating: string expected"; + return null; + }; + + /** + * Creates an AnswerFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback} AnswerFeedback + */ + AnswerFeedback.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AnswerFeedback) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AnswerFeedback(); + switch (object.rating) { + default: + if (typeof object.rating === "number") { + message.rating = object.rating; + break; + } + break; + case "RATING_UNSPECIFIED": + case 0: + message.rating = 0; + break; + case "THUMBS_UP": + case 1: + message.rating = 1; + break; + case "THUMBS_DOWN": + case 2: + message.rating = 2; + break; + } + if (object.ratingReason != null) { + if (typeof object.ratingReason !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AnswerFeedback.ratingReason: object expected"); + message.ratingReason = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.fromObject(object.ratingReason, long + 1); + } + if (object.customRating != null) + message.customRating = String(object.customRating); + return message; + }; + + /** + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback} message AnswerFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rating = options.enums === String ? "RATING_UNSPECIFIED" : 0; + object.ratingReason = null; + object.customRating = ""; + } + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating[message.rating] === undefined ? message.rating : $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating[message.rating] : message.rating; + if (message.ratingReason != null && message.hasOwnProperty("ratingReason")) + object.ratingReason = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.toObject(message.ratingReason, options); + if (message.customRating != null && message.hasOwnProperty("customRating")) + object.customRating = message.customRating; + return object; + }; + + /** + * Converts this AnswerFeedback to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @instance + * @returns {Object.} JSON object + */ + AnswerFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerFeedback + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AnswerFeedback"; + }; + + /** + * Rating enum. + * @name google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating + * @enum {number} + * @property {number} RATING_UNSPECIFIED=0 RATING_UNSPECIFIED value + * @property {number} THUMBS_UP=1 THUMBS_UP value + * @property {number} THUMBS_DOWN=2 THUMBS_DOWN value + */ + AnswerFeedback.Rating = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RATING_UNSPECIFIED"] = 0; + values[valuesById[1] = "THUMBS_UP"] = 1; + values[valuesById[2] = "THUMBS_DOWN"] = 2; + return values; + })(); + + AnswerFeedback.RatingReason = (function() { + + /** + * Properties of a RatingReason. + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @interface IRatingReason + * @property {Array.|null} [reasonLabels] RatingReason reasonLabels + * @property {string|null} [feedback] RatingReason feedback + */ + + /** + * Constructs a new RatingReason. + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback + * @classdesc Represents a RatingReason. + * @implements IRatingReason + * @constructor + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason=} [properties] Properties to set + */ + function RatingReason(properties) { + this.reasonLabels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RatingReason reasonLabels. + * @member {Array.} reasonLabels + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @instance + */ + RatingReason.prototype.reasonLabels = $util.emptyArray; + + /** + * RatingReason feedback. + * @member {string} feedback + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @instance + */ + RatingReason.prototype.feedback = ""; + + /** + * Creates a new RatingReason instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason} RatingReason instance + */ + RatingReason.create = function create(properties) { + return new RatingReason(properties); + }; + + /** + * Encodes the specified RatingReason message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason} message RatingReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RatingReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feedback != null && Object.hasOwnProperty.call(message, "feedback")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedback); + if (message.reasonLabels != null && message.reasonLabels.length) + for (var i = 0; i < message.reasonLabels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.reasonLabels[i]); + return writer; + }; + + /** + * Encodes the specified RatingReason message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback.IRatingReason} message RatingReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RatingReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RatingReason message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason} RatingReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RatingReason.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.reasonLabels && message.reasonLabels.length)) + message.reasonLabels = []; + message.reasonLabels.push(reader.string()); + break; + } + case 2: { + message.feedback = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RatingReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason} RatingReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RatingReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RatingReason message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RatingReason.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.reasonLabels != null && message.hasOwnProperty("reasonLabels")) { + if (!Array.isArray(message.reasonLabels)) + return "reasonLabels: array expected"; + for (var i = 0; i < message.reasonLabels.length; ++i) + if (!$util.isString(message.reasonLabels[i])) + return "reasonLabels: string[] expected"; + } + if (message.feedback != null && message.hasOwnProperty("feedback")) + if (!$util.isString(message.feedback)) + return "feedback: string expected"; + return null; + }; + + /** + * Creates a RatingReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason} RatingReason + */ + RatingReason.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason(); + if (object.reasonLabels) { + if (!Array.isArray(object.reasonLabels)) + throw TypeError(".google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason.reasonLabels: array expected"); + message.reasonLabels = []; + for (var i = 0; i < object.reasonLabels.length; ++i) + message.reasonLabels[i] = String(object.reasonLabels[i]); + } + if (object.feedback != null) + message.feedback = String(object.feedback); + return message; + }; + + /** + * Creates a plain object from a RatingReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason} message RatingReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RatingReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reasonLabels = []; + if (options.defaults) + object.feedback = ""; + if (message.feedback != null && message.hasOwnProperty("feedback")) + object.feedback = message.feedback; + if (message.reasonLabels && message.reasonLabels.length) { + object.reasonLabels = []; + for (var j = 0; j < message.reasonLabels.length; ++j) + object.reasonLabels[j] = message.reasonLabels[j]; + } + return object; + }; + + /** + * Converts this RatingReason to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @instance + * @returns {Object.} JSON object + */ + RatingReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RatingReason + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RatingReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason"; + }; + + return RatingReason; + })(); + + return AnswerFeedback; + })(); + + v3.SubmitAnswerFeedbackRequest = (function() { + + /** + * Properties of a SubmitAnswerFeedbackRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISubmitAnswerFeedbackRequest + * @property {string|null} [session] SubmitAnswerFeedbackRequest session + * @property {string|null} [responseId] SubmitAnswerFeedbackRequest responseId + * @property {google.cloud.dialogflow.cx.v3.IAnswerFeedback|null} [answerFeedback] SubmitAnswerFeedbackRequest answerFeedback + * @property {google.protobuf.IFieldMask|null} [updateMask] SubmitAnswerFeedbackRequest updateMask + */ + + /** + * Constructs a new SubmitAnswerFeedbackRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SubmitAnswerFeedbackRequest. + * @implements ISubmitAnswerFeedbackRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest=} [properties] Properties to set + */ + function SubmitAnswerFeedbackRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubmitAnswerFeedbackRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.session = ""; + + /** + * SubmitAnswerFeedbackRequest responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.responseId = ""; + + /** + * SubmitAnswerFeedbackRequest answerFeedback. + * @member {google.cloud.dialogflow.cx.v3.IAnswerFeedback|null|undefined} answerFeedback + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.answerFeedback = null; + + /** + * SubmitAnswerFeedbackRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.updateMask = null; + + /** + * Creates a new SubmitAnswerFeedbackRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest instance + */ + SubmitAnswerFeedbackRequest.create = function create(properties) { + return new SubmitAnswerFeedbackRequest(properties); + }; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest} message SubmitAnswerFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitAnswerFeedbackRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.responseId); + if (message.answerFeedback != null && Object.hasOwnProperty.call(message, "answerFeedback")) + $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.encode(message.answerFeedback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest} message SubmitAnswerFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitAnswerFeedbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitAnswerFeedbackRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.responseId = reader.string(); + break; + } + case 3: { + message.answerFeedback = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitAnswerFeedbackRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubmitAnswerFeedbackRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubmitAnswerFeedbackRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) { + var error = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.verify(message.answerFeedback, long + 1); + if (error) + return "answerFeedback." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SubmitAnswerFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest + */ + SubmitAnswerFeedbackRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.answerFeedback != null) { + if (typeof object.answerFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest.answerFeedback: object expected"); + message.answerFeedback = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.fromObject(object.answerFeedback, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SubmitAnswerFeedbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest} message SubmitAnswerFeedbackRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubmitAnswerFeedbackRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.responseId = ""; + object.answerFeedback = null; + object.updateMask = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) + object.answerFeedback = $root.google.cloud.dialogflow.cx.v3.AnswerFeedback.toObject(message.answerFeedback, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SubmitAnswerFeedbackRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @instance + * @returns {Object.} JSON object + */ + SubmitAnswerFeedbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubmitAnswerFeedbackRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubmitAnswerFeedbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest"; + }; + + return SubmitAnswerFeedbackRequest; + })(); + + v3.DetectIntentRequest = (function() { + + /** + * Properties of a DetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDetectIntentRequest + * @property {string|null} [session] DetectIntentRequest session + * @property {google.cloud.dialogflow.cx.v3.IQueryParameters|null} [queryParams] DetectIntentRequest queryParams + * @property {google.cloud.dialogflow.cx.v3.IQueryInput|null} [queryInput] DetectIntentRequest queryInput + * @property {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentRequest outputAudioConfig + * @property {google.cloud.dialogflow.cx.v3.DetectIntentResponseView|null} [responseView] DetectIntentRequest responseView + */ + + /** + * Constructs a new DetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DetectIntentRequest. + * @implements IDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest=} [properties] Properties to set + */ + function DetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.session = ""; + + /** + * DetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.cx.v3.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryParams = null; + + /** + * DetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.cx.v3.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryInput = null; + + /** + * DetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.outputAudioConfig = null; + + /** + * DetectIntentRequest responseView. + * @member {google.cloud.dialogflow.cx.v3.DetectIntentResponseView} responseView + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.responseView = 0; + + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentRequest} DetectIntentRequest instance + */ + DetectIntentRequest.create = function create(properties) { + return new DetectIntentRequest(properties); + }; + + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.cx.v3.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.cx.v3.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.responseView); + return writer; + }; + + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.responseView = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryParameters.verify(message.queryParams, long + 1); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryInput.verify(message.queryInput, long + 1); + if (error) + return "queryInput." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + if (message.responseView != null && message.hasOwnProperty("responseView")) + switch (message.responseView) { + default: + return "responseView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentRequest} DetectIntentRequest + */ + DetectIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DetectIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.fromObject(object.queryParams, long + 1); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.fromObject(object.queryInput, long + 1); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + switch (object.responseView) { + default: + if (typeof object.responseView === "number") { + message.responseView = object.responseView; + break; + } + break; + case "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.responseView = 0; + break; + case "DETECT_INTENT_RESPONSE_VIEW_FULL": + case 1: + message.responseView = 1; + break; + case "DETECT_INTENT_RESPONSE_VIEW_BASIC": + case 2: + message.responseView = 2; + break; + case "DETECT_INTENT_RESPONSE_VIEW_DEFAULT": + case 3: + message.responseView = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DetectIntentRequest} message DetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.outputAudioConfig = null; + object.responseView = options.enums === String ? "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.toObject(message.queryInput, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.responseView != null && message.hasOwnProperty("responseView")) + object.responseView = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DetectIntentResponseView[message.responseView] === undefined ? message.responseView : $root.google.cloud.dialogflow.cx.v3.DetectIntentResponseView[message.responseView] : message.responseView; + return object; + }; + + /** + * Converts this DetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + DetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DetectIntentRequest"; + }; + + return DetectIntentRequest; + })(); + + v3.DetectIntentResponse = (function() { + + /** + * Properties of a DetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDetectIntentResponse + * @property {string|null} [responseId] DetectIntentResponse responseId + * @property {google.cloud.dialogflow.cx.v3.IQueryResult|null} [queryResult] DetectIntentResponse queryResult + * @property {Uint8Array|null} [outputAudio] DetectIntentResponse outputAudio + * @property {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentResponse outputAudioConfig + * @property {google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|null} [responseType] DetectIntentResponse responseType + * @property {boolean|null} [allowCancellation] DetectIntentResponse allowCancellation + */ + + /** + * Constructs a new DetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DetectIntentResponse. + * @implements IDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentResponse=} [properties] Properties to set + */ + function DetectIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.responseId = ""; + + /** + * DetectIntentResponse queryResult. + * @member {google.cloud.dialogflow.cx.v3.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.queryResult = null; + + /** + * DetectIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + + /** + * DetectIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudioConfig = null; + + /** + * DetectIntentResponse responseType. + * @member {google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType} responseType + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.responseType = 0; + + /** + * DetectIntentResponse allowCancellation. + * @member {boolean} allowCancellation + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.allowCancellation = false; + + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentResponse} DetectIntentResponse instance + */ + DetectIntentResponse.create = function create(properties) { + return new DetectIntentResponse(properties); + }; + + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.cx.v3.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.outputAudio); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.responseType); + if (message.allowCancellation != null && Object.hasOwnProperty.call(message, "allowCancellation")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.allowCancellation); + return writer; + }; + + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseId = reader.string(); + break; + } + case 2: { + message.queryResult = $root.google.cloud.dialogflow.cx.v3.QueryResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputAudio = reader.bytes(); + break; + } + case 5: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.responseType = reader.int32(); + break; + } + case 7: { + message.allowCancellation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryResult.verify(message.queryResult, long + 1); + if (error) + return "queryResult." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + switch (message.responseType) { + default: + return "responseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allowCancellation != null && message.hasOwnProperty("allowCancellation")) + if (typeof message.allowCancellation !== "boolean") + return "allowCancellation: boolean expected"; + return null; + }; + + /** + * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DetectIntentResponse} DetectIntentResponse + */ + DetectIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DetectIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.cx.v3.QueryResult.fromObject(object.queryResult, long + 1); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length >= 0) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.DetectIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + switch (object.responseType) { + default: + if (typeof object.responseType === "number") { + message.responseType = object.responseType; + break; + } + break; + case "RESPONSE_TYPE_UNSPECIFIED": + case 0: + message.responseType = 0; + break; + case "PARTIAL": + case 1: + message.responseType = 1; + break; + case "FINAL": + case 2: + message.responseType = 2; + break; + } + if (object.allowCancellation != null) + message.allowCancellation = Boolean(object.allowCancellation); + return message; + }; + + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.DetectIntentResponse} message DetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseId = ""; + object.queryResult = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + object.responseType = options.enums === String ? "RESPONSE_TYPE_UNSPECIFIED" : 0; + object.allowCancellation = false; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.cx.v3.QueryResult.toObject(message.queryResult, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType[message.responseType] === undefined ? message.responseType : $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType[message.responseType] : message.responseType; + if (message.allowCancellation != null && message.hasOwnProperty("allowCancellation")) + object.allowCancellation = message.allowCancellation; + return object; + }; + + /** + * Converts this DetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + DetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DetectIntentResponse"; + }; + + /** + * ResponseType enum. + * @name google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType + * @enum {number} + * @property {number} RESPONSE_TYPE_UNSPECIFIED=0 RESPONSE_TYPE_UNSPECIFIED value + * @property {number} PARTIAL=1 PARTIAL value + * @property {number} FINAL=2 FINAL value + */ + DetectIntentResponse.ResponseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARTIAL"] = 1; + values[valuesById[2] = "FINAL"] = 2; + return values; + })(); + + return DetectIntentResponse; + })(); + + v3.StreamingDetectIntentRequest = (function() { + + /** + * Properties of a StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IStreamingDetectIntentRequest + * @property {string|null} [session] StreamingDetectIntentRequest session + * @property {google.cloud.dialogflow.cx.v3.IQueryParameters|null} [queryParams] StreamingDetectIntentRequest queryParams + * @property {google.cloud.dialogflow.cx.v3.IQueryInput|null} [queryInput] StreamingDetectIntentRequest queryInput + * @property {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentRequest outputAudioConfig + * @property {boolean|null} [enablePartialResponse] StreamingDetectIntentRequest enablePartialResponse + * @property {boolean|null} [enableDebuggingInfo] StreamingDetectIntentRequest enableDebuggingInfo + * @property {google.cloud.dialogflow.cx.v3.DetectIntentResponseView|null} [responseView] StreamingDetectIntentRequest responseView + */ + + /** + * Constructs a new StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a StreamingDetectIntentRequest. + * @implements IStreamingDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest=} [properties] Properties to set + */ + function StreamingDetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingDetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.session = ""; + + /** + * StreamingDetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.cx.v3.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryParams = null; + + /** + * StreamingDetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.cx.v3.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryInput = null; + + /** + * StreamingDetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.outputAudioConfig = null; + + /** + * StreamingDetectIntentRequest enablePartialResponse. + * @member {boolean} enablePartialResponse + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.enablePartialResponse = false; + + /** + * StreamingDetectIntentRequest enableDebuggingInfo. + * @member {boolean} enableDebuggingInfo + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.enableDebuggingInfo = false; + + /** + * StreamingDetectIntentRequest responseView. + * @member {google.cloud.dialogflow.cx.v3.DetectIntentResponseView} responseView + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.responseView = 0; + + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest} StreamingDetectIntentRequest instance + */ + StreamingDetectIntentRequest.create = function create(properties) { + return new StreamingDetectIntentRequest(properties); + }; + + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.cx.v3.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.cx.v3.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enablePartialResponse != null && Object.hasOwnProperty.call(message, "enablePartialResponse")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enablePartialResponse); + if (message.enableDebuggingInfo != null && Object.hasOwnProperty.call(message, "enableDebuggingInfo")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableDebuggingInfo); + if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.responseView); + return writer; + }; + + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.enablePartialResponse = reader.bool(); + break; + } + case 8: { + message.enableDebuggingInfo = reader.bool(); + break; + } + case 16: { + message.responseView = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingDetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryParameters.verify(message.queryParams, long + 1); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryInput.verify(message.queryInput, long + 1); + if (error) + return "queryInput." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + if (message.enablePartialResponse != null && message.hasOwnProperty("enablePartialResponse")) + if (typeof message.enablePartialResponse !== "boolean") + return "enablePartialResponse: boolean expected"; + if (message.enableDebuggingInfo != null && message.hasOwnProperty("enableDebuggingInfo")) + if (typeof message.enableDebuggingInfo !== "boolean") + return "enableDebuggingInfo: boolean expected"; + if (message.responseView != null && message.hasOwnProperty("responseView")) + switch (message.responseView) { + default: + return "responseView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest} StreamingDetectIntentRequest + */ + StreamingDetectIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.fromObject(object.queryParams, long + 1); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.fromObject(object.queryInput, long + 1); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + if (object.enablePartialResponse != null) + message.enablePartialResponse = Boolean(object.enablePartialResponse); + if (object.enableDebuggingInfo != null) + message.enableDebuggingInfo = Boolean(object.enableDebuggingInfo); + switch (object.responseView) { + default: + if (typeof object.responseView === "number") { + message.responseView = object.responseView; + break; + } + break; + case "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.responseView = 0; + break; + case "DETECT_INTENT_RESPONSE_VIEW_FULL": + case 1: + message.responseView = 1; + break; + case "DETECT_INTENT_RESPONSE_VIEW_BASIC": + case 2: + message.responseView = 2; + break; + case "DETECT_INTENT_RESPONSE_VIEW_DEFAULT": + case 3: + message.responseView = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest} message StreamingDetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.outputAudioConfig = null; + object.enablePartialResponse = false; + object.enableDebuggingInfo = false; + object.responseView = options.enums === String ? "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.toObject(message.queryInput, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.enablePartialResponse != null && message.hasOwnProperty("enablePartialResponse")) + object.enablePartialResponse = message.enablePartialResponse; + if (message.enableDebuggingInfo != null && message.hasOwnProperty("enableDebuggingInfo")) + object.enableDebuggingInfo = message.enableDebuggingInfo; + if (message.responseView != null && message.hasOwnProperty("responseView")) + object.responseView = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DetectIntentResponseView[message.responseView] === undefined ? message.responseView : $root.google.cloud.dialogflow.cx.v3.DetectIntentResponseView[message.responseView] : message.responseView; + return object; + }; + + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingDetectIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingDetectIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest"; + }; + + return StreamingDetectIntentRequest; + })(); + + v3.CloudConversationDebuggingInfo = (function() { + + /** + * Properties of a CloudConversationDebuggingInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICloudConversationDebuggingInfo + * @property {number|null} [audioDataChunks] CloudConversationDebuggingInfo audioDataChunks + * @property {google.protobuf.IDuration|null} [resultEndTimeOffset] CloudConversationDebuggingInfo resultEndTimeOffset + * @property {google.protobuf.IDuration|null} [firstAudioDuration] CloudConversationDebuggingInfo firstAudioDuration + * @property {boolean|null} [singleUtterance] CloudConversationDebuggingInfo singleUtterance + * @property {Array.|null} [speechPartialResultsEndTimes] CloudConversationDebuggingInfo speechPartialResultsEndTimes + * @property {Array.|null} [speechFinalResultsEndTimes] CloudConversationDebuggingInfo speechFinalResultsEndTimes + * @property {number|null} [partialResponses] CloudConversationDebuggingInfo partialResponses + * @property {number|null} [speakerIdPassiveLatencyMsOffset] CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset + * @property {boolean|null} [bargeinEventTriggered] CloudConversationDebuggingInfo bargeinEventTriggered + * @property {boolean|null} [speechSingleUtterance] CloudConversationDebuggingInfo speechSingleUtterance + * @property {Array.|null} [dtmfPartialResultsTimes] CloudConversationDebuggingInfo dtmfPartialResultsTimes + * @property {Array.|null} [dtmfFinalResultsTimes] CloudConversationDebuggingInfo dtmfFinalResultsTimes + * @property {google.protobuf.IDuration|null} [singleUtteranceEndTimeOffset] CloudConversationDebuggingInfo singleUtteranceEndTimeOffset + * @property {google.protobuf.IDuration|null} [noSpeechTimeout] CloudConversationDebuggingInfo noSpeechTimeout + * @property {google.protobuf.IDuration|null} [endpointingTimeout] CloudConversationDebuggingInfo endpointingTimeout + * @property {boolean|null} [isInputText] CloudConversationDebuggingInfo isInputText + * @property {google.protobuf.IDuration|null} [clientHalfCloseTimeOffset] CloudConversationDebuggingInfo clientHalfCloseTimeOffset + * @property {google.protobuf.IDuration|null} [clientHalfCloseStreamingTimeOffset] CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset + */ + + /** + * Constructs a new CloudConversationDebuggingInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CloudConversationDebuggingInfo. + * @implements ICloudConversationDebuggingInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo=} [properties] Properties to set + */ + function CloudConversationDebuggingInfo(properties) { + this.speechPartialResultsEndTimes = []; + this.speechFinalResultsEndTimes = []; + this.dtmfPartialResultsTimes = []; + this.dtmfFinalResultsTimes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudConversationDebuggingInfo audioDataChunks. + * @member {number} audioDataChunks + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.audioDataChunks = 0; + + /** + * CloudConversationDebuggingInfo resultEndTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} resultEndTimeOffset + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.resultEndTimeOffset = null; + + /** + * CloudConversationDebuggingInfo firstAudioDuration. + * @member {google.protobuf.IDuration|null|undefined} firstAudioDuration + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.firstAudioDuration = null; + + /** + * CloudConversationDebuggingInfo singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.singleUtterance = false; + + /** + * CloudConversationDebuggingInfo speechPartialResultsEndTimes. + * @member {Array.} speechPartialResultsEndTimes + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speechPartialResultsEndTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo speechFinalResultsEndTimes. + * @member {Array.} speechFinalResultsEndTimes + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speechFinalResultsEndTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo partialResponses. + * @member {number} partialResponses + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.partialResponses = 0; + + /** + * CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset. + * @member {number} speakerIdPassiveLatencyMsOffset + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speakerIdPassiveLatencyMsOffset = 0; + + /** + * CloudConversationDebuggingInfo bargeinEventTriggered. + * @member {boolean} bargeinEventTriggered + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.bargeinEventTriggered = false; + + /** + * CloudConversationDebuggingInfo speechSingleUtterance. + * @member {boolean} speechSingleUtterance + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speechSingleUtterance = false; + + /** + * CloudConversationDebuggingInfo dtmfPartialResultsTimes. + * @member {Array.} dtmfPartialResultsTimes + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.dtmfPartialResultsTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo dtmfFinalResultsTimes. + * @member {Array.} dtmfFinalResultsTimes + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.dtmfFinalResultsTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo singleUtteranceEndTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} singleUtteranceEndTimeOffset + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.singleUtteranceEndTimeOffset = null; + + /** + * CloudConversationDebuggingInfo noSpeechTimeout. + * @member {google.protobuf.IDuration|null|undefined} noSpeechTimeout + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.noSpeechTimeout = null; + + /** + * CloudConversationDebuggingInfo endpointingTimeout. + * @member {google.protobuf.IDuration|null|undefined} endpointingTimeout + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.endpointingTimeout = null; + + /** + * CloudConversationDebuggingInfo isInputText. + * @member {boolean} isInputText + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.isInputText = false; + + /** + * CloudConversationDebuggingInfo clientHalfCloseTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} clientHalfCloseTimeOffset + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.clientHalfCloseTimeOffset = null; + + /** + * CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} clientHalfCloseStreamingTimeOffset + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.clientHalfCloseStreamingTimeOffset = null; + + /** + * Creates a new CloudConversationDebuggingInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo instance + */ + CloudConversationDebuggingInfo.create = function create(properties) { + return new CloudConversationDebuggingInfo(properties); + }; + + /** + * Encodes the specified CloudConversationDebuggingInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo} message CloudConversationDebuggingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudConversationDebuggingInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioDataChunks != null && Object.hasOwnProperty.call(message, "audioDataChunks")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioDataChunks); + if (message.resultEndTimeOffset != null && Object.hasOwnProperty.call(message, "resultEndTimeOffset")) + $root.google.protobuf.Duration.encode(message.resultEndTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.firstAudioDuration != null && Object.hasOwnProperty.call(message, "firstAudioDuration")) + $root.google.protobuf.Duration.encode(message.firstAudioDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.singleUtterance); + if (message.speechPartialResultsEndTimes != null && message.speechPartialResultsEndTimes.length) + for (var i = 0; i < message.speechPartialResultsEndTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.speechPartialResultsEndTimes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.speechFinalResultsEndTimes != null && message.speechFinalResultsEndTimes.length) + for (var i = 0; i < message.speechFinalResultsEndTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.speechFinalResultsEndTimes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.partialResponses != null && Object.hasOwnProperty.call(message, "partialResponses")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.partialResponses); + if (message.speakerIdPassiveLatencyMsOffset != null && Object.hasOwnProperty.call(message, "speakerIdPassiveLatencyMsOffset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.speakerIdPassiveLatencyMsOffset); + if (message.bargeinEventTriggered != null && Object.hasOwnProperty.call(message, "bargeinEventTriggered")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.bargeinEventTriggered); + if (message.speechSingleUtterance != null && Object.hasOwnProperty.call(message, "speechSingleUtterance")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.speechSingleUtterance); + if (message.dtmfPartialResultsTimes != null && message.dtmfPartialResultsTimes.length) + for (var i = 0; i < message.dtmfPartialResultsTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.dtmfPartialResultsTimes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.dtmfFinalResultsTimes != null && message.dtmfFinalResultsTimes.length) + for (var i = 0; i < message.dtmfFinalResultsTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.dtmfFinalResultsTimes[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.singleUtteranceEndTimeOffset != null && Object.hasOwnProperty.call(message, "singleUtteranceEndTimeOffset")) + $root.google.protobuf.Duration.encode(message.singleUtteranceEndTimeOffset, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.noSpeechTimeout != null && Object.hasOwnProperty.call(message, "noSpeechTimeout")) + $root.google.protobuf.Duration.encode(message.noSpeechTimeout, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.isInputText != null && Object.hasOwnProperty.call(message, "isInputText")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.isInputText); + if (message.clientHalfCloseTimeOffset != null && Object.hasOwnProperty.call(message, "clientHalfCloseTimeOffset")) + $root.google.protobuf.Duration.encode(message.clientHalfCloseTimeOffset, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.clientHalfCloseStreamingTimeOffset != null && Object.hasOwnProperty.call(message, "clientHalfCloseStreamingTimeOffset")) + $root.google.protobuf.Duration.encode(message.clientHalfCloseStreamingTimeOffset, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.endpointingTimeout != null && Object.hasOwnProperty.call(message, "endpointingTimeout")) + $root.google.protobuf.Duration.encode(message.endpointingTimeout, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudConversationDebuggingInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo} message CloudConversationDebuggingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudConversationDebuggingInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudConversationDebuggingInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioDataChunks = reader.int32(); + break; + } + case 2: { + message.resultEndTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.firstAudioDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.singleUtterance = reader.bool(); + break; + } + case 6: { + if (!(message.speechPartialResultsEndTimes && message.speechPartialResultsEndTimes.length)) + message.speechPartialResultsEndTimes = []; + message.speechPartialResultsEndTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.speechFinalResultsEndTimes && message.speechFinalResultsEndTimes.length)) + message.speechFinalResultsEndTimes = []; + message.speechFinalResultsEndTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.partialResponses = reader.int32(); + break; + } + case 9: { + message.speakerIdPassiveLatencyMsOffset = reader.int32(); + break; + } + case 10: { + message.bargeinEventTriggered = reader.bool(); + break; + } + case 11: { + message.speechSingleUtterance = reader.bool(); + break; + } + case 12: { + if (!(message.dtmfPartialResultsTimes && message.dtmfPartialResultsTimes.length)) + message.dtmfPartialResultsTimes = []; + message.dtmfPartialResultsTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 13: { + if (!(message.dtmfFinalResultsTimes && message.dtmfFinalResultsTimes.length)) + message.dtmfFinalResultsTimes = []; + message.dtmfFinalResultsTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 14: { + message.singleUtteranceEndTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.noSpeechTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.endpointingTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.isInputText = reader.bool(); + break; + } + case 17: { + message.clientHalfCloseTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.clientHalfCloseStreamingTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudConversationDebuggingInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudConversationDebuggingInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudConversationDebuggingInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioDataChunks != null && message.hasOwnProperty("audioDataChunks")) + if (!$util.isInteger(message.audioDataChunks)) + return "audioDataChunks: integer expected"; + if (message.resultEndTimeOffset != null && message.hasOwnProperty("resultEndTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTimeOffset, long + 1); + if (error) + return "resultEndTimeOffset." + error; + } + if (message.firstAudioDuration != null && message.hasOwnProperty("firstAudioDuration")) { + var error = $root.google.protobuf.Duration.verify(message.firstAudioDuration, long + 1); + if (error) + return "firstAudioDuration." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.speechPartialResultsEndTimes != null && message.hasOwnProperty("speechPartialResultsEndTimes")) { + if (!Array.isArray(message.speechPartialResultsEndTimes)) + return "speechPartialResultsEndTimes: array expected"; + for (var i = 0; i < message.speechPartialResultsEndTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.speechPartialResultsEndTimes[i], long + 1); + if (error) + return "speechPartialResultsEndTimes." + error; + } + } + if (message.speechFinalResultsEndTimes != null && message.hasOwnProperty("speechFinalResultsEndTimes")) { + if (!Array.isArray(message.speechFinalResultsEndTimes)) + return "speechFinalResultsEndTimes: array expected"; + for (var i = 0; i < message.speechFinalResultsEndTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.speechFinalResultsEndTimes[i], long + 1); + if (error) + return "speechFinalResultsEndTimes." + error; + } + } + if (message.partialResponses != null && message.hasOwnProperty("partialResponses")) + if (!$util.isInteger(message.partialResponses)) + return "partialResponses: integer expected"; + if (message.speakerIdPassiveLatencyMsOffset != null && message.hasOwnProperty("speakerIdPassiveLatencyMsOffset")) + if (!$util.isInteger(message.speakerIdPassiveLatencyMsOffset)) + return "speakerIdPassiveLatencyMsOffset: integer expected"; + if (message.bargeinEventTriggered != null && message.hasOwnProperty("bargeinEventTriggered")) + if (typeof message.bargeinEventTriggered !== "boolean") + return "bargeinEventTriggered: boolean expected"; + if (message.speechSingleUtterance != null && message.hasOwnProperty("speechSingleUtterance")) + if (typeof message.speechSingleUtterance !== "boolean") + return "speechSingleUtterance: boolean expected"; + if (message.dtmfPartialResultsTimes != null && message.hasOwnProperty("dtmfPartialResultsTimes")) { + if (!Array.isArray(message.dtmfPartialResultsTimes)) + return "dtmfPartialResultsTimes: array expected"; + for (var i = 0; i < message.dtmfPartialResultsTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.dtmfPartialResultsTimes[i], long + 1); + if (error) + return "dtmfPartialResultsTimes." + error; + } + } + if (message.dtmfFinalResultsTimes != null && message.hasOwnProperty("dtmfFinalResultsTimes")) { + if (!Array.isArray(message.dtmfFinalResultsTimes)) + return "dtmfFinalResultsTimes: array expected"; + for (var i = 0; i < message.dtmfFinalResultsTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.dtmfFinalResultsTimes[i], long + 1); + if (error) + return "dtmfFinalResultsTimes." + error; + } + } + if (message.singleUtteranceEndTimeOffset != null && message.hasOwnProperty("singleUtteranceEndTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.singleUtteranceEndTimeOffset, long + 1); + if (error) + return "singleUtteranceEndTimeOffset." + error; + } + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.noSpeechTimeout, long + 1); + if (error) + return "noSpeechTimeout." + error; + } + if (message.endpointingTimeout != null && message.hasOwnProperty("endpointingTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.endpointingTimeout, long + 1); + if (error) + return "endpointingTimeout." + error; + } + if (message.isInputText != null && message.hasOwnProperty("isInputText")) + if (typeof message.isInputText !== "boolean") + return "isInputText: boolean expected"; + if (message.clientHalfCloseTimeOffset != null && message.hasOwnProperty("clientHalfCloseTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.clientHalfCloseTimeOffset, long + 1); + if (error) + return "clientHalfCloseTimeOffset." + error; + } + if (message.clientHalfCloseStreamingTimeOffset != null && message.hasOwnProperty("clientHalfCloseStreamingTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.clientHalfCloseStreamingTimeOffset, long + 1); + if (error) + return "clientHalfCloseStreamingTimeOffset." + error; + } + return null; + }; + + /** + * Creates a CloudConversationDebuggingInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo + */ + CloudConversationDebuggingInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo(); + if (object.audioDataChunks != null) + message.audioDataChunks = object.audioDataChunks | 0; + if (object.resultEndTimeOffset != null) { + if (typeof object.resultEndTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.resultEndTimeOffset: object expected"); + message.resultEndTimeOffset = $root.google.protobuf.Duration.fromObject(object.resultEndTimeOffset, long + 1); + } + if (object.firstAudioDuration != null) { + if (typeof object.firstAudioDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.firstAudioDuration: object expected"); + message.firstAudioDuration = $root.google.protobuf.Duration.fromObject(object.firstAudioDuration, long + 1); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.speechPartialResultsEndTimes) { + if (!Array.isArray(object.speechPartialResultsEndTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.speechPartialResultsEndTimes: array expected"); + message.speechPartialResultsEndTimes = []; + for (var i = 0; i < object.speechPartialResultsEndTimes.length; ++i) { + if (typeof object.speechPartialResultsEndTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.speechPartialResultsEndTimes: object expected"); + message.speechPartialResultsEndTimes[i] = $root.google.protobuf.Duration.fromObject(object.speechPartialResultsEndTimes[i], long + 1); + } + } + if (object.speechFinalResultsEndTimes) { + if (!Array.isArray(object.speechFinalResultsEndTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.speechFinalResultsEndTimes: array expected"); + message.speechFinalResultsEndTimes = []; + for (var i = 0; i < object.speechFinalResultsEndTimes.length; ++i) { + if (typeof object.speechFinalResultsEndTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.speechFinalResultsEndTimes: object expected"); + message.speechFinalResultsEndTimes[i] = $root.google.protobuf.Duration.fromObject(object.speechFinalResultsEndTimes[i], long + 1); + } + } + if (object.partialResponses != null) + message.partialResponses = object.partialResponses | 0; + if (object.speakerIdPassiveLatencyMsOffset != null) + message.speakerIdPassiveLatencyMsOffset = object.speakerIdPassiveLatencyMsOffset | 0; + if (object.bargeinEventTriggered != null) + message.bargeinEventTriggered = Boolean(object.bargeinEventTriggered); + if (object.speechSingleUtterance != null) + message.speechSingleUtterance = Boolean(object.speechSingleUtterance); + if (object.dtmfPartialResultsTimes) { + if (!Array.isArray(object.dtmfPartialResultsTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.dtmfPartialResultsTimes: array expected"); + message.dtmfPartialResultsTimes = []; + for (var i = 0; i < object.dtmfPartialResultsTimes.length; ++i) { + if (typeof object.dtmfPartialResultsTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.dtmfPartialResultsTimes: object expected"); + message.dtmfPartialResultsTimes[i] = $root.google.protobuf.Duration.fromObject(object.dtmfPartialResultsTimes[i], long + 1); + } + } + if (object.dtmfFinalResultsTimes) { + if (!Array.isArray(object.dtmfFinalResultsTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.dtmfFinalResultsTimes: array expected"); + message.dtmfFinalResultsTimes = []; + for (var i = 0; i < object.dtmfFinalResultsTimes.length; ++i) { + if (typeof object.dtmfFinalResultsTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.dtmfFinalResultsTimes: object expected"); + message.dtmfFinalResultsTimes[i] = $root.google.protobuf.Duration.fromObject(object.dtmfFinalResultsTimes[i], long + 1); + } + } + if (object.singleUtteranceEndTimeOffset != null) { + if (typeof object.singleUtteranceEndTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.singleUtteranceEndTimeOffset: object expected"); + message.singleUtteranceEndTimeOffset = $root.google.protobuf.Duration.fromObject(object.singleUtteranceEndTimeOffset, long + 1); + } + if (object.noSpeechTimeout != null) { + if (typeof object.noSpeechTimeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.noSpeechTimeout: object expected"); + message.noSpeechTimeout = $root.google.protobuf.Duration.fromObject(object.noSpeechTimeout, long + 1); + } + if (object.endpointingTimeout != null) { + if (typeof object.endpointingTimeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.endpointingTimeout: object expected"); + message.endpointingTimeout = $root.google.protobuf.Duration.fromObject(object.endpointingTimeout, long + 1); + } + if (object.isInputText != null) + message.isInputText = Boolean(object.isInputText); + if (object.clientHalfCloseTimeOffset != null) { + if (typeof object.clientHalfCloseTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.clientHalfCloseTimeOffset: object expected"); + message.clientHalfCloseTimeOffset = $root.google.protobuf.Duration.fromObject(object.clientHalfCloseTimeOffset, long + 1); + } + if (object.clientHalfCloseStreamingTimeOffset != null) { + if (typeof object.clientHalfCloseStreamingTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.clientHalfCloseStreamingTimeOffset: object expected"); + message.clientHalfCloseStreamingTimeOffset = $root.google.protobuf.Duration.fromObject(object.clientHalfCloseStreamingTimeOffset, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CloudConversationDebuggingInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo} message CloudConversationDebuggingInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudConversationDebuggingInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechPartialResultsEndTimes = []; + object.speechFinalResultsEndTimes = []; + object.dtmfPartialResultsTimes = []; + object.dtmfFinalResultsTimes = []; + } + if (options.defaults) { + object.audioDataChunks = 0; + object.resultEndTimeOffset = null; + object.firstAudioDuration = null; + object.singleUtterance = false; + object.partialResponses = 0; + object.speakerIdPassiveLatencyMsOffset = 0; + object.bargeinEventTriggered = false; + object.speechSingleUtterance = false; + object.singleUtteranceEndTimeOffset = null; + object.noSpeechTimeout = null; + object.isInputText = false; + object.clientHalfCloseTimeOffset = null; + object.clientHalfCloseStreamingTimeOffset = null; + object.endpointingTimeout = null; + } + if (message.audioDataChunks != null && message.hasOwnProperty("audioDataChunks")) + object.audioDataChunks = message.audioDataChunks; + if (message.resultEndTimeOffset != null && message.hasOwnProperty("resultEndTimeOffset")) + object.resultEndTimeOffset = $root.google.protobuf.Duration.toObject(message.resultEndTimeOffset, options); + if (message.firstAudioDuration != null && message.hasOwnProperty("firstAudioDuration")) + object.firstAudioDuration = $root.google.protobuf.Duration.toObject(message.firstAudioDuration, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.speechPartialResultsEndTimes && message.speechPartialResultsEndTimes.length) { + object.speechPartialResultsEndTimes = []; + for (var j = 0; j < message.speechPartialResultsEndTimes.length; ++j) + object.speechPartialResultsEndTimes[j] = $root.google.protobuf.Duration.toObject(message.speechPartialResultsEndTimes[j], options); + } + if (message.speechFinalResultsEndTimes && message.speechFinalResultsEndTimes.length) { + object.speechFinalResultsEndTimes = []; + for (var j = 0; j < message.speechFinalResultsEndTimes.length; ++j) + object.speechFinalResultsEndTimes[j] = $root.google.protobuf.Duration.toObject(message.speechFinalResultsEndTimes[j], options); + } + if (message.partialResponses != null && message.hasOwnProperty("partialResponses")) + object.partialResponses = message.partialResponses; + if (message.speakerIdPassiveLatencyMsOffset != null && message.hasOwnProperty("speakerIdPassiveLatencyMsOffset")) + object.speakerIdPassiveLatencyMsOffset = message.speakerIdPassiveLatencyMsOffset; + if (message.bargeinEventTriggered != null && message.hasOwnProperty("bargeinEventTriggered")) + object.bargeinEventTriggered = message.bargeinEventTriggered; + if (message.speechSingleUtterance != null && message.hasOwnProperty("speechSingleUtterance")) + object.speechSingleUtterance = message.speechSingleUtterance; + if (message.dtmfPartialResultsTimes && message.dtmfPartialResultsTimes.length) { + object.dtmfPartialResultsTimes = []; + for (var j = 0; j < message.dtmfPartialResultsTimes.length; ++j) + object.dtmfPartialResultsTimes[j] = $root.google.protobuf.Duration.toObject(message.dtmfPartialResultsTimes[j], options); + } + if (message.dtmfFinalResultsTimes && message.dtmfFinalResultsTimes.length) { + object.dtmfFinalResultsTimes = []; + for (var j = 0; j < message.dtmfFinalResultsTimes.length; ++j) + object.dtmfFinalResultsTimes[j] = $root.google.protobuf.Duration.toObject(message.dtmfFinalResultsTimes[j], options); + } + if (message.singleUtteranceEndTimeOffset != null && message.hasOwnProperty("singleUtteranceEndTimeOffset")) + object.singleUtteranceEndTimeOffset = $root.google.protobuf.Duration.toObject(message.singleUtteranceEndTimeOffset, options); + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) + object.noSpeechTimeout = $root.google.protobuf.Duration.toObject(message.noSpeechTimeout, options); + if (message.isInputText != null && message.hasOwnProperty("isInputText")) + object.isInputText = message.isInputText; + if (message.clientHalfCloseTimeOffset != null && message.hasOwnProperty("clientHalfCloseTimeOffset")) + object.clientHalfCloseTimeOffset = $root.google.protobuf.Duration.toObject(message.clientHalfCloseTimeOffset, options); + if (message.clientHalfCloseStreamingTimeOffset != null && message.hasOwnProperty("clientHalfCloseStreamingTimeOffset")) + object.clientHalfCloseStreamingTimeOffset = $root.google.protobuf.Duration.toObject(message.clientHalfCloseStreamingTimeOffset, options); + if (message.endpointingTimeout != null && message.hasOwnProperty("endpointingTimeout")) + object.endpointingTimeout = $root.google.protobuf.Duration.toObject(message.endpointingTimeout, options); + return object; + }; + + /** + * Converts this CloudConversationDebuggingInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @instance + * @returns {Object.} JSON object + */ + CloudConversationDebuggingInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudConversationDebuggingInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudConversationDebuggingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo"; + }; + + return CloudConversationDebuggingInfo; + })(); + + v3.StreamingDetectIntentResponse = (function() { + + /** + * Properties of a StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IStreamingDetectIntentResponse + * @property {google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult|null} [recognitionResult] StreamingDetectIntentResponse recognitionResult + * @property {google.cloud.dialogflow.cx.v3.IDetectIntentResponse|null} [detectIntentResponse] StreamingDetectIntentResponse detectIntentResponse + * @property {google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo|null} [debuggingInfo] StreamingDetectIntentResponse debuggingInfo + */ + + /** + * Constructs a new StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a StreamingDetectIntentResponse. + * @implements IStreamingDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse=} [properties] Properties to set + */ + function StreamingDetectIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingDetectIntentResponse recognitionResult. + * @member {google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.recognitionResult = null; + + /** + * StreamingDetectIntentResponse detectIntentResponse. + * @member {google.cloud.dialogflow.cx.v3.IDetectIntentResponse|null|undefined} detectIntentResponse + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.detectIntentResponse = null; + + /** + * StreamingDetectIntentResponse debuggingInfo. + * @member {google.cloud.dialogflow.cx.v3.ICloudConversationDebuggingInfo|null|undefined} debuggingInfo + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.debuggingInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingDetectIntentResponse response. + * @member {"recognitionResult"|"detectIntentResponse"|undefined} response + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @instance + */ + Object.defineProperty(StreamingDetectIntentResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["recognitionResult", "detectIntentResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse} StreamingDetectIntentResponse instance + */ + StreamingDetectIntentResponse.create = function create(properties) { + return new StreamingDetectIntentResponse(properties); + }; + + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectIntentResponse != null && Object.hasOwnProperty.call(message, "detectIntentResponse")) + $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.encode(message.detectIntentResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debuggingInfo != null && Object.hasOwnProperty.call(message, "debuggingInfo")) + $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.encode(message.debuggingInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recognitionResult = $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.detectIntentResponse = $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.debuggingInfo = $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingDetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + properties.response = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.verify(message.recognitionResult, long + 1); + if (error) + return "recognitionResult." + error; + } + } + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.verify(message.detectIntentResponse, long + 1); + if (error) + return "detectIntentResponse." + error; + } + } + if (message.debuggingInfo != null && message.hasOwnProperty("debuggingInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.verify(message.debuggingInfo, long + 1); + if (error) + return "debuggingInfo." + error; + } + return null; + }; + + /** + * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse} StreamingDetectIntentResponse + */ + StreamingDetectIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse(); + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.fromObject(object.recognitionResult, long + 1); + } + if (object.detectIntentResponse != null) { + if (typeof object.detectIntentResponse !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.detectIntentResponse: object expected"); + message.detectIntentResponse = $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.fromObject(object.detectIntentResponse, long + 1); + } + if (object.debuggingInfo != null) { + if (typeof object.debuggingInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.debuggingInfo: object expected"); + message.debuggingInfo = $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.fromObject(object.debuggingInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse} message StreamingDetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.debuggingInfo = null; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + object.recognitionResult = $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.toObject(message.recognitionResult, options); + if (options.oneofs) + object.response = "recognitionResult"; + } + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) { + object.detectIntentResponse = $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.toObject(message.detectIntentResponse, options); + if (options.oneofs) + object.response = "detectIntentResponse"; + } + if (message.debuggingInfo != null && message.hasOwnProperty("debuggingInfo")) + object.debuggingInfo = $root.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo.toObject(message.debuggingInfo, options); + return object; + }; + + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingDetectIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingDetectIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse"; + }; + + return StreamingDetectIntentResponse; + })(); + + v3.StreamingRecognitionResult = (function() { + + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IStreamingRecognitionResult + * @property {google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType|null} [messageType] StreamingRecognitionResult messageType + * @property {string|null} [transcript] StreamingRecognitionResult transcript + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [confidence] StreamingRecognitionResult confidence + * @property {number|null} [stability] StreamingRecognitionResult stability + * @property {Array.|null} [speechWordInfo] StreamingRecognitionResult speechWordInfo + * @property {google.protobuf.IDuration|null} [speechEndOffset] StreamingRecognitionResult speechEndOffset + * @property {string|null} [languageCode] StreamingRecognitionResult languageCode + */ + + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.speechWordInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionResult messageType. + * @member {google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType} messageType + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.messageType = 0; + + /** + * StreamingRecognitionResult transcript. + * @member {string} transcript + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.transcript = ""; + + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; + + /** + * StreamingRecognitionResult confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.confidence = 0; + + /** + * StreamingRecognitionResult stability. + * @member {number} stability + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.stability = 0; + + /** + * StreamingRecognitionResult speechWordInfo. + * @member {Array.} speechWordInfo + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechWordInfo = $util.emptyArray; + + /** + * StreamingRecognitionResult speechEndOffset. + * @member {google.protobuf.IDuration|null|undefined} speechEndOffset + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechEndOffset = null; + + /** + * StreamingRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.messageType); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.transcript); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFinal); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.stability); + if (message.speechWordInfo != null && message.speechWordInfo.length) + for (var i = 0; i < message.speechWordInfo.length; ++i) + $root.google.cloud.dialogflow.cx.v3.SpeechWordInfo.encode(message.speechWordInfo[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.speechEndOffset != null && Object.hasOwnProperty.call(message, "speechEndOffset")) + $root.google.protobuf.Duration.encode(message.speechEndOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageType = reader.int32(); + break; + } + case 2: { + message.transcript = reader.string(); + break; + } + case 3: { + message.isFinal = reader.bool(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 6: { + message.stability = reader.float(); + break; + } + case 7: { + if (!(message.speechWordInfo && message.speechWordInfo.length)) + message.speechWordInfo = []; + message.speechWordInfo.push($root.google.cloud.dialogflow.cx.v3.SpeechWordInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.speechEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messageType != null && message.hasOwnProperty("messageType")) + switch (message.messageType) { + default: + return "messageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.stability != null && message.hasOwnProperty("stability")) + if (typeof message.stability !== "number") + return "stability: number expected"; + if (message.speechWordInfo != null && message.hasOwnProperty("speechWordInfo")) { + if (!Array.isArray(message.speechWordInfo)) + return "speechWordInfo: array expected"; + for (var i = 0; i < message.speechWordInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.SpeechWordInfo.verify(message.speechWordInfo[i], long + 1); + if (error) + return "speechWordInfo." + error; + } + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndOffset, long + 1); + if (error) + return "speechEndOffset." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult(); + switch (object.messageType) { + default: + if (typeof object.messageType === "number") { + message.messageType = object.messageType; + break; + } + break; + case "MESSAGE_TYPE_UNSPECIFIED": + case 0: + message.messageType = 0; + break; + case "TRANSCRIPT": + case 1: + message.messageType = 1; + break; + case "END_OF_SINGLE_UTTERANCE": + case 2: + message.messageType = 2; + break; + } + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.stability != null) + message.stability = Number(object.stability); + if (object.speechWordInfo) { + if (!Array.isArray(object.speechWordInfo)) + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.speechWordInfo: array expected"); + message.speechWordInfo = []; + for (var i = 0; i < object.speechWordInfo.length; ++i) { + if (typeof object.speechWordInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.speechWordInfo: object expected"); + message.speechWordInfo[i] = $root.google.cloud.dialogflow.cx.v3.SpeechWordInfo.fromObject(object.speechWordInfo[i], long + 1); + } + } + if (object.speechEndOffset != null) { + if (typeof object.speechEndOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.speechEndOffset: object expected"); + message.speechEndOffset = $root.google.protobuf.Duration.fromObject(object.speechEndOffset, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speechWordInfo = []; + if (options.defaults) { + object.messageType = options.enums === String ? "MESSAGE_TYPE_UNSPECIFIED" : 0; + object.transcript = ""; + object.isFinal = false; + object.confidence = 0; + object.stability = 0; + object.speechEndOffset = null; + object.languageCode = ""; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) + object.messageType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType[message.messageType] === undefined ? message.messageType : $root.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType[message.messageType] : message.messageType; + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.stability != null && message.hasOwnProperty("stability")) + object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; + if (message.speechWordInfo && message.speechWordInfo.length) { + object.speechWordInfo = []; + for (var j = 0; j < message.speechWordInfo.length; ++j) + object.speechWordInfo[j] = $root.google.cloud.dialogflow.cx.v3.SpeechWordInfo.toObject(message.speechWordInfo[j], options); + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) + object.speechEndOffset = $root.google.protobuf.Duration.toObject(message.speechEndOffset, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.StreamingRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.StreamingRecognitionResult"; + }; + + /** + * MessageType enum. + * @name google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType + * @enum {number} + * @property {number} MESSAGE_TYPE_UNSPECIFIED=0 MESSAGE_TYPE_UNSPECIFIED value + * @property {number} TRANSCRIPT=1 TRANSCRIPT value + * @property {number} END_OF_SINGLE_UTTERANCE=2 END_OF_SINGLE_UTTERANCE value + */ + StreamingRecognitionResult.MessageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSCRIPT"] = 1; + values[valuesById[2] = "END_OF_SINGLE_UTTERANCE"] = 2; + return values; + })(); + + return StreamingRecognitionResult; + })(); + + v3.QueryParameters = (function() { + + /** + * Properties of a QueryParameters. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IQueryParameters + * @property {string|null} [timeZone] QueryParameters timeZone + * @property {google.type.ILatLng|null} [geoLocation] QueryParameters geoLocation + * @property {Array.|null} [sessionEntityTypes] QueryParameters sessionEntityTypes + * @property {google.protobuf.IStruct|null} [payload] QueryParameters payload + * @property {google.protobuf.IStruct|null} [parameters] QueryParameters parameters + * @property {string|null} [parameterScope] QueryParameters parameterScope + * @property {string|null} [currentPage] QueryParameters currentPage + * @property {boolean|null} [disableWebhook] QueryParameters disableWebhook + * @property {boolean|null} [analyzeQueryTextSentiment] QueryParameters analyzeQueryTextSentiment + * @property {Object.|null} [webhookHeaders] QueryParameters webhookHeaders + * @property {Array.|null} [flowVersions] QueryParameters flowVersions + * @property {string|null} [currentPlaybook] QueryParameters currentPlaybook + * @property {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null} [llmModelSettings] QueryParameters llmModelSettings + * @property {string|null} [channel] QueryParameters channel + * @property {google.protobuf.IDuration|null} [sessionTtl] QueryParameters sessionTtl + * @property {google.protobuf.IStruct|null} [endUserMetadata] QueryParameters endUserMetadata + * @property {google.cloud.dialogflow.cx.v3.ISearchConfig|null} [searchConfig] QueryParameters searchConfig + * @property {boolean|null} [populateDataStoreConnectionSignals] QueryParameters populateDataStoreConnectionSignals + */ + + /** + * Constructs a new QueryParameters. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a QueryParameters. + * @implements IQueryParameters + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IQueryParameters=} [properties] Properties to set + */ + function QueryParameters(properties) { + this.sessionEntityTypes = []; + this.webhookHeaders = {}; + this.flowVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameters timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.timeZone = ""; + + /** + * QueryParameters geoLocation. + * @member {google.type.ILatLng|null|undefined} geoLocation + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.geoLocation = null; + + /** + * QueryParameters sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.sessionEntityTypes = $util.emptyArray; + + /** + * QueryParameters payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.payload = null; + + /** + * QueryParameters parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.parameters = null; + + /** + * QueryParameters parameterScope. + * @member {string} parameterScope + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.parameterScope = ""; + + /** + * QueryParameters currentPage. + * @member {string} currentPage + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.currentPage = ""; + + /** + * QueryParameters disableWebhook. + * @member {boolean} disableWebhook + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.disableWebhook = false; + + /** + * QueryParameters analyzeQueryTextSentiment. + * @member {boolean} analyzeQueryTextSentiment + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.analyzeQueryTextSentiment = false; + + /** + * QueryParameters webhookHeaders. + * @member {Object.} webhookHeaders + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.webhookHeaders = $util.emptyObject; + + /** + * QueryParameters flowVersions. + * @member {Array.} flowVersions + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.flowVersions = $util.emptyArray; + + /** + * QueryParameters currentPlaybook. + * @member {string} currentPlaybook + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.currentPlaybook = ""; + + /** + * QueryParameters llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.llmModelSettings = null; + + /** + * QueryParameters channel. + * @member {string} channel + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.channel = ""; + + /** + * QueryParameters sessionTtl. + * @member {google.protobuf.IDuration|null|undefined} sessionTtl + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.sessionTtl = null; + + /** + * QueryParameters endUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} endUserMetadata + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.endUserMetadata = null; + + /** + * QueryParameters searchConfig. + * @member {google.cloud.dialogflow.cx.v3.ISearchConfig|null|undefined} searchConfig + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.searchConfig = null; + + /** + * QueryParameters populateDataStoreConnectionSignals. + * @member {boolean} populateDataStoreConnectionSignals + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + */ + QueryParameters.prototype.populateDataStoreConnectionSignals = false; + + /** + * Creates a new QueryParameters instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryParameters=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.QueryParameters} QueryParameters instance + */ + QueryParameters.create = function create(properties) { + return new QueryParameters(properties); + }; + + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + if (message.geoLocation != null && Object.hasOwnProperty.call(message, "geoLocation")) + $root.google.type.LatLng.encode(message.geoLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.cx.v3.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.currentPage); + if (message.disableWebhook != null && Object.hasOwnProperty.call(message, "disableWebhook")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.disableWebhook); + if (message.analyzeQueryTextSentiment != null && Object.hasOwnProperty.call(message, "analyzeQueryTextSentiment")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.analyzeQueryTextSentiment); + if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) + for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + if (message.parameterScope != null && Object.hasOwnProperty.call(message, "parameterScope")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.parameterScope); + if (message.flowVersions != null && message.flowVersions.length) + for (var i = 0; i < message.flowVersions.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.flowVersions[i]); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.channel); + if (message.sessionTtl != null && Object.hasOwnProperty.call(message, "sessionTtl")) + $root.google.protobuf.Duration.encode(message.sessionTtl, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) + $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.currentPlaybook != null && Object.hasOwnProperty.call(message, "currentPlaybook")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.currentPlaybook); + if (message.searchConfig != null && Object.hasOwnProperty.call(message, "searchConfig")) + $root.google.cloud.dialogflow.cx.v3.SearchConfig.encode(message.searchConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.populateDataStoreConnectionSignals != null && Object.hasOwnProperty.call(message, "populateDataStoreConnectionSignals")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.populateDataStoreConnectionSignals); + return writer; + }; + + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.QueryParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timeZone = reader.string(); + break; + } + case 2: { + message.geoLocation = $root.google.type.LatLng.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.cx.v3.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.parameterScope = reader.string(); + break; + } + case 6: { + message.currentPage = reader.string(); + break; + } + case 7: { + message.disableWebhook = reader.bool(); + break; + } + case 8: { + message.analyzeQueryTextSentiment = reader.bool(); + break; + } + case 10: { + if (message.webhookHeaders === $util.emptyObject) + message.webhookHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.webhookHeaders, key); + message.webhookHeaders[key] = value; + break; + } + case 14: { + if (!(message.flowVersions && message.flowVersions.length)) + message.flowVersions = []; + message.flowVersions.push(reader.string()); + break; + } + case 19: { + message.currentPlaybook = reader.string(); + break; + } + case 21: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.channel = reader.string(); + break; + } + case 16: { + message.sessionTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.searchConfig = $root.google.cloud.dialogflow.cx.v3.SearchConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.populateDataStoreConnectionSignals = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameters message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameters.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) { + var error = $root.google.type.LatLng.verify(message.geoLocation, long + 1); + if (error) + return "geoLocation." + error; + } + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.verify(message.sessionEntityTypes[i], long + 1); + if (error) + return "sessionEntityTypes." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters, long + 1); + if (error) + return "parameters." + error; + } + if (message.parameterScope != null && message.hasOwnProperty("parameterScope")) + if (!$util.isString(message.parameterScope)) + return "parameterScope: string expected"; + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + if (!$util.isString(message.currentPage)) + return "currentPage: string expected"; + if (message.disableWebhook != null && message.hasOwnProperty("disableWebhook")) + if (typeof message.disableWebhook !== "boolean") + return "disableWebhook: boolean expected"; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + if (typeof message.analyzeQueryTextSentiment !== "boolean") + return "analyzeQueryTextSentiment: boolean expected"; + if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { + if (!$util.isObject(message.webhookHeaders)) + return "webhookHeaders: object expected"; + var key = Object.keys(message.webhookHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.webhookHeaders[key[i]])) + return "webhookHeaders: string{k:string} expected"; + } + if (message.flowVersions != null && message.hasOwnProperty("flowVersions")) { + if (!Array.isArray(message.flowVersions)) + return "flowVersions: array expected"; + for (var i = 0; i < message.flowVersions.length; ++i) + if (!$util.isString(message.flowVersions[i])) + return "flowVersions: string[] expected"; + } + if (message.currentPlaybook != null && message.hasOwnProperty("currentPlaybook")) + if (!$util.isString(message.currentPlaybook)) + return "currentPlaybook: string expected"; + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + if (message.channel != null && message.hasOwnProperty("channel")) + if (!$util.isString(message.channel)) + return "channel: string expected"; + if (message.sessionTtl != null && message.hasOwnProperty("sessionTtl")) { + var error = $root.google.protobuf.Duration.verify(message.sessionTtl, long + 1); + if (error) + return "sessionTtl." + error; + } + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.endUserMetadata, long + 1); + if (error) + return "endUserMetadata." + error; + } + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.SearchConfig.verify(message.searchConfig, long + 1); + if (error) + return "searchConfig." + error; + } + if (message.populateDataStoreConnectionSignals != null && message.hasOwnProperty("populateDataStoreConnectionSignals")) + if (typeof message.populateDataStoreConnectionSignals !== "boolean") + return "populateDataStoreConnectionSignals: boolean expected"; + return null; + }; + + /** + * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.QueryParameters} QueryParameters + */ + QueryParameters.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.QueryParameters) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.QueryParameters(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.geoLocation != null) { + if (typeof object.geoLocation !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.geoLocation: object expected"); + message.geoLocation = $root.google.type.LatLng.fromObject(object.geoLocation, long + 1); + } + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.fromObject(object.sessionEntityTypes[i], long + 1); + } + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters, long + 1); + } + if (object.parameterScope != null) + message.parameterScope = String(object.parameterScope); + if (object.currentPage != null) + message.currentPage = String(object.currentPage); + if (object.disableWebhook != null) + message.disableWebhook = Boolean(object.disableWebhook); + if (object.analyzeQueryTextSentiment != null) + message.analyzeQueryTextSentiment = Boolean(object.analyzeQueryTextSentiment); + if (object.webhookHeaders) { + if (typeof object.webhookHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.webhookHeaders: object expected"); + message.webhookHeaders = {}; + for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.webhookHeaders, keys[i]); + message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + } + } + if (object.flowVersions) { + if (!Array.isArray(object.flowVersions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.flowVersions: array expected"); + message.flowVersions = []; + for (var i = 0; i < object.flowVersions.length; ++i) + message.flowVersions[i] = String(object.flowVersions[i]); + } + if (object.currentPlaybook != null) + message.currentPlaybook = String(object.currentPlaybook); + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + if (object.channel != null) + message.channel = String(object.channel); + if (object.sessionTtl != null) { + if (typeof object.sessionTtl !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.sessionTtl: object expected"); + message.sessionTtl = $root.google.protobuf.Duration.fromObject(object.sessionTtl, long + 1); + } + if (object.endUserMetadata != null) { + if (typeof object.endUserMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.endUserMetadata: object expected"); + message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata, long + 1); + } + if (object.searchConfig != null) { + if (typeof object.searchConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryParameters.searchConfig: object expected"); + message.searchConfig = $root.google.cloud.dialogflow.cx.v3.SearchConfig.fromObject(object.searchConfig, long + 1); + } + if (object.populateDataStoreConnectionSignals != null) + message.populateDataStoreConnectionSignals = Boolean(object.populateDataStoreConnectionSignals); + return message; + }; + + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3.QueryParameters} message QueryParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sessionEntityTypes = []; + object.flowVersions = []; + } + if (options.objects || options.defaults) + object.webhookHeaders = {}; + if (options.defaults) { + object.timeZone = ""; + object.geoLocation = null; + object.payload = null; + object.parameters = null; + object.currentPage = ""; + object.disableWebhook = false; + object.analyzeQueryTextSentiment = false; + object.parameterScope = ""; + object.channel = ""; + object.sessionTtl = null; + object.endUserMetadata = null; + object.currentPlaybook = ""; + object.searchConfig = null; + object.llmModelSettings = null; + object.populateDataStoreConnectionSignals = false; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) + object.geoLocation = $root.google.type.LatLng.toObject(message.geoLocation, options); + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = message.currentPage; + if (message.disableWebhook != null && message.hasOwnProperty("disableWebhook")) + object.disableWebhook = message.disableWebhook; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + object.analyzeQueryTextSentiment = message.analyzeQueryTextSentiment; + var keys2; + if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { + object.webhookHeaders = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.webhookHeaders, keys2[j]); + object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; + } + } + if (message.parameterScope != null && message.hasOwnProperty("parameterScope")) + object.parameterScope = message.parameterScope; + if (message.flowVersions && message.flowVersions.length) { + object.flowVersions = []; + for (var j = 0; j < message.flowVersions.length; ++j) + object.flowVersions[j] = message.flowVersions[j]; + } + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = message.channel; + if (message.sessionTtl != null && message.hasOwnProperty("sessionTtl")) + object.sessionTtl = $root.google.protobuf.Duration.toObject(message.sessionTtl, options); + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) + object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); + if (message.currentPlaybook != null && message.hasOwnProperty("currentPlaybook")) + object.currentPlaybook = message.currentPlaybook; + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) + object.searchConfig = $root.google.cloud.dialogflow.cx.v3.SearchConfig.toObject(message.searchConfig, options); + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.toObject(message.llmModelSettings, options); + if (message.populateDataStoreConnectionSignals != null && message.hasOwnProperty("populateDataStoreConnectionSignals")) + object.populateDataStoreConnectionSignals = message.populateDataStoreConnectionSignals; + return object; + }; + + /** + * Converts this QueryParameters to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @instance + * @returns {Object.} JSON object + */ + QueryParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryParameters + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.QueryParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.QueryParameters"; + }; + + return QueryParameters; + })(); + + v3.SearchConfig = (function() { + + /** + * Properties of a SearchConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISearchConfig + * @property {Array.|null} [boostSpecs] SearchConfig boostSpecs + * @property {Array.|null} [filterSpecs] SearchConfig filterSpecs + */ + + /** + * Constructs a new SearchConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SearchConfig. + * @implements ISearchConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISearchConfig=} [properties] Properties to set + */ + function SearchConfig(properties) { + this.boostSpecs = []; + this.filterSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchConfig boostSpecs. + * @member {Array.} boostSpecs + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @instance + */ + SearchConfig.prototype.boostSpecs = $util.emptyArray; + + /** + * SearchConfig filterSpecs. + * @member {Array.} filterSpecs + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @instance + */ + SearchConfig.prototype.filterSpecs = $util.emptyArray; + + /** + * Creates a new SearchConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ISearchConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SearchConfig} SearchConfig instance + */ + SearchConfig.create = function create(properties) { + return new SearchConfig(properties); + }; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SearchConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boostSpecs != null && message.boostSpecs.length) + for (var i = 0; i < message.boostSpecs.length; ++i) + $root.google.cloud.dialogflow.cx.v3.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.filterSpecs != null && message.filterSpecs.length) + for (var i = 0; i < message.filterSpecs.length; ++i) + $root.google.cloud.dialogflow.cx.v3.FilterSpecs.encode(message.filterSpecs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SearchConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SearchConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.boostSpecs && message.boostSpecs.length)) + message.boostSpecs = []; + message.boostSpecs.push($root.google.cloud.dialogflow.cx.v3.BoostSpecs.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.filterSpecs && message.filterSpecs.length)) + message.filterSpecs = []; + message.filterSpecs.push($root.google.cloud.dialogflow.cx.v3.FilterSpecs.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { + if (!Array.isArray(message.boostSpecs)) + return "boostSpecs: array expected"; + for (var i = 0; i < message.boostSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.BoostSpecs.verify(message.boostSpecs[i], long + 1); + if (error) + return "boostSpecs." + error; + } + } + if (message.filterSpecs != null && message.hasOwnProperty("filterSpecs")) { + if (!Array.isArray(message.filterSpecs)) + return "filterSpecs: array expected"; + for (var i = 0; i < message.filterSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.FilterSpecs.verify(message.filterSpecs[i], long + 1); + if (error) + return "filterSpecs." + error; + } + } + return null; + }; + + /** + * Creates a SearchConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SearchConfig} SearchConfig + */ + SearchConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SearchConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SearchConfig(); + if (object.boostSpecs) { + if (!Array.isArray(object.boostSpecs)) + throw TypeError(".google.cloud.dialogflow.cx.v3.SearchConfig.boostSpecs: array expected"); + message.boostSpecs = []; + for (var i = 0; i < object.boostSpecs.length; ++i) { + if (typeof object.boostSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SearchConfig.boostSpecs: object expected"); + message.boostSpecs[i] = $root.google.cloud.dialogflow.cx.v3.BoostSpecs.fromObject(object.boostSpecs[i], long + 1); + } + } + if (object.filterSpecs) { + if (!Array.isArray(object.filterSpecs)) + throw TypeError(".google.cloud.dialogflow.cx.v3.SearchConfig.filterSpecs: array expected"); + message.filterSpecs = []; + for (var i = 0; i < object.filterSpecs.length; ++i) { + if (typeof object.filterSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SearchConfig.filterSpecs: object expected"); + message.filterSpecs[i] = $root.google.cloud.dialogflow.cx.v3.FilterSpecs.fromObject(object.filterSpecs[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.SearchConfig} message SearchConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.boostSpecs = []; + object.filterSpecs = []; + } + if (message.boostSpecs && message.boostSpecs.length) { + object.boostSpecs = []; + for (var j = 0; j < message.boostSpecs.length; ++j) + object.boostSpecs[j] = $root.google.cloud.dialogflow.cx.v3.BoostSpecs.toObject(message.boostSpecs[j], options); + } + if (message.filterSpecs && message.filterSpecs.length) { + object.filterSpecs = []; + for (var j = 0; j < message.filterSpecs.length; ++j) + object.filterSpecs[j] = $root.google.cloud.dialogflow.cx.v3.FilterSpecs.toObject(message.filterSpecs[j], options); + } + return object; + }; + + /** + * Converts this SearchConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @instance + * @returns {Object.} JSON object + */ + SearchConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SearchConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SearchConfig"; + }; + + return SearchConfig; + })(); + + v3.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i], long + 1); + if (error) + return "conditionBoostSpecs." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BoostSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BoostSpec"; + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + * @property {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * ConditionBoostSpec boostControlSpec. + * @member {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boostControlSpec = null; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) + $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + case 4: { + message.boostControlSpec = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { + var error = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec, long + 1); + if (error) + return "boostControlSpec." + error; + } + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.boostControlSpec != null) { + if (typeof object.boostControlSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); + message.boostControlSpec = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + object.boostControlSpec = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) + object.boostControlSpec = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionBoostSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec"; + }; + + ConditionBoostSpec.BoostControlSpec = (function() { + + /** + * Properties of a BoostControlSpec. + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @interface IBoostControlSpec + * @property {string|null} [fieldName] BoostControlSpec fieldName + * @property {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType + * @property {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType + * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints + */ + + /** + * Constructs a new BoostControlSpec. + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec + * @classdesc Represents a BoostControlSpec. + * @implements IBoostControlSpec + * @constructor + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + */ + function BoostControlSpec(properties) { + this.controlPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostControlSpec fieldName. + * @member {string} fieldName + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.fieldName = ""; + + /** + * BoostControlSpec attributeType. + * @member {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.attributeType = 0; + + /** + * BoostControlSpec interpolationType. + * @member {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.interpolationType = 0; + + /** + * BoostControlSpec controlPoints. + * @member {Array.} controlPoints + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.controlPoints = $util.emptyArray; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance + */ + BoostControlSpec.create = function create(properties) { + return new BoostControlSpec(properties); + }; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); + if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); + if (message.controlPoints != null && message.controlPoints.length) + for (var i = 0; i < message.controlPoints.length; ++i) + $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.attributeType = reader.int32(); + break; + } + case 3: { + message.interpolationType = reader.int32(); + break; + } + case 4: { + if (!(message.controlPoints && message.controlPoints.length)) + message.controlPoints = []; + message.controlPoints.push($root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostControlSpec message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostControlSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + switch (message.attributeType) { + default: + return "attributeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + switch (message.interpolationType) { + default: + return "interpolationType: enum value expected"; + case 0: + case 1: + break; + } + if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { + if (!Array.isArray(message.controlPoints)) + return "controlPoints: array expected"; + for (var i = 0; i < message.controlPoints.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i], long + 1); + if (error) + return "controlPoints." + error; + } + } + return null; + }; + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + */ + BoostControlSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.attributeType) { + default: + if (typeof object.attributeType === "number") { + message.attributeType = object.attributeType; + break; + } + break; + case "ATTRIBUTE_TYPE_UNSPECIFIED": + case 0: + message.attributeType = 0; + break; + case "NUMERICAL": + case 1: + message.attributeType = 1; + break; + case "FRESHNESS": + case 2: + message.attributeType = 2; + break; + } + switch (object.interpolationType) { + default: + if (typeof object.interpolationType === "number") { + message.interpolationType = object.interpolationType; + break; + } + break; + case "INTERPOLATION_TYPE_UNSPECIFIED": + case 0: + message.interpolationType = 0; + break; + case "LINEAR": + case 1: + message.interpolationType = 1; + break; + } + if (object.controlPoints) { + if (!Array.isArray(object.controlPoints)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); + message.controlPoints = []; + for (var i = 0; i < object.controlPoints.length; ++i) { + if (typeof object.controlPoints[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); + message.controlPoints[i] = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostControlSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controlPoints = []; + if (options.defaults) { + object.fieldName = ""; + object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; + object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + object.attributeType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + object.interpolationType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; + if (message.controlPoints && message.controlPoints.length) { + object.controlPoints = []; + for (var j = 0; j < message.controlPoints.length; ++j) + object.controlPoints[j] = $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); + } + return object; + }; + + /** + * Converts this BoostControlSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + * @returns {Object.} JSON object + */ + BoostControlSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostControlSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec"; + }; + + /** + * AttributeType enum. + * @name google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + * @enum {number} + * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value + * @property {number} NUMERICAL=1 NUMERICAL value + * @property {number} FRESHNESS=2 FRESHNESS value + */ + BoostControlSpec.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERICAL"] = 1; + values[valuesById[2] = "FRESHNESS"] = 2; + return values; + })(); + + /** + * InterpolationType enum. + * @name google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + * @enum {number} + * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value + * @property {number} LINEAR=1 LINEAR value + */ + BoostControlSpec.InterpolationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR"] = 1; + return values; + })(); + + BoostControlSpec.ControlPoint = (function() { + + /** + * Properties of a ControlPoint. + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @interface IControlPoint + * @property {string|null} [attributeValue] ControlPoint attributeValue + * @property {number|null} [boostAmount] ControlPoint boostAmount + */ + + /** + * Constructs a new ControlPoint. + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @classdesc Represents a ControlPoint. + * @implements IControlPoint + * @constructor + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + */ + function ControlPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ControlPoint attributeValue. + * @member {string} attributeValue + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.attributeValue = ""; + + /** + * ControlPoint boostAmount. + * @member {number} boostAmount + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.boostAmount = 0; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance + */ + ControlPoint.create = function create(properties) { + return new ControlPoint(properties); + }; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); + if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); + return writer; + }; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.attributeValue = reader.string(); + break; + } + case 2: { + message.boostAmount = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ControlPoint message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ControlPoint.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + if (!$util.isString(message.attributeValue)) + return "attributeValue: string expected"; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + if (typeof message.boostAmount !== "number") + return "boostAmount: number expected"; + return null; + }; + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + */ + ControlPoint.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + if (object.attributeValue != null) + message.attributeValue = String(object.attributeValue); + if (object.boostAmount != null) + message.boostAmount = Number(object.boostAmount); + return message; + }; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeValue = ""; + object.boostAmount = 0; + } + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + object.attributeValue = message.attributeValue; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; + return object; + }; + + /** + * Converts this ControlPoint to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + * @returns {Object.} JSON object + */ + ControlPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ControlPoint + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; + }; + + return ControlPoint; + })(); + + return BoostControlSpec; + })(); + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + v3.BoostSpecs = (function() { + + /** + * Properties of a BoostSpecs. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IBoostSpecs + * @property {Array.|null} [dataStores] BoostSpecs dataStores + * @property {Array.|null} [spec] BoostSpecs spec + */ + + /** + * Constructs a new BoostSpecs. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a BoostSpecs. + * @implements IBoostSpecs + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IBoostSpecs=} [properties] Properties to set + */ + function BoostSpecs(properties) { + this.dataStores = []; + this.spec = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @instance + */ + BoostSpecs.prototype.dataStores = $util.emptyArray; + + /** + * BoostSpecs spec. + * @member {Array.} spec + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @instance + */ + BoostSpecs.prototype.spec = $util.emptyArray; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.IBoostSpecs=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.BoostSpecs} BoostSpecs instance + */ + BoostSpecs.create = function create(properties) { + return new BoostSpecs(properties); + }; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.spec != null && message.spec.length) + for (var i = 0; i < message.spec.length; ++i) + $root.google.cloud.dialogflow.cx.v3.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.BoostSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.BoostSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + if (!(message.spec && message.spec.length)) + message.spec = []; + message.spec.push($root.google.cloud.dialogflow.cx.v3.BoostSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpecs message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpecs.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (!Array.isArray(message.spec)) + return "spec: array expected"; + for (var i = 0; i < message.spec.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.BoostSpec.verify(message.spec[i], long + 1); + if (error) + return "spec." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.BoostSpecs} BoostSpecs + */ + BoostSpecs.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.BoostSpecs) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.BoostSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.spec) { + if (!Array.isArray(object.spec)) + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpecs.spec: array expected"); + message.spec = []; + for (var i = 0; i < object.spec.length; ++i) { + if (typeof object.spec[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.BoostSpecs.spec: object expected"); + message.spec[i] = $root.google.cloud.dialogflow.cx.v3.BoostSpec.fromObject(object.spec[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.BoostSpecs} message BoostSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataStores = []; + object.spec = []; + } + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.spec && message.spec.length) { + object.spec = []; + for (var j = 0; j < message.spec.length; ++j) + object.spec[j] = $root.google.cloud.dialogflow.cx.v3.BoostSpec.toObject(message.spec[j], options); + } + return object; + }; + + /** + * Converts this BoostSpecs to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @instance + * @returns {Object.} JSON object + */ + BoostSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpecs + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.BoostSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.BoostSpecs"; + }; + + return BoostSpecs; + })(); + + v3.FilterSpecs = (function() { + + /** + * Properties of a FilterSpecs. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFilterSpecs + * @property {Array.|null} [dataStores] FilterSpecs dataStores + * @property {string|null} [filter] FilterSpecs filter + */ + + /** + * Constructs a new FilterSpecs. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FilterSpecs. + * @implements IFilterSpecs + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFilterSpecs=} [properties] Properties to set + */ + function FilterSpecs(properties) { + this.dataStores = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FilterSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @instance + */ + FilterSpecs.prototype.dataStores = $util.emptyArray; + + /** + * FilterSpecs filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @instance + */ + FilterSpecs.prototype.filter = ""; + + /** + * Creates a new FilterSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.IFilterSpecs=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FilterSpecs} FilterSpecs instance + */ + FilterSpecs.create = function create(properties) { + return new FilterSpecs(properties); + }; + + /** + * Encodes the specified FilterSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FilterSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.IFilterSpecs} message FilterSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + return writer; + }; + + /** + * Encodes the specified FilterSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FilterSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.IFilterSpecs} message FilterSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FilterSpecs} FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterSpecs.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FilterSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FilterSpecs} FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FilterSpecs message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterSpecs.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a FilterSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FilterSpecs} FilterSpecs + */ + FilterSpecs.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FilterSpecs) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FilterSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.dialogflow.cx.v3.FilterSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a FilterSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3.FilterSpecs} message FilterSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStores = []; + if (options.defaults) + object.filter = ""; + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this FilterSpecs to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @instance + * @returns {Object.} JSON object + */ + FilterSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FilterSpecs + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FilterSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FilterSpecs"; + }; + + return FilterSpecs; + })(); + + v3.QueryInput = (function() { + + /** + * Properties of a QueryInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IQueryInput + * @property {google.cloud.dialogflow.cx.v3.ITextInput|null} [text] QueryInput text + * @property {google.cloud.dialogflow.cx.v3.IIntentInput|null} [intent] QueryInput intent + * @property {google.cloud.dialogflow.cx.v3.IAudioInput|null} [audio] QueryInput audio + * @property {google.cloud.dialogflow.cx.v3.IEventInput|null} [event] QueryInput event + * @property {google.cloud.dialogflow.cx.v3.IDtmfInput|null} [dtmf] QueryInput dtmf + * @property {google.cloud.dialogflow.cx.v3.IToolCallResult|null} [toolCallResult] QueryInput toolCallResult + * @property {string|null} [languageCode] QueryInput languageCode + */ + + /** + * Constructs a new QueryInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a QueryInput. + * @implements IQueryInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IQueryInput=} [properties] Properties to set + */ + function QueryInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInput text. + * @member {google.cloud.dialogflow.cx.v3.ITextInput|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + QueryInput.prototype.text = null; + + /** + * QueryInput intent. + * @member {google.cloud.dialogflow.cx.v3.IIntentInput|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + QueryInput.prototype.intent = null; + + /** + * QueryInput audio. + * @member {google.cloud.dialogflow.cx.v3.IAudioInput|null|undefined} audio + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + QueryInput.prototype.audio = null; + + /** + * QueryInput event. + * @member {google.cloud.dialogflow.cx.v3.IEventInput|null|undefined} event + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + QueryInput.prototype.event = null; + + /** + * QueryInput dtmf. + * @member {google.cloud.dialogflow.cx.v3.IDtmfInput|null|undefined} dtmf + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + QueryInput.prototype.dtmf = null; + + /** + * QueryInput toolCallResult. + * @member {google.cloud.dialogflow.cx.v3.IToolCallResult|null|undefined} toolCallResult + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + QueryInput.prototype.toolCallResult = null; + + /** + * QueryInput languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + QueryInput.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryInput input. + * @member {"text"|"intent"|"audio"|"event"|"dtmf"|"toolCallResult"|undefined} input + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + */ + Object.defineProperty(QueryInput.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["text", "intent", "audio", "event", "dtmf", "toolCallResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.QueryInput} QueryInput instance + */ + QueryInput.create = function create(properties) { + return new QueryInput(properties); + }; + + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.cx.v3.TextInput.encode(message.text, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3.IntentInput.encode(message.intent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.dialogflow.cx.v3.AudioInput.encode(message.audio, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.dialogflow.cx.v3.EventInput.encode(message.event, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) + $root.google.cloud.dialogflow.cx.v3.DtmfInput.encode(message.dtmf, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.toolCallResult != null && Object.hasOwnProperty.call(message, "toolCallResult")) + $root.google.cloud.dialogflow.cx.v3.ToolCallResult.encode(message.toolCallResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.QueryInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.text = $root.google.cloud.dialogflow.cx.v3.TextInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.intent = $root.google.cloud.dialogflow.cx.v3.IntentInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.audio = $root.google.cloud.dialogflow.cx.v3.AudioInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.event = $root.google.cloud.dialogflow.cx.v3.EventInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.dtmf = $root.google.cloud.dialogflow.cx.v3.DtmfInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.toolCallResult = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.TextInput.verify(message.text, long + 1); + if (error) + return "text." + error; + } + } + if (message.intent != null && message.hasOwnProperty("intent")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.IntentInput.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.AudioInput.verify(message.audio, long + 1); + if (error) + return "audio." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.EventInput.verify(message.event, long + 1); + if (error) + return "event." + error; + } + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.DtmfInput.verify(message.dtmf, long + 1); + if (error) + return "dtmf." + error; + } + } + if (message.toolCallResult != null && message.hasOwnProperty("toolCallResult")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.verify(message.toolCallResult, long + 1); + if (error) + return "toolCallResult." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.QueryInput} QueryInput + */ + QueryInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.QueryInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.QueryInput(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryInput.text: object expected"); + message.text = $root.google.cloud.dialogflow.cx.v3.TextInput.fromObject(object.text, long + 1); + } + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryInput.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3.IntentInput.fromObject(object.intent, long + 1); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryInput.audio: object expected"); + message.audio = $root.google.cloud.dialogflow.cx.v3.AudioInput.fromObject(object.audio, long + 1); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryInput.event: object expected"); + message.event = $root.google.cloud.dialogflow.cx.v3.EventInput.fromObject(object.event, long + 1); + } + if (object.dtmf != null) { + if (typeof object.dtmf !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryInput.dtmf: object expected"); + message.dtmf = $root.google.cloud.dialogflow.cx.v3.DtmfInput.fromObject(object.dtmf, long + 1); + } + if (object.toolCallResult != null) { + if (typeof object.toolCallResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryInput.toolCallResult: object expected"); + message.toolCallResult = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.fromObject(object.toolCallResult, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3.QueryInput} message QueryInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.languageCode = ""; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.cx.v3.TextInput.toObject(message.text, options); + if (options.oneofs) + object.input = "text"; + } + if (message.intent != null && message.hasOwnProperty("intent")) { + object.intent = $root.google.cloud.dialogflow.cx.v3.IntentInput.toObject(message.intent, options); + if (options.oneofs) + object.input = "intent"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = $root.google.cloud.dialogflow.cx.v3.AudioInput.toObject(message.audio, options); + if (options.oneofs) + object.input = "audio"; + } + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.dialogflow.cx.v3.EventInput.toObject(message.event, options); + if (options.oneofs) + object.input = "event"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + object.dtmf = $root.google.cloud.dialogflow.cx.v3.DtmfInput.toObject(message.dtmf, options); + if (options.oneofs) + object.input = "dtmf"; + } + if (message.toolCallResult != null && message.hasOwnProperty("toolCallResult")) { + object.toolCallResult = $root.google.cloud.dialogflow.cx.v3.ToolCallResult.toObject(message.toolCallResult, options); + if (options.oneofs) + object.input = "toolCallResult"; + } + return object; + }; + + /** + * Converts this QueryInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @instance + * @returns {Object.} JSON object + */ + QueryInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.QueryInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.QueryInput"; + }; + + return QueryInput; + })(); + + v3.QueryResult = (function() { + + /** + * Properties of a QueryResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IQueryResult + * @property {string|null} [text] QueryResult text + * @property {string|null} [triggerIntent] QueryResult triggerIntent + * @property {string|null} [transcript] QueryResult transcript + * @property {string|null} [triggerEvent] QueryResult triggerEvent + * @property {google.cloud.dialogflow.cx.v3.IDtmfInput|null} [dtmf] QueryResult dtmf + * @property {string|null} [languageCode] QueryResult languageCode + * @property {google.protobuf.IStruct|null} [parameters] QueryResult parameters + * @property {Array.|null} [responseMessages] QueryResult responseMessages + * @property {Array.|null} [webhookStatuses] QueryResult webhookStatuses + * @property {Array.|null} [webhookPayloads] QueryResult webhookPayloads + * @property {google.cloud.dialogflow.cx.v3.IPage|null} [currentPage] QueryResult currentPage + * @property {google.cloud.dialogflow.cx.v3.IFlow|null} [currentFlow] QueryResult currentFlow + * @property {google.cloud.dialogflow.cx.v3.IIntent|null} [intent] QueryResult intent + * @property {number|null} [intentDetectionConfidence] QueryResult intentDetectionConfidence + * @property {google.cloud.dialogflow.cx.v3.IMatch|null} [match] QueryResult match + * @property {google.protobuf.IStruct|null} [diagnosticInfo] QueryResult diagnosticInfo + * @property {google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult|null} [sentimentAnalysisResult] QueryResult sentimentAnalysisResult + * @property {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null} [advancedSettings] QueryResult advancedSettings + * @property {boolean|null} [allowAnswerFeedback] QueryResult allowAnswerFeedback + * @property {google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals|null} [dataStoreConnectionSignals] QueryResult dataStoreConnectionSignals + * @property {Array.|null} [traceBlocks] QueryResult traceBlocks + */ + + /** + * Constructs a new QueryResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a QueryResult. + * @implements IQueryResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IQueryResult=} [properties] Properties to set + */ + function QueryResult(properties) { + this.responseMessages = []; + this.webhookStatuses = []; + this.webhookPayloads = []; + this.traceBlocks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryResult text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.text = null; + + /** + * QueryResult triggerIntent. + * @member {string|null|undefined} triggerIntent + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.triggerIntent = null; + + /** + * QueryResult transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.transcript = null; + + /** + * QueryResult triggerEvent. + * @member {string|null|undefined} triggerEvent + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.triggerEvent = null; + + /** + * QueryResult dtmf. + * @member {google.cloud.dialogflow.cx.v3.IDtmfInput|null|undefined} dtmf + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.dtmf = null; + + /** + * QueryResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.languageCode = ""; + + /** + * QueryResult parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.parameters = null; + + /** + * QueryResult responseMessages. + * @member {Array.} responseMessages + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.responseMessages = $util.emptyArray; + + /** + * QueryResult webhookStatuses. + * @member {Array.} webhookStatuses + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.webhookStatuses = $util.emptyArray; + + /** + * QueryResult webhookPayloads. + * @member {Array.} webhookPayloads + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.webhookPayloads = $util.emptyArray; + + /** + * QueryResult currentPage. + * @member {google.cloud.dialogflow.cx.v3.IPage|null|undefined} currentPage + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.currentPage = null; + + /** + * QueryResult currentFlow. + * @member {google.cloud.dialogflow.cx.v3.IFlow|null|undefined} currentFlow + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.currentFlow = null; + + /** + * QueryResult intent. + * @member {google.cloud.dialogflow.cx.v3.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.intent = null; + + /** + * QueryResult intentDetectionConfidence. + * @member {number} intentDetectionConfidence + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.intentDetectionConfidence = 0; + + /** + * QueryResult match. + * @member {google.cloud.dialogflow.cx.v3.IMatch|null|undefined} match + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.match = null; + + /** + * QueryResult diagnosticInfo. + * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.diagnosticInfo = null; + + /** + * QueryResult sentimentAnalysisResult. + * @member {google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.sentimentAnalysisResult = null; + + /** + * QueryResult advancedSettings. + * @member {google.cloud.dialogflow.cx.v3.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.advancedSettings = null; + + /** + * QueryResult allowAnswerFeedback. + * @member {boolean} allowAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.allowAnswerFeedback = false; + + /** + * QueryResult dataStoreConnectionSignals. + * @member {google.cloud.dialogflow.cx.v3.IDataStoreConnectionSignals|null|undefined} dataStoreConnectionSignals + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.dataStoreConnectionSignals = null; + + /** + * QueryResult traceBlocks. + * @member {Array.} traceBlocks + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + QueryResult.prototype.traceBlocks = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryResult query. + * @member {"text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmf"|undefined} query + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + */ + Object.defineProperty(QueryResult.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["text", "triggerIntent", "transcript", "triggerEvent", "dtmf"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.QueryResult} QueryResult instance + */ + QueryResult.create = function create(properties) { + return new QueryResult(properties); + }; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.responseMessages != null && message.responseMessages.length) + for (var i = 0; i < message.responseMessages.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.encode(message.responseMessages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.webhookPayloads != null && message.webhookPayloads.length) + for (var i = 0; i < message.webhookPayloads.length; ++i) + $root.google.protobuf.Struct.encode(message.webhookPayloads[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + $root.google.cloud.dialogflow.cx.v3.Page.encode(message.currentPage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3.Intent.encode(message.intent, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.intentDetectionConfidence != null && Object.hasOwnProperty.call(message, "intentDetectionConfidence")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.intentDetectionConfidence); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.triggerIntent != null && Object.hasOwnProperty.call(message, "triggerIntent")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.triggerIntent); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.transcript); + if (message.webhookStatuses != null && message.webhookStatuses.length) + for (var i = 0; i < message.webhookStatuses.length; ++i) + $root.google.rpc.Status.encode(message.webhookStatuses[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.triggerEvent != null && Object.hasOwnProperty.call(message, "triggerEvent")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.triggerEvent); + if (message.match != null && Object.hasOwnProperty.call(message, "match")) + $root.google.cloud.dialogflow.cx.v3.Match.encode(message.match, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) + $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) + $root.google.cloud.dialogflow.cx.v3.DtmfInput.encode(message.dtmf, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.currentFlow != null && Object.hasOwnProperty.call(message, "currentFlow")) + $root.google.cloud.dialogflow.cx.v3.Flow.encode(message.currentFlow, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.allowAnswerFeedback != null && Object.hasOwnProperty.call(message, "allowAnswerFeedback")) + writer.uint32(/* id 32, wireType 0 =*/256).bool(message.allowAnswerFeedback); + if (message.dataStoreConnectionSignals != null && Object.hasOwnProperty.call(message, "dataStoreConnectionSignals")) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.encode(message.dataStoreConnectionSignals, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.traceBlocks != null && message.traceBlocks.length) + for (var i = 0; i < message.traceBlocks.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TraceBlock.encode(message.traceBlocks[i], writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.QueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.QueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 11: { + message.triggerIntent = reader.string(); + break; + } + case 12: { + message.transcript = reader.string(); + break; + } + case 14: { + message.triggerEvent = reader.string(); + break; + } + case 23: { + message.dtmf = $root.google.cloud.dialogflow.cx.v3.DtmfInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.responseMessages && message.responseMessages.length)) + message.responseMessages = []; + message.responseMessages.push($root.google.cloud.dialogflow.cx.v3.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 13: { + if (!(message.webhookStatuses && message.webhookStatuses.length)) + message.webhookStatuses = []; + message.webhookStatuses.push($root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.webhookPayloads && message.webhookPayloads.length)) + message.webhookPayloads = []; + message.webhookPayloads.push($root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.currentFlow = $root.google.cloud.dialogflow.cx.v3.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.intentDetectionConfidence = reader.float(); + break; + } + case 15: { + message.match = $root.google.cloud.dialogflow.cx.v3.Match.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 32: { + message.allowAnswerFeedback = reader.bool(); + break; + } + case 35: { + message.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 37: { + if (!(message.traceBlocks && message.traceBlocks.length)) + message.traceBlocks = []; + message.traceBlocks.push($root.google.cloud.dialogflow.cx.v3.TraceBlock.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.query = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerIntent)) + return "triggerIntent: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerEvent)) + return "triggerEvent: string expected"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.DtmfInput.verify(message.dtmf, long + 1); + if (error) + return "dtmf." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters, long + 1); + if (error) + return "parameters." + error; + } + if (message.responseMessages != null && message.hasOwnProperty("responseMessages")) { + if (!Array.isArray(message.responseMessages)) + return "responseMessages: array expected"; + for (var i = 0; i < message.responseMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.verify(message.responseMessages[i], long + 1); + if (error) + return "responseMessages." + error; + } + } + if (message.webhookStatuses != null && message.hasOwnProperty("webhookStatuses")) { + if (!Array.isArray(message.webhookStatuses)) + return "webhookStatuses: array expected"; + for (var i = 0; i < message.webhookStatuses.length; ++i) { + var error = $root.google.rpc.Status.verify(message.webhookStatuses[i], long + 1); + if (error) + return "webhookStatuses." + error; + } + } + if (message.webhookPayloads != null && message.hasOwnProperty("webhookPayloads")) { + if (!Array.isArray(message.webhookPayloads)) + return "webhookPayloads: array expected"; + for (var i = 0; i < message.webhookPayloads.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.webhookPayloads[i], long + 1); + if (error) + return "webhookPayloads." + error; + } + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) { + var error = $root.google.cloud.dialogflow.cx.v3.Page.verify(message.currentPage, long + 1); + if (error) + return "currentPage." + error; + } + if (message.currentFlow != null && message.hasOwnProperty("currentFlow")) { + var error = $root.google.cloud.dialogflow.cx.v3.Flow.verify(message.currentFlow, long + 1); + if (error) + return "currentFlow." + error; + } + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + if (typeof message.intentDetectionConfidence !== "number") + return "intentDetectionConfidence: number expected"; + if (message.match != null && message.hasOwnProperty("match")) { + var error = $root.google.cloud.dialogflow.cx.v3.Match.verify(message.match, long + 1); + if (error) + return "match." + error; + } + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo, long + 1); + if (error) + return "diagnosticInfo." + error; + } + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { + var error = $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.verify(message.sentimentAnalysisResult, long + 1); + if (error) + return "sentimentAnalysisResult." + error; + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.allowAnswerFeedback != null && message.hasOwnProperty("allowAnswerFeedback")) + if (typeof message.allowAnswerFeedback !== "boolean") + return "allowAnswerFeedback: boolean expected"; + if (message.dataStoreConnectionSignals != null && message.hasOwnProperty("dataStoreConnectionSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.verify(message.dataStoreConnectionSignals, long + 1); + if (error) + return "dataStoreConnectionSignals." + error; + } + if (message.traceBlocks != null && message.hasOwnProperty("traceBlocks")) { + if (!Array.isArray(message.traceBlocks)) + return "traceBlocks: array expected"; + for (var i = 0; i < message.traceBlocks.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TraceBlock.verify(message.traceBlocks[i], long + 1); + if (error) + return "traceBlocks." + error; + } + } + return null; + }; + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.QueryResult} QueryResult + */ + QueryResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.QueryResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.QueryResult(); + if (object.text != null) + message.text = String(object.text); + if (object.triggerIntent != null) + message.triggerIntent = String(object.triggerIntent); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.triggerEvent != null) + message.triggerEvent = String(object.triggerEvent); + if (object.dtmf != null) { + if (typeof object.dtmf !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.dtmf: object expected"); + message.dtmf = $root.google.cloud.dialogflow.cx.v3.DtmfInput.fromObject(object.dtmf, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters, long + 1); + } + if (object.responseMessages) { + if (!Array.isArray(object.responseMessages)) + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.responseMessages: array expected"); + message.responseMessages = []; + for (var i = 0; i < object.responseMessages.length; ++i) { + if (typeof object.responseMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.responseMessages: object expected"); + message.responseMessages[i] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.fromObject(object.responseMessages[i], long + 1); + } + } + if (object.webhookStatuses) { + if (!Array.isArray(object.webhookStatuses)) + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.webhookStatuses: array expected"); + message.webhookStatuses = []; + for (var i = 0; i < object.webhookStatuses.length; ++i) { + if (typeof object.webhookStatuses[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.webhookStatuses: object expected"); + message.webhookStatuses[i] = $root.google.rpc.Status.fromObject(object.webhookStatuses[i], long + 1); + } + } + if (object.webhookPayloads) { + if (!Array.isArray(object.webhookPayloads)) + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.webhookPayloads: array expected"); + message.webhookPayloads = []; + for (var i = 0; i < object.webhookPayloads.length; ++i) { + if (typeof object.webhookPayloads[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.webhookPayloads: object expected"); + message.webhookPayloads[i] = $root.google.protobuf.Struct.fromObject(object.webhookPayloads[i], long + 1); + } + } + if (object.currentPage != null) { + if (typeof object.currentPage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.currentPage: object expected"); + message.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.fromObject(object.currentPage, long + 1); + } + if (object.currentFlow != null) { + if (typeof object.currentFlow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.currentFlow: object expected"); + message.currentFlow = $root.google.cloud.dialogflow.cx.v3.Flow.fromObject(object.currentFlow, long + 1); + } + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.fromObject(object.intent, long + 1); + } + if (object.intentDetectionConfidence != null) + message.intentDetectionConfidence = Number(object.intentDetectionConfidence); + if (object.match != null) { + if (typeof object.match !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.match: object expected"); + message.match = $root.google.cloud.dialogflow.cx.v3.Match.fromObject(object.match, long + 1); + } + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo, long + 1); + } + if (object.sentimentAnalysisResult != null) { + if (typeof object.sentimentAnalysisResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.sentimentAnalysisResult: object expected"); + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult, long + 1); + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.allowAnswerFeedback != null) + message.allowAnswerFeedback = Boolean(object.allowAnswerFeedback); + if (object.dataStoreConnectionSignals != null) { + if (typeof object.dataStoreConnectionSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.dataStoreConnectionSignals: object expected"); + message.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.fromObject(object.dataStoreConnectionSignals, long + 1); + } + if (object.traceBlocks) { + if (!Array.isArray(object.traceBlocks)) + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.traceBlocks: array expected"); + message.traceBlocks = []; + for (var i = 0; i < object.traceBlocks.length; ++i) { + if (typeof object.traceBlocks[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.QueryResult.traceBlocks: object expected"); + message.traceBlocks[i] = $root.google.cloud.dialogflow.cx.v3.TraceBlock.fromObject(object.traceBlocks[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3.QueryResult} message QueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.responseMessages = []; + object.webhookPayloads = []; + object.webhookStatuses = []; + object.traceBlocks = []; + } + if (options.defaults) { + object.languageCode = ""; + object.parameters = null; + object.currentPage = null; + object.intent = null; + object.intentDetectionConfidence = 0; + object.diagnosticInfo = null; + object.match = null; + object.sentimentAnalysisResult = null; + object.advancedSettings = null; + object.currentFlow = null; + object.allowAnswerFeedback = false; + object.dataStoreConnectionSignals = null; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.query = "text"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.responseMessages && message.responseMessages.length) { + object.responseMessages = []; + for (var j = 0; j < message.responseMessages.length; ++j) + object.responseMessages[j] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.toObject(message.responseMessages[j], options); + } + if (message.webhookPayloads && message.webhookPayloads.length) { + object.webhookPayloads = []; + for (var j = 0; j < message.webhookPayloads.length; ++j) + object.webhookPayloads[j] = $root.google.protobuf.Struct.toObject(message.webhookPayloads[j], options); + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.toObject(message.currentPage, options); + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3.Intent.toObject(message.intent, options); + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + object.intentDetectionConfidence = options.json && !isFinite(message.intentDetectionConfidence) ? String(message.intentDetectionConfidence) : message.intentDetectionConfidence; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + object.triggerIntent = message.triggerIntent; + if (options.oneofs) + object.query = "triggerIntent"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.query = "transcript"; + } + if (message.webhookStatuses && message.webhookStatuses.length) { + object.webhookStatuses = []; + for (var j = 0; j < message.webhookStatuses.length; ++j) + object.webhookStatuses[j] = $root.google.rpc.Status.toObject(message.webhookStatuses[j], options); + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + object.triggerEvent = message.triggerEvent; + if (options.oneofs) + object.query = "triggerEvent"; + } + if (message.match != null && message.hasOwnProperty("match")) + object.match = $root.google.cloud.dialogflow.cx.v3.Match.toObject(message.match, options); + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) + object.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + object.dtmf = $root.google.cloud.dialogflow.cx.v3.DtmfInput.toObject(message.dtmf, options); + if (options.oneofs) + object.query = "dtmf"; + } + if (message.currentFlow != null && message.hasOwnProperty("currentFlow")) + object.currentFlow = $root.google.cloud.dialogflow.cx.v3.Flow.toObject(message.currentFlow, options); + if (message.allowAnswerFeedback != null && message.hasOwnProperty("allowAnswerFeedback")) + object.allowAnswerFeedback = message.allowAnswerFeedback; + if (message.dataStoreConnectionSignals != null && message.hasOwnProperty("dataStoreConnectionSignals")) + object.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.toObject(message.dataStoreConnectionSignals, options); + if (message.traceBlocks && message.traceBlocks.length) { + object.traceBlocks = []; + for (var j = 0; j < message.traceBlocks.length; ++j) + object.traceBlocks[j] = $root.google.cloud.dialogflow.cx.v3.TraceBlock.toObject(message.traceBlocks[j], options); + } + return object; + }; + + /** + * Converts this QueryResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @instance + * @returns {Object.} JSON object + */ + QueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.QueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.QueryResult"; + }; + + return QueryResult; + })(); + + v3.TextInput = (function() { + + /** + * Properties of a TextInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITextInput + * @property {string|null} [text] TextInput text + */ + + /** + * Constructs a new TextInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TextInput. + * @implements ITextInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITextInput=} [properties] Properties to set + */ + function TextInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextInput text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @instance + */ + TextInput.prototype.text = ""; + + /** + * Creates a new TextInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3.ITextInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TextInput} TextInput instance + */ + TextInput.create = function create(properties) { + return new TextInput(properties); + }; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TextInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TextInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TextInput} TextInput + */ + TextInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TextInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TextInput(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3.TextInput} message TextInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @instance + * @returns {Object.} JSON object + */ + TextInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TextInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TextInput"; + }; + + return TextInput; + })(); + + v3.IntentInput = (function() { + + /** + * Properties of an IntentInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IIntentInput + * @property {string|null} [intent] IntentInput intent + */ + + /** + * Constructs a new IntentInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an IntentInput. + * @implements IIntentInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IIntentInput=} [properties] Properties to set + */ + function IntentInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentInput intent. + * @member {string} intent + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @instance + */ + IntentInput.prototype.intent = ""; + + /** + * Creates a new IntentInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntentInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.IntentInput} IntentInput instance + */ + IntentInput.create = function create(properties) { + return new IntentInput(properties); + }; + + /** + * Encodes the specified IntentInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntentInput} message IntentInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intent); + return writer; + }; + + /** + * Encodes the specified IntentInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.IntentInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IIntentInput} message IntentInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.IntentInput} IntentInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.IntentInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.IntentInput} IntentInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) + if (!$util.isString(message.intent)) + return "intent: string expected"; + return null; + }; + + /** + * Creates an IntentInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.IntentInput} IntentInput + */ + IntentInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.IntentInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.IntentInput(); + if (object.intent != null) + message.intent = String(object.intent); + return message; + }; + + /** + * Creates a plain object from an IntentInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IntentInput} message IntentInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.intent = ""; + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = message.intent; + return object; + }; + + /** + * Converts this IntentInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @instance + * @returns {Object.} JSON object + */ + IntentInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.IntentInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.IntentInput"; + }; + + return IntentInput; + })(); + + v3.AudioInput = (function() { + + /** + * Properties of an AudioInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IAudioInput + * @property {google.cloud.dialogflow.cx.v3.IInputAudioConfig|null} [config] AudioInput config + * @property {Uint8Array|null} [audio] AudioInput audio + */ + + /** + * Constructs a new AudioInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an AudioInput. + * @implements IAudioInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IAudioInput=} [properties] Properties to set + */ + function AudioInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioInput config. + * @member {google.cloud.dialogflow.cx.v3.IInputAudioConfig|null|undefined} config + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @instance + */ + AudioInput.prototype.config = null; + + /** + * AudioInput audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @instance + */ + AudioInput.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new AudioInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IAudioInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AudioInput} AudioInput instance + */ + AudioInput.create = function create(properties) { + return new AudioInput(properties); + }; + + /** + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AudioInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IAudioInput} message AudioInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dialogflow.cx.v3.InputAudioConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AudioInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IAudioInput} message AudioInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AudioInput} AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AudioInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.dialogflow.cx.v3.InputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AudioInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AudioInput} AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dialogflow.cx.v3.InputAudioConfig.verify(message.config, long + 1); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates an AudioInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AudioInput} AudioInput + */ + AudioInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AudioInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AudioInput(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.AudioInput.config: object expected"); + message.config = $root.google.cloud.dialogflow.cx.v3.InputAudioConfig.fromObject(object.config, long + 1); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3.AudioInput} message AudioInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dialogflow.cx.v3.InputAudioConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this AudioInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @instance + * @returns {Object.} JSON object + */ + AudioInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AudioInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AudioInput"; + }; + + return AudioInput; + })(); + + v3.EventInput = (function() { + + /** + * Properties of an EventInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IEventInput + * @property {string|null} [event] EventInput event + */ + + /** + * Constructs a new EventInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an EventInput. + * @implements IEventInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IEventInput=} [properties] Properties to set + */ + function EventInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventInput event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @instance + */ + EventInput.prototype.event = ""; + + /** + * Creates a new EventInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IEventInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.EventInput} EventInput instance + */ + EventInput.create = function create(properties) { + return new EventInput(properties); + }; + + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + return writer; + }; + + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.EventInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.EventInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + return null; + }; + + /** + * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.EventInput} EventInput + */ + EventInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.EventInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.EventInput(); + if (object.event != null) + message.event = String(object.event); + return message; + }; + + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3.EventInput} message EventInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.event = ""; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this EventInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @instance + * @returns {Object.} JSON object + */ + EventInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.EventInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.EventInput"; + }; + + return EventInput; + })(); + + v3.DtmfInput = (function() { + + /** + * Properties of a DtmfInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDtmfInput + * @property {string|null} [digits] DtmfInput digits + * @property {string|null} [finishDigit] DtmfInput finishDigit + */ + + /** + * Constructs a new DtmfInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DtmfInput. + * @implements IDtmfInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDtmfInput=} [properties] Properties to set + */ + function DtmfInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DtmfInput digits. + * @member {string} digits + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @instance + */ + DtmfInput.prototype.digits = ""; + + /** + * DtmfInput finishDigit. + * @member {string} finishDigit + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @instance + */ + DtmfInput.prototype.finishDigit = ""; + + /** + * Creates a new DtmfInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IDtmfInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DtmfInput} DtmfInput instance + */ + DtmfInput.create = function create(properties) { + return new DtmfInput(properties); + }; + + /** + * Encodes the specified DtmfInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DtmfInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IDtmfInput} message DtmfInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.digits != null && Object.hasOwnProperty.call(message, "digits")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.digits); + if (message.finishDigit != null && Object.hasOwnProperty.call(message, "finishDigit")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.finishDigit); + return writer; + }; + + /** + * Encodes the specified DtmfInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DtmfInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IDtmfInput} message DtmfInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DtmfInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DtmfInput} DtmfInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DtmfInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.digits = reader.string(); + break; + } + case 2: { + message.finishDigit = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DtmfInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DtmfInput} DtmfInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DtmfInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DtmfInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.digits != null && message.hasOwnProperty("digits")) + if (!$util.isString(message.digits)) + return "digits: string expected"; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + if (!$util.isString(message.finishDigit)) + return "finishDigit: string expected"; + return null; + }; + + /** + * Creates a DtmfInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DtmfInput} DtmfInput + */ + DtmfInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DtmfInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DtmfInput(); + if (object.digits != null) + message.digits = String(object.digits); + if (object.finishDigit != null) + message.finishDigit = String(object.finishDigit); + return message; + }; + + /** + * Creates a plain object from a DtmfInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3.DtmfInput} message DtmfInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DtmfInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.digits = ""; + object.finishDigit = ""; + } + if (message.digits != null && message.hasOwnProperty("digits")) + object.digits = message.digits; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + object.finishDigit = message.finishDigit; + return object; + }; + + /** + * Converts this DtmfInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @instance + * @returns {Object.} JSON object + */ + DtmfInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DtmfInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DtmfInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DtmfInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DtmfInput"; + }; + + return DtmfInput; + })(); + + v3.Match = (function() { + + /** + * Properties of a Match. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IMatch + * @property {google.cloud.dialogflow.cx.v3.IIntent|null} [intent] Match intent + * @property {string|null} [event] Match event + * @property {google.protobuf.IStruct|null} [parameters] Match parameters + * @property {string|null} [resolvedInput] Match resolvedInput + * @property {google.cloud.dialogflow.cx.v3.Match.MatchType|null} [matchType] Match matchType + * @property {number|null} [confidence] Match confidence + */ + + /** + * Constructs a new Match. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Match. + * @implements IMatch + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IMatch=} [properties] Properties to set + */ + function Match(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Match intent. + * @member {google.cloud.dialogflow.cx.v3.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3.Match + * @instance + */ + Match.prototype.intent = null; + + /** + * Match event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3.Match + * @instance + */ + Match.prototype.event = ""; + + /** + * Match parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.cx.v3.Match + * @instance + */ + Match.prototype.parameters = null; + + /** + * Match resolvedInput. + * @member {string} resolvedInput + * @memberof google.cloud.dialogflow.cx.v3.Match + * @instance + */ + Match.prototype.resolvedInput = ""; + + /** + * Match matchType. + * @member {google.cloud.dialogflow.cx.v3.Match.MatchType} matchType + * @memberof google.cloud.dialogflow.cx.v3.Match + * @instance + */ + Match.prototype.matchType = 0; + + /** + * Match confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3.Match + * @instance + */ + Match.prototype.confidence = 0; + + /** + * Creates a new Match instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatch=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Match} Match instance + */ + Match.create = function create(properties) { + return new Match(properties); + }; + + /** + * Encodes the specified Match message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Match.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatch} message Match message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Match.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resolvedInput != null && Object.hasOwnProperty.call(message, "resolvedInput")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resolvedInput); + if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchType); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.event); + return writer; + }; + + /** + * Encodes the specified Match message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Match.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatch} message Match message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Match.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Match message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Match} Match + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Match.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Match(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.event = reader.string(); + break; + } + case 2: { + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.resolvedInput = reader.string(); + break; + } + case 4: { + message.matchType = reader.int32(); + break; + } + case 5: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Match message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Match} Match + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Match.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Match message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Match.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters, long + 1); + if (error) + return "parameters." + error; + } + if (message.resolvedInput != null && message.hasOwnProperty("resolvedInput")) + if (!$util.isString(message.resolvedInput)) + return "resolvedInput: string expected"; + if (message.matchType != null && message.hasOwnProperty("matchType")) + switch (message.matchType) { + default: + return "matchType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + break; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Match message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Match} Match + */ + Match.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Match) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Match(); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Match.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3.Intent.fromObject(object.intent, long + 1); + } + if (object.event != null) + message.event = String(object.event); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Match.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters, long + 1); + } + if (object.resolvedInput != null) + message.resolvedInput = String(object.resolvedInput); + switch (object.matchType) { + default: + if (typeof object.matchType === "number") { + message.matchType = object.matchType; + break; + } + break; + case "MATCH_TYPE_UNSPECIFIED": + case 0: + message.matchType = 0; + break; + case "INTENT": + case 1: + message.matchType = 1; + break; + case "DIRECT_INTENT": + case 2: + message.matchType = 2; + break; + case "PARAMETER_FILLING": + case 3: + message.matchType = 3; + break; + case "NO_MATCH": + case 4: + message.matchType = 4; + break; + case "NO_INPUT": + case 5: + message.matchType = 5; + break; + case "EVENT": + case 6: + message.matchType = 6; + break; + case "KNOWLEDGE_CONNECTOR": + case 8: + message.matchType = 8; + break; + case "PLAYBOOK": + case 9: + message.matchType = 9; + break; + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Match message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {google.cloud.dialogflow.cx.v3.Match} message Match + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Match.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = null; + object.parameters = null; + object.resolvedInput = ""; + object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; + object.confidence = 0; + object.event = ""; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3.Intent.toObject(message.intent, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.resolvedInput != null && message.hasOwnProperty("resolvedInput")) + object.resolvedInput = message.resolvedInput; + if (message.matchType != null && message.hasOwnProperty("matchType")) + object.matchType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Match.MatchType[message.matchType] === undefined ? message.matchType : $root.google.cloud.dialogflow.cx.v3.Match.MatchType[message.matchType] : message.matchType; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this Match to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Match + * @instance + * @returns {Object.} JSON object + */ + Match.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Match + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Match + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Match.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Match"; + }; + + /** + * MatchType enum. + * @name google.cloud.dialogflow.cx.v3.Match.MatchType + * @enum {number} + * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value + * @property {number} INTENT=1 INTENT value + * @property {number} DIRECT_INTENT=2 DIRECT_INTENT value + * @property {number} PARAMETER_FILLING=3 PARAMETER_FILLING value + * @property {number} NO_MATCH=4 NO_MATCH value + * @property {number} NO_INPUT=5 NO_INPUT value + * @property {number} EVENT=6 EVENT value + * @property {number} KNOWLEDGE_CONNECTOR=8 KNOWLEDGE_CONNECTOR value + * @property {number} PLAYBOOK=9 PLAYBOOK value + */ + Match.MatchType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT"] = 1; + values[valuesById[2] = "DIRECT_INTENT"] = 2; + values[valuesById[3] = "PARAMETER_FILLING"] = 3; + values[valuesById[4] = "NO_MATCH"] = 4; + values[valuesById[5] = "NO_INPUT"] = 5; + values[valuesById[6] = "EVENT"] = 6; + values[valuesById[8] = "KNOWLEDGE_CONNECTOR"] = 8; + values[valuesById[9] = "PLAYBOOK"] = 9; + return values; + })(); + + return Match; + })(); + + v3.MatchIntentRequest = (function() { + + /** + * Properties of a MatchIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IMatchIntentRequest + * @property {string|null} [session] MatchIntentRequest session + * @property {google.cloud.dialogflow.cx.v3.IQueryParameters|null} [queryParams] MatchIntentRequest queryParams + * @property {google.cloud.dialogflow.cx.v3.IQueryInput|null} [queryInput] MatchIntentRequest queryInput + * @property {boolean|null} [persistParameterChanges] MatchIntentRequest persistParameterChanges + */ + + /** + * Constructs a new MatchIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a MatchIntentRequest. + * @implements IMatchIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentRequest=} [properties] Properties to set + */ + function MatchIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.session = ""; + + /** + * MatchIntentRequest queryParams. + * @member {google.cloud.dialogflow.cx.v3.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.queryParams = null; + + /** + * MatchIntentRequest queryInput. + * @member {google.cloud.dialogflow.cx.v3.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.queryInput = null; + + /** + * MatchIntentRequest persistParameterChanges. + * @member {boolean} persistParameterChanges + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.persistParameterChanges = false; + + /** + * Creates a new MatchIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentRequest} MatchIntentRequest instance + */ + MatchIntentRequest.create = function create(properties) { + return new MatchIntentRequest(properties); + }; + + /** + * Encodes the specified MatchIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentRequest} message MatchIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.cx.v3.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.cx.v3.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.persistParameterChanges != null && Object.hasOwnProperty.call(message, "persistParameterChanges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.persistParameterChanges); + return writer; + }; + + /** + * Encodes the specified MatchIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentRequest} message MatchIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentRequest} MatchIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.persistParameterChanges = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentRequest} MatchIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryParameters.verify(message.queryParams, long + 1); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryInput.verify(message.queryInput, long + 1); + if (error) + return "queryInput." + error; + } + if (message.persistParameterChanges != null && message.hasOwnProperty("persistParameterChanges")) + if (typeof message.persistParameterChanges !== "boolean") + return "persistParameterChanges: boolean expected"; + return null; + }; + + /** + * Creates a MatchIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentRequest} MatchIntentRequest + */ + MatchIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.MatchIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.fromObject(object.queryParams, long + 1); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.MatchIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.fromObject(object.queryInput, long + 1); + } + if (object.persistParameterChanges != null) + message.persistParameterChanges = Boolean(object.persistParameterChanges); + return message; + }; + + /** + * Creates a plain object from a MatchIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.MatchIntentRequest} message MatchIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.persistParameterChanges = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.cx.v3.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.toObject(message.queryInput, options); + if (message.persistParameterChanges != null && message.hasOwnProperty("persistParameterChanges")) + object.persistParameterChanges = message.persistParameterChanges; + return object; + }; + + /** + * Converts this MatchIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @instance + * @returns {Object.} JSON object + */ + MatchIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.MatchIntentRequest"; + }; + + return MatchIntentRequest; + })(); + + v3.MatchIntentResponse = (function() { + + /** + * Properties of a MatchIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IMatchIntentResponse + * @property {string|null} [text] MatchIntentResponse text + * @property {string|null} [triggerIntent] MatchIntentResponse triggerIntent + * @property {string|null} [transcript] MatchIntentResponse transcript + * @property {string|null} [triggerEvent] MatchIntentResponse triggerEvent + * @property {Array.|null} [matches] MatchIntentResponse matches + * @property {google.cloud.dialogflow.cx.v3.IPage|null} [currentPage] MatchIntentResponse currentPage + */ + + /** + * Constructs a new MatchIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a MatchIntentResponse. + * @implements IMatchIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentResponse=} [properties] Properties to set + */ + function MatchIntentResponse(properties) { + this.matches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchIntentResponse text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.text = null; + + /** + * MatchIntentResponse triggerIntent. + * @member {string|null|undefined} triggerIntent + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.triggerIntent = null; + + /** + * MatchIntentResponse transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.transcript = null; + + /** + * MatchIntentResponse triggerEvent. + * @member {string|null|undefined} triggerEvent + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.triggerEvent = null; + + /** + * MatchIntentResponse matches. + * @member {Array.} matches + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.matches = $util.emptyArray; + + /** + * MatchIntentResponse currentPage. + * @member {google.cloud.dialogflow.cx.v3.IPage|null|undefined} currentPage + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.currentPage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MatchIntentResponse query. + * @member {"text"|"triggerIntent"|"transcript"|"triggerEvent"|undefined} query + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + */ + Object.defineProperty(MatchIntentResponse.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["text", "triggerIntent", "transcript", "triggerEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MatchIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentResponse} MatchIntentResponse instance + */ + MatchIntentResponse.create = function create(properties) { + return new MatchIntentResponse(properties); + }; + + /** + * Encodes the specified MatchIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentResponse} message MatchIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.triggerIntent != null && Object.hasOwnProperty.call(message, "triggerIntent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerIntent); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transcript); + if (message.matches != null && message.matches.length) + for (var i = 0; i < message.matches.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Match.encode(message.matches[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + $root.google.cloud.dialogflow.cx.v3.Page.encode(message.currentPage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.triggerEvent != null && Object.hasOwnProperty.call(message, "triggerEvent")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.triggerEvent); + return writer; + }; + + /** + * Encodes the specified MatchIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.MatchIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IMatchIntentResponse} message MatchIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentResponse} MatchIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.MatchIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.triggerIntent = reader.string(); + break; + } + case 3: { + message.transcript = reader.string(); + break; + } + case 6: { + message.triggerEvent = reader.string(); + break; + } + case 4: { + if (!(message.matches && message.matches.length)) + message.matches = []; + message.matches.push($root.google.cloud.dialogflow.cx.v3.Match.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentResponse} MatchIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.query = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerIntent)) + return "triggerIntent: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerEvent)) + return "triggerEvent: string expected"; + } + if (message.matches != null && message.hasOwnProperty("matches")) { + if (!Array.isArray(message.matches)) + return "matches: array expected"; + for (var i = 0; i < message.matches.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Match.verify(message.matches[i], long + 1); + if (error) + return "matches." + error; + } + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) { + var error = $root.google.cloud.dialogflow.cx.v3.Page.verify(message.currentPage, long + 1); + if (error) + return "currentPage." + error; + } + return null; + }; + + /** + * Creates a MatchIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.MatchIntentResponse} MatchIntentResponse + */ + MatchIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.MatchIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.MatchIntentResponse(); + if (object.text != null) + message.text = String(object.text); + if (object.triggerIntent != null) + message.triggerIntent = String(object.triggerIntent); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.triggerEvent != null) + message.triggerEvent = String(object.triggerEvent); + if (object.matches) { + if (!Array.isArray(object.matches)) + throw TypeError(".google.cloud.dialogflow.cx.v3.MatchIntentResponse.matches: array expected"); + message.matches = []; + for (var i = 0; i < object.matches.length; ++i) { + if (typeof object.matches[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.MatchIntentResponse.matches: object expected"); + message.matches[i] = $root.google.cloud.dialogflow.cx.v3.Match.fromObject(object.matches[i], long + 1); + } + } + if (object.currentPage != null) { + if (typeof object.currentPage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.MatchIntentResponse.currentPage: object expected"); + message.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.fromObject(object.currentPage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MatchIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.MatchIntentResponse} message MatchIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matches = []; + if (options.defaults) + object.currentPage = null; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.query = "text"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + object.triggerIntent = message.triggerIntent; + if (options.oneofs) + object.query = "triggerIntent"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.query = "transcript"; + } + if (message.matches && message.matches.length) { + object.matches = []; + for (var j = 0; j < message.matches.length; ++j) + object.matches[j] = $root.google.cloud.dialogflow.cx.v3.Match.toObject(message.matches[j], options); + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = $root.google.cloud.dialogflow.cx.v3.Page.toObject(message.currentPage, options); + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + object.triggerEvent = message.triggerEvent; + if (options.oneofs) + object.query = "triggerEvent"; + } + return object; + }; + + /** + * Converts this MatchIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @instance + * @returns {Object.} JSON object + */ + MatchIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.MatchIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.MatchIntentResponse"; + }; + + return MatchIntentResponse; + })(); + + v3.FulfillIntentRequest = (function() { + + /** + * Properties of a FulfillIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFulfillIntentRequest + * @property {google.cloud.dialogflow.cx.v3.IMatchIntentRequest|null} [matchIntentRequest] FulfillIntentRequest matchIntentRequest + * @property {google.cloud.dialogflow.cx.v3.IMatch|null} [match] FulfillIntentRequest match + * @property {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null} [outputAudioConfig] FulfillIntentRequest outputAudioConfig + */ + + /** + * Constructs a new FulfillIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FulfillIntentRequest. + * @implements IFulfillIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentRequest=} [properties] Properties to set + */ + function FulfillIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillIntentRequest matchIntentRequest. + * @member {google.cloud.dialogflow.cx.v3.IMatchIntentRequest|null|undefined} matchIntentRequest + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @instance + */ + FulfillIntentRequest.prototype.matchIntentRequest = null; + + /** + * FulfillIntentRequest match. + * @member {google.cloud.dialogflow.cx.v3.IMatch|null|undefined} match + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @instance + */ + FulfillIntentRequest.prototype.match = null; + + /** + * FulfillIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @instance + */ + FulfillIntentRequest.prototype.outputAudioConfig = null; + + /** + * Creates a new FulfillIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentRequest} FulfillIntentRequest instance + */ + FulfillIntentRequest.create = function create(properties) { + return new FulfillIntentRequest(properties); + }; + + /** + * Encodes the specified FulfillIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentRequest} message FulfillIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchIntentRequest != null && Object.hasOwnProperty.call(message, "matchIntentRequest")) + $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest.encode(message.matchIntentRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.match != null && Object.hasOwnProperty.call(message, "match")) + $root.google.cloud.dialogflow.cx.v3.Match.encode(message.match, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FulfillIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentRequest} message FulfillIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentRequest} FulfillIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FulfillIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.matchIntentRequest = $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.match = $root.google.cloud.dialogflow.cx.v3.Match.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentRequest} FulfillIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.matchIntentRequest != null && message.hasOwnProperty("matchIntentRequest")) { + var error = $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest.verify(message.matchIntentRequest, long + 1); + if (error) + return "matchIntentRequest." + error; + } + if (message.match != null && message.hasOwnProperty("match")) { + var error = $root.google.cloud.dialogflow.cx.v3.Match.verify(message.match, long + 1); + if (error) + return "match." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; + + /** + * Creates a FulfillIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentRequest} FulfillIntentRequest + */ + FulfillIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FulfillIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FulfillIntentRequest(); + if (object.matchIntentRequest != null) { + if (typeof object.matchIntentRequest !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.FulfillIntentRequest.matchIntentRequest: object expected"); + message.matchIntentRequest = $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest.fromObject(object.matchIntentRequest, long + 1); + } + if (object.match != null) { + if (typeof object.match !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.FulfillIntentRequest.match: object expected"); + message.match = $root.google.cloud.dialogflow.cx.v3.Match.fromObject(object.match, long + 1); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.FulfillIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FulfillIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.FulfillIntentRequest} message FulfillIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.matchIntentRequest = null; + object.match = null; + object.outputAudioConfig = null; + } + if (message.matchIntentRequest != null && message.hasOwnProperty("matchIntentRequest")) + object.matchIntentRequest = $root.google.cloud.dialogflow.cx.v3.MatchIntentRequest.toObject(message.matchIntentRequest, options); + if (message.match != null && message.hasOwnProperty("match")) + object.match = $root.google.cloud.dialogflow.cx.v3.Match.toObject(message.match, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.toObject(message.outputAudioConfig, options); + return object; + }; + + /** + * Converts this FulfillIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @instance + * @returns {Object.} JSON object + */ + FulfillIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FulfillIntentRequest"; + }; + + return FulfillIntentRequest; + })(); + + v3.FulfillIntentResponse = (function() { + + /** + * Properties of a FulfillIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFulfillIntentResponse + * @property {string|null} [responseId] FulfillIntentResponse responseId + * @property {google.cloud.dialogflow.cx.v3.IQueryResult|null} [queryResult] FulfillIntentResponse queryResult + * @property {Uint8Array|null} [outputAudio] FulfillIntentResponse outputAudio + * @property {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null} [outputAudioConfig] FulfillIntentResponse outputAudioConfig + */ + + /** + * Constructs a new FulfillIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FulfillIntentResponse. + * @implements IFulfillIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentResponse=} [properties] Properties to set + */ + function FulfillIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.responseId = ""; + + /** + * FulfillIntentResponse queryResult. + * @member {google.cloud.dialogflow.cx.v3.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.queryResult = null; + + /** + * FulfillIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.outputAudio = $util.newBuffer([]); + + /** + * FulfillIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.outputAudioConfig = null; + + /** + * Creates a new FulfillIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentResponse} FulfillIntentResponse instance + */ + FulfillIntentResponse.create = function create(properties) { + return new FulfillIntentResponse(properties); + }; + + /** + * Encodes the specified FulfillIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentResponse} message FulfillIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.cx.v3.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.outputAudio); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FulfillIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FulfillIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IFulfillIntentResponse} message FulfillIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentResponse} FulfillIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FulfillIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseId = reader.string(); + break; + } + case 2: { + message.queryResult = $root.google.cloud.dialogflow.cx.v3.QueryResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.outputAudio = reader.bytes(); + break; + } + case 4: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentResponse} FulfillIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.cx.v3.QueryResult.verify(message.queryResult, long + 1); + if (error) + return "queryResult." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; + + /** + * Creates a FulfillIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FulfillIntentResponse} FulfillIntentResponse + */ + FulfillIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FulfillIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FulfillIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.FulfillIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.cx.v3.QueryResult.fromObject(object.queryResult, long + 1); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length >= 0) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.FulfillIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FulfillIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.FulfillIntentResponse} message FulfillIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseId = ""; + object.queryResult = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.cx.v3.QueryResult.toObject(message.queryResult, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.toObject(message.outputAudioConfig, options); + return object; + }; + + /** + * Converts this FulfillIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @instance + * @returns {Object.} JSON object + */ + FulfillIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FulfillIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FulfillIntentResponse"; + }; + + return FulfillIntentResponse; + })(); + + v3.SentimentAnalysisResult = (function() { + + /** + * Properties of a SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISentimentAnalysisResult + * @property {number|null} [score] SentimentAnalysisResult score + * @property {number|null} [magnitude] SentimentAnalysisResult magnitude + */ + + /** + * Constructs a new SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SentimentAnalysisResult. + * @implements ISentimentAnalysisResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult=} [properties] Properties to set + */ + function SentimentAnalysisResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SentimentAnalysisResult score. + * @member {number} score + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.score = 0; + + /** + * SentimentAnalysisResult magnitude. + * @member {number} magnitude + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.magnitude = 0; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SentimentAnalysisResult} SentimentAnalysisResult instance + */ + SentimentAnalysisResult.create = function create(properties) { + return new SentimentAnalysisResult(properties); + }; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + return writer; + }; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SentimentAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + case 2: { + message.magnitude = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SentimentAnalysisResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + return null; + }; + + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SentimentAnalysisResult} SentimentAnalysisResult + */ + SentimentAnalysisResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult(); + if (object.score != null) + message.score = Number(object.score); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + return message; + }; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.SentimentAnalysisResult} message SentimentAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.magnitude = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + return object; + }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SentimentAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SentimentAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SentimentAnalysisResult"; + }; + + return SentimentAnalysisResult; + })(); + + /** + * DetectIntentResponseView enum. + * @name google.cloud.dialogflow.cx.v3.DetectIntentResponseView + * @enum {number} + * @property {number} DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED=0 DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED value + * @property {number} DETECT_INTENT_RESPONSE_VIEW_FULL=1 DETECT_INTENT_RESPONSE_VIEW_FULL value + * @property {number} DETECT_INTENT_RESPONSE_VIEW_BASIC=2 DETECT_INTENT_RESPONSE_VIEW_BASIC value + * @property {number} DETECT_INTENT_RESPONSE_VIEW_DEFAULT=3 DETECT_INTENT_RESPONSE_VIEW_DEFAULT value + */ + v3.DetectIntentResponseView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "DETECT_INTENT_RESPONSE_VIEW_FULL"] = 1; + values[valuesById[2] = "DETECT_INTENT_RESPONSE_VIEW_BASIC"] = 2; + values[valuesById[3] = "DETECT_INTENT_RESPONSE_VIEW_DEFAULT"] = 3; + return values; + })(); + + v3.SessionEntityTypes = (function() { + + /** + * Constructs a new SessionEntityTypes service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SessionEntityTypes + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SessionEntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionEntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionEntityTypes; + + /** + * Creates new SessionEntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SessionEntityTypes} RPC service. Useful where requests and/or responses are streamed. + */ + SessionEntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|listSessionEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @typedef ListSessionEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse} [response] ListSessionEntityTypesResponse + */ + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypesCallback} callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.listSessionEntityTypes = function listSessionEntityTypes(request, callback) { + return this.rpcCall(listSessionEntityTypes, $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest, $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse, request, callback); + }, "name", { value: "ListSessionEntityTypes" }); + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|getSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @typedef GetSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.getSessionEntityType = function getSessionEntityType(request, callback) { + return this.rpcCall(getSessionEntityType, $root.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3.SessionEntityType, request, callback); + }, "name", { value: "GetSessionEntityType" }); + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|createSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @typedef CreateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.createSessionEntityType = function createSessionEntityType(request, callback) { + return this.rpcCall(createSessionEntityType, $root.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3.SessionEntityType, request, callback); + }, "name", { value: "CreateSessionEntityType" }); + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|updateSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @typedef UpdateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.updateSessionEntityType = function updateSessionEntityType(request, callback) { + return this.rpcCall(updateSessionEntityType, $root.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3.SessionEntityType, request, callback); + }, "name", { value: "UpdateSessionEntityType" }); + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SessionEntityTypes|deleteSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @typedef DeleteSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.deleteSessionEntityType = function deleteSessionEntityType(request, callback) { + return this.rpcCall(deleteSessionEntityType, $root.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSessionEntityType" }); + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionEntityTypes; + })(); + + v3.SessionEntityType = (function() { + + /** + * Properties of a SessionEntityType. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISessionEntityType + * @property {string|null} [name] SessionEntityType name + * @property {google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode|null} [entityOverrideMode] SessionEntityType entityOverrideMode + * @property {Array.|null} [entities] SessionEntityType entities + */ + + /** + * Constructs a new SessionEntityType. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SessionEntityType. + * @implements ISessionEntityType + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISessionEntityType=} [properties] Properties to set + */ + function SessionEntityType(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionEntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @instance + */ + SessionEntityType.prototype.name = ""; + + /** + * SessionEntityType entityOverrideMode. + * @member {google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode} entityOverrideMode + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entityOverrideMode = 0; + + /** + * SessionEntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entities = $util.emptyArray; + + /** + * Creates a new SessionEntityType instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.ISessionEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SessionEntityType} SessionEntityType instance + */ + SessionEntityType.create = function create(properties) { + return new SessionEntityType(properties); + }; + + /** + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionEntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEntityType.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.entityOverrideMode != null && Object.hasOwnProperty.call(message, "entityOverrideMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.entityOverrideMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionEntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SessionEntityType} SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEntityType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SessionEntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.entityOverrideMode = reader.int32(); + break; + } + case 4: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.cx.v3.EntityType.Entity.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SessionEntityType} SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionEntityType message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionEntityType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + switch (message.entityOverrideMode) { + default: + return "entityOverrideMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.verify(message.entities[i], long + 1); + if (error) + return "entities." + error; + } + } + return null; + }; + + /** + * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SessionEntityType} SessionEntityType + */ + SessionEntityType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SessionEntityType) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SessionEntityType(); + if (object.name != null) + message.name = String(object.name); + switch (object.entityOverrideMode) { + default: + if (typeof object.entityOverrideMode === "number") { + message.entityOverrideMode = object.entityOverrideMode; + break; + } + break; + case "ENTITY_OVERRIDE_MODE_UNSPECIFIED": + case 0: + message.entityOverrideMode = 0; + break; + case "ENTITY_OVERRIDE_MODE_OVERRIDE": + case 1: + message.entityOverrideMode = 1; + break; + case "ENTITY_OVERRIDE_MODE_SUPPLEMENT": + case 2: + message.entityOverrideMode = 2; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.cx.v3.SessionEntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SessionEntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.fromObject(object.entities[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3.SessionEntityType} message SessionEntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionEntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.name = ""; + object.entityOverrideMode = options.enums === String ? "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + object.entityOverrideMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] === undefined ? message.entityOverrideMode : $root.google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] : message.entityOverrideMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.cx.v3.EntityType.Entity.toObject(message.entities[j], options); + } + return object; + }; + + /** + * Converts this SessionEntityType to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @instance + * @returns {Object.} JSON object + */ + SessionEntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionEntityType + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SessionEntityType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionEntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SessionEntityType"; + }; + + /** + * EntityOverrideMode enum. + * @name google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode + * @enum {number} + * @property {number} ENTITY_OVERRIDE_MODE_UNSPECIFIED=0 ENTITY_OVERRIDE_MODE_UNSPECIFIED value + * @property {number} ENTITY_OVERRIDE_MODE_OVERRIDE=1 ENTITY_OVERRIDE_MODE_OVERRIDE value + * @property {number} ENTITY_OVERRIDE_MODE_SUPPLEMENT=2 ENTITY_OVERRIDE_MODE_SUPPLEMENT value + */ + SessionEntityType.EntityOverrideMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_OVERRIDE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTITY_OVERRIDE_MODE_OVERRIDE"] = 1; + values[valuesById[2] = "ENTITY_OVERRIDE_MODE_SUPPLEMENT"] = 2; + return values; + })(); + + return SessionEntityType; + })(); + + v3.ListSessionEntityTypesRequest = (function() { + + /** + * Properties of a ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListSessionEntityTypesRequest + * @property {string|null} [parent] ListSessionEntityTypesRequest parent + * @property {number|null} [pageSize] ListSessionEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListSessionEntityTypesRequest pageToken + */ + + /** + * Constructs a new ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListSessionEntityTypesRequest. + * @implements IListSessionEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest=} [properties] Properties to set + */ + function ListSessionEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.parent = ""; + + /** + * ListSessionEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.pageSize = 0; + + /** + * ListSessionEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest instance + */ + ListSessionEntityTypesRequest.create = function create(properties) { + return new ListSessionEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesRequest.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); + return writer; + }; + + /** + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + */ + ListSessionEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest} message ListSessionEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListSessionEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest"; + }; + + return ListSessionEntityTypesRequest; + })(); + + v3.ListSessionEntityTypesResponse = (function() { + + /** + * Properties of a ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListSessionEntityTypesResponse + * @property {Array.|null} [sessionEntityTypes] ListSessionEntityTypesResponse sessionEntityTypes + * @property {string|null} [nextPageToken] ListSessionEntityTypesResponse nextPageToken + */ + + /** + * Constructs a new ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListSessionEntityTypesResponse. + * @implements IListSessionEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse=} [properties] Properties to set + */ + function ListSessionEntityTypesResponse(properties) { + this.sessionEntityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionEntityTypesResponse sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @instance + */ + ListSessionEntityTypesResponse.prototype.sessionEntityTypes = $util.emptyArray; + + /** + * ListSessionEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @instance + */ + ListSessionEntityTypesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse instance + */ + ListSessionEntityTypesResponse.create = function create(properties) { + return new ListSessionEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.cx.v3.SessionEntityType.encode(message.sessionEntityTypes[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 ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.cx.v3.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.verify(message.sessionEntityTypes[i], long + 1); + if (error) + return "sessionEntityTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + */ + ListSessionEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse(); + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.fromObject(object.sessionEntityTypes[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse} message ListSessionEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessionEntityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSessionEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse"; + }; + + return ListSessionEntityTypesResponse; + })(); + + v3.GetSessionEntityTypeRequest = (function() { + + /** + * Properties of a GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetSessionEntityTypeRequest + * @property {string|null} [name] GetSessionEntityTypeRequest name + */ + + /** + * Constructs a new GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetSessionEntityTypeRequest. + * @implements IGetSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest=} [properties] Properties to set + */ + function GetSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSessionEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @instance + */ + GetSessionEntityTypeRequest.prototype.name = ""; + + /** + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest instance + */ + GetSessionEntityTypeRequest.create = function create(properties) { + return new GetSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionEntityTypeRequest.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 GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + */ + GetSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest} message GetSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSessionEntityTypeRequest.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 GetSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest"; + }; + + return GetSessionEntityTypeRequest; + })(); + + v3.CreateSessionEntityTypeRequest = (function() { + + /** + * Properties of a CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateSessionEntityTypeRequest + * @property {string|null} [parent] CreateSessionEntityTypeRequest parent + * @property {google.cloud.dialogflow.cx.v3.ISessionEntityType|null} [sessionEntityType] CreateSessionEntityTypeRequest sessionEntityType + */ + + /** + * Constructs a new CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateSessionEntityTypeRequest. + * @implements ICreateSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest=} [properties] Properties to set + */ + function CreateSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSessionEntityTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @instance + */ + CreateSessionEntityTypeRequest.prototype.parent = ""; + + /** + * CreateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.cx.v3.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @instance + */ + CreateSessionEntityTypeRequest.prototype.sessionEntityType = null; + + /** + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest instance + */ + CreateSessionEntityTypeRequest.create = function create(properties) { + return new CreateSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionEntityTypeRequest.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.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.cx.v3.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.verify(message.sessionEntityType, long + 1); + if (error) + return "sessionEntityType." + error; + } + return null; + }; + + /** + * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + */ + CreateSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.fromObject(object.sessionEntityType, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sessionEntityType = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.toObject(message.sessionEntityType, options); + return object; + }; + + /** + * Converts this CreateSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest"; + }; + + return CreateSessionEntityTypeRequest; + })(); + + v3.UpdateSessionEntityTypeRequest = (function() { + + /** + * Properties of an UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateSessionEntityTypeRequest + * @property {google.cloud.dialogflow.cx.v3.ISessionEntityType|null} [sessionEntityType] UpdateSessionEntityTypeRequest sessionEntityType + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSessionEntityTypeRequest updateMask + */ + + /** + * Constructs a new UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateSessionEntityTypeRequest. + * @implements IUpdateSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + */ + function UpdateSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.cx.v3.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @instance + */ + UpdateSessionEntityTypeRequest.prototype.sessionEntityType = null; + + /** + * UpdateSessionEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @instance + */ + UpdateSessionEntityTypeRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest instance + */ + UpdateSessionEntityTypeRequest.create = function create(properties) { + return new UpdateSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.cx.v3.SessionEntityType.encode(message.sessionEntityType, 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 UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.verify(message.sessionEntityType, long + 1); + if (error) + return "sessionEntityType." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + */ + UpdateSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest(); + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.fromObject(object.sessionEntityType, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sessionEntityType = null; + object.updateMask = null; + } + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.cx.v3.SessionEntityType.toObject(message.sessionEntityType, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest"; + }; + + return UpdateSessionEntityTypeRequest; + })(); + + v3.DeleteSessionEntityTypeRequest = (function() { + + /** + * Properties of a DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteSessionEntityTypeRequest + * @property {string|null} [name] DeleteSessionEntityTypeRequest name + */ + + /** + * Constructs a new DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteSessionEntityTypeRequest. + * @implements IDeleteSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + */ + function DeleteSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSessionEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @instance + */ + DeleteSessionEntityTypeRequest.prototype.name = ""; + + /** + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest instance + */ + DeleteSessionEntityTypeRequest.create = function create(properties) { + return new DeleteSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionEntityTypeRequest.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 DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + */ + DeleteSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSessionEntityTypeRequest.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 DeleteSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest"; + }; + + return DeleteSessionEntityTypeRequest; + })(); + + v3.TraceBlock = (function() { + + /** + * Properties of a TraceBlock. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITraceBlock + * @property {google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata|null} [playbookTraceMetadata] TraceBlock playbookTraceMetadata + * @property {google.cloud.dialogflow.cx.v3.IFlowTraceMetadata|null} [flowTraceMetadata] TraceBlock flowTraceMetadata + * @property {google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata|null} [speechProcessingMetadata] TraceBlock speechProcessingMetadata + * @property {Array.|null} [actions] TraceBlock actions + * @property {google.protobuf.ITimestamp|null} [startTime] TraceBlock startTime + * @property {google.protobuf.ITimestamp|null} [completeTime] TraceBlock completeTime + * @property {google.protobuf.IStruct|null} [inputParameters] TraceBlock inputParameters + * @property {google.protobuf.IStruct|null} [outputParameters] TraceBlock outputParameters + * @property {google.cloud.dialogflow.cx.v3.OutputState|null} [endState] TraceBlock endState + */ + + /** + * Constructs a new TraceBlock. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TraceBlock. + * @implements ITraceBlock + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITraceBlock=} [properties] Properties to set + */ + function TraceBlock(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TraceBlock playbookTraceMetadata. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata|null|undefined} playbookTraceMetadata + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.playbookTraceMetadata = null; + + /** + * TraceBlock flowTraceMetadata. + * @member {google.cloud.dialogflow.cx.v3.IFlowTraceMetadata|null|undefined} flowTraceMetadata + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.flowTraceMetadata = null; + + /** + * TraceBlock speechProcessingMetadata. + * @member {google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata|null|undefined} speechProcessingMetadata + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.speechProcessingMetadata = null; + + /** + * TraceBlock actions. + * @member {Array.} actions + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.actions = $util.emptyArray; + + /** + * TraceBlock startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.startTime = null; + + /** + * TraceBlock completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.completeTime = null; + + /** + * TraceBlock inputParameters. + * @member {google.protobuf.IStruct|null|undefined} inputParameters + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.inputParameters = null; + + /** + * TraceBlock outputParameters. + * @member {google.protobuf.IStruct|null|undefined} outputParameters + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.outputParameters = null; + + /** + * TraceBlock endState. + * @member {google.cloud.dialogflow.cx.v3.OutputState} endState + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + TraceBlock.prototype.endState = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TraceBlock traceMetadata. + * @member {"playbookTraceMetadata"|"flowTraceMetadata"|"speechProcessingMetadata"|undefined} traceMetadata + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + */ + Object.defineProperty(TraceBlock.prototype, "traceMetadata", { + get: $util.oneOfGetter($oneOfFields = ["playbookTraceMetadata", "flowTraceMetadata", "speechProcessingMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TraceBlock instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.ITraceBlock=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TraceBlock} TraceBlock instance + */ + TraceBlock.create = function create(properties) { + return new TraceBlock(properties); + }; + + /** + * Encodes the specified TraceBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TraceBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.ITraceBlock} message TraceBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TraceBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbookTraceMetadata != null && Object.hasOwnProperty.call(message, "playbookTraceMetadata")) + $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.encode(message.playbookTraceMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.flowTraceMetadata != null && Object.hasOwnProperty.call(message, "flowTraceMetadata")) + $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata.encode(message.flowTraceMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Action.encode(message.actions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputParameters != null && Object.hasOwnProperty.call(message, "outputParameters")) + $root.google.protobuf.Struct.encode(message.outputParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endState != null && Object.hasOwnProperty.call(message, "endState")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.endState); + if (message.speechProcessingMetadata != null && Object.hasOwnProperty.call(message, "speechProcessingMetadata")) + $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.encode(message.speechProcessingMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.inputParameters != null && Object.hasOwnProperty.call(message, "inputParameters")) + $root.google.protobuf.Struct.encode(message.inputParameters, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TraceBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TraceBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.ITraceBlock} message TraceBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TraceBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TraceBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TraceBlock} TraceBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TraceBlock.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TraceBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbookTraceMetadata = $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.flowTraceMetadata = $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.speechProcessingMetadata = $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.dialogflow.cx.v3.Action.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.inputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.outputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.endState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TraceBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TraceBlock} TraceBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TraceBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TraceBlock message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TraceBlock.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.playbookTraceMetadata != null && message.hasOwnProperty("playbookTraceMetadata")) { + properties.traceMetadata = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.verify(message.playbookTraceMetadata, long + 1); + if (error) + return "playbookTraceMetadata." + error; + } + } + if (message.flowTraceMetadata != null && message.hasOwnProperty("flowTraceMetadata")) { + if (properties.traceMetadata === 1) + return "traceMetadata: multiple values"; + properties.traceMetadata = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata.verify(message.flowTraceMetadata, long + 1); + if (error) + return "flowTraceMetadata." + error; + } + } + if (message.speechProcessingMetadata != null && message.hasOwnProperty("speechProcessingMetadata")) { + if (properties.traceMetadata === 1) + return "traceMetadata: multiple values"; + properties.traceMetadata = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.verify(message.speechProcessingMetadata, long + 1); + if (error) + return "speechProcessingMetadata." + error; + } + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Action.verify(message.actions[i], long + 1); + if (error) + return "actions." + error; + } + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime, long + 1); + if (error) + return "completeTime." + error; + } + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputParameters, long + 1); + if (error) + return "inputParameters." + error; + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + var error = $root.google.protobuf.Struct.verify(message.outputParameters, long + 1); + if (error) + return "outputParameters." + error; + } + if (message.endState != null && message.hasOwnProperty("endState")) + switch (message.endState) { + default: + return "endState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a TraceBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TraceBlock} TraceBlock + */ + TraceBlock.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TraceBlock) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TraceBlock(); + if (object.playbookTraceMetadata != null) { + if (typeof object.playbookTraceMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.playbookTraceMetadata: object expected"); + message.playbookTraceMetadata = $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.fromObject(object.playbookTraceMetadata, long + 1); + } + if (object.flowTraceMetadata != null) { + if (typeof object.flowTraceMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.flowTraceMetadata: object expected"); + message.flowTraceMetadata = $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata.fromObject(object.flowTraceMetadata, long + 1); + } + if (object.speechProcessingMetadata != null) { + if (typeof object.speechProcessingMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.speechProcessingMetadata: object expected"); + message.speechProcessingMetadata = $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.fromObject(object.speechProcessingMetadata, long + 1); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.actions: object expected"); + message.actions[i] = $root.google.cloud.dialogflow.cx.v3.Action.fromObject(object.actions[i], long + 1); + } + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime, long + 1); + } + if (object.inputParameters != null) { + if (typeof object.inputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.inputParameters: object expected"); + message.inputParameters = $root.google.protobuf.Struct.fromObject(object.inputParameters, long + 1); + } + if (object.outputParameters != null) { + if (typeof object.outputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TraceBlock.outputParameters: object expected"); + message.outputParameters = $root.google.protobuf.Struct.fromObject(object.outputParameters, long + 1); + } + switch (object.endState) { + default: + if (typeof object.endState === "number") { + message.endState = object.endState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.endState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.endState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.endState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.endState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.endState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.endState = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a TraceBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3.TraceBlock} message TraceBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TraceBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.startTime = null; + object.completeTime = null; + object.outputParameters = null; + object.endState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.inputParameters = null; + } + if (message.playbookTraceMetadata != null && message.hasOwnProperty("playbookTraceMetadata")) { + object.playbookTraceMetadata = $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.toObject(message.playbookTraceMetadata, options); + if (options.oneofs) + object.traceMetadata = "playbookTraceMetadata"; + } + if (message.flowTraceMetadata != null && message.hasOwnProperty("flowTraceMetadata")) { + object.flowTraceMetadata = $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata.toObject(message.flowTraceMetadata, options); + if (options.oneofs) + object.traceMetadata = "flowTraceMetadata"; + } + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.dialogflow.cx.v3.Action.toObject(message.actions[j], options); + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) + object.outputParameters = $root.google.protobuf.Struct.toObject(message.outputParameters, options); + if (message.endState != null && message.hasOwnProperty("endState")) + object.endState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.OutputState[message.endState] === undefined ? message.endState : $root.google.cloud.dialogflow.cx.v3.OutputState[message.endState] : message.endState; + if (message.speechProcessingMetadata != null && message.hasOwnProperty("speechProcessingMetadata")) { + object.speechProcessingMetadata = $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.toObject(message.speechProcessingMetadata, options); + if (options.oneofs) + object.traceMetadata = "speechProcessingMetadata"; + } + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) + object.inputParameters = $root.google.protobuf.Struct.toObject(message.inputParameters, options); + return object; + }; + + /** + * Converts this TraceBlock to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @instance + * @returns {Object.} JSON object + */ + TraceBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TraceBlock + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TraceBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TraceBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TraceBlock"; + }; + + return TraceBlock; + })(); + + v3.SpeechProcessingMetadata = (function() { + + /** + * Properties of a SpeechProcessingMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISpeechProcessingMetadata + * @property {string|null} [displayName] SpeechProcessingMetadata displayName + */ + + /** + * Constructs a new SpeechProcessingMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SpeechProcessingMetadata. + * @implements ISpeechProcessingMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata=} [properties] Properties to set + */ + function SpeechProcessingMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechProcessingMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @instance + */ + SpeechProcessingMetadata.prototype.displayName = ""; + + /** + * Creates a new SpeechProcessingMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata} SpeechProcessingMetadata instance + */ + SpeechProcessingMetadata.create = function create(properties) { + return new SpeechProcessingMetadata(properties); + }; + + /** + * Encodes the specified SpeechProcessingMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata} message SpeechProcessingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechProcessingMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified SpeechProcessingMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ISpeechProcessingMetadata} message SpeechProcessingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechProcessingMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata} SpeechProcessingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechProcessingMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata} SpeechProcessingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechProcessingMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechProcessingMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechProcessingMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a SpeechProcessingMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata} SpeechProcessingMetadata + */ + SpeechProcessingMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata(); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a SpeechProcessingMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata} message SpeechProcessingMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechProcessingMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.displayName = ""; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this SpeechProcessingMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @instance + * @returns {Object.} JSON object + */ + SpeechProcessingMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechProcessingMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechProcessingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SpeechProcessingMetadata"; + }; + + return SpeechProcessingMetadata; + })(); + + v3.PlaybookTraceMetadata = (function() { + + /** + * Properties of a PlaybookTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybookTraceMetadata + * @property {string|null} [playbook] PlaybookTraceMetadata playbook + * @property {string|null} [displayName] PlaybookTraceMetadata displayName + */ + + /** + * Constructs a new PlaybookTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PlaybookTraceMetadata. + * @implements IPlaybookTraceMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata=} [properties] Properties to set + */ + function PlaybookTraceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookTraceMetadata playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @instance + */ + PlaybookTraceMetadata.prototype.playbook = ""; + + /** + * PlaybookTraceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @instance + */ + PlaybookTraceMetadata.prototype.displayName = ""; + + /** + * Creates a new PlaybookTraceMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata} PlaybookTraceMetadata instance + */ + PlaybookTraceMetadata.create = function create(properties) { + return new PlaybookTraceMetadata(properties); + }; + + /** + * Encodes the specified PlaybookTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata} message PlaybookTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTraceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PlaybookTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTraceMetadata} message PlaybookTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTraceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata} PlaybookTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTraceMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata} PlaybookTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTraceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookTraceMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookTraceMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a PlaybookTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata} PlaybookTraceMetadata + */ + PlaybookTraceMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a PlaybookTraceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata} message PlaybookTraceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookTraceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.displayName = ""; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PlaybookTraceMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @instance + * @returns {Object.} JSON object + */ + PlaybookTraceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookTraceMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookTraceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PlaybookTraceMetadata"; + }; + + return PlaybookTraceMetadata; + })(); + + v3.FlowTraceMetadata = (function() { + + /** + * Properties of a FlowTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFlowTraceMetadata + * @property {string|null} [flow] FlowTraceMetadata flow + * @property {string|null} [displayName] FlowTraceMetadata displayName + */ + + /** + * Constructs a new FlowTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FlowTraceMetadata. + * @implements IFlowTraceMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFlowTraceMetadata=} [properties] Properties to set + */ + function FlowTraceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowTraceMetadata flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @instance + */ + FlowTraceMetadata.prototype.flow = ""; + + /** + * FlowTraceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @instance + */ + FlowTraceMetadata.prototype.displayName = ""; + + /** + * Creates a new FlowTraceMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowTraceMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FlowTraceMetadata} FlowTraceMetadata instance + */ + FlowTraceMetadata.create = function create(properties) { + return new FlowTraceMetadata(properties); + }; + + /** + * Encodes the specified FlowTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTraceMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowTraceMetadata} message FlowTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTraceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified FlowTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTraceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowTraceMetadata} message FlowTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTraceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FlowTraceMetadata} FlowTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTraceMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FlowTraceMetadata} FlowTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTraceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowTraceMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowTraceMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a FlowTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FlowTraceMetadata} FlowTraceMetadata + */ + FlowTraceMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FlowTraceMetadata(); + if (object.flow != null) + message.flow = String(object.flow); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a FlowTraceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.FlowTraceMetadata} message FlowTraceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowTraceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = ""; + object.displayName = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this FlowTraceMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @instance + * @returns {Object.} JSON object + */ + FlowTraceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowTraceMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FlowTraceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowTraceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FlowTraceMetadata"; + }; + + return FlowTraceMetadata; + })(); + + v3.PlaybookInput = (function() { + + /** + * Properties of a PlaybookInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybookInput + * @property {string|null} [precedingConversationSummary] PlaybookInput precedingConversationSummary + */ + + /** + * Constructs a new PlaybookInput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PlaybookInput. + * @implements IPlaybookInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInput=} [properties] Properties to set + */ + function PlaybookInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookInput precedingConversationSummary. + * @member {string} precedingConversationSummary + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @instance + */ + PlaybookInput.prototype.precedingConversationSummary = ""; + + /** + * Creates a new PlaybookInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInput} PlaybookInput instance + */ + PlaybookInput.create = function create(properties) { + return new PlaybookInput(properties); + }; + + /** + * Encodes the specified PlaybookInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInput} message PlaybookInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precedingConversationSummary != null && Object.hasOwnProperty.call(message, "precedingConversationSummary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.precedingConversationSummary); + return writer; + }; + + /** + * Encodes the specified PlaybookInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInput} message PlaybookInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInput} PlaybookInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PlaybookInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.precedingConversationSummary = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInput} PlaybookInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.precedingConversationSummary != null && message.hasOwnProperty("precedingConversationSummary")) + if (!$util.isString(message.precedingConversationSummary)) + return "precedingConversationSummary: string expected"; + return null; + }; + + /** + * Creates a PlaybookInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInput} PlaybookInput + */ + PlaybookInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PlaybookInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PlaybookInput(); + if (object.precedingConversationSummary != null) + message.precedingConversationSummary = String(object.precedingConversationSummary); + return message; + }; + + /** + * Creates a plain object from a PlaybookInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3.PlaybookInput} message PlaybookInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.precedingConversationSummary = ""; + if (message.precedingConversationSummary != null && message.hasOwnProperty("precedingConversationSummary")) + object.precedingConversationSummary = message.precedingConversationSummary; + return object; + }; + + /** + * Converts this PlaybookInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @instance + * @returns {Object.} JSON object + */ + PlaybookInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PlaybookInput"; + }; + + return PlaybookInput; + })(); + + v3.PlaybookOutput = (function() { + + /** + * Properties of a PlaybookOutput. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybookOutput + * @property {string|null} [executionSummary] PlaybookOutput executionSummary + */ + + /** + * Constructs a new PlaybookOutput. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PlaybookOutput. + * @implements IPlaybookOutput + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybookOutput=} [properties] Properties to set + */ + function PlaybookOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookOutput executionSummary. + * @member {string} executionSummary + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @instance + */ + PlaybookOutput.prototype.executionSummary = ""; + + /** + * Creates a new PlaybookOutput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookOutput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PlaybookOutput} PlaybookOutput instance + */ + PlaybookOutput.create = function create(properties) { + return new PlaybookOutput(properties); + }; + + /** + * Encodes the specified PlaybookOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookOutput} message PlaybookOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executionSummary != null && Object.hasOwnProperty.call(message, "executionSummary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionSummary); + return writer; + }; + + /** + * Encodes the specified PlaybookOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookOutput} message PlaybookOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PlaybookOutput} PlaybookOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookOutput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PlaybookOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.executionSummary = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PlaybookOutput} PlaybookOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookOutput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookOutput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.executionSummary != null && message.hasOwnProperty("executionSummary")) + if (!$util.isString(message.executionSummary)) + return "executionSummary: string expected"; + return null; + }; + + /** + * Creates a PlaybookOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PlaybookOutput} PlaybookOutput + */ + PlaybookOutput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PlaybookOutput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PlaybookOutput(); + if (object.executionSummary != null) + message.executionSummary = String(object.executionSummary); + return message; + }; + + /** + * Creates a plain object from a PlaybookOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3.PlaybookOutput} message PlaybookOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.executionSummary = ""; + if (message.executionSummary != null && message.hasOwnProperty("executionSummary")) + object.executionSummary = message.executionSummary; + return object; + }; + + /** + * Converts this PlaybookOutput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @instance + * @returns {Object.} JSON object + */ + PlaybookOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookOutput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PlaybookOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PlaybookOutput"; + }; + + return PlaybookOutput; + })(); + + v3.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IAction + * @property {google.cloud.dialogflow.cx.v3.IUserUtterance|null} [userUtterance] Action userUtterance + * @property {google.cloud.dialogflow.cx.v3.IAgentUtterance|null} [agentUtterance] Action agentUtterance + * @property {google.cloud.dialogflow.cx.v3.IToolUse|null} [toolUse] Action toolUse + * @property {google.cloud.dialogflow.cx.v3.IPlaybookInvocation|null} [playbookInvocation] Action playbookInvocation + * @property {google.cloud.dialogflow.cx.v3.IFlowInvocation|null} [flowInvocation] Action flowInvocation + * @property {google.cloud.dialogflow.cx.v3.IPlaybookTransition|null} [playbookTransition] Action playbookTransition + * @property {google.cloud.dialogflow.cx.v3.IFlowTransition|null} [flowTransition] Action flowTransition + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IAction=} [properties] Properties to set + */ + function Action(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action userUtterance. + * @member {google.cloud.dialogflow.cx.v3.IUserUtterance|null|undefined} userUtterance + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Action.prototype.userUtterance = null; + + /** + * Action agentUtterance. + * @member {google.cloud.dialogflow.cx.v3.IAgentUtterance|null|undefined} agentUtterance + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Action.prototype.agentUtterance = null; + + /** + * Action toolUse. + * @member {google.cloud.dialogflow.cx.v3.IToolUse|null|undefined} toolUse + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Action.prototype.toolUse = null; + + /** + * Action playbookInvocation. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookInvocation|null|undefined} playbookInvocation + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Action.prototype.playbookInvocation = null; + + /** + * Action flowInvocation. + * @member {google.cloud.dialogflow.cx.v3.IFlowInvocation|null|undefined} flowInvocation + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Action.prototype.flowInvocation = null; + + /** + * Action playbookTransition. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookTransition|null|undefined} playbookTransition + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Action.prototype.playbookTransition = null; + + /** + * Action flowTransition. + * @member {google.cloud.dialogflow.cx.v3.IFlowTransition|null|undefined} flowTransition + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Action.prototype.flowTransition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action action. + * @member {"userUtterance"|"agentUtterance"|"toolUse"|"playbookInvocation"|"flowInvocation"|"playbookTransition"|"flowTransition"|undefined} action + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + */ + Object.defineProperty(Action.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["userUtterance", "agentUtterance", "toolUse", "playbookInvocation", "flowInvocation", "playbookTransition", "flowTransition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {google.cloud.dialogflow.cx.v3.IAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {google.cloud.dialogflow.cx.v3.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userUtterance != null && Object.hasOwnProperty.call(message, "userUtterance")) + $root.google.cloud.dialogflow.cx.v3.UserUtterance.encode(message.userUtterance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agentUtterance != null && Object.hasOwnProperty.call(message, "agentUtterance")) + $root.google.cloud.dialogflow.cx.v3.AgentUtterance.encode(message.agentUtterance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolUse != null && Object.hasOwnProperty.call(message, "toolUse")) + $root.google.cloud.dialogflow.cx.v3.ToolUse.encode(message.toolUse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.playbookInvocation != null && Object.hasOwnProperty.call(message, "playbookInvocation")) + $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation.encode(message.playbookInvocation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.flowInvocation != null && Object.hasOwnProperty.call(message, "flowInvocation")) + $root.google.cloud.dialogflow.cx.v3.FlowInvocation.encode(message.flowInvocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.playbookTransition != null && Object.hasOwnProperty.call(message, "playbookTransition")) + $root.google.cloud.dialogflow.cx.v3.PlaybookTransition.encode(message.playbookTransition, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.flowTransition != null && Object.hasOwnProperty.call(message, "flowTransition")) + $root.google.cloud.dialogflow.cx.v3.FlowTransition.encode(message.flowTransition, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {google.cloud.dialogflow.cx.v3.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userUtterance = $root.google.cloud.dialogflow.cx.v3.UserUtterance.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.agentUtterance = $root.google.cloud.dialogflow.cx.v3.AgentUtterance.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.toolUse = $root.google.cloud.dialogflow.cx.v3.ToolUse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.playbookInvocation = $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.flowInvocation = $root.google.cloud.dialogflow.cx.v3.FlowInvocation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.playbookTransition = $root.google.cloud.dialogflow.cx.v3.PlaybookTransition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.flowTransition = $root.google.cloud.dialogflow.cx.v3.FlowTransition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.userUtterance != null && message.hasOwnProperty("userUtterance")) { + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.UserUtterance.verify(message.userUtterance, long + 1); + if (error) + return "userUtterance." + error; + } + } + if (message.agentUtterance != null && message.hasOwnProperty("agentUtterance")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.AgentUtterance.verify(message.agentUtterance, long + 1); + if (error) + return "agentUtterance." + error; + } + } + if (message.toolUse != null && message.hasOwnProperty("toolUse")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.ToolUse.verify(message.toolUse, long + 1); + if (error) + return "toolUse." + error; + } + } + if (message.playbookInvocation != null && message.hasOwnProperty("playbookInvocation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation.verify(message.playbookInvocation, long + 1); + if (error) + return "playbookInvocation." + error; + } + } + if (message.flowInvocation != null && message.hasOwnProperty("flowInvocation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.FlowInvocation.verify(message.flowInvocation, long + 1); + if (error) + return "flowInvocation." + error; + } + } + if (message.playbookTransition != null && message.hasOwnProperty("playbookTransition")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookTransition.verify(message.playbookTransition, long + 1); + if (error) + return "playbookTransition." + error; + } + } + if (message.flowTransition != null && message.hasOwnProperty("flowTransition")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.FlowTransition.verify(message.flowTransition, long + 1); + if (error) + return "flowTransition." + error; + } + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Action} Action + */ + Action.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Action) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Action(); + if (object.userUtterance != null) { + if (typeof object.userUtterance !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Action.userUtterance: object expected"); + message.userUtterance = $root.google.cloud.dialogflow.cx.v3.UserUtterance.fromObject(object.userUtterance, long + 1); + } + if (object.agentUtterance != null) { + if (typeof object.agentUtterance !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Action.agentUtterance: object expected"); + message.agentUtterance = $root.google.cloud.dialogflow.cx.v3.AgentUtterance.fromObject(object.agentUtterance, long + 1); + } + if (object.toolUse != null) { + if (typeof object.toolUse !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Action.toolUse: object expected"); + message.toolUse = $root.google.cloud.dialogflow.cx.v3.ToolUse.fromObject(object.toolUse, long + 1); + } + if (object.playbookInvocation != null) { + if (typeof object.playbookInvocation !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Action.playbookInvocation: object expected"); + message.playbookInvocation = $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation.fromObject(object.playbookInvocation, long + 1); + } + if (object.flowInvocation != null) { + if (typeof object.flowInvocation !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Action.flowInvocation: object expected"); + message.flowInvocation = $root.google.cloud.dialogflow.cx.v3.FlowInvocation.fromObject(object.flowInvocation, long + 1); + } + if (object.playbookTransition != null) { + if (typeof object.playbookTransition !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Action.playbookTransition: object expected"); + message.playbookTransition = $root.google.cloud.dialogflow.cx.v3.PlaybookTransition.fromObject(object.playbookTransition, long + 1); + } + if (object.flowTransition != null) { + if (typeof object.flowTransition !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Action.flowTransition: object expected"); + message.flowTransition = $root.google.cloud.dialogflow.cx.v3.FlowTransition.fromObject(object.flowTransition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {google.cloud.dialogflow.cx.v3.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.userUtterance != null && message.hasOwnProperty("userUtterance")) { + object.userUtterance = $root.google.cloud.dialogflow.cx.v3.UserUtterance.toObject(message.userUtterance, options); + if (options.oneofs) + object.action = "userUtterance"; + } + if (message.agentUtterance != null && message.hasOwnProperty("agentUtterance")) { + object.agentUtterance = $root.google.cloud.dialogflow.cx.v3.AgentUtterance.toObject(message.agentUtterance, options); + if (options.oneofs) + object.action = "agentUtterance"; + } + if (message.toolUse != null && message.hasOwnProperty("toolUse")) { + object.toolUse = $root.google.cloud.dialogflow.cx.v3.ToolUse.toObject(message.toolUse, options); + if (options.oneofs) + object.action = "toolUse"; + } + if (message.playbookInvocation != null && message.hasOwnProperty("playbookInvocation")) { + object.playbookInvocation = $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation.toObject(message.playbookInvocation, options); + if (options.oneofs) + object.action = "playbookInvocation"; + } + if (message.flowInvocation != null && message.hasOwnProperty("flowInvocation")) { + object.flowInvocation = $root.google.cloud.dialogflow.cx.v3.FlowInvocation.toObject(message.flowInvocation, options); + if (options.oneofs) + object.action = "flowInvocation"; + } + if (message.playbookTransition != null && message.hasOwnProperty("playbookTransition")) { + object.playbookTransition = $root.google.cloud.dialogflow.cx.v3.PlaybookTransition.toObject(message.playbookTransition, options); + if (options.oneofs) + object.action = "playbookTransition"; + } + if (message.flowTransition != null && message.hasOwnProperty("flowTransition")) { + object.flowTransition = $root.google.cloud.dialogflow.cx.v3.FlowTransition.toObject(message.flowTransition, options); + if (options.oneofs) + object.action = "flowTransition"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Action"; + }; + + return Action; + })(); + + v3.UserUtterance = (function() { + + /** + * Properties of a UserUtterance. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUserUtterance + * @property {string|null} [text] UserUtterance text + */ + + /** + * Constructs a new UserUtterance. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a UserUtterance. + * @implements IUserUtterance + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUserUtterance=} [properties] Properties to set + */ + function UserUtterance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserUtterance text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @instance + */ + UserUtterance.prototype.text = ""; + + /** + * Creates a new UserUtterance instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.IUserUtterance=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UserUtterance} UserUtterance instance + */ + UserUtterance.create = function create(properties) { + return new UserUtterance(properties); + }; + + /** + * Encodes the specified UserUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UserUtterance.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.IUserUtterance} message UserUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserUtterance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified UserUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UserUtterance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.IUserUtterance} message UserUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserUtterance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserUtterance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UserUtterance} UserUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserUtterance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UserUtterance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UserUtterance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UserUtterance} UserUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserUtterance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserUtterance message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserUtterance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a UserUtterance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UserUtterance} UserUtterance + */ + UserUtterance.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UserUtterance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UserUtterance(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a UserUtterance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.UserUtterance} message UserUtterance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserUtterance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this UserUtterance to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @instance + * @returns {Object.} JSON object + */ + UserUtterance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserUtterance + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UserUtterance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserUtterance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UserUtterance"; + }; + + return UserUtterance; + })(); + + v3.AgentUtterance = (function() { + + /** + * Properties of an AgentUtterance. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IAgentUtterance + * @property {string|null} [text] AgentUtterance text + */ + + /** + * Constructs a new AgentUtterance. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an AgentUtterance. + * @implements IAgentUtterance + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IAgentUtterance=} [properties] Properties to set + */ + function AgentUtterance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentUtterance text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @instance + */ + AgentUtterance.prototype.text = ""; + + /** + * Creates a new AgentUtterance instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgentUtterance=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.AgentUtterance} AgentUtterance instance + */ + AgentUtterance.create = function create(properties) { + return new AgentUtterance(properties); + }; + + /** + * Encodes the specified AgentUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentUtterance.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgentUtterance} message AgentUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentUtterance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified AgentUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AgentUtterance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.IAgentUtterance} message AgentUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentUtterance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.AgentUtterance} AgentUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentUtterance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AgentUtterance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.AgentUtterance} AgentUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentUtterance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentUtterance message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentUtterance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates an AgentUtterance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.AgentUtterance} AgentUtterance + */ + AgentUtterance.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.AgentUtterance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.AgentUtterance(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from an AgentUtterance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3.AgentUtterance} message AgentUtterance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentUtterance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this AgentUtterance to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @instance + * @returns {Object.} JSON object + */ + AgentUtterance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentUtterance + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.AgentUtterance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentUtterance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AgentUtterance"; + }; + + return AgentUtterance; + })(); + + v3.ToolUse = (function() { + + /** + * Properties of a ToolUse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IToolUse + * @property {string|null} [tool] ToolUse tool + * @property {string|null} [displayName] ToolUse displayName + * @property {string|null} [action] ToolUse action + * @property {google.protobuf.IStruct|null} [inputActionParameters] ToolUse inputActionParameters + * @property {google.protobuf.IStruct|null} [outputActionParameters] ToolUse outputActionParameters + */ + + /** + * Constructs a new ToolUse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ToolUse. + * @implements IToolUse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IToolUse=} [properties] Properties to set + */ + function ToolUse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolUse tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @instance + */ + ToolUse.prototype.tool = ""; + + /** + * ToolUse displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @instance + */ + ToolUse.prototype.displayName = ""; + + /** + * ToolUse action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @instance + */ + ToolUse.prototype.action = ""; + + /** + * ToolUse inputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} inputActionParameters + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @instance + */ + ToolUse.prototype.inputActionParameters = null; + + /** + * ToolUse outputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} outputActionParameters + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @instance + */ + ToolUse.prototype.outputActionParameters = null; + + /** + * Creates a new ToolUse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolUse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ToolUse} ToolUse instance + */ + ToolUse.create = function create(properties) { + return new ToolUse(properties); + }; + + /** + * Encodes the specified ToolUse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolUse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolUse} message ToolUse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolUse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.inputActionParameters != null && Object.hasOwnProperty.call(message, "inputActionParameters")) + $root.google.protobuf.Struct.encode(message.inputActionParameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputActionParameters != null && Object.hasOwnProperty.call(message, "outputActionParameters")) + $root.google.protobuf.Struct.encode(message.outputActionParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ToolUse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolUse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolUse} message ToolUse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolUse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolUse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ToolUse} ToolUse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolUse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ToolUse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 5: { + message.inputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.outputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolUse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ToolUse} ToolUse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolUse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolUse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolUse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputActionParameters, long + 1); + if (error) + return "inputActionParameters." + error; + } + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.outputActionParameters, long + 1); + if (error) + return "outputActionParameters." + error; + } + return null; + }; + + /** + * Creates a ToolUse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ToolUse} ToolUse + */ + ToolUse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ToolUse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ToolUse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.action != null) + message.action = String(object.action); + if (object.inputActionParameters != null) { + if (typeof object.inputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolUse.inputActionParameters: object expected"); + message.inputActionParameters = $root.google.protobuf.Struct.fromObject(object.inputActionParameters, long + 1); + } + if (object.outputActionParameters != null) { + if (typeof object.outputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolUse.outputActionParameters: object expected"); + message.outputActionParameters = $root.google.protobuf.Struct.fromObject(object.outputActionParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolUse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolUse} message ToolUse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolUse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + object.inputActionParameters = null; + object.outputActionParameters = null; + object.displayName = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) + object.inputActionParameters = $root.google.protobuf.Struct.toObject(message.inputActionParameters, options); + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) + object.outputActionParameters = $root.google.protobuf.Struct.toObject(message.outputActionParameters, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ToolUse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @instance + * @returns {Object.} JSON object + */ + ToolUse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolUse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ToolUse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolUse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ToolUse"; + }; + + return ToolUse; + })(); + + v3.PlaybookInvocation = (function() { + + /** + * Properties of a PlaybookInvocation. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybookInvocation + * @property {string|null} [playbook] PlaybookInvocation playbook + * @property {string|null} [displayName] PlaybookInvocation displayName + * @property {google.cloud.dialogflow.cx.v3.IPlaybookInput|null} [playbookInput] PlaybookInvocation playbookInput + * @property {google.cloud.dialogflow.cx.v3.IPlaybookOutput|null} [playbookOutput] PlaybookInvocation playbookOutput + * @property {google.cloud.dialogflow.cx.v3.OutputState|null} [playbookState] PlaybookInvocation playbookState + */ + + /** + * Constructs a new PlaybookInvocation. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PlaybookInvocation. + * @implements IPlaybookInvocation + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInvocation=} [properties] Properties to set + */ + function PlaybookInvocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookInvocation playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbook = ""; + + /** + * PlaybookInvocation displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.displayName = ""; + + /** + * PlaybookInvocation playbookInput. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookInput|null|undefined} playbookInput + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbookInput = null; + + /** + * PlaybookInvocation playbookOutput. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookOutput|null|undefined} playbookOutput + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbookOutput = null; + + /** + * PlaybookInvocation playbookState. + * @member {google.cloud.dialogflow.cx.v3.OutputState} playbookState + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbookState = 0; + + /** + * Creates a new PlaybookInvocation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInvocation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInvocation} PlaybookInvocation instance + */ + PlaybookInvocation.create = function create(properties) { + return new PlaybookInvocation(properties); + }; + + /** + * Encodes the specified PlaybookInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInvocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInvocation} message PlaybookInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInvocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.playbookInput != null && Object.hasOwnProperty.call(message, "playbookInput")) + $root.google.cloud.dialogflow.cx.v3.PlaybookInput.encode(message.playbookInput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.playbookOutput != null && Object.hasOwnProperty.call(message, "playbookOutput")) + $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.encode(message.playbookOutput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.playbookState != null && Object.hasOwnProperty.call(message, "playbookState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.playbookState); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PlaybookInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookInvocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookInvocation} message PlaybookInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInvocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInvocation} PlaybookInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInvocation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 2: { + message.playbookInput = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.playbookState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInvocation} PlaybookInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInvocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookInvocation message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookInvocation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.verify(message.playbookInput, long + 1); + if (error) + return "playbookInput." + error; + } + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.verify(message.playbookOutput, long + 1); + if (error) + return "playbookOutput." + error; + } + if (message.playbookState != null && message.hasOwnProperty("playbookState")) + switch (message.playbookState) { + default: + return "playbookState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a PlaybookInvocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PlaybookInvocation} PlaybookInvocation + */ + PlaybookInvocation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PlaybookInvocation(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.playbookInput != null) { + if (typeof object.playbookInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PlaybookInvocation.playbookInput: object expected"); + message.playbookInput = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.fromObject(object.playbookInput, long + 1); + } + if (object.playbookOutput != null) { + if (typeof object.playbookOutput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PlaybookInvocation.playbookOutput: object expected"); + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.fromObject(object.playbookOutput, long + 1); + } + switch (object.playbookState) { + default: + if (typeof object.playbookState === "number") { + message.playbookState = object.playbookState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.playbookState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.playbookState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.playbookState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.playbookState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.playbookState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.playbookState = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a PlaybookInvocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.PlaybookInvocation} message PlaybookInvocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookInvocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.playbookInput = null; + object.playbookOutput = null; + object.playbookState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) + object.playbookInput = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.toObject(message.playbookInput, options); + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) + object.playbookOutput = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.toObject(message.playbookOutput, options); + if (message.playbookState != null && message.hasOwnProperty("playbookState")) + object.playbookState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.OutputState[message.playbookState] === undefined ? message.playbookState : $root.google.cloud.dialogflow.cx.v3.OutputState[message.playbookState] : message.playbookState; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PlaybookInvocation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @instance + * @returns {Object.} JSON object + */ + PlaybookInvocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookInvocation + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PlaybookInvocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookInvocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PlaybookInvocation"; + }; + + return PlaybookInvocation; + })(); + + v3.FlowInvocation = (function() { + + /** + * Properties of a FlowInvocation. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFlowInvocation + * @property {string|null} [flow] FlowInvocation flow + * @property {string|null} [displayName] FlowInvocation displayName + * @property {google.cloud.dialogflow.cx.v3.OutputState|null} [flowState] FlowInvocation flowState + */ + + /** + * Constructs a new FlowInvocation. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FlowInvocation. + * @implements IFlowInvocation + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFlowInvocation=} [properties] Properties to set + */ + function FlowInvocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowInvocation flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @instance + */ + FlowInvocation.prototype.flow = ""; + + /** + * FlowInvocation displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @instance + */ + FlowInvocation.prototype.displayName = ""; + + /** + * FlowInvocation flowState. + * @member {google.cloud.dialogflow.cx.v3.OutputState} flowState + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @instance + */ + FlowInvocation.prototype.flowState = 0; + + /** + * Creates a new FlowInvocation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowInvocation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FlowInvocation} FlowInvocation instance + */ + FlowInvocation.create = function create(properties) { + return new FlowInvocation(properties); + }; + + /** + * Encodes the specified FlowInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowInvocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowInvocation} message FlowInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowInvocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + if (message.flowState != null && Object.hasOwnProperty.call(message, "flowState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.flowState); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified FlowInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowInvocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowInvocation} message FlowInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowInvocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FlowInvocation} FlowInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowInvocation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FlowInvocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + case 7: { + message.displayName = reader.string(); + break; + } + case 4: { + message.flowState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FlowInvocation} FlowInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowInvocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowInvocation message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowInvocation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.flowState != null && message.hasOwnProperty("flowState")) + switch (message.flowState) { + default: + return "flowState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FlowInvocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FlowInvocation} FlowInvocation + */ + FlowInvocation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FlowInvocation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FlowInvocation(); + if (object.flow != null) + message.flow = String(object.flow); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.flowState) { + default: + if (typeof object.flowState === "number") { + message.flowState = object.flowState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.flowState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.flowState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.flowState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.flowState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.flowState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.flowState = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FlowInvocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3.FlowInvocation} message FlowInvocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowInvocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = ""; + object.flowState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.flowState != null && message.hasOwnProperty("flowState")) + object.flowState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.OutputState[message.flowState] === undefined ? message.flowState : $root.google.cloud.dialogflow.cx.v3.OutputState[message.flowState] : message.flowState; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this FlowInvocation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @instance + * @returns {Object.} JSON object + */ + FlowInvocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowInvocation + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FlowInvocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowInvocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FlowInvocation"; + }; + + return FlowInvocation; + })(); + + v3.PlaybookTransition = (function() { + + /** + * Properties of a PlaybookTransition. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybookTransition + * @property {string|null} [playbook] PlaybookTransition playbook + * @property {string|null} [displayName] PlaybookTransition displayName + */ + + /** + * Constructs a new PlaybookTransition. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PlaybookTransition. + * @implements IPlaybookTransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTransition=} [properties] Properties to set + */ + function PlaybookTransition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookTransition playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @instance + */ + PlaybookTransition.prototype.playbook = ""; + + /** + * PlaybookTransition displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @instance + */ + PlaybookTransition.prototype.displayName = ""; + + /** + * Creates a new PlaybookTransition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTransition} PlaybookTransition instance + */ + PlaybookTransition.create = function create(properties) { + return new PlaybookTransition(properties); + }; + + /** + * Encodes the specified PlaybookTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTransition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTransition} message PlaybookTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTransition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PlaybookTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookTransition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookTransition} message PlaybookTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTransition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTransition} PlaybookTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTransition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PlaybookTransition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTransition} PlaybookTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTransition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookTransition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookTransition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a PlaybookTransition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PlaybookTransition} PlaybookTransition + */ + PlaybookTransition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PlaybookTransition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PlaybookTransition(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a PlaybookTransition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.PlaybookTransition} message PlaybookTransition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookTransition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.displayName = ""; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PlaybookTransition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @instance + * @returns {Object.} JSON object + */ + PlaybookTransition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookTransition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PlaybookTransition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookTransition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PlaybookTransition"; + }; + + return PlaybookTransition; + })(); + + v3.FlowTransition = (function() { + + /** + * Properties of a FlowTransition. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IFlowTransition + * @property {string|null} [flow] FlowTransition flow + * @property {string|null} [displayName] FlowTransition displayName + */ + + /** + * Constructs a new FlowTransition. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a FlowTransition. + * @implements IFlowTransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IFlowTransition=} [properties] Properties to set + */ + function FlowTransition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowTransition flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @instance + */ + FlowTransition.prototype.flow = ""; + + /** + * FlowTransition displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @instance + */ + FlowTransition.prototype.displayName = ""; + + /** + * Creates a new FlowTransition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowTransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.FlowTransition} FlowTransition instance + */ + FlowTransition.create = function create(properties) { + return new FlowTransition(properties); + }; + + /** + * Encodes the specified FlowTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTransition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowTransition} message FlowTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTransition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified FlowTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.FlowTransition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.IFlowTransition} message FlowTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTransition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowTransition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.FlowTransition} FlowTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTransition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.FlowTransition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowTransition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.FlowTransition} FlowTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTransition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowTransition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowTransition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a FlowTransition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.FlowTransition} FlowTransition + */ + FlowTransition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.FlowTransition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.FlowTransition(); + if (object.flow != null) + message.flow = String(object.flow); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a FlowTransition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3.FlowTransition} message FlowTransition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowTransition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = ""; + object.displayName = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this FlowTransition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @instance + * @returns {Object.} JSON object + */ + FlowTransition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowTransition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.FlowTransition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowTransition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.FlowTransition"; + }; + + return FlowTransition; + })(); + + /** + * OutputState enum. + * @name google.cloud.dialogflow.cx.v3.OutputState + * @enum {number} + * @property {number} OUTPUT_STATE_UNSPECIFIED=0 OUTPUT_STATE_UNSPECIFIED value + * @property {number} OUTPUT_STATE_OK=1 OUTPUT_STATE_OK value + * @property {number} OUTPUT_STATE_CANCELLED=2 OUTPUT_STATE_CANCELLED value + * @property {number} OUTPUT_STATE_FAILED=3 OUTPUT_STATE_FAILED value + * @property {number} OUTPUT_STATE_ESCALATED=4 OUTPUT_STATE_ESCALATED value + * @property {number} OUTPUT_STATE_PENDING=5 OUTPUT_STATE_PENDING value + */ + v3.OutputState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTPUT_STATE_OK"] = 1; + values[valuesById[2] = "OUTPUT_STATE_CANCELLED"] = 2; + values[valuesById[3] = "OUTPUT_STATE_FAILED"] = 3; + values[valuesById[4] = "OUTPUT_STATE_ESCALATED"] = 4; + values[valuesById[5] = "OUTPUT_STATE_PENDING"] = 5; + return values; + })(); + + v3.TransitionRouteGroups = (function() { + + /** + * Constructs a new TransitionRouteGroups service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TransitionRouteGroups + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TransitionRouteGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TransitionRouteGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TransitionRouteGroups; + + /** + * Creates new TransitionRouteGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TransitionRouteGroups} RPC service. Useful where requests and/or responses are streamed. + */ + TransitionRouteGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|listTransitionRouteGroups}. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @typedef ListTransitionRouteGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse} [response] ListTransitionRouteGroupsResponse + */ + + /** + * Calls ListTransitionRouteGroups. + * @function listTransitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest} request ListTransitionRouteGroupsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroupsCallback} callback Node-style callback called with the error, if any, and ListTransitionRouteGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.listTransitionRouteGroups = function listTransitionRouteGroups(request, callback) { + return this.rpcCall(listTransitionRouteGroups, $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest, $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse, request, callback); + }, "name", { value: "ListTransitionRouteGroups" }); + + /** + * Calls ListTransitionRouteGroups. + * @function listTransitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest} request ListTransitionRouteGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|getTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @typedef GetTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} [response] TransitionRouteGroup + */ + + /** + * Calls GetTransitionRouteGroup. + * @function getTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest} request GetTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroups.GetTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and TransitionRouteGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.getTransitionRouteGroup = function getTransitionRouteGroup(request, callback) { + return this.rpcCall(getTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest, $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup, request, callback); + }, "name", { value: "GetTransitionRouteGroup" }); + + /** + * Calls GetTransitionRouteGroup. + * @function getTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest} request GetTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|createTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @typedef CreateTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} [response] TransitionRouteGroup + */ + + /** + * Calls CreateTransitionRouteGroup. + * @function createTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest} request CreateTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and TransitionRouteGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.createTransitionRouteGroup = function createTransitionRouteGroup(request, callback) { + return this.rpcCall(createTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest, $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup, request, callback); + }, "name", { value: "CreateTransitionRouteGroup" }); + + /** + * Calls CreateTransitionRouteGroup. + * @function createTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest} request CreateTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|updateTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @typedef UpdateTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} [response] TransitionRouteGroup + */ + + /** + * Calls UpdateTransitionRouteGroup. + * @function updateTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest} request UpdateTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroups.UpdateTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and TransitionRouteGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.updateTransitionRouteGroup = function updateTransitionRouteGroup(request, callback) { + return this.rpcCall(updateTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest, $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup, request, callback); + }, "name", { value: "UpdateTransitionRouteGroup" }); + + /** + * Calls UpdateTransitionRouteGroup. + * @function updateTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest} request UpdateTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroups|deleteTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @typedef DeleteTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTransitionRouteGroup. + * @function deleteTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest} request DeleteTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroups.DeleteTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.deleteTransitionRouteGroup = function deleteTransitionRouteGroup(request, callback) { + return this.rpcCall(deleteTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTransitionRouteGroup" }); + + /** + * Calls DeleteTransitionRouteGroup. + * @function deleteTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest} request DeleteTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TransitionRouteGroups; + })(); + + v3.TransitionRouteGroup = (function() { + + /** + * Properties of a TransitionRouteGroup. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITransitionRouteGroup + * @property {string|null} [name] TransitionRouteGroup name + * @property {string|null} [displayName] TransitionRouteGroup displayName + * @property {Array.|null} [transitionRoutes] TransitionRouteGroup transitionRoutes + */ + + /** + * Constructs a new TransitionRouteGroup. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a TransitionRouteGroup. + * @implements ITransitionRouteGroup + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup=} [properties] Properties to set + */ + function TransitionRouteGroup(properties) { + this.transitionRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionRouteGroup name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @instance + */ + TransitionRouteGroup.prototype.name = ""; + + /** + * TransitionRouteGroup displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @instance + */ + TransitionRouteGroup.prototype.displayName = ""; + + /** + * TransitionRouteGroup transitionRoutes. + * @member {Array.} transitionRoutes + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @instance + */ + TransitionRouteGroup.prototype.transitionRoutes = $util.emptyArray; + + /** + * Creates a new TransitionRouteGroup instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} TransitionRouteGroup instance + */ + TransitionRouteGroup.create = function create(properties) { + return new TransitionRouteGroup(properties); + }; + + /** + * Encodes the specified TransitionRouteGroup message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup} message TransitionRouteGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroup.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.transitionRoutes != null && message.transitionRoutes.length) + for (var i = 0; i < message.transitionRoutes.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TransitionRoute.encode(message.transitionRoutes[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitionRouteGroup message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup} message TransitionRouteGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} TransitionRouteGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroup.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 5: { + if (!(message.transitionRoutes && message.transitionRoutes.length)) + message.transitionRoutes = []; + message.transitionRoutes.push($root.google.cloud.dialogflow.cx.v3.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} TransitionRouteGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionRouteGroup message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionRouteGroup.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.transitionRoutes != null && message.hasOwnProperty("transitionRoutes")) { + if (!Array.isArray(message.transitionRoutes)) + return "transitionRoutes: array expected"; + for (var i = 0; i < message.transitionRoutes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.verify(message.transitionRoutes[i], long + 1); + if (error) + return "transitionRoutes." + error; + } + } + return null; + }; + + /** + * Creates a TransitionRouteGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} TransitionRouteGroup + */ + TransitionRouteGroup.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.transitionRoutes) { + if (!Array.isArray(object.transitionRoutes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroup.transitionRoutes: array expected"); + message.transitionRoutes = []; + for (var i = 0; i < object.transitionRoutes.length; ++i) { + if (typeof object.transitionRoutes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.TransitionRouteGroup.transitionRoutes: object expected"); + message.transitionRoutes[i] = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.fromObject(object.transitionRoutes[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TransitionRouteGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} message TransitionRouteGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionRouteGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitionRoutes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.transitionRoutes && message.transitionRoutes.length) { + object.transitionRoutes = []; + for (var j = 0; j < message.transitionRoutes.length; ++j) + object.transitionRoutes[j] = $root.google.cloud.dialogflow.cx.v3.TransitionRoute.toObject(message.transitionRoutes[j], options); + } + return object; + }; + + /** + * Converts this TransitionRouteGroup to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @instance + * @returns {Object.} JSON object + */ + TransitionRouteGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionRouteGroup + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionRouteGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.TransitionRouteGroup"; + }; + + return TransitionRouteGroup; + })(); + + v3.ListTransitionRouteGroupsRequest = (function() { + + /** + * Properties of a ListTransitionRouteGroupsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListTransitionRouteGroupsRequest + * @property {string|null} [parent] ListTransitionRouteGroupsRequest parent + * @property {number|null} [pageSize] ListTransitionRouteGroupsRequest pageSize + * @property {string|null} [pageToken] ListTransitionRouteGroupsRequest pageToken + * @property {string|null} [languageCode] ListTransitionRouteGroupsRequest languageCode + */ + + /** + * Constructs a new ListTransitionRouteGroupsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListTransitionRouteGroupsRequest. + * @implements IListTransitionRouteGroupsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest=} [properties] Properties to set + */ + function ListTransitionRouteGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransitionRouteGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.parent = ""; + + /** + * ListTransitionRouteGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.pageSize = 0; + + /** + * ListTransitionRouteGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.pageToken = ""; + + /** + * ListTransitionRouteGroupsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.languageCode = ""; + + /** + * Creates a new ListTransitionRouteGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest instance + */ + ListTransitionRouteGroupsRequest.create = function create(properties) { + return new ListTransitionRouteGroupsRequest(properties); + }; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest} message ListTransitionRouteGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest} message ListTransitionRouteGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransitionRouteGroupsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransitionRouteGroupsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListTransitionRouteGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest + */ + ListTransitionRouteGroupsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListTransitionRouteGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest} message ListTransitionRouteGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransitionRouteGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListTransitionRouteGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransitionRouteGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransitionRouteGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransitionRouteGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest"; + }; + + return ListTransitionRouteGroupsRequest; + })(); + + v3.ListTransitionRouteGroupsResponse = (function() { + + /** + * Properties of a ListTransitionRouteGroupsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListTransitionRouteGroupsResponse + * @property {Array.|null} [transitionRouteGroups] ListTransitionRouteGroupsResponse transitionRouteGroups + * @property {string|null} [nextPageToken] ListTransitionRouteGroupsResponse nextPageToken + */ + + /** + * Constructs a new ListTransitionRouteGroupsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListTransitionRouteGroupsResponse. + * @implements IListTransitionRouteGroupsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse=} [properties] Properties to set + */ + function ListTransitionRouteGroupsResponse(properties) { + this.transitionRouteGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransitionRouteGroupsResponse transitionRouteGroups. + * @member {Array.} transitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @instance + */ + ListTransitionRouteGroupsResponse.prototype.transitionRouteGroups = $util.emptyArray; + + /** + * ListTransitionRouteGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @instance + */ + ListTransitionRouteGroupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransitionRouteGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse instance + */ + ListTransitionRouteGroupsResponse.create = function create(properties) { + return new ListTransitionRouteGroupsResponse(properties); + }; + + /** + * Encodes the specified ListTransitionRouteGroupsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse} message ListTransitionRouteGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitionRouteGroups != null && message.transitionRouteGroups.length) + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.encode(message.transitionRouteGroups[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 ListTransitionRouteGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse} message ListTransitionRouteGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.transitionRouteGroups && message.transitionRouteGroups.length)) + message.transitionRouteGroups = []; + message.transitionRouteGroups.push($root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransitionRouteGroupsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransitionRouteGroupsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitionRouteGroups != null && message.hasOwnProperty("transitionRouteGroups")) { + if (!Array.isArray(message.transitionRouteGroups)) + return "transitionRouteGroups: array expected"; + for (var i = 0; i < message.transitionRouteGroups.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify(message.transitionRouteGroups[i], long + 1); + if (error) + return "transitionRouteGroups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransitionRouteGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse + */ + ListTransitionRouteGroupsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse(); + if (object.transitionRouteGroups) { + if (!Array.isArray(object.transitionRouteGroups)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse.transitionRouteGroups: array expected"); + message.transitionRouteGroups = []; + for (var i = 0; i < object.transitionRouteGroups.length; ++i) { + if (typeof object.transitionRouteGroups[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse.transitionRouteGroups: object expected"); + message.transitionRouteGroups[i] = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.fromObject(object.transitionRouteGroups[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransitionRouteGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse} message ListTransitionRouteGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransitionRouteGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitionRouteGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transitionRouteGroups && message.transitionRouteGroups.length) { + object.transitionRouteGroups = []; + for (var j = 0; j < message.transitionRouteGroups.length; ++j) + object.transitionRouteGroups[j] = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.toObject(message.transitionRouteGroups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransitionRouteGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransitionRouteGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransitionRouteGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransitionRouteGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse"; + }; + + return ListTransitionRouteGroupsResponse; + })(); + + v3.GetTransitionRouteGroupRequest = (function() { + + /** + * Properties of a GetTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetTransitionRouteGroupRequest + * @property {string|null} [name] GetTransitionRouteGroupRequest name + * @property {string|null} [languageCode] GetTransitionRouteGroupRequest languageCode + */ + + /** + * Constructs a new GetTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetTransitionRouteGroupRequest. + * @implements IGetTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest=} [properties] Properties to set + */ + function GetTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTransitionRouteGroupRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @instance + */ + GetTransitionRouteGroupRequest.prototype.name = ""; + + /** + * GetTransitionRouteGroupRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @instance + */ + GetTransitionRouteGroupRequest.prototype.languageCode = ""; + + /** + * Creates a new GetTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest instance + */ + GetTransitionRouteGroupRequest.create = function create(properties) { + return new GetTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest} message GetTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransitionRouteGroupRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest} message GetTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest + */ + GetTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest} message GetTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest"; + }; + + return GetTransitionRouteGroupRequest; + })(); + + v3.CreateTransitionRouteGroupRequest = (function() { + + /** + * Properties of a CreateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateTransitionRouteGroupRequest + * @property {string|null} [parent] CreateTransitionRouteGroupRequest parent + * @property {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null} [transitionRouteGroup] CreateTransitionRouteGroupRequest transitionRouteGroup + * @property {string|null} [languageCode] CreateTransitionRouteGroupRequest languageCode + */ + + /** + * Constructs a new CreateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateTransitionRouteGroupRequest. + * @implements ICreateTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest=} [properties] Properties to set + */ + function CreateTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTransitionRouteGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @instance + */ + CreateTransitionRouteGroupRequest.prototype.parent = ""; + + /** + * CreateTransitionRouteGroupRequest transitionRouteGroup. + * @member {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null|undefined} transitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @instance + */ + CreateTransitionRouteGroupRequest.prototype.transitionRouteGroup = null; + + /** + * CreateTransitionRouteGroupRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @instance + */ + CreateTransitionRouteGroupRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest instance + */ + CreateTransitionRouteGroupRequest.create = function create(properties) { + return new CreateTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest} message CreateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransitionRouteGroupRequest.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.transitionRouteGroup != null && Object.hasOwnProperty.call(message, "transitionRouteGroup")) + $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.encode(message.transitionRouteGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest} message CreateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify(message.transitionRouteGroup, long + 1); + if (error) + return "transitionRouteGroup." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest + */ + CreateTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.transitionRouteGroup != null) { + if (typeof object.transitionRouteGroup !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest.transitionRouteGroup: object expected"); + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.fromObject(object.transitionRouteGroup, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest} message CreateTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.transitionRouteGroup = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) + object.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.toObject(message.transitionRouteGroup, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest"; + }; + + return CreateTransitionRouteGroupRequest; + })(); + + v3.UpdateTransitionRouteGroupRequest = (function() { + + /** + * Properties of an UpdateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateTransitionRouteGroupRequest + * @property {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null} [transitionRouteGroup] UpdateTransitionRouteGroupRequest transitionRouteGroup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTransitionRouteGroupRequest updateMask + * @property {string|null} [languageCode] UpdateTransitionRouteGroupRequest languageCode + */ + + /** + * Constructs a new UpdateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateTransitionRouteGroupRequest. + * @implements IUpdateTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest=} [properties] Properties to set + */ + function UpdateTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTransitionRouteGroupRequest transitionRouteGroup. + * @member {google.cloud.dialogflow.cx.v3.ITransitionRouteGroup|null|undefined} transitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @instance + */ + UpdateTransitionRouteGroupRequest.prototype.transitionRouteGroup = null; + + /** + * UpdateTransitionRouteGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @instance + */ + UpdateTransitionRouteGroupRequest.prototype.updateMask = null; + + /** + * UpdateTransitionRouteGroupRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @instance + */ + UpdateTransitionRouteGroupRequest.prototype.languageCode = ""; + + /** + * Creates a new UpdateTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest instance + */ + UpdateTransitionRouteGroupRequest.create = function create(properties) { + return new UpdateTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest} message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransitionRouteGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitionRouteGroup != null && Object.hasOwnProperty.call(message, "transitionRouteGroup")) + $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.encode(message.transitionRouteGroup, 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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest} message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) { + var error = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.verify(message.transitionRouteGroup, long + 1); + if (error) + return "transitionRouteGroup." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an UpdateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest + */ + UpdateTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest(); + if (object.transitionRouteGroup != null) { + if (typeof object.transitionRouteGroup !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest.transitionRouteGroup: object expected"); + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.fromObject(object.transitionRouteGroup, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an UpdateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest} message UpdateTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transitionRouteGroup = null; + object.updateMask = null; + object.languageCode = ""; + } + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) + object.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3.TransitionRouteGroup.toObject(message.transitionRouteGroup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this UpdateTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest"; + }; + + return UpdateTransitionRouteGroupRequest; + })(); + + v3.DeleteTransitionRouteGroupRequest = (function() { + + /** + * Properties of a DeleteTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteTransitionRouteGroupRequest + * @property {string|null} [name] DeleteTransitionRouteGroupRequest name + * @property {boolean|null} [force] DeleteTransitionRouteGroupRequest force + */ + + /** + * Constructs a new DeleteTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteTransitionRouteGroupRequest. + * @implements IDeleteTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest=} [properties] Properties to set + */ + function DeleteTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTransitionRouteGroupRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @instance + */ + DeleteTransitionRouteGroupRequest.prototype.name = ""; + + /** + * DeleteTransitionRouteGroupRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @instance + */ + DeleteTransitionRouteGroupRequest.prototype.force = false; + + /** + * Creates a new DeleteTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest instance + */ + DeleteTransitionRouteGroupRequest.create = function create(properties) { + return new DeleteTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest} message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransitionRouteGroupRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest} message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest + */ + DeleteTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest} message DeleteTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest"; + }; + + return DeleteTransitionRouteGroupRequest; + })(); + + v3.Webhooks = (function() { + + /** + * Constructs a new Webhooks service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Webhooks + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Webhooks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Webhooks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Webhooks; + + /** + * Creates new Webhooks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Webhooks} RPC service. Useful where requests and/or responses are streamed. + */ + Webhooks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|listWebhooks}. + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @typedef ListWebhooksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListWebhooksResponse} [response] ListWebhooksResponse + */ + + /** + * Calls ListWebhooks. + * @function listWebhooks + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksRequest} request ListWebhooksRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooksCallback} callback Node-style callback called with the error, if any, and ListWebhooksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.listWebhooks = function listWebhooks(request, callback) { + return this.rpcCall(listWebhooks, $root.google.cloud.dialogflow.cx.v3.ListWebhooksRequest, $root.google.cloud.dialogflow.cx.v3.ListWebhooksResponse, request, callback); + }, "name", { value: "ListWebhooks" }); + + /** + * Calls ListWebhooks. + * @function listWebhooks + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksRequest} request ListWebhooksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|getWebhook}. + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @typedef GetWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Webhook} [response] Webhook + */ + + /** + * Calls GetWebhook. + * @function getWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetWebhookRequest} request GetWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Webhooks.GetWebhookCallback} callback Node-style callback called with the error, if any, and Webhook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.getWebhook = function getWebhook(request, callback) { + return this.rpcCall(getWebhook, $root.google.cloud.dialogflow.cx.v3.GetWebhookRequest, $root.google.cloud.dialogflow.cx.v3.Webhook, request, callback); + }, "name", { value: "GetWebhook" }); + + /** + * Calls GetWebhook. + * @function getWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetWebhookRequest} request GetWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|createWebhook}. + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @typedef CreateWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Webhook} [response] Webhook + */ + + /** + * Calls CreateWebhook. + * @function createWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateWebhookRequest} request CreateWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhookCallback} callback Node-style callback called with the error, if any, and Webhook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.createWebhook = function createWebhook(request, callback) { + return this.rpcCall(createWebhook, $root.google.cloud.dialogflow.cx.v3.CreateWebhookRequest, $root.google.cloud.dialogflow.cx.v3.Webhook, request, callback); + }, "name", { value: "CreateWebhook" }); + + /** + * Calls CreateWebhook. + * @function createWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateWebhookRequest} request CreateWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|updateWebhook}. + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @typedef UpdateWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Webhook} [response] Webhook + */ + + /** + * Calls UpdateWebhook. + * @function updateWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest} request UpdateWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhookCallback} callback Node-style callback called with the error, if any, and Webhook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.updateWebhook = function updateWebhook(request, callback) { + return this.rpcCall(updateWebhook, $root.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest, $root.google.cloud.dialogflow.cx.v3.Webhook, request, callback); + }, "name", { value: "UpdateWebhook" }); + + /** + * Calls UpdateWebhook. + * @function updateWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest} request UpdateWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Webhooks|deleteWebhook}. + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @typedef DeleteWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteWebhook. + * @function deleteWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest} request DeleteWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Webhooks.DeleteWebhookCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.deleteWebhook = function deleteWebhook(request, callback) { + return this.rpcCall(deleteWebhook, $root.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteWebhook" }); + + /** + * Calls DeleteWebhook. + * @function deleteWebhook + * @memberof google.cloud.dialogflow.cx.v3.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest} request DeleteWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Webhooks; + })(); + + v3.Webhook = (function() { + + /** + * Properties of a Webhook. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IWebhook + * @property {string|null} [name] Webhook name + * @property {string|null} [displayName] Webhook displayName + * @property {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null} [genericWebService] Webhook genericWebService + * @property {google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig|null} [serviceDirectory] Webhook serviceDirectory + * @property {google.protobuf.IDuration|null} [timeout] Webhook timeout + * @property {boolean|null} [disabled] Webhook disabled + */ + + /** + * Constructs a new Webhook. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Webhook. + * @implements IWebhook + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IWebhook=} [properties] Properties to set + */ + function Webhook(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Webhook name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + */ + Webhook.prototype.name = ""; + + /** + * Webhook displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + */ + Webhook.prototype.displayName = ""; + + /** + * Webhook genericWebService. + * @member {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null|undefined} genericWebService + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + */ + Webhook.prototype.genericWebService = null; + + /** + * Webhook serviceDirectory. + * @member {google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig|null|undefined} serviceDirectory + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + */ + Webhook.prototype.serviceDirectory = null; + + /** + * Webhook timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + */ + Webhook.prototype.timeout = null; + + /** + * Webhook disabled. + * @member {boolean} disabled + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + */ + Webhook.prototype.disabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Webhook webhook. + * @member {"genericWebService"|"serviceDirectory"|undefined} webhook + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + */ + Object.defineProperty(Webhook.prototype, "webhook", { + get: $util.oneOfGetter($oneOfFields = ["genericWebService", "serviceDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Webhook instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhook=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Webhook} Webhook instance + */ + Webhook.create = function create(properties) { + return new Webhook(properties); + }; + + /** + * Encodes the specified Webhook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhook} message Webhook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Webhook.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.genericWebService != null && Object.hasOwnProperty.call(message, "genericWebService")) + $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.encode(message.genericWebService, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disabled); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.serviceDirectory != null && Object.hasOwnProperty.call(message, "serviceDirectory")) + $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.encode(message.serviceDirectory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Webhook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhook} message Webhook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Webhook.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Webhook message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Webhook} Webhook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Webhook.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Webhook(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 4: { + message.genericWebService = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.serviceDirectory = $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Webhook message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Webhook} Webhook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Webhook.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Webhook message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Webhook.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) { + properties.webhook = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.verify(message.genericWebService, long + 1); + if (error) + return "genericWebService." + error; + } + } + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) { + if (properties.webhook === 1) + return "webhook: multiple values"; + properties.webhook = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.verify(message.serviceDirectory, long + 1); + if (error) + return "serviceDirectory." + error; + } + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout, long + 1); + if (error) + return "timeout." + error; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a Webhook message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Webhook} Webhook + */ + Webhook.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Webhook) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Webhook(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.genericWebService != null) { + if (typeof object.genericWebService !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.genericWebService: object expected"); + message.genericWebService = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.fromObject(object.genericWebService, long + 1); + } + if (object.serviceDirectory != null) { + if (typeof object.serviceDirectory !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.serviceDirectory: object expected"); + message.serviceDirectory = $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.fromObject(object.serviceDirectory, long + 1); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout, long + 1); + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a Webhook message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook} message Webhook + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Webhook.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.disabled = false; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) { + object.genericWebService = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.toObject(message.genericWebService, options); + if (options.oneofs) + object.webhook = "genericWebService"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) { + object.serviceDirectory = $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.toObject(message.serviceDirectory, options); + if (options.oneofs) + object.webhook = "serviceDirectory"; + } + return object; + }; + + /** + * Converts this Webhook to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @instance + * @returns {Object.} JSON object + */ + Webhook.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Webhook + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Webhook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Webhook"; + }; + + Webhook.GenericWebService = (function() { + + /** + * Properties of a GenericWebService. + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @interface IGenericWebService + * @property {string|null} [uri] GenericWebService uri + * @property {string|null} [username] GenericWebService username + * @property {string|null} [password] GenericWebService password + * @property {string|null} [secretVersionForUsernamePassword] GenericWebService secretVersionForUsernamePassword + * @property {Object.|null} [requestHeaders] GenericWebService requestHeaders + * @property {Object.|null} [secretVersionsForRequestHeaders] GenericWebService secretVersionsForRequestHeaders + * @property {Array.|null} [allowedCaCerts] GenericWebService allowedCaCerts + * @property {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig|null} [oauthConfig] GenericWebService oauthConfig + * @property {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth|null} [serviceAgentAuth] GenericWebService serviceAgentAuth + * @property {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] GenericWebService serviceAccountAuthConfig + * @property {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|null} [webhookType] GenericWebService webhookType + * @property {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|null} [httpMethod] GenericWebService httpMethod + * @property {string|null} [requestBody] GenericWebService requestBody + * @property {Object.|null} [parameterMapping] GenericWebService parameterMapping + */ + + /** + * Constructs a new GenericWebService. + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @classdesc Represents a GenericWebService. + * @implements IGenericWebService + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService=} [properties] Properties to set + */ + function GenericWebService(properties) { + this.requestHeaders = {}; + this.secretVersionsForRequestHeaders = {}; + this.allowedCaCerts = []; + this.parameterMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenericWebService uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.uri = ""; + + /** + * GenericWebService username. + * @member {string} username + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.username = ""; + + /** + * GenericWebService password. + * @member {string} password + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.password = ""; + + /** + * GenericWebService secretVersionForUsernamePassword. + * @member {string} secretVersionForUsernamePassword + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.secretVersionForUsernamePassword = ""; + + /** + * GenericWebService requestHeaders. + * @member {Object.} requestHeaders + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.requestHeaders = $util.emptyObject; + + /** + * GenericWebService secretVersionsForRequestHeaders. + * @member {Object.} secretVersionsForRequestHeaders + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.secretVersionsForRequestHeaders = $util.emptyObject; + + /** + * GenericWebService allowedCaCerts. + * @member {Array.} allowedCaCerts + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.allowedCaCerts = $util.emptyArray; + + /** + * GenericWebService oauthConfig. + * @member {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig|null|undefined} oauthConfig + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.oauthConfig = null; + + /** + * GenericWebService serviceAgentAuth. + * @member {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth} serviceAgentAuth + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.serviceAgentAuth = 0; + + /** + * GenericWebService serviceAccountAuthConfig. + * @member {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.serviceAccountAuthConfig = null; + + /** + * GenericWebService webhookType. + * @member {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType} webhookType + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.webhookType = 0; + + /** + * GenericWebService httpMethod. + * @member {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod} httpMethod + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.httpMethod = 0; + + /** + * GenericWebService requestBody. + * @member {string} requestBody + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.requestBody = ""; + + /** + * GenericWebService parameterMapping. + * @member {Object.} parameterMapping + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.parameterMapping = $util.emptyObject; + + /** + * Creates a new GenericWebService instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService} GenericWebService instance + */ + GenericWebService.create = function create(properties) { + return new GenericWebService(properties); + }; + + /** + * Encodes the specified GenericWebService message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService} message GenericWebService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenericWebService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.password); + if (message.requestHeaders != null && Object.hasOwnProperty.call(message, "requestHeaders")) + for (var keys = Object.keys(message.requestHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.requestHeaders[keys[i]]).ldelim(); + if (message.allowedCaCerts != null && message.allowedCaCerts.length) + for (var i = 0; i < message.allowedCaCerts.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.allowedCaCerts[i]); + if (message.webhookType != null && Object.hasOwnProperty.call(message, "webhookType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookType); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.httpMethod); + if (message.requestBody != null && Object.hasOwnProperty.call(message, "requestBody")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.requestBody); + if (message.parameterMapping != null && Object.hasOwnProperty.call(message, "parameterMapping")) + for (var keys = Object.keys(message.parameterMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameterMapping[keys[i]]).ldelim(); + if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) + $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.serviceAgentAuth != null && Object.hasOwnProperty.call(message, "serviceAgentAuth")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.serviceAgentAuth); + if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) + $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.secretVersionForUsernamePassword != null && Object.hasOwnProperty.call(message, "secretVersionForUsernamePassword")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.secretVersionForUsernamePassword); + if (message.secretVersionsForRequestHeaders != null && Object.hasOwnProperty.call(message, "secretVersionsForRequestHeaders")) + for (var keys = Object.keys(message.secretVersionsForRequestHeaders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.encode(message.secretVersionsForRequestHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified GenericWebService message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService} message GenericWebService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenericWebService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenericWebService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService} GenericWebService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenericWebService.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.username = reader.string(); + break; + } + case 3: { + message.password = reader.string(); + break; + } + case 19: { + message.secretVersionForUsernamePassword = reader.string(); + break; + } + case 4: { + if (message.requestHeaders === $util.emptyObject) + message.requestHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.requestHeaders, key); + message.requestHeaders[key] = value; + break; + } + case 20: { + if (message.secretVersionsForRequestHeaders === $util.emptyObject) + message.secretVersionsForRequestHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.secretVersionsForRequestHeaders, key); + message.secretVersionsForRequestHeaders[key] = value; + break; + } + case 5: { + if (!(message.allowedCaCerts && message.allowedCaCerts.length)) + message.allowedCaCerts = []; + message.allowedCaCerts.push(reader.bytes()); + break; + } + case 11: { + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.serviceAgentAuth = reader.int32(); + break; + } + case 18: { + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.webhookType = reader.int32(); + break; + } + case 7: { + message.httpMethod = reader.int32(); + break; + } + case 8: { + message.requestBody = reader.string(); + break; + } + case 9: { + if (message.parameterMapping === $util.emptyObject) + message.parameterMapping = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameterMapping, key); + message.parameterMapping[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenericWebService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService} GenericWebService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenericWebService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenericWebService message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenericWebService.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.secretVersionForUsernamePassword != null && message.hasOwnProperty("secretVersionForUsernamePassword")) + if (!$util.isString(message.secretVersionForUsernamePassword)) + return "secretVersionForUsernamePassword: string expected"; + if (message.requestHeaders != null && message.hasOwnProperty("requestHeaders")) { + if (!$util.isObject(message.requestHeaders)) + return "requestHeaders: object expected"; + var key = Object.keys(message.requestHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.requestHeaders[key[i]])) + return "requestHeaders: string{k:string} expected"; + } + if (message.secretVersionsForRequestHeaders != null && message.hasOwnProperty("secretVersionsForRequestHeaders")) { + if (!$util.isObject(message.secretVersionsForRequestHeaders)) + return "secretVersionsForRequestHeaders: object expected"; + var key = Object.keys(message.secretVersionsForRequestHeaders); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.verify(message.secretVersionsForRequestHeaders[key[i]], long + 1); + if (error) + return "secretVersionsForRequestHeaders." + error; + } + } + if (message.allowedCaCerts != null && message.hasOwnProperty("allowedCaCerts")) { + if (!Array.isArray(message.allowedCaCerts)) + return "allowedCaCerts: array expected"; + for (var i = 0; i < message.allowedCaCerts.length; ++i) + if (!(message.allowedCaCerts[i] && typeof message.allowedCaCerts[i].length === "number" || $util.isString(message.allowedCaCerts[i]))) + return "allowedCaCerts: buffer[] expected"; + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.verify(message.oauthConfig, long + 1); + if (error) + return "oauthConfig." + error; + } + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + switch (message.serviceAgentAuth) { + default: + return "serviceAgentAuth: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig, long + 1); + if (error) + return "serviceAccountAuthConfig." + error; + } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + switch (message.webhookType) { + default: + return "webhookType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + switch (message.httpMethod) { + default: + return "httpMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + if (!$util.isString(message.requestBody)) + return "requestBody: string expected"; + if (message.parameterMapping != null && message.hasOwnProperty("parameterMapping")) { + if (!$util.isObject(message.parameterMapping)) + return "parameterMapping: object expected"; + var key = Object.keys(message.parameterMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameterMapping[key[i]])) + return "parameterMapping: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GenericWebService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService} GenericWebService + */ + GenericWebService.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.secretVersionForUsernamePassword != null) + message.secretVersionForUsernamePassword = String(object.secretVersionForUsernamePassword); + if (object.requestHeaders) { + if (typeof object.requestHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.requestHeaders: object expected"); + message.requestHeaders = {}; + for (var keys = Object.keys(object.requestHeaders), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.requestHeaders, keys[i]); + message.requestHeaders[keys[i]] = String(object.requestHeaders[keys[i]]); + } + } + if (object.secretVersionsForRequestHeaders) { + if (typeof object.secretVersionsForRequestHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.secretVersionsForRequestHeaders: object expected"); + message.secretVersionsForRequestHeaders = {}; + for (var keys = Object.keys(object.secretVersionsForRequestHeaders), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.secretVersionsForRequestHeaders, keys[i]); + if (typeof object.secretVersionsForRequestHeaders[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.secretVersionsForRequestHeaders: object expected"); + message.secretVersionsForRequestHeaders[keys[i]] = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.fromObject(object.secretVersionsForRequestHeaders[keys[i]], long + 1); + } + } + if (object.allowedCaCerts) { + if (!Array.isArray(object.allowedCaCerts)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.allowedCaCerts: array expected"); + message.allowedCaCerts = []; + for (var i = 0; i < object.allowedCaCerts.length; ++i) + if (typeof object.allowedCaCerts[i] === "string") + $util.base64.decode(object.allowedCaCerts[i], message.allowedCaCerts[i] = $util.newBuffer($util.base64.length(object.allowedCaCerts[i])), 0); + else if (object.allowedCaCerts[i].length >= 0) + message.allowedCaCerts[i] = object.allowedCaCerts[i]; + } + if (object.oauthConfig != null) { + if (typeof object.oauthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.oauthConfig: object expected"); + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.fromObject(object.oauthConfig, long + 1); + } + switch (object.serviceAgentAuth) { + default: + if (typeof object.serviceAgentAuth === "number") { + message.serviceAgentAuth = object.serviceAgentAuth; + break; + } + break; + case "SERVICE_AGENT_AUTH_UNSPECIFIED": + case 0: + message.serviceAgentAuth = 0; + break; + case "NONE": + case 1: + message.serviceAgentAuth = 1; + break; + case "ID_TOKEN": + case 2: + message.serviceAgentAuth = 2; + break; + case "ACCESS_TOKEN": + case 3: + message.serviceAgentAuth = 3; + break; + } + if (object.serviceAccountAuthConfig != null) { + if (typeof object.serviceAccountAuthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.serviceAccountAuthConfig: object expected"); + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig, long + 1); + } + switch (object.webhookType) { + default: + if (typeof object.webhookType === "number") { + message.webhookType = object.webhookType; + break; + } + break; + case "WEBHOOK_TYPE_UNSPECIFIED": + case 0: + message.webhookType = 0; + break; + case "STANDARD": + case 1: + message.webhookType = 1; + break; + case "FLEXIBLE": + case 2: + message.webhookType = 2; + break; + } + switch (object.httpMethod) { + default: + if (typeof object.httpMethod === "number") { + message.httpMethod = object.httpMethod; + break; + } + break; + case "HTTP_METHOD_UNSPECIFIED": + case 0: + message.httpMethod = 0; + break; + case "POST": + case 1: + message.httpMethod = 1; + break; + case "GET": + case 2: + message.httpMethod = 2; + break; + case "HEAD": + case 3: + message.httpMethod = 3; + break; + case "PUT": + case 4: + message.httpMethod = 4; + break; + case "DELETE": + case 5: + message.httpMethod = 5; + break; + case "PATCH": + case 6: + message.httpMethod = 6; + break; + case "OPTIONS": + case 7: + message.httpMethod = 7; + break; + } + if (object.requestBody != null) + message.requestBody = String(object.requestBody); + if (object.parameterMapping) { + if (typeof object.parameterMapping !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.parameterMapping: object expected"); + message.parameterMapping = {}; + for (var keys = Object.keys(object.parameterMapping), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameterMapping, keys[i]); + message.parameterMapping[keys[i]] = String(object.parameterMapping[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenericWebService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService} message GenericWebService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenericWebService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedCaCerts = []; + if (options.objects || options.defaults) { + object.requestHeaders = {}; + object.parameterMapping = {}; + object.secretVersionsForRequestHeaders = {}; + } + if (options.defaults) { + object.uri = ""; + object.username = ""; + object.password = ""; + object.webhookType = options.enums === String ? "WEBHOOK_TYPE_UNSPECIFIED" : 0; + object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; + object.requestBody = ""; + object.oauthConfig = null; + object.serviceAgentAuth = options.enums === String ? "SERVICE_AGENT_AUTH_UNSPECIFIED" : 0; + object.serviceAccountAuthConfig = null; + object.secretVersionForUsernamePassword = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + var keys2; + if (message.requestHeaders && (keys2 = Object.keys(message.requestHeaders)).length) { + object.requestHeaders = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.requestHeaders, keys2[j]); + object.requestHeaders[keys2[j]] = message.requestHeaders[keys2[j]]; + } + } + if (message.allowedCaCerts && message.allowedCaCerts.length) { + object.allowedCaCerts = []; + for (var j = 0; j < message.allowedCaCerts.length; ++j) + object.allowedCaCerts[j] = options.bytes === String ? $util.base64.encode(message.allowedCaCerts[j], 0, message.allowedCaCerts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.allowedCaCerts[j]) : message.allowedCaCerts[j]; + } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + object.webhookType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType[message.webhookType] === undefined ? message.webhookType : $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType[message.webhookType] : message.webhookType; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod[message.httpMethod] : message.httpMethod; + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + object.requestBody = message.requestBody; + if (message.parameterMapping && (keys2 = Object.keys(message.parameterMapping)).length) { + object.parameterMapping = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameterMapping, keys2[j]); + object.parameterMapping[keys2[j]] = message.parameterMapping[keys2[j]]; + } + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) + object.oauthConfig = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.toObject(message.oauthConfig, options); + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + object.serviceAgentAuth = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth[message.serviceAgentAuth] === undefined ? message.serviceAgentAuth : $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth[message.serviceAgentAuth] : message.serviceAgentAuth; + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) + object.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); + if (message.secretVersionForUsernamePassword != null && message.hasOwnProperty("secretVersionForUsernamePassword")) + object.secretVersionForUsernamePassword = message.secretVersionForUsernamePassword; + if (message.secretVersionsForRequestHeaders && (keys2 = Object.keys(message.secretVersionsForRequestHeaders)).length) { + object.secretVersionsForRequestHeaders = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.secretVersionsForRequestHeaders, keys2[j]); + object.secretVersionsForRequestHeaders[keys2[j]] = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.toObject(message.secretVersionsForRequestHeaders[keys2[j]], options); + } + } + return object; + }; + + /** + * Converts this GenericWebService to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + * @returns {Object.} JSON object + */ + GenericWebService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenericWebService + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenericWebService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Webhook.GenericWebService"; + }; + + GenericWebService.SecretVersionHeaderValue = (function() { + + /** + * Properties of a SecretVersionHeaderValue. + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @interface ISecretVersionHeaderValue + * @property {string|null} [secretVersion] SecretVersionHeaderValue secretVersion + */ + + /** + * Constructs a new SecretVersionHeaderValue. + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @classdesc Represents a SecretVersionHeaderValue. + * @implements ISecretVersionHeaderValue + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue=} [properties] Properties to set + */ + function SecretVersionHeaderValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecretVersionHeaderValue secretVersion. + * @member {string} secretVersion + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @instance + */ + SecretVersionHeaderValue.prototype.secretVersion = ""; + + /** + * Creates a new SecretVersionHeaderValue instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue instance + */ + SecretVersionHeaderValue.create = function create(properties) { + return new SecretVersionHeaderValue(properties); + }; + + /** + * Encodes the specified SecretVersionHeaderValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue} message SecretVersionHeaderValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVersionHeaderValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secretVersion != null && Object.hasOwnProperty.call(message, "secretVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secretVersion); + return writer; + }; + + /** + * Encodes the specified SecretVersionHeaderValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ISecretVersionHeaderValue} message SecretVersionHeaderValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVersionHeaderValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVersionHeaderValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.secretVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVersionHeaderValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecretVersionHeaderValue message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretVersionHeaderValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + if (!$util.isString(message.secretVersion)) + return "secretVersion: string expected"; + return null; + }; + + /** + * Creates a SecretVersionHeaderValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue + */ + SecretVersionHeaderValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue(); + if (object.secretVersion != null) + message.secretVersion = String(object.secretVersion); + return message; + }; + + /** + * Creates a plain object from a SecretVersionHeaderValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue} message SecretVersionHeaderValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretVersionHeaderValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.secretVersion = ""; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + object.secretVersion = message.secretVersion; + return object; + }; + + /** + * Converts this SecretVersionHeaderValue to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @instance + * @returns {Object.} JSON object + */ + SecretVersionHeaderValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretVersionHeaderValue + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretVersionHeaderValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue"; + }; + + return SecretVersionHeaderValue; + })(); + + GenericWebService.OAuthConfig = (function() { + + /** + * Properties of a OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @interface IOAuthConfig + * @property {string|null} [clientId] OAuthConfig clientId + * @property {string|null} [clientSecret] OAuthConfig clientSecret + * @property {string|null} [secretVersionForClientSecret] OAuthConfig secretVersionForClientSecret + * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint + * @property {Array.|null} [scopes] OAuthConfig scopes + */ + + /** + * Constructs a new OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @classdesc Represents a OAuthConfig. + * @implements IOAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig=} [properties] Properties to set + */ + function OAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthConfig clientId. + * @member {string} clientId + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientId = ""; + + /** + * OAuthConfig clientSecret. + * @member {string} clientSecret + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientSecret = ""; + + /** + * OAuthConfig secretVersionForClientSecret. + * @member {string} secretVersionForClientSecret + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.secretVersionForClientSecret = ""; + + /** + * OAuthConfig tokenEndpoint. + * @member {string} tokenEndpoint + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.tokenEndpoint = ""; + + /** + * OAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig} OAuthConfig instance + */ + OAuthConfig.create = function create(properties) { + return new OAuthConfig(properties); + }; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientSecret != null && Object.hasOwnProperty.call(message, "clientSecret")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientSecret); + if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tokenEndpoint); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.scopes[i]); + if (message.secretVersionForClientSecret != null && Object.hasOwnProperty.call(message, "secretVersionForClientSecret")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.secretVersionForClientSecret); + return writer; + }; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.clientSecret = reader.string(); + break; + } + case 5: { + message.secretVersionForClientSecret = reader.string(); + break; + } + case 3: { + message.tokenEndpoint = reader.string(); + break; + } + case 4: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + if (!$util.isString(message.clientSecret)) + return "clientSecret: string expected"; + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + if (!$util.isString(message.secretVersionForClientSecret)) + return "secretVersionForClientSecret: string expected"; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + if (!$util.isString(message.tokenEndpoint)) + return "tokenEndpoint: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig} OAuthConfig + */ + OAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecret != null) + message.clientSecret = String(object.clientSecret); + if (object.secretVersionForClientSecret != null) + message.secretVersionForClientSecret = String(object.secretVersionForClientSecret); + if (object.tokenEndpoint != null) + message.tokenEndpoint = String(object.tokenEndpoint); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig} message OAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.clientId = ""; + object.clientSecret = ""; + object.tokenEndpoint = ""; + object.secretVersionForClientSecret = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + object.clientSecret = message.clientSecret; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + object.tokenEndpoint = message.tokenEndpoint; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + object.secretVersionForClientSecret = message.secretVersionForClientSecret; + return object; + }; + + /** + * Converts this OAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @instance + * @returns {Object.} JSON object + */ + OAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig"; + }; + + return OAuthConfig; + })(); + + /** + * ServiceAgentAuth enum. + * @name google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth + * @enum {number} + * @property {number} SERVICE_AGENT_AUTH_UNSPECIFIED=0 SERVICE_AGENT_AUTH_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} ID_TOKEN=2 ID_TOKEN value + * @property {number} ACCESS_TOKEN=3 ACCESS_TOKEN value + */ + GenericWebService.ServiceAgentAuth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_AGENT_AUTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "ID_TOKEN"] = 2; + values[valuesById[3] = "ACCESS_TOKEN"] = 3; + return values; + })(); + + GenericWebService.ServiceAccountAuthConfig = (function() { + + /** + * Properties of a ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @interface IServiceAccountAuthConfig + * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount + */ + + /** + * Constructs a new ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @classdesc Represents a ServiceAccountAuthConfig. + * @implements IServiceAccountAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig=} [properties] Properties to set + */ + function ServiceAccountAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountAuthConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.serviceAccount = ""; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance + */ + ServiceAccountAuthConfig.create = function create(properties) { + return new ServiceAccountAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig + */ + ServiceAccountAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig} message ServiceAccountAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceAccount = ""; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig"; + }; + + return ServiceAccountAuthConfig; + })(); + + /** + * WebhookType enum. + * @name google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType + * @enum {number} + * @property {number} WEBHOOK_TYPE_UNSPECIFIED=0 WEBHOOK_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} FLEXIBLE=2 FLEXIBLE value + */ + GenericWebService.WebhookType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEBHOOK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "FLEXIBLE"] = 2; + return values; + })(); + + /** + * HttpMethod enum. + * @name google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod + * @enum {number} + * @property {number} HTTP_METHOD_UNSPECIFIED=0 HTTP_METHOD_UNSPECIFIED value + * @property {number} POST=1 POST value + * @property {number} GET=2 GET value + * @property {number} HEAD=3 HEAD value + * @property {number} PUT=4 PUT value + * @property {number} DELETE=5 DELETE value + * @property {number} PATCH=6 PATCH value + * @property {number} OPTIONS=7 OPTIONS value + */ + GenericWebService.HttpMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HTTP_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "POST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "HEAD"] = 3; + values[valuesById[4] = "PUT"] = 4; + values[valuesById[5] = "DELETE"] = 5; + values[valuesById[6] = "PATCH"] = 6; + values[valuesById[7] = "OPTIONS"] = 7; + return values; + })(); + + return GenericWebService; + })(); + + Webhook.ServiceDirectoryConfig = (function() { + + /** + * Properties of a ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @interface IServiceDirectoryConfig + * @property {string|null} [service] ServiceDirectoryConfig service + * @property {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null} [genericWebService] ServiceDirectoryConfig genericWebService + */ + + /** + * Constructs a new ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3.Webhook + * @classdesc Represents a ServiceDirectoryConfig. + * @implements IServiceDirectoryConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig=} [properties] Properties to set + */ + function ServiceDirectoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDirectoryConfig service. + * @member {string} service + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.service = ""; + + /** + * ServiceDirectoryConfig genericWebService. + * @member {google.cloud.dialogflow.cx.v3.Webhook.IGenericWebService|null|undefined} genericWebService + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.genericWebService = null; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig instance + */ + ServiceDirectoryConfig.create = function create(properties) { + return new ServiceDirectoryConfig(properties); + }; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.genericWebService != null && Object.hasOwnProperty.call(message, "genericWebService")) + $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.encode(message.genericWebService, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 2: { + message.genericWebService = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDirectoryConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDirectoryConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.verify(message.genericWebService, long + 1); + if (error) + return "genericWebService." + error; + } + return null; + }; + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig + */ + ServiceDirectoryConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.genericWebService != null) { + if (typeof object.genericWebService !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig.genericWebService: object expected"); + message.genericWebService = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.fromObject(object.genericWebService, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig} message ServiceDirectoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDirectoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.service = ""; + object.genericWebService = null; + } + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) + object.genericWebService = $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.toObject(message.genericWebService, options); + return object; + }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceDirectoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig"; + }; + + return ServiceDirectoryConfig; + })(); + + return Webhook; + })(); + + v3.ListWebhooksRequest = (function() { + + /** + * Properties of a ListWebhooksRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListWebhooksRequest + * @property {string|null} [parent] ListWebhooksRequest parent + * @property {number|null} [pageSize] ListWebhooksRequest pageSize + * @property {string|null} [pageToken] ListWebhooksRequest pageToken + */ + + /** + * Constructs a new ListWebhooksRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListWebhooksRequest. + * @implements IListWebhooksRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksRequest=} [properties] Properties to set + */ + function ListWebhooksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWebhooksRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @instance + */ + ListWebhooksRequest.prototype.parent = ""; + + /** + * ListWebhooksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @instance + */ + ListWebhooksRequest.prototype.pageSize = 0; + + /** + * ListWebhooksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @instance + */ + ListWebhooksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWebhooksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksRequest} ListWebhooksRequest instance + */ + ListWebhooksRequest.create = function create(properties) { + return new ListWebhooksRequest(properties); + }; + + /** + * Encodes the specified ListWebhooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksRequest} message ListWebhooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksRequest.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); + return writer; + }; + + /** + * Encodes the specified ListWebhooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksRequest} message ListWebhooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksRequest} ListWebhooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksRequest} ListWebhooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWebhooksRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWebhooksRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListWebhooksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksRequest} ListWebhooksRequest + */ + ListWebhooksRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListWebhooksRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListWebhooksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListWebhooksRequest} message ListWebhooksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWebhooksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListWebhooksRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @instance + * @returns {Object.} JSON object + */ + ListWebhooksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWebhooksRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWebhooksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListWebhooksRequest"; + }; + + return ListWebhooksRequest; + })(); + + v3.ListWebhooksResponse = (function() { + + /** + * Properties of a ListWebhooksResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListWebhooksResponse + * @property {Array.|null} [webhooks] ListWebhooksResponse webhooks + * @property {string|null} [nextPageToken] ListWebhooksResponse nextPageToken + */ + + /** + * Constructs a new ListWebhooksResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListWebhooksResponse. + * @implements IListWebhooksResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksResponse=} [properties] Properties to set + */ + function ListWebhooksResponse(properties) { + this.webhooks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWebhooksResponse webhooks. + * @member {Array.} webhooks + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @instance + */ + ListWebhooksResponse.prototype.webhooks = $util.emptyArray; + + /** + * ListWebhooksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @instance + */ + ListWebhooksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListWebhooksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksResponse} ListWebhooksResponse instance + */ + ListWebhooksResponse.create = function create(properties) { + return new ListWebhooksResponse(properties); + }; + + /** + * Encodes the specified ListWebhooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksResponse} message ListWebhooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhooks != null && message.webhooks.length) + for (var i = 0; i < message.webhooks.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Webhook.encode(message.webhooks[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 ListWebhooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListWebhooksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListWebhooksResponse} message ListWebhooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksResponse} ListWebhooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListWebhooksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.webhooks && message.webhooks.length)) + message.webhooks = []; + message.webhooks.push($root.google.cloud.dialogflow.cx.v3.Webhook.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksResponse} ListWebhooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWebhooksResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWebhooksResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.webhooks != null && message.hasOwnProperty("webhooks")) { + if (!Array.isArray(message.webhooks)) + return "webhooks: array expected"; + for (var i = 0; i < message.webhooks.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.verify(message.webhooks[i], long + 1); + if (error) + return "webhooks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListWebhooksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListWebhooksResponse} ListWebhooksResponse + */ + ListWebhooksResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListWebhooksResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListWebhooksResponse(); + if (object.webhooks) { + if (!Array.isArray(object.webhooks)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListWebhooksResponse.webhooks: array expected"); + message.webhooks = []; + for (var i = 0; i < object.webhooks.length; ++i) { + if (typeof object.webhooks[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListWebhooksResponse.webhooks: object expected"); + message.webhooks[i] = $root.google.cloud.dialogflow.cx.v3.Webhook.fromObject(object.webhooks[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListWebhooksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListWebhooksResponse} message ListWebhooksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWebhooksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.webhooks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.webhooks && message.webhooks.length) { + object.webhooks = []; + for (var j = 0; j < message.webhooks.length; ++j) + object.webhooks[j] = $root.google.cloud.dialogflow.cx.v3.Webhook.toObject(message.webhooks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListWebhooksResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @instance + * @returns {Object.} JSON object + */ + ListWebhooksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWebhooksResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListWebhooksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWebhooksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListWebhooksResponse"; + }; + + return ListWebhooksResponse; + })(); + + v3.GetWebhookRequest = (function() { + + /** + * Properties of a GetWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetWebhookRequest + * @property {string|null} [name] GetWebhookRequest name + */ + + /** + * Constructs a new GetWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetWebhookRequest. + * @implements IGetWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetWebhookRequest=} [properties] Properties to set + */ + function GetWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWebhookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @instance + */ + GetWebhookRequest.prototype.name = ""; + + /** + * Creates a new GetWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetWebhookRequest} GetWebhookRequest instance + */ + GetWebhookRequest.create = function create(properties) { + return new GetWebhookRequest(properties); + }; + + /** + * Encodes the specified GetWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetWebhookRequest} message GetWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWebhookRequest.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 GetWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetWebhookRequest} message GetWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetWebhookRequest} GetWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetWebhookRequest} GetWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetWebhookRequest} GetWebhookRequest + */ + GetWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetWebhookRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetWebhookRequest} message GetWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWebhookRequest.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 GetWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + GetWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetWebhookRequest"; + }; + + return GetWebhookRequest; + })(); + + v3.CreateWebhookRequest = (function() { + + /** + * Properties of a CreateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateWebhookRequest + * @property {string|null} [parent] CreateWebhookRequest parent + * @property {google.cloud.dialogflow.cx.v3.IWebhook|null} [webhook] CreateWebhookRequest webhook + */ + + /** + * Constructs a new CreateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateWebhookRequest. + * @implements ICreateWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateWebhookRequest=} [properties] Properties to set + */ + function CreateWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWebhookRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @instance + */ + CreateWebhookRequest.prototype.parent = ""; + + /** + * CreateWebhookRequest webhook. + * @member {google.cloud.dialogflow.cx.v3.IWebhook|null|undefined} webhook + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @instance + */ + CreateWebhookRequest.prototype.webhook = null; + + /** + * Creates a new CreateWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateWebhookRequest} CreateWebhookRequest instance + */ + CreateWebhookRequest.create = function create(properties) { + return new CreateWebhookRequest(properties); + }; + + /** + * Encodes the specified CreateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateWebhookRequest} message CreateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWebhookRequest.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.webhook != null && Object.hasOwnProperty.call(message, "webhook")) + $root.google.cloud.dialogflow.cx.v3.Webhook.encode(message.webhook, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateWebhookRequest} message CreateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateWebhookRequest} CreateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.webhook = $root.google.cloud.dialogflow.cx.v3.Webhook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateWebhookRequest} CreateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.webhook != null && message.hasOwnProperty("webhook")) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.verify(message.webhook, long + 1); + if (error) + return "webhook." + error; + } + return null; + }; + + /** + * Creates a CreateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateWebhookRequest} CreateWebhookRequest + */ + CreateWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateWebhookRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.webhook != null) { + if (typeof object.webhook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateWebhookRequest.webhook: object expected"); + message.webhook = $root.google.cloud.dialogflow.cx.v3.Webhook.fromObject(object.webhook, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateWebhookRequest} message CreateWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.webhook = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.webhook != null && message.hasOwnProperty("webhook")) + object.webhook = $root.google.cloud.dialogflow.cx.v3.Webhook.toObject(message.webhook, options); + return object; + }; + + /** + * Converts this CreateWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateWebhookRequest"; + }; + + return CreateWebhookRequest; + })(); + + v3.UpdateWebhookRequest = (function() { + + /** + * Properties of an UpdateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateWebhookRequest + * @property {google.cloud.dialogflow.cx.v3.IWebhook|null} [webhook] UpdateWebhookRequest webhook + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWebhookRequest updateMask + */ + + /** + * Constructs a new UpdateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateWebhookRequest. + * @implements IUpdateWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest=} [properties] Properties to set + */ + function UpdateWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWebhookRequest webhook. + * @member {google.cloud.dialogflow.cx.v3.IWebhook|null|undefined} webhook + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @instance + */ + UpdateWebhookRequest.prototype.webhook = null; + + /** + * UpdateWebhookRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @instance + */ + UpdateWebhookRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateWebhookRequest} UpdateWebhookRequest instance + */ + UpdateWebhookRequest.create = function create(properties) { + return new UpdateWebhookRequest(properties); + }; + + /** + * Encodes the specified UpdateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest} message UpdateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWebhookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhook != null && Object.hasOwnProperty.call(message, "webhook")) + $root.google.cloud.dialogflow.cx.v3.Webhook.encode(message.webhook, 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 UpdateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest} message UpdateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateWebhookRequest} UpdateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.webhook = $root.google.cloud.dialogflow.cx.v3.Webhook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateWebhookRequest} UpdateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.webhook != null && message.hasOwnProperty("webhook")) { + var error = $root.google.cloud.dialogflow.cx.v3.Webhook.verify(message.webhook, long + 1); + if (error) + return "webhook." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateWebhookRequest} UpdateWebhookRequest + */ + UpdateWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest(); + if (object.webhook != null) { + if (typeof object.webhook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateWebhookRequest.webhook: object expected"); + message.webhook = $root.google.cloud.dialogflow.cx.v3.Webhook.fromObject(object.webhook, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateWebhookRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateWebhookRequest} message UpdateWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.webhook = null; + object.updateMask = null; + } + if (message.webhook != null && message.hasOwnProperty("webhook")) + object.webhook = $root.google.cloud.dialogflow.cx.v3.Webhook.toObject(message.webhook, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateWebhookRequest"; + }; + + return UpdateWebhookRequest; + })(); + + v3.DeleteWebhookRequest = (function() { + + /** + * Properties of a DeleteWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteWebhookRequest + * @property {string|null} [name] DeleteWebhookRequest name + * @property {boolean|null} [force] DeleteWebhookRequest force + */ + + /** + * Constructs a new DeleteWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteWebhookRequest. + * @implements IDeleteWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest=} [properties] Properties to set + */ + function DeleteWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWebhookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @instance + */ + DeleteWebhookRequest.prototype.name = ""; + + /** + * DeleteWebhookRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @instance + */ + DeleteWebhookRequest.prototype.force = false; + + /** + * Creates a new DeleteWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteWebhookRequest} DeleteWebhookRequest instance + */ + DeleteWebhookRequest.create = function create(properties) { + return new DeleteWebhookRequest(properties); + }; + + /** + * Encodes the specified DeleteWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest} message DeleteWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWebhookRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest} message DeleteWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteWebhookRequest} DeleteWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteWebhookRequest} DeleteWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteWebhookRequest} DeleteWebhookRequest + */ + DeleteWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteWebhookRequest} message DeleteWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteWebhookRequest"; + }; + + return DeleteWebhookRequest; + })(); + + v3.WebhookRequest = (function() { + + /** + * Properties of a WebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IWebhookRequest + * @property {string|null} [detectIntentResponseId] WebhookRequest detectIntentResponseId + * @property {string|null} [text] WebhookRequest text + * @property {string|null} [triggerIntent] WebhookRequest triggerIntent + * @property {string|null} [transcript] WebhookRequest transcript + * @property {string|null} [triggerEvent] WebhookRequest triggerEvent + * @property {string|null} [dtmfDigits] WebhookRequest dtmfDigits + * @property {string|null} [languageCode] WebhookRequest languageCode + * @property {google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo|null} [fulfillmentInfo] WebhookRequest fulfillmentInfo + * @property {google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo|null} [intentInfo] WebhookRequest intentInfo + * @property {google.cloud.dialogflow.cx.v3.IPageInfo|null} [pageInfo] WebhookRequest pageInfo + * @property {google.cloud.dialogflow.cx.v3.ISessionInfo|null} [sessionInfo] WebhookRequest sessionInfo + * @property {Array.|null} [messages] WebhookRequest messages + * @property {google.protobuf.IStruct|null} [payload] WebhookRequest payload + * @property {google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult|null} [sentimentAnalysisResult] WebhookRequest sentimentAnalysisResult + * @property {google.cloud.dialogflow.cx.v3.ILanguageInfo|null} [languageInfo] WebhookRequest languageInfo + */ + + /** + * Constructs a new WebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a WebhookRequest. + * @implements IWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IWebhookRequest=} [properties] Properties to set + */ + function WebhookRequest(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookRequest detectIntentResponseId. + * @member {string} detectIntentResponseId + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.detectIntentResponseId = ""; + + /** + * WebhookRequest text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.text = null; + + /** + * WebhookRequest triggerIntent. + * @member {string|null|undefined} triggerIntent + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.triggerIntent = null; + + /** + * WebhookRequest transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.transcript = null; + + /** + * WebhookRequest triggerEvent. + * @member {string|null|undefined} triggerEvent + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.triggerEvent = null; + + /** + * WebhookRequest dtmfDigits. + * @member {string|null|undefined} dtmfDigits + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.dtmfDigits = null; + + /** + * WebhookRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.languageCode = ""; + + /** + * WebhookRequest fulfillmentInfo. + * @member {google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo|null|undefined} fulfillmentInfo + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.fulfillmentInfo = null; + + /** + * WebhookRequest intentInfo. + * @member {google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo|null|undefined} intentInfo + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.intentInfo = null; + + /** + * WebhookRequest pageInfo. + * @member {google.cloud.dialogflow.cx.v3.IPageInfo|null|undefined} pageInfo + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.pageInfo = null; + + /** + * WebhookRequest sessionInfo. + * @member {google.cloud.dialogflow.cx.v3.ISessionInfo|null|undefined} sessionInfo + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.sessionInfo = null; + + /** + * WebhookRequest messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.messages = $util.emptyArray; + + /** + * WebhookRequest payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.payload = null; + + /** + * WebhookRequest sentimentAnalysisResult. + * @member {google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.sentimentAnalysisResult = null; + + /** + * WebhookRequest languageInfo. + * @member {google.cloud.dialogflow.cx.v3.ILanguageInfo|null|undefined} languageInfo + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + WebhookRequest.prototype.languageInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WebhookRequest query. + * @member {"text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmfDigits"|undefined} query + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + */ + Object.defineProperty(WebhookRequest.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["text", "triggerIntent", "transcript", "triggerEvent", "dtmfDigits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest} WebhookRequest instance + */ + WebhookRequest.create = function create(properties) { + return new WebhookRequest(properties); + }; + + /** + * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhookRequest} message WebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectIntentResponseId != null && Object.hasOwnProperty.call(message, "detectIntentResponseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.detectIntentResponseId); + if (message.intentInfo != null && Object.hasOwnProperty.call(message, "intentInfo")) + $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.encode(message.intentInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageInfo != null && Object.hasOwnProperty.call(message, "pageInfo")) + $root.google.cloud.dialogflow.cx.v3.PageInfo.encode(message.pageInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + $root.google.cloud.dialogflow.cx.v3.SessionInfo.encode(message.sessionInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fulfillmentInfo != null && Object.hasOwnProperty.call(message, "fulfillmentInfo")) + $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.encode(message.fulfillmentInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.encode(message.messages[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) + $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.text); + if (message.triggerIntent != null && Object.hasOwnProperty.call(message, "triggerIntent")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.triggerIntent); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.transcript); + if (message.triggerEvent != null && Object.hasOwnProperty.call(message, "triggerEvent")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.triggerEvent); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); + if (message.dtmfDigits != null && Object.hasOwnProperty.call(message, "dtmfDigits")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.dtmfDigits); + if (message.languageInfo != null && Object.hasOwnProperty.call(message, "languageInfo")) + $root.google.cloud.dialogflow.cx.v3.LanguageInfo.encode(message.languageInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhookRequest} message WebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest} WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.detectIntentResponseId = reader.string(); + break; + } + case 10: { + message.text = reader.string(); + break; + } + case 11: { + message.triggerIntent = reader.string(); + break; + } + case 12: { + message.transcript = reader.string(); + break; + } + case 14: { + message.triggerEvent = reader.string(); + break; + } + case 17: { + message.dtmfDigits = reader.string(); + break; + } + case 15: { + message.languageCode = reader.string(); + break; + } + case 6: { + message.fulfillmentInfo = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.intentInfo = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.pageInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3.SessionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.cx.v3.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.languageInfo = $root.google.cloud.dialogflow.cx.v3.LanguageInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest} WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.detectIntentResponseId != null && message.hasOwnProperty("detectIntentResponseId")) + if (!$util.isString(message.detectIntentResponseId)) + return "detectIntentResponseId: string expected"; + if (message.text != null && message.hasOwnProperty("text")) { + properties.query = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerIntent)) + return "triggerIntent: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerEvent)) + return "triggerEvent: string expected"; + } + if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.dtmfDigits)) + return "dtmfDigits: string expected"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.verify(message.fulfillmentInfo, long + 1); + if (error) + return "fulfillmentInfo." + error; + } + if (message.intentInfo != null && message.hasOwnProperty("intentInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.verify(message.intentInfo, long + 1); + if (error) + return "intentInfo." + error; + } + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.PageInfo.verify(message.pageInfo, long + 1); + if (error) + return "pageInfo." + error; + } + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.SessionInfo.verify(message.sessionInfo, long + 1); + if (error) + return "sessionInfo." + error; + } + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.verify(message.messages[i], long + 1); + if (error) + return "messages." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { + var error = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.verify(message.sentimentAnalysisResult, long + 1); + if (error) + return "sentimentAnalysisResult." + error; + } + if (message.languageInfo != null && message.hasOwnProperty("languageInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.LanguageInfo.verify(message.languageInfo, long + 1); + if (error) + return "languageInfo." + error; + } + return null; + }; + + /** + * Creates a WebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest} WebhookRequest + */ + WebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.WebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest(); + if (object.detectIntentResponseId != null) + message.detectIntentResponseId = String(object.detectIntentResponseId); + if (object.text != null) + message.text = String(object.text); + if (object.triggerIntent != null) + message.triggerIntent = String(object.triggerIntent); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.triggerEvent != null) + message.triggerEvent = String(object.triggerEvent); + if (object.dtmfDigits != null) + message.dtmfDigits = String(object.dtmfDigits); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.fulfillmentInfo != null) { + if (typeof object.fulfillmentInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.fulfillmentInfo: object expected"); + message.fulfillmentInfo = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.fromObject(object.fulfillmentInfo, long + 1); + } + if (object.intentInfo != null) { + if (typeof object.intentInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.intentInfo: object expected"); + message.intentInfo = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.fromObject(object.intentInfo, long + 1); + } + if (object.pageInfo != null) { + if (typeof object.pageInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.pageInfo: object expected"); + message.pageInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.fromObject(object.pageInfo, long + 1); + } + if (object.sessionInfo != null) { + if (typeof object.sessionInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.sessionInfo: object expected"); + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3.SessionInfo.fromObject(object.sessionInfo, long + 1); + } + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.fromObject(object.messages[i], long + 1); + } + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.sentimentAnalysisResult != null) { + if (typeof object.sentimentAnalysisResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.sentimentAnalysisResult: object expected"); + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult, long + 1); + } + if (object.languageInfo != null) { + if (typeof object.languageInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.languageInfo: object expected"); + message.languageInfo = $root.google.cloud.dialogflow.cx.v3.LanguageInfo.fromObject(object.languageInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest} message WebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) { + object.detectIntentResponseId = ""; + object.intentInfo = null; + object.pageInfo = null; + object.sessionInfo = null; + object.fulfillmentInfo = null; + object.payload = null; + object.sentimentAnalysisResult = null; + object.languageCode = ""; + object.languageInfo = null; + } + if (message.detectIntentResponseId != null && message.hasOwnProperty("detectIntentResponseId")) + object.detectIntentResponseId = message.detectIntentResponseId; + if (message.intentInfo != null && message.hasOwnProperty("intentInfo")) + object.intentInfo = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.toObject(message.intentInfo, options); + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) + object.pageInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.toObject(message.pageInfo, options); + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) + object.sessionInfo = $root.google.cloud.dialogflow.cx.v3.SessionInfo.toObject(message.sessionInfo, options); + if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) + object.fulfillmentInfo = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.toObject(message.fulfillmentInfo, options); + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.toObject(message.messages[j], options); + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) + object.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.query = "text"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + object.triggerIntent = message.triggerIntent; + if (options.oneofs) + object.query = "triggerIntent"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.query = "transcript"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + object.triggerEvent = message.triggerEvent; + if (options.oneofs) + object.query = "triggerEvent"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) { + object.dtmfDigits = message.dtmfDigits; + if (options.oneofs) + object.query = "dtmfDigits"; + } + if (message.languageInfo != null && message.hasOwnProperty("languageInfo")) + object.languageInfo = $root.google.cloud.dialogflow.cx.v3.LanguageInfo.toObject(message.languageInfo, options); + return object; + }; + + /** + * Converts this WebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @instance + * @returns {Object.} JSON object + */ + WebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.WebhookRequest"; + }; + + WebhookRequest.FulfillmentInfo = (function() { + + /** + * Properties of a FulfillmentInfo. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @interface IFulfillmentInfo + * @property {string|null} [tag] FulfillmentInfo tag + */ + + /** + * Constructs a new FulfillmentInfo. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @classdesc Represents a FulfillmentInfo. + * @implements IFulfillmentInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo=} [properties] Properties to set + */ + function FulfillmentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillmentInfo tag. + * @member {string} tag + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @instance + */ + FulfillmentInfo.prototype.tag = ""; + + /** + * Creates a new FulfillmentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo} FulfillmentInfo instance + */ + FulfillmentInfo.create = function create(properties) { + return new FulfillmentInfo(properties); + }; + + /** + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tag); + return writer; + }; + + /** + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo} FulfillmentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo} FulfillmentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillmentInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillmentInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo} FulfillmentInfo + */ + FulfillmentInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo(); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo} message FulfillmentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillmentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tag = ""; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + return object; + }; + + /** + * Converts this FulfillmentInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @instance + * @returns {Object.} JSON object + */ + FulfillmentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillmentInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillmentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo"; + }; + + return FulfillmentInfo; + })(); + + WebhookRequest.IntentInfo = (function() { + + /** + * Properties of an IntentInfo. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @interface IIntentInfo + * @property {string|null} [lastMatchedIntent] IntentInfo lastMatchedIntent + * @property {string|null} [displayName] IntentInfo displayName + * @property {Object.|null} [parameters] IntentInfo parameters + * @property {number|null} [confidence] IntentInfo confidence + */ + + /** + * Constructs a new IntentInfo. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @classdesc Represents an IntentInfo. + * @implements IIntentInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo=} [properties] Properties to set + */ + function IntentInfo(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentInfo lastMatchedIntent. + * @member {string} lastMatchedIntent + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.lastMatchedIntent = ""; + + /** + * IntentInfo displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.displayName = ""; + + /** + * IntentInfo parameters. + * @member {Object.} parameters + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.parameters = $util.emptyObject; + + /** + * IntentInfo confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.confidence = 0; + + /** + * Creates a new IntentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo} IntentInfo instance + */ + IntentInfo.create = function create(properties) { + return new IntentInfo(properties); + }; + + /** + * Encodes the specified IntentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo} message IntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastMatchedIntent != null && Object.hasOwnProperty.call(message, "lastMatchedIntent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.lastMatchedIntent); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.encode(message.parameters[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified IntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IIntentInfo} message IntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo} IntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lastMatchedIntent = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 2: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameters, key); + message.parameters[key] = value; + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo} IntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.lastMatchedIntent != null && message.hasOwnProperty("lastMatchedIntent")) + if (!$util.isString(message.lastMatchedIntent)) + return "lastMatchedIntent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.verify(message.parameters[key[i]], long + 1); + if (error) + return "parameters." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates an IntentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo} IntentInfo + */ + IntentInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo(); + if (object.lastMatchedIntent != null) + message.lastMatchedIntent = String(object.lastMatchedIntent); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameters, keys[i]); + if (typeof object.parameters[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.parameters: object expected"); + message.parameters[keys[i]] = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.fromObject(object.parameters[keys[i]], long + 1); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from an IntentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo} message IntentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) { + object.lastMatchedIntent = ""; + object.displayName = ""; + object.confidence = 0; + } + if (message.lastMatchedIntent != null && message.hasOwnProperty("lastMatchedIntent")) + object.lastMatchedIntent = message.lastMatchedIntent; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameters, keys2[j]); + object.parameters[keys2[j]] = $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.toObject(message.parameters[keys2[j]], options); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this IntentInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @instance + * @returns {Object.} JSON object + */ + IntentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo"; + }; + + IntentInfo.IntentParameterValue = (function() { + + /** + * Properties of an IntentParameterValue. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @interface IIntentParameterValue + * @property {string|null} [originalValue] IntentParameterValue originalValue + * @property {google.protobuf.IValue|null} [resolvedValue] IntentParameterValue resolvedValue + */ + + /** + * Constructs a new IntentParameterValue. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo + * @classdesc Represents an IntentParameterValue. + * @implements IIntentParameterValue + * @constructor + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue=} [properties] Properties to set + */ + function IntentParameterValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentParameterValue originalValue. + * @member {string} originalValue + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @instance + */ + IntentParameterValue.prototype.originalValue = ""; + + /** + * IntentParameterValue resolvedValue. + * @member {google.protobuf.IValue|null|undefined} resolvedValue + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @instance + */ + IntentParameterValue.prototype.resolvedValue = null; + + /** + * Creates a new IntentParameterValue instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue instance + */ + IntentParameterValue.create = function create(properties) { + return new IntentParameterValue(properties); + }; + + /** + * Encodes the specified IntentParameterValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue} message IntentParameterValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentParameterValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalValue != null && Object.hasOwnProperty.call(message, "originalValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.originalValue); + if (message.resolvedValue != null && Object.hasOwnProperty.call(message, "resolvedValue")) + $root.google.protobuf.Value.encode(message.resolvedValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntentParameterValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IIntentParameterValue} message IntentParameterValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentParameterValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentParameterValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalValue = reader.string(); + break; + } + case 2: { + message.resolvedValue = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentParameterValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentParameterValue message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentParameterValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.originalValue != null && message.hasOwnProperty("originalValue")) + if (!$util.isString(message.originalValue)) + return "originalValue: string expected"; + if (message.resolvedValue != null && message.hasOwnProperty("resolvedValue")) { + var error = $root.google.protobuf.Value.verify(message.resolvedValue, long + 1); + if (error) + return "resolvedValue." + error; + } + return null; + }; + + /** + * Creates an IntentParameterValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue + */ + IntentParameterValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue(); + if (object.originalValue != null) + message.originalValue = String(object.originalValue); + if (object.resolvedValue != null) { + if (typeof object.resolvedValue !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue.resolvedValue: object expected"); + message.resolvedValue = $root.google.protobuf.Value.fromObject(object.resolvedValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IntentParameterValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue} message IntentParameterValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentParameterValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalValue = ""; + object.resolvedValue = null; + } + if (message.originalValue != null && message.hasOwnProperty("originalValue")) + object.originalValue = message.originalValue; + if (message.resolvedValue != null && message.hasOwnProperty("resolvedValue")) + object.resolvedValue = $root.google.protobuf.Value.toObject(message.resolvedValue, options); + return object; + }; + + /** + * Converts this IntentParameterValue to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @instance + * @returns {Object.} JSON object + */ + IntentParameterValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentParameterValue + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentParameterValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue"; + }; + + return IntentParameterValue; + })(); + + return IntentInfo; + })(); + + WebhookRequest.SentimentAnalysisResult = (function() { + + /** + * Properties of a SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @interface ISentimentAnalysisResult + * @property {number|null} [score] SentimentAnalysisResult score + * @property {number|null} [magnitude] SentimentAnalysisResult magnitude + */ + + /** + * Constructs a new SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest + * @classdesc Represents a SentimentAnalysisResult. + * @implements ISentimentAnalysisResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult=} [properties] Properties to set + */ + function SentimentAnalysisResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SentimentAnalysisResult score. + * @member {number} score + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.score = 0; + + /** + * SentimentAnalysisResult magnitude. + * @member {number} magnitude + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.magnitude = 0; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult instance + */ + SentimentAnalysisResult.create = function create(properties) { + return new SentimentAnalysisResult(properties); + }; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + return writer; + }; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + case 2: { + message.magnitude = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SentimentAnalysisResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + return null; + }; + + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult + */ + SentimentAnalysisResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult(); + if (object.score != null) + message.score = Number(object.score); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + return message; + }; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult} message SentimentAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.magnitude = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + return object; + }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SentimentAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult"; + }; + + return SentimentAnalysisResult; + })(); + + return WebhookRequest; + })(); + + v3.WebhookResponse = (function() { + + /** + * Properties of a WebhookResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IWebhookResponse + * @property {google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse|null} [fulfillmentResponse] WebhookResponse fulfillmentResponse + * @property {google.cloud.dialogflow.cx.v3.IPageInfo|null} [pageInfo] WebhookResponse pageInfo + * @property {google.cloud.dialogflow.cx.v3.ISessionInfo|null} [sessionInfo] WebhookResponse sessionInfo + * @property {google.protobuf.IStruct|null} [payload] WebhookResponse payload + * @property {string|null} [targetPage] WebhookResponse targetPage + * @property {string|null} [targetFlow] WebhookResponse targetFlow + */ + + /** + * Constructs a new WebhookResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a WebhookResponse. + * @implements IWebhookResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IWebhookResponse=} [properties] Properties to set + */ + function WebhookResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookResponse fulfillmentResponse. + * @member {google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse|null|undefined} fulfillmentResponse + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + */ + WebhookResponse.prototype.fulfillmentResponse = null; + + /** + * WebhookResponse pageInfo. + * @member {google.cloud.dialogflow.cx.v3.IPageInfo|null|undefined} pageInfo + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + */ + WebhookResponse.prototype.pageInfo = null; + + /** + * WebhookResponse sessionInfo. + * @member {google.cloud.dialogflow.cx.v3.ISessionInfo|null|undefined} sessionInfo + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + */ + WebhookResponse.prototype.sessionInfo = null; + + /** + * WebhookResponse payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + */ + WebhookResponse.prototype.payload = null; + + /** + * WebhookResponse targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + */ + WebhookResponse.prototype.targetPage = null; + + /** + * WebhookResponse targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + */ + WebhookResponse.prototype.targetFlow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WebhookResponse transition. + * @member {"targetPage"|"targetFlow"|undefined} transition + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + */ + Object.defineProperty(WebhookResponse.prototype, "transition", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WebhookResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhookResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse} WebhookResponse instance + */ + WebhookResponse.create = function create(properties) { + return new WebhookResponse(properties); + }; + + /** + * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhookResponse} message WebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fulfillmentResponse != null && Object.hasOwnProperty.call(message, "fulfillmentResponse")) + $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.encode(message.fulfillmentResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageInfo != null && Object.hasOwnProperty.call(message, "pageInfo")) + $root.google.cloud.dialogflow.cx.v3.PageInfo.encode(message.pageInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + $root.google.cloud.dialogflow.cx.v3.SessionInfo.encode(message.sessionInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.targetFlow); + return writer; + }; + + /** + * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IWebhookResponse} message WebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse} WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.WebhookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fulfillmentResponse = $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.pageInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3.SessionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.targetPage = reader.string(); + break; + } + case 6: { + message.targetFlow = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse} WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.fulfillmentResponse != null && message.hasOwnProperty("fulfillmentResponse")) { + var error = $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.verify(message.fulfillmentResponse, long + 1); + if (error) + return "fulfillmentResponse." + error; + } + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.PageInfo.verify(message.pageInfo, long + 1); + if (error) + return "pageInfo." + error; + } + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.SessionInfo.verify(message.sessionInfo, long + 1); + if (error) + return "sessionInfo." + error; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.transition = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.transition === 1) + return "transition: multiple values"; + properties.transition = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + return null; + }; + + /** + * Creates a WebhookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse} WebhookResponse + */ + WebhookResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.WebhookResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.WebhookResponse(); + if (object.fulfillmentResponse != null) { + if (typeof object.fulfillmentResponse !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookResponse.fulfillmentResponse: object expected"); + message.fulfillmentResponse = $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.fromObject(object.fulfillmentResponse, long + 1); + } + if (object.pageInfo != null) { + if (typeof object.pageInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookResponse.pageInfo: object expected"); + message.pageInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.fromObject(object.pageInfo, long + 1); + } + if (object.sessionInfo != null) { + if (typeof object.sessionInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookResponse.sessionInfo: object expected"); + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3.SessionInfo.fromObject(object.sessionInfo, long + 1); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookResponse.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + return message; + }; + + /** + * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookResponse} message WebhookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fulfillmentResponse = null; + object.pageInfo = null; + object.sessionInfo = null; + object.payload = null; + } + if (message.fulfillmentResponse != null && message.hasOwnProperty("fulfillmentResponse")) + object.fulfillmentResponse = $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.toObject(message.fulfillmentResponse, options); + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) + object.pageInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.toObject(message.pageInfo, options); + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) + object.sessionInfo = $root.google.cloud.dialogflow.cx.v3.SessionInfo.toObject(message.sessionInfo, options); + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.transition = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.transition = "targetFlow"; + } + return object; + }; + + /** + * Converts this WebhookResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @instance + * @returns {Object.} JSON object + */ + WebhookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.WebhookResponse"; + }; + + WebhookResponse.FulfillmentResponse = (function() { + + /** + * Properties of a FulfillmentResponse. + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @interface IFulfillmentResponse + * @property {Array.|null} [messages] FulfillmentResponse messages + * @property {google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior|null} [mergeBehavior] FulfillmentResponse mergeBehavior + */ + + /** + * Constructs a new FulfillmentResponse. + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse + * @classdesc Represents a FulfillmentResponse. + * @implements IFulfillmentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse=} [properties] Properties to set + */ + function FulfillmentResponse(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillmentResponse messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @instance + */ + FulfillmentResponse.prototype.messages = $util.emptyArray; + + /** + * FulfillmentResponse mergeBehavior. + * @member {google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior} mergeBehavior + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @instance + */ + FulfillmentResponse.prototype.mergeBehavior = 0; + + /** + * Creates a new FulfillmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse} FulfillmentResponse instance + */ + FulfillmentResponse.create = function create(properties) { + return new FulfillmentResponse(properties); + }; + + /** + * Encodes the specified FulfillmentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse} message FulfillmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ResponseMessage.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mergeBehavior != null && Object.hasOwnProperty.call(message, "mergeBehavior")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mergeBehavior); + return writer; + }; + + /** + * Encodes the specified FulfillmentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookResponse.IFulfillmentResponse} message FulfillmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse} FulfillmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.cx.v3.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.mergeBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse} FulfillmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillmentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillmentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.verify(message.messages[i], long + 1); + if (error) + return "messages." + error; + } + } + if (message.mergeBehavior != null && message.hasOwnProperty("mergeBehavior")) + switch (message.mergeBehavior) { + default: + return "mergeBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FulfillmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse} FulfillmentResponse + */ + FulfillmentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.fromObject(object.messages[i], long + 1); + } + } + switch (object.mergeBehavior) { + default: + if (typeof object.mergeBehavior === "number") { + message.mergeBehavior = object.mergeBehavior; + break; + } + break; + case "MERGE_BEHAVIOR_UNSPECIFIED": + case 0: + message.mergeBehavior = 0; + break; + case "APPEND": + case 1: + message.mergeBehavior = 1; + break; + case "REPLACE": + case 2: + message.mergeBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FulfillmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse} message FulfillmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.mergeBehavior = options.enums === String ? "MERGE_BEHAVIOR_UNSPECIFIED" : 0; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.cx.v3.ResponseMessage.toObject(message.messages[j], options); + } + if (message.mergeBehavior != null && message.hasOwnProperty("mergeBehavior")) + object.mergeBehavior = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior[message.mergeBehavior] === undefined ? message.mergeBehavior : $root.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior[message.mergeBehavior] : message.mergeBehavior; + return object; + }; + + /** + * Converts this FulfillmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @instance + * @returns {Object.} JSON object + */ + FulfillmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillmentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse"; + }; + + /** + * MergeBehavior enum. + * @name google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior + * @enum {number} + * @property {number} MERGE_BEHAVIOR_UNSPECIFIED=0 MERGE_BEHAVIOR_UNSPECIFIED value + * @property {number} APPEND=1 APPEND value + * @property {number} REPLACE=2 REPLACE value + */ + FulfillmentResponse.MergeBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MERGE_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "APPEND"] = 1; + values[valuesById[2] = "REPLACE"] = 2; + return values; + })(); + + return FulfillmentResponse; + })(); + + return WebhookResponse; + })(); + + v3.PageInfo = (function() { + + /** + * Properties of a PageInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPageInfo + * @property {string|null} [currentPage] PageInfo currentPage + * @property {string|null} [displayName] PageInfo displayName + * @property {google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo|null} [formInfo] PageInfo formInfo + */ + + /** + * Constructs a new PageInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PageInfo. + * @implements IPageInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPageInfo=} [properties] Properties to set + */ + function PageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageInfo currentPage. + * @member {string} currentPage + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @instance + */ + PageInfo.prototype.currentPage = ""; + + /** + * PageInfo displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @instance + */ + PageInfo.prototype.displayName = ""; + + /** + * PageInfo formInfo. + * @member {google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo|null|undefined} formInfo + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @instance + */ + PageInfo.prototype.formInfo = null; + + /** + * Creates a new PageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.IPageInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PageInfo} PageInfo instance + */ + PageInfo.create = function create(properties) { + return new PageInfo(properties); + }; + + /** + * Encodes the specified PageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.IPageInfo} message PageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currentPage); + if (message.formInfo != null && Object.hasOwnProperty.call(message, "formInfo")) + $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.encode(message.formInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.IPageInfo} message PageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PageInfo} PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.currentPage = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.formInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PageInfo} PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + if (!$util.isString(message.currentPage)) + return "currentPage: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.formInfo != null && message.hasOwnProperty("formInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.verify(message.formInfo, long + 1); + if (error) + return "formInfo." + error; + } + return null; + }; + + /** + * Creates a PageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PageInfo} PageInfo + */ + PageInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PageInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PageInfo(); + if (object.currentPage != null) + message.currentPage = String(object.currentPage); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.formInfo != null) { + if (typeof object.formInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PageInfo.formInfo: object expected"); + message.formInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.fromObject(object.formInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo} message PageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currentPage = ""; + object.formInfo = null; + object.displayName = ""; + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = message.currentPage; + if (message.formInfo != null && message.hasOwnProperty("formInfo")) + object.formInfo = $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.toObject(message.formInfo, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PageInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @instance + * @returns {Object.} JSON object + */ + PageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PageInfo"; + }; + + PageInfo.FormInfo = (function() { + + /** + * Properties of a FormInfo. + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @interface IFormInfo + * @property {Array.|null} [parameterInfo] FormInfo parameterInfo + */ + + /** + * Constructs a new FormInfo. + * @memberof google.cloud.dialogflow.cx.v3.PageInfo + * @classdesc Represents a FormInfo. + * @implements IFormInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo=} [properties] Properties to set + */ + function FormInfo(properties) { + this.parameterInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FormInfo parameterInfo. + * @member {Array.} parameterInfo + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @instance + */ + FormInfo.prototype.parameterInfo = $util.emptyArray; + + /** + * Creates a new FormInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo} FormInfo instance + */ + FormInfo.create = function create(properties) { + return new FormInfo(properties); + }; + + /** + * Encodes the specified FormInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo} message FormInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterInfo != null && message.parameterInfo.length) + for (var i = 0; i < message.parameterInfo.length; ++i) + $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.encode(message.parameterInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FormInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.IFormInfo} message FormInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FormInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo} FormInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.parameterInfo && message.parameterInfo.length)) + message.parameterInfo = []; + message.parameterInfo.push($root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FormInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo} FormInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FormInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FormInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameterInfo != null && message.hasOwnProperty("parameterInfo")) { + if (!Array.isArray(message.parameterInfo)) + return "parameterInfo: array expected"; + for (var i = 0; i < message.parameterInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.verify(message.parameterInfo[i], long + 1); + if (error) + return "parameterInfo." + error; + } + } + return null; + }; + + /** + * Creates a FormInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo} FormInfo + */ + FormInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo(); + if (object.parameterInfo) { + if (!Array.isArray(object.parameterInfo)) + throw TypeError(".google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.parameterInfo: array expected"); + message.parameterInfo = []; + for (var i = 0; i < object.parameterInfo.length; ++i) { + if (typeof object.parameterInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.parameterInfo: object expected"); + message.parameterInfo[i] = $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.fromObject(object.parameterInfo[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FormInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo} message FormInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FormInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameterInfo = []; + if (message.parameterInfo && message.parameterInfo.length) { + object.parameterInfo = []; + for (var j = 0; j < message.parameterInfo.length; ++j) + object.parameterInfo[j] = $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.toObject(message.parameterInfo[j], options); + } + return object; + }; + + /** + * Converts this FormInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @instance + * @returns {Object.} JSON object + */ + FormInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FormInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FormInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PageInfo.FormInfo"; + }; + + FormInfo.ParameterInfo = (function() { + + /** + * Properties of a ParameterInfo. + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @interface IParameterInfo + * @property {string|null} [displayName] ParameterInfo displayName + * @property {boolean|null} [required] ParameterInfo required + * @property {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState|null} [state] ParameterInfo state + * @property {google.protobuf.IValue|null} [value] ParameterInfo value + * @property {boolean|null} [justCollected] ParameterInfo justCollected + */ + + /** + * Constructs a new ParameterInfo. + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo + * @classdesc Represents a ParameterInfo. + * @implements IParameterInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo=} [properties] Properties to set + */ + function ParameterInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterInfo displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.displayName = ""; + + /** + * ParameterInfo required. + * @member {boolean} required + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.required = false; + + /** + * ParameterInfo state. + * @member {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState} state + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.state = 0; + + /** + * ParameterInfo value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.value = null; + + /** + * ParameterInfo justCollected. + * @member {boolean} justCollected + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.justCollected = false; + + /** + * Creates a new ParameterInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo} ParameterInfo instance + */ + ParameterInfo.create = function create(properties) { + return new ParameterInfo(properties); + }; + + /** + * Encodes the specified ParameterInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo} message ParameterInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.required); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.justCollected != null && Object.hasOwnProperty.call(message, "justCollected")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.justCollected); + return writer; + }; + + /** + * Encodes the specified ParameterInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.IParameterInfo} message ParameterInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo} ParameterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.required = reader.bool(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.justCollected = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo} ParameterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value, long + 1); + if (error) + return "value." + error; + } + if (message.justCollected != null && message.hasOwnProperty("justCollected")) + if (typeof message.justCollected !== "boolean") + return "justCollected: boolean expected"; + return null; + }; + + /** + * Creates a ParameterInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo} ParameterInfo + */ + ParameterInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.required != null) + message.required = Boolean(object.required); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "PARAMETER_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "EMPTY": + case 1: + message.state = 1; + break; + case "INVALID": + case 2: + message.state = 2; + break; + case "FILLED": + case 3: + message.state = 3; + break; + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value, long + 1); + } + if (object.justCollected != null) + message.justCollected = Boolean(object.justCollected); + return message; + }; + + /** + * Creates a plain object from a ParameterInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo} message ParameterInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.required = false; + object.state = options.enums === String ? "PARAMETER_STATE_UNSPECIFIED" : 0; + object.value = null; + object.justCollected = false; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState[message.state] : message.state; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (message.justCollected != null && message.hasOwnProperty("justCollected")) + object.justCollected = message.justCollected; + return object; + }; + + /** + * Converts this ParameterInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @instance + * @returns {Object.} JSON object + */ + ParameterInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo"; + }; + + /** + * ParameterState enum. + * @name google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState + * @enum {number} + * @property {number} PARAMETER_STATE_UNSPECIFIED=0 PARAMETER_STATE_UNSPECIFIED value + * @property {number} EMPTY=1 EMPTY value + * @property {number} INVALID=2 INVALID value + * @property {number} FILLED=3 FILLED value + */ + ParameterInfo.ParameterState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARAMETER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EMPTY"] = 1; + values[valuesById[2] = "INVALID"] = 2; + values[valuesById[3] = "FILLED"] = 3; + return values; + })(); + + return ParameterInfo; + })(); + + return FormInfo; + })(); + + return PageInfo; + })(); + + v3.SessionInfo = (function() { + + /** + * Properties of a SessionInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISessionInfo + * @property {string|null} [session] SessionInfo session + * @property {Object.|null} [parameters] SessionInfo parameters + */ + + /** + * Constructs a new SessionInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SessionInfo. + * @implements ISessionInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISessionInfo=} [properties] Properties to set + */ + function SessionInfo(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionInfo session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @instance + */ + SessionInfo.prototype.session = ""; + + /** + * SessionInfo parameters. + * @member {Object.} parameters + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @instance + */ + SessionInfo.prototype.parameters = $util.emptyObject; + + /** + * Creates a new SessionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ISessionInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SessionInfo} SessionInfo instance + */ + SessionInfo.create = function create(properties) { + return new SessionInfo(properties); + }; + + /** + * Encodes the specified SessionInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ISessionInfo} message SessionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.parameters[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SessionInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SessionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ISessionInfo} message SessionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SessionInfo} SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SessionInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameters, key); + message.parameters[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SessionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SessionInfo} SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.parameters[key[i]], long + 1); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a SessionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SessionInfo} SessionInfo + */ + SessionInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SessionInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SessionInfo(); + if (object.session != null) + message.session = String(object.session); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SessionInfo.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameters, keys[i]); + if (typeof object.parameters[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SessionInfo.parameters: object expected"); + message.parameters[keys[i]] = $root.google.protobuf.Value.fromObject(object.parameters[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SessionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.SessionInfo} message SessionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) + object.session = ""; + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameters, keys2[j]); + object.parameters[keys2[j]] = $root.google.protobuf.Value.toObject(message.parameters[keys2[j]], options); + } + } + return object; + }; + + /** + * Converts this SessionInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @instance + * @returns {Object.} JSON object + */ + SessionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SessionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SessionInfo"; + }; + + return SessionInfo; + })(); + + v3.LanguageInfo = (function() { + + /** + * Properties of a LanguageInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ILanguageInfo + * @property {string|null} [inputLanguageCode] LanguageInfo inputLanguageCode + * @property {string|null} [resolvedLanguageCode] LanguageInfo resolvedLanguageCode + * @property {number|null} [confidenceScore] LanguageInfo confidenceScore + */ + + /** + * Constructs a new LanguageInfo. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a LanguageInfo. + * @implements ILanguageInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ILanguageInfo=} [properties] Properties to set + */ + function LanguageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageInfo inputLanguageCode. + * @member {string} inputLanguageCode + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @instance + */ + LanguageInfo.prototype.inputLanguageCode = ""; + + /** + * LanguageInfo resolvedLanguageCode. + * @member {string} resolvedLanguageCode + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @instance + */ + LanguageInfo.prototype.resolvedLanguageCode = ""; + + /** + * LanguageInfo confidenceScore. + * @member {number} confidenceScore + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @instance + */ + LanguageInfo.prototype.confidenceScore = 0; + + /** + * Creates a new LanguageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ILanguageInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.LanguageInfo} LanguageInfo instance + */ + LanguageInfo.create = function create(properties) { + return new LanguageInfo(properties); + }; + + /** + * Encodes the specified LanguageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LanguageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ILanguageInfo} message LanguageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputLanguageCode != null && Object.hasOwnProperty.call(message, "inputLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputLanguageCode); + if (message.resolvedLanguageCode != null && Object.hasOwnProperty.call(message, "resolvedLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resolvedLanguageCode); + if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidenceScore); + return writer; + }; + + /** + * Encodes the specified LanguageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LanguageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.ILanguageInfo} message LanguageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.LanguageInfo} LanguageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.LanguageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputLanguageCode = reader.string(); + break; + } + case 2: { + message.resolvedLanguageCode = reader.string(); + break; + } + case 3: { + message.confidenceScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.LanguageInfo} LanguageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.inputLanguageCode != null && message.hasOwnProperty("inputLanguageCode")) + if (!$util.isString(message.inputLanguageCode)) + return "inputLanguageCode: string expected"; + if (message.resolvedLanguageCode != null && message.hasOwnProperty("resolvedLanguageCode")) + if (!$util.isString(message.resolvedLanguageCode)) + return "resolvedLanguageCode: string expected"; + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + if (typeof message.confidenceScore !== "number") + return "confidenceScore: number expected"; + return null; + }; + + /** + * Creates a LanguageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.LanguageInfo} LanguageInfo + */ + LanguageInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.LanguageInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.LanguageInfo(); + if (object.inputLanguageCode != null) + message.inputLanguageCode = String(object.inputLanguageCode); + if (object.resolvedLanguageCode != null) + message.resolvedLanguageCode = String(object.resolvedLanguageCode); + if (object.confidenceScore != null) + message.confidenceScore = Number(object.confidenceScore); + return message; + }; + + /** + * Creates a plain object from a LanguageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3.LanguageInfo} message LanguageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputLanguageCode = ""; + object.resolvedLanguageCode = ""; + object.confidenceScore = 0; + } + if (message.inputLanguageCode != null && message.hasOwnProperty("inputLanguageCode")) + object.inputLanguageCode = message.inputLanguageCode; + if (message.resolvedLanguageCode != null && message.hasOwnProperty("resolvedLanguageCode")) + object.resolvedLanguageCode = message.resolvedLanguageCode; + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; + return object; + }; + + /** + * Converts this LanguageInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @instance + * @returns {Object.} JSON object + */ + LanguageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LanguageInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.LanguageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.LanguageInfo"; + }; + + return LanguageInfo; + })(); + + v3.Examples = (function() { + + /** + * Constructs a new Examples service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Examples + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Examples(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Examples.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Examples; + + /** + * Creates new Examples service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Examples} RPC service. Useful where requests and/or responses are streamed. + */ + Examples.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|createExample}. + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @typedef CreateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Example} [response] Example + */ + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Examples.CreateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.createExample = function createExample(request, callback) { + return this.rpcCall(createExample, $root.google.cloud.dialogflow.cx.v3.CreateExampleRequest, $root.google.cloud.dialogflow.cx.v3.Example, request, callback); + }, "name", { value: "CreateExample" }); + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|deleteExample}. + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @typedef DeleteExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Examples.DeleteExampleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.deleteExample = function deleteExample(request, callback) { + return this.rpcCall(deleteExample, $root.google.cloud.dialogflow.cx.v3.DeleteExampleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExample" }); + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|listExamples}. + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @typedef ListExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListExamplesResponse} [response] ListExamplesResponse + */ + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListExamplesRequest} request ListExamplesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Examples.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.listExamples = function listExamples(request, callback) { + return this.rpcCall(listExamples, $root.google.cloud.dialogflow.cx.v3.ListExamplesRequest, $root.google.cloud.dialogflow.cx.v3.ListExamplesResponse, request, callback); + }, "name", { value: "ListExamples" }); + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListExamplesRequest} request ListExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|getExample}. + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @typedef GetExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Example} [response] Example + */ + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetExampleRequest} request GetExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Examples.GetExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.getExample = function getExample(request, callback) { + return this.rpcCall(getExample, $root.google.cloud.dialogflow.cx.v3.GetExampleRequest, $root.google.cloud.dialogflow.cx.v3.Example, request, callback); + }, "name", { value: "GetExample" }); + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetExampleRequest} request GetExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Examples|updateExample}. + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @typedef UpdateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Example} [response] Example + */ + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Examples.UpdateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.updateExample = function updateExample(request, callback) { + return this.rpcCall(updateExample, $root.google.cloud.dialogflow.cx.v3.UpdateExampleRequest, $root.google.cloud.dialogflow.cx.v3.Example, request, callback); + }, "name", { value: "UpdateExample" }); + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.dialogflow.cx.v3.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Examples; + })(); + + v3.CreateExampleRequest = (function() { + + /** + * Properties of a CreateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateExampleRequest + * @property {string|null} [parent] CreateExampleRequest parent + * @property {google.cloud.dialogflow.cx.v3.IExample|null} [example] CreateExampleRequest example + */ + + /** + * Constructs a new CreateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateExampleRequest. + * @implements ICreateExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateExampleRequest=} [properties] Properties to set + */ + function CreateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExampleRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.parent = ""; + + /** + * CreateExampleRequest example. + * @member {google.cloud.dialogflow.cx.v3.IExample|null|undefined} example + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.example = null; + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateExampleRequest} CreateExampleRequest instance + */ + CreateExampleRequest.create = function create(properties) { + return new CreateExampleRequest(properties); + }; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.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.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.dialogflow.cx.v3.Example.encode(message.example, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.example = $root.google.cloud.dialogflow.cx.v3.Example.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.dialogflow.cx.v3.Example.verify(message.example, long + 1); + if (error) + return "example." + error; + } + return null; + }; + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateExampleRequest} CreateExampleRequest + */ + CreateExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateExampleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateExampleRequest.example: object expected"); + message.example = $root.google.cloud.dialogflow.cx.v3.Example.fromObject(object.example, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateExampleRequest} message CreateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.example = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.dialogflow.cx.v3.Example.toObject(message.example, options); + return object; + }; + + /** + * Converts this CreateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateExampleRequest"; + }; + + return CreateExampleRequest; + })(); + + v3.DeleteExampleRequest = (function() { + + /** + * Properties of a DeleteExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteExampleRequest + * @property {string|null} [name] DeleteExampleRequest name + */ + + /** + * Constructs a new DeleteExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteExampleRequest. + * @implements IDeleteExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteExampleRequest=} [properties] Properties to set + */ + function DeleteExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExampleRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.name = ""; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteExampleRequest} DeleteExampleRequest instance + */ + DeleteExampleRequest.create = function create(properties) { + return new DeleteExampleRequest(properties); + }; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.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 DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteExampleRequest} DeleteExampleRequest + */ + DeleteExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteExampleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteExampleRequest} message DeleteExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExampleRequest.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 DeleteExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteExampleRequest"; + }; + + return DeleteExampleRequest; + })(); + + v3.ListExamplesRequest = (function() { + + /** + * Properties of a ListExamplesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListExamplesRequest + * @property {string|null} [parent] ListExamplesRequest parent + * @property {number|null} [pageSize] ListExamplesRequest pageSize + * @property {string|null} [pageToken] ListExamplesRequest pageToken + * @property {string|null} [languageCode] ListExamplesRequest languageCode + */ + + /** + * Constructs a new ListExamplesRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListExamplesRequest. + * @implements IListExamplesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListExamplesRequest=} [properties] Properties to set + */ + function ListExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.parent = ""; + + /** + * ListExamplesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageSize = 0; + + /** + * ListExamplesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageToken = ""; + + /** + * ListExamplesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.languageCode = ""; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesRequest} ListExamplesRequest instance + */ + ListExamplesRequest.create = function create(properties) { + return new ListExamplesRequest(properties); + }; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesRequest} ListExamplesRequest + */ + ListExamplesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListExamplesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListExamplesRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListExamplesRequest} message ListExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ListExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListExamplesRequest"; + }; + + return ListExamplesRequest; + })(); + + v3.ListExamplesResponse = (function() { + + /** + * Properties of a ListExamplesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListExamplesResponse + * @property {Array.|null} [examples] ListExamplesResponse examples + * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken + */ + + /** + * Constructs a new ListExamplesResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListExamplesResponse. + * @implements IListExamplesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListExamplesResponse=} [properties] Properties to set + */ + function ListExamplesResponse(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesResponse examples. + * @member {Array.} examples + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.examples = $util.emptyArray; + + /** + * ListExamplesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExamplesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesResponse} ListExamplesResponse instance + */ + ListExamplesResponse.create = function create(properties) { + return new ListExamplesResponse(properties); + }; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExamplesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListExamplesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.dialogflow.cx.v3.Example.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Example.verify(message.examples[i], long + 1); + if (error) + return "examples." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListExamplesResponse} ListExamplesResponse + */ + ListExamplesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListExamplesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListExamplesResponse(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListExamplesResponse.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListExamplesResponse.examples: object expected"); + message.examples[i] = $root.google.cloud.dialogflow.cx.v3.Example.fromObject(object.examples[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListExamplesResponse} message ListExamplesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.dialogflow.cx.v3.Example.toObject(message.examples[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExamplesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @instance + * @returns {Object.} JSON object + */ + ListExamplesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListExamplesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListExamplesResponse"; + }; + + return ListExamplesResponse; + })(); + + v3.GetExampleRequest = (function() { + + /** + * Properties of a GetExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetExampleRequest + * @property {string|null} [name] GetExampleRequest name + */ + + /** + * Constructs a new GetExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetExampleRequest. + * @implements IGetExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetExampleRequest=} [properties] Properties to set + */ + function GetExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExampleRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @instance + */ + GetExampleRequest.prototype.name = ""; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetExampleRequest} GetExampleRequest instance + */ + GetExampleRequest.create = function create(properties) { + return new GetExampleRequest(properties); + }; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.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 GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetExampleRequest} GetExampleRequest + */ + GetExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetExampleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetExampleRequest} message GetExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExampleRequest.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 GetExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @instance + * @returns {Object.} JSON object + */ + GetExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetExampleRequest"; + }; + + return GetExampleRequest; + })(); + + v3.UpdateExampleRequest = (function() { + + /** + * Properties of an UpdateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateExampleRequest + * @property {google.cloud.dialogflow.cx.v3.IExample|null} [example] UpdateExampleRequest example + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExampleRequest updateMask + */ + + /** + * Constructs a new UpdateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateExampleRequest. + * @implements IUpdateExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateExampleRequest=} [properties] Properties to set + */ + function UpdateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExampleRequest example. + * @member {google.cloud.dialogflow.cx.v3.IExample|null|undefined} example + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.example = null; + + /** + * UpdateExampleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateExampleRequest} UpdateExampleRequest instance + */ + UpdateExampleRequest.create = function create(properties) { + return new UpdateExampleRequest(properties); + }; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.dialogflow.cx.v3.Example.encode(message.example, 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 UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.example = $root.google.cloud.dialogflow.cx.v3.Example.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.dialogflow.cx.v3.Example.verify(message.example, long + 1); + if (error) + return "example." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateExampleRequest} UpdateExampleRequest + */ + UpdateExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateExampleRequest(); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateExampleRequest.example: object expected"); + message.example = $root.google.cloud.dialogflow.cx.v3.Example.fromObject(object.example, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateExampleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateExampleRequest} message UpdateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.example = null; + object.updateMask = null; + } + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.dialogflow.cx.v3.Example.toObject(message.example, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateExampleRequest"; + }; + + return UpdateExampleRequest; + })(); + + v3.Example = (function() { + + /** + * Properties of an Example. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExample + * @property {string|null} [name] Example name + * @property {google.cloud.dialogflow.cx.v3.IPlaybookInput|null} [playbookInput] Example playbookInput + * @property {google.cloud.dialogflow.cx.v3.IPlaybookOutput|null} [playbookOutput] Example playbookOutput + * @property {Array.|null} [actions] Example actions + * @property {string|null} [displayName] Example displayName + * @property {string|null} [description] Example description + * @property {number|Long|null} [tokenCount] Example tokenCount + * @property {google.protobuf.ITimestamp|null} [createTime] Example createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Example updateTime + * @property {google.cloud.dialogflow.cx.v3.OutputState|null} [conversationState] Example conversationState + * @property {string|null} [languageCode] Example languageCode + */ + + /** + * Constructs a new Example. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExample=} [properties] Properties to set + */ + function Example(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Example name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.name = ""; + + /** + * Example playbookInput. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookInput|null|undefined} playbookInput + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.playbookInput = null; + + /** + * Example playbookOutput. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookOutput|null|undefined} playbookOutput + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.playbookOutput = null; + + /** + * Example actions. + * @member {Array.} actions + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.actions = $util.emptyArray; + + /** + * Example displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.displayName = ""; + + /** + * Example description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.description = ""; + + /** + * Example tokenCount. + * @member {number|Long} tokenCount + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.tokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Example createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.createTime = null; + + /** + * Example updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.updateTime = null; + + /** + * Example conversationState. + * @member {google.cloud.dialogflow.cx.v3.OutputState} conversationState + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.conversationState = 0; + + /** + * Example languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + */ + Example.prototype.languageCode = ""; + + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {google.cloud.dialogflow.cx.v3.IExample=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Example.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {google.cloud.dialogflow.cx.v3.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.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.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Action.encode(message.actions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.playbookInput != null && Object.hasOwnProperty.call(message, "playbookInput")) + $root.google.cloud.dialogflow.cx.v3.PlaybookInput.encode(message.playbookInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.playbookOutput != null && Object.hasOwnProperty.call(message, "playbookOutput")) + $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.encode(message.playbookOutput, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.tokenCount); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.conversationState != null && Object.hasOwnProperty.call(message, "conversationState")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.conversationState); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {google.cloud.dialogflow.cx.v3.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.playbookInput = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.dialogflow.cx.v3.Action.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 9: { + message.tokenCount = reader.int64(); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.conversationState = reader.int32(); + break; + } + case 13: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Example message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.verify(message.playbookInput, long + 1); + if (error) + return "playbookInput." + error; + } + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.verify(message.playbookOutput, long + 1); + if (error) + return "playbookOutput." + error; + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Action.verify(message.actions[i], long + 1); + if (error) + return "actions." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount) && !(message.tokenCount && $util.isInteger(message.tokenCount.low) && $util.isInteger(message.tokenCount.high))) + return "tokenCount: integer|Long expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.conversationState != null && message.hasOwnProperty("conversationState")) + switch (message.conversationState) { + default: + return "conversationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Example} Example + */ + Example.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Example) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Example(); + if (object.name != null) + message.name = String(object.name); + if (object.playbookInput != null) { + if (typeof object.playbookInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Example.playbookInput: object expected"); + message.playbookInput = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.fromObject(object.playbookInput, long + 1); + } + if (object.playbookOutput != null) { + if (typeof object.playbookOutput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Example.playbookOutput: object expected"); + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.fromObject(object.playbookOutput, long + 1); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Example.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Example.actions: object expected"); + message.actions[i] = $root.google.cloud.dialogflow.cx.v3.Action.fromObject(object.actions[i], long + 1); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.tokenCount != null) + if ($util.Long) + (message.tokenCount = $util.Long.fromValue(object.tokenCount)).unsigned = false; + else if (typeof object.tokenCount === "string") + message.tokenCount = parseInt(object.tokenCount, 10); + else if (typeof object.tokenCount === "number") + message.tokenCount = object.tokenCount; + else if (typeof object.tokenCount === "object") + message.tokenCount = new $util.LongBits(object.tokenCount.low >>> 0, object.tokenCount.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Example.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Example.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + switch (object.conversationState) { + default: + if (typeof object.conversationState === "number") { + message.conversationState = object.conversationState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.conversationState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.conversationState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.conversationState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.conversationState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.conversationState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.conversationState = 5; + break; + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {google.cloud.dialogflow.cx.v3.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.name = ""; + object.playbookInput = null; + object.playbookOutput = null; + object.displayName = ""; + object.description = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.tokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tokenCount = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.conversationState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.dialogflow.cx.v3.Action.toObject(message.actions[j], options); + } + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) + object.playbookInput = $root.google.cloud.dialogflow.cx.v3.PlaybookInput.toObject(message.playbookInput, options); + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) + object.playbookOutput = $root.google.cloud.dialogflow.cx.v3.PlaybookOutput.toObject(message.playbookOutput, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (typeof message.tokenCount === "number") + object.tokenCount = options.longs === String ? String(message.tokenCount) : message.tokenCount; + else + object.tokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.tokenCount) : options.longs === Number ? new $util.LongBits(message.tokenCount.low >>> 0, message.tokenCount.high >>> 0).toNumber() : message.tokenCount; + if (message.createTime != null && message.hasOwnProperty("createTime")) + 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.conversationState != null && message.hasOwnProperty("conversationState")) + object.conversationState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.OutputState[message.conversationState] === undefined ? message.conversationState : $root.google.cloud.dialogflow.cx.v3.OutputState[message.conversationState] : message.conversationState; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Example"; + }; + + return Example; + })(); + + v3.Experiments = (function() { + + /** + * Constructs a new Experiments service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Experiments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Experiments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Experiments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Experiments; + + /** + * Creates new Experiments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Experiments} RPC service. Useful where requests and/or responses are streamed. + */ + Experiments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|listExperiments}. + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @typedef ListExperimentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListExperimentsResponse} [response] ListExperimentsResponse + */ + + /** + * Calls ListExperiments. + * @function listExperiments + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsRequest} request ListExperimentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Experiments.ListExperimentsCallback} callback Node-style callback called with the error, if any, and ListExperimentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.listExperiments = function listExperiments(request, callback) { + return this.rpcCall(listExperiments, $root.google.cloud.dialogflow.cx.v3.ListExperimentsRequest, $root.google.cloud.dialogflow.cx.v3.ListExperimentsResponse, request, callback); + }, "name", { value: "ListExperiments" }); + + /** + * Calls ListExperiments. + * @function listExperiments + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsRequest} request ListExperimentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|getExperiment}. + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @typedef GetExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Experiment} [response] Experiment + */ + + /** + * Calls GetExperiment. + * @function getExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetExperimentRequest} request GetExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Experiments.GetExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.getExperiment = function getExperiment(request, callback) { + return this.rpcCall(getExperiment, $root.google.cloud.dialogflow.cx.v3.GetExperimentRequest, $root.google.cloud.dialogflow.cx.v3.Experiment, request, callback); + }, "name", { value: "GetExperiment" }); + + /** + * Calls GetExperiment. + * @function getExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetExperimentRequest} request GetExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|createExperiment}. + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @typedef CreateExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Experiment} [response] Experiment + */ + + /** + * Calls CreateExperiment. + * @function createExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateExperimentRequest} request CreateExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Experiments.CreateExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.createExperiment = function createExperiment(request, callback) { + return this.rpcCall(createExperiment, $root.google.cloud.dialogflow.cx.v3.CreateExperimentRequest, $root.google.cloud.dialogflow.cx.v3.Experiment, request, callback); + }, "name", { value: "CreateExperiment" }); + + /** + * Calls CreateExperiment. + * @function createExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateExperimentRequest} request CreateExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|updateExperiment}. + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @typedef UpdateExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Experiment} [response] Experiment + */ + + /** + * Calls UpdateExperiment. + * @function updateExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest} request UpdateExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Experiments.UpdateExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.updateExperiment = function updateExperiment(request, callback) { + return this.rpcCall(updateExperiment, $root.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest, $root.google.cloud.dialogflow.cx.v3.Experiment, request, callback); + }, "name", { value: "UpdateExperiment" }); + + /** + * Calls UpdateExperiment. + * @function updateExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest} request UpdateExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|deleteExperiment}. + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @typedef DeleteExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExperiment. + * @function deleteExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest} request DeleteExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Experiments.DeleteExperimentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.deleteExperiment = function deleteExperiment(request, callback) { + return this.rpcCall(deleteExperiment, $root.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExperiment" }); + + /** + * Calls DeleteExperiment. + * @function deleteExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest} request DeleteExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|startExperiment}. + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @typedef StartExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Experiment} [response] Experiment + */ + + /** + * Calls StartExperiment. + * @function startExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IStartExperimentRequest} request StartExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Experiments.StartExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.startExperiment = function startExperiment(request, callback) { + return this.rpcCall(startExperiment, $root.google.cloud.dialogflow.cx.v3.StartExperimentRequest, $root.google.cloud.dialogflow.cx.v3.Experiment, request, callback); + }, "name", { value: "StartExperiment" }); + + /** + * Calls StartExperiment. + * @function startExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IStartExperimentRequest} request StartExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Experiments|stopExperiment}. + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @typedef StopExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Experiment} [response] Experiment + */ + + /** + * Calls StopExperiment. + * @function stopExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IStopExperimentRequest} request StopExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Experiments.StopExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.stopExperiment = function stopExperiment(request, callback) { + return this.rpcCall(stopExperiment, $root.google.cloud.dialogflow.cx.v3.StopExperimentRequest, $root.google.cloud.dialogflow.cx.v3.Experiment, request, callback); + }, "name", { value: "StopExperiment" }); + + /** + * Calls StopExperiment. + * @function stopExperiment + * @memberof google.cloud.dialogflow.cx.v3.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IStopExperimentRequest} request StopExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Experiments; + })(); + + v3.Experiment = (function() { + + /** + * Properties of an Experiment. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExperiment + * @property {string|null} [name] Experiment name + * @property {string|null} [displayName] Experiment displayName + * @property {string|null} [description] Experiment description + * @property {google.cloud.dialogflow.cx.v3.Experiment.State|null} [state] Experiment state + * @property {google.cloud.dialogflow.cx.v3.Experiment.IDefinition|null} [definition] Experiment definition + * @property {google.cloud.dialogflow.cx.v3.IRolloutConfig|null} [rolloutConfig] Experiment rolloutConfig + * @property {google.cloud.dialogflow.cx.v3.IRolloutState|null} [rolloutState] Experiment rolloutState + * @property {string|null} [rolloutFailureReason] Experiment rolloutFailureReason + * @property {google.cloud.dialogflow.cx.v3.Experiment.IResult|null} [result] Experiment result + * @property {google.protobuf.ITimestamp|null} [createTime] Experiment createTime + * @property {google.protobuf.ITimestamp|null} [startTime] Experiment startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Experiment endTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Experiment lastUpdateTime + * @property {google.protobuf.IDuration|null} [experimentLength] Experiment experimentLength + * @property {Array.|null} [variantsHistory] Experiment variantsHistory + */ + + /** + * Constructs a new Experiment. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an Experiment. + * @implements IExperiment + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExperiment=} [properties] Properties to set + */ + function Experiment(properties) { + this.variantsHistory = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Experiment name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.name = ""; + + /** + * Experiment displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.displayName = ""; + + /** + * Experiment description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.description = ""; + + /** + * Experiment state. + * @member {google.cloud.dialogflow.cx.v3.Experiment.State} state + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.state = 0; + + /** + * Experiment definition. + * @member {google.cloud.dialogflow.cx.v3.Experiment.IDefinition|null|undefined} definition + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.definition = null; + + /** + * Experiment rolloutConfig. + * @member {google.cloud.dialogflow.cx.v3.IRolloutConfig|null|undefined} rolloutConfig + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.rolloutConfig = null; + + /** + * Experiment rolloutState. + * @member {google.cloud.dialogflow.cx.v3.IRolloutState|null|undefined} rolloutState + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.rolloutState = null; + + /** + * Experiment rolloutFailureReason. + * @member {string} rolloutFailureReason + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.rolloutFailureReason = ""; + + /** + * Experiment result. + * @member {google.cloud.dialogflow.cx.v3.Experiment.IResult|null|undefined} result + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.result = null; + + /** + * Experiment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.createTime = null; + + /** + * Experiment startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.startTime = null; + + /** + * Experiment endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.endTime = null; + + /** + * Experiment lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.lastUpdateTime = null; + + /** + * Experiment experimentLength. + * @member {google.protobuf.IDuration|null|undefined} experimentLength + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.experimentLength = null; + + /** + * Experiment variantsHistory. + * @member {Array.} variantsHistory + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + */ + Experiment.prototype.variantsHistory = $util.emptyArray; + + /** + * Creates a new Experiment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3.IExperiment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Experiment} Experiment instance + */ + Experiment.create = function create(properties) { + return new Experiment(properties); + }; + + /** + * Encodes the specified Experiment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3.IExperiment} message Experiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Experiment.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.definition != null && Object.hasOwnProperty.call(message, "definition")) + $root.google.cloud.dialogflow.cx.v3.Experiment.Definition.encode(message.definition, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.dialogflow.cx.v3.Experiment.Result.encode(message.result, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.experimentLength != null && Object.hasOwnProperty.call(message, "experimentLength")) + $root.google.protobuf.Duration.encode(message.experimentLength, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.variantsHistory != null && message.variantsHistory.length) + for (var i = 0; i < message.variantsHistory.length; ++i) + $root.google.cloud.dialogflow.cx.v3.VariantsHistory.encode(message.variantsHistory[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.rolloutConfig != null && Object.hasOwnProperty.call(message, "rolloutConfig")) + $root.google.cloud.dialogflow.cx.v3.RolloutConfig.encode(message.rolloutConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.rolloutState != null && Object.hasOwnProperty.call(message, "rolloutState")) + $root.google.cloud.dialogflow.cx.v3.RolloutState.encode(message.rolloutState, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.rolloutFailureReason != null && Object.hasOwnProperty.call(message, "rolloutFailureReason")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.rolloutFailureReason); + return writer; + }; + + /** + * Encodes the specified Experiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3.IExperiment} message Experiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Experiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Experiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Experiment} Experiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Experiment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Experiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.definition = $root.google.cloud.dialogflow.cx.v3.Experiment.Definition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.rolloutConfig = $root.google.cloud.dialogflow.cx.v3.RolloutConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.rolloutState = $root.google.cloud.dialogflow.cx.v3.RolloutState.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.rolloutFailureReason = reader.string(); + break; + } + case 6: { + message.result = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.experimentLength = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + if (!(message.variantsHistory && message.variantsHistory.length)) + message.variantsHistory = []; + message.variantsHistory.push($root.google.cloud.dialogflow.cx.v3.VariantsHistory.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Experiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Experiment} Experiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Experiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Experiment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Experiment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.definition != null && message.hasOwnProperty("definition")) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.Definition.verify(message.definition, long + 1); + if (error) + return "definition." + error; + } + if (message.rolloutConfig != null && message.hasOwnProperty("rolloutConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.RolloutConfig.verify(message.rolloutConfig, long + 1); + if (error) + return "rolloutConfig." + error; + } + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) { + var error = $root.google.cloud.dialogflow.cx.v3.RolloutState.verify(message.rolloutState, long + 1); + if (error) + return "rolloutState." + error; + } + if (message.rolloutFailureReason != null && message.hasOwnProperty("rolloutFailureReason")) + if (!$util.isString(message.rolloutFailureReason)) + return "rolloutFailureReason: string expected"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.verify(message.result, long + 1); + if (error) + return "result." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime, long + 1); + if (error) + return "lastUpdateTime." + error; + } + if (message.experimentLength != null && message.hasOwnProperty("experimentLength")) { + var error = $root.google.protobuf.Duration.verify(message.experimentLength, long + 1); + if (error) + return "experimentLength." + error; + } + if (message.variantsHistory != null && message.hasOwnProperty("variantsHistory")) { + if (!Array.isArray(message.variantsHistory)) + return "variantsHistory: array expected"; + for (var i = 0; i < message.variantsHistory.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.VariantsHistory.verify(message.variantsHistory[i], long + 1); + if (error) + return "variantsHistory." + error; + } + } + return null; + }; + + /** + * Creates an Experiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Experiment} Experiment + */ + Experiment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Experiment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Experiment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "DRAFT": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + case "ROLLOUT_FAILED": + case 4: + message.state = 4; + break; + } + if (object.definition != null) { + if (typeof object.definition !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.definition: object expected"); + message.definition = $root.google.cloud.dialogflow.cx.v3.Experiment.Definition.fromObject(object.definition, long + 1); + } + if (object.rolloutConfig != null) { + if (typeof object.rolloutConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.rolloutConfig: object expected"); + message.rolloutConfig = $root.google.cloud.dialogflow.cx.v3.RolloutConfig.fromObject(object.rolloutConfig, long + 1); + } + if (object.rolloutState != null) { + if (typeof object.rolloutState !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.rolloutState: object expected"); + message.rolloutState = $root.google.cloud.dialogflow.cx.v3.RolloutState.fromObject(object.rolloutState, long + 1); + } + if (object.rolloutFailureReason != null) + message.rolloutFailureReason = String(object.rolloutFailureReason); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.result: object expected"); + message.result = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.fromObject(object.result, long + 1); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime, long + 1); + } + if (object.experimentLength != null) { + if (typeof object.experimentLength !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.experimentLength: object expected"); + message.experimentLength = $root.google.protobuf.Duration.fromObject(object.experimentLength, long + 1); + } + if (object.variantsHistory) { + if (!Array.isArray(object.variantsHistory)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.variantsHistory: array expected"); + message.variantsHistory = []; + for (var i = 0; i < object.variantsHistory.length; ++i) { + if (typeof object.variantsHistory[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.variantsHistory: object expected"); + message.variantsHistory[i] = $root.google.cloud.dialogflow.cx.v3.VariantsHistory.fromObject(object.variantsHistory[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an Experiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment} message Experiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Experiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.variantsHistory = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.definition = null; + object.result = null; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.lastUpdateTime = null; + object.experimentLength = null; + object.rolloutConfig = null; + object.rolloutState = null; + object.rolloutFailureReason = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Experiment.State[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3.Experiment.State[message.state] : message.state; + if (message.definition != null && message.hasOwnProperty("definition")) + object.definition = $root.google.cloud.dialogflow.cx.v3.Experiment.Definition.toObject(message.definition, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.toObject(message.result, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.experimentLength != null && message.hasOwnProperty("experimentLength")) + object.experimentLength = $root.google.protobuf.Duration.toObject(message.experimentLength, options); + if (message.variantsHistory && message.variantsHistory.length) { + object.variantsHistory = []; + for (var j = 0; j < message.variantsHistory.length; ++j) + object.variantsHistory[j] = $root.google.cloud.dialogflow.cx.v3.VariantsHistory.toObject(message.variantsHistory[j], options); + } + if (message.rolloutConfig != null && message.hasOwnProperty("rolloutConfig")) + object.rolloutConfig = $root.google.cloud.dialogflow.cx.v3.RolloutConfig.toObject(message.rolloutConfig, options); + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + object.rolloutState = $root.google.cloud.dialogflow.cx.v3.RolloutState.toObject(message.rolloutState, options); + if (message.rolloutFailureReason != null && message.hasOwnProperty("rolloutFailureReason")) + object.rolloutFailureReason = message.rolloutFailureReason; + return object; + }; + + /** + * Converts this Experiment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @instance + * @returns {Object.} JSON object + */ + Experiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Experiment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Experiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Experiment"; + }; + + /** + * State enum. + * @name google.cloud.dialogflow.cx.v3.Experiment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} DRAFT=1 DRAFT value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + * @property {number} ROLLOUT_FAILED=4 ROLLOUT_FAILED value + */ + Experiment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRAFT"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + values[valuesById[4] = "ROLLOUT_FAILED"] = 4; + return values; + })(); + + Experiment.Definition = (function() { + + /** + * Properties of a Definition. + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @interface IDefinition + * @property {string|null} [condition] Definition condition + * @property {google.cloud.dialogflow.cx.v3.IVersionVariants|null} [versionVariants] Definition versionVariants + */ + + /** + * Constructs a new Definition. + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @classdesc Represents a Definition. + * @implements IDefinition + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Experiment.IDefinition=} [properties] Properties to set + */ + function Definition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Definition condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @instance + */ + Definition.prototype.condition = ""; + + /** + * Definition versionVariants. + * @member {google.cloud.dialogflow.cx.v3.IVersionVariants|null|undefined} versionVariants + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @instance + */ + Definition.prototype.versionVariants = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Definition variants. + * @member {"versionVariants"|undefined} variants + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @instance + */ + Object.defineProperty(Definition.prototype, "variants", { + get: $util.oneOfGetter($oneOfFields = ["versionVariants"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Definition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.IDefinition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Definition} Definition instance + */ + Definition.create = function create(properties) { + return new Definition(properties); + }; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Definition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.versionVariants != null && Object.hasOwnProperty.call(message, "versionVariants")) + $root.google.cloud.dialogflow.cx.v3.VersionVariants.encode(message.versionVariants, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Definition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Definition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.versionVariants = $root.google.cloud.dialogflow.cx.v3.VersionVariants.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Definition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Definition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + properties.variants = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.VersionVariants.verify(message.versionVariants, long + 1); + if (error) + return "versionVariants." + error; + } + } + return null; + }; + + /** + * Creates a Definition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Definition} Definition + */ + Definition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Experiment.Definition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Definition(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.versionVariants != null) { + if (typeof object.versionVariants !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.Definition.versionVariants: object expected"); + message.versionVariants = $root.google.cloud.dialogflow.cx.v3.VersionVariants.fromObject(object.versionVariants, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Definition} message Definition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Definition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.condition = ""; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + object.versionVariants = $root.google.cloud.dialogflow.cx.v3.VersionVariants.toObject(message.versionVariants, options); + if (options.oneofs) + object.variants = "versionVariants"; + } + return object; + }; + + /** + * Converts this Definition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @instance + * @returns {Object.} JSON object + */ + Definition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Definition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Definition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Definition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Experiment.Definition"; + }; + + return Definition; + })(); + + Experiment.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @interface IResult + * @property {Array.|null} [versionMetrics] Result versionMetrics + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Result lastUpdateTime + */ + + /** + * Constructs a new Result. + * @memberof google.cloud.dialogflow.cx.v3.Experiment + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Experiment.IResult=} [properties] Properties to set + */ + function Result(properties) { + this.versionMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Result versionMetrics. + * @member {Array.} versionMetrics + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @instance + */ + Result.prototype.versionMetrics = $util.emptyArray; + + /** + * Result lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @instance + */ + Result.prototype.lastUpdateTime = null; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.IResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionMetrics != null && message.versionMetrics.length) + for (var i = 0; i < message.versionMetrics.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.encode(message.versionMetrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.versionMetrics && message.versionMetrics.length)) + message.versionMetrics = []; + message.versionMetrics.push($root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.versionMetrics != null && message.hasOwnProperty("versionMetrics")) { + if (!Array.isArray(message.versionMetrics)) + return "versionMetrics: array expected"; + for (var i = 0; i < message.versionMetrics.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.verify(message.versionMetrics[i], long + 1); + if (error) + return "versionMetrics." + error; + } + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime, long + 1); + if (error) + return "lastUpdateTime." + error; + } + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result} Result + */ + Result.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Experiment.Result) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result(); + if (object.versionMetrics) { + if (!Array.isArray(object.versionMetrics)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.Result.versionMetrics: array expected"); + message.versionMetrics = []; + for (var i = 0; i < object.versionMetrics.length; ++i) { + if (typeof object.versionMetrics[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.Result.versionMetrics: object expected"); + message.versionMetrics[i] = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.fromObject(object.versionMetrics[i], long + 1); + } + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.Result.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionMetrics = []; + if (options.defaults) + object.lastUpdateTime = null; + if (message.versionMetrics && message.versionMetrics.length) { + object.versionMetrics = []; + for (var j = 0; j < message.versionMetrics.length; ++j) + object.versionMetrics[j] = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.toObject(message.versionMetrics[j], options); + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Result + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Result.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Experiment.Result"; + }; + + /** + * MetricType enum. + * @name google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType + * @enum {number} + * @property {number} METRIC_UNSPECIFIED=0 METRIC_UNSPECIFIED value + * @property {number} CONTAINED_SESSION_NO_CALLBACK_RATE=1 CONTAINED_SESSION_NO_CALLBACK_RATE value + * @property {number} LIVE_AGENT_HANDOFF_RATE=2 LIVE_AGENT_HANDOFF_RATE value + * @property {number} CALLBACK_SESSION_RATE=3 CALLBACK_SESSION_RATE value + * @property {number} ABANDONED_SESSION_RATE=4 ABANDONED_SESSION_RATE value + * @property {number} SESSION_END_RATE=5 SESSION_END_RATE value + */ + Result.MetricType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTAINED_SESSION_NO_CALLBACK_RATE"] = 1; + values[valuesById[2] = "LIVE_AGENT_HANDOFF_RATE"] = 2; + values[valuesById[3] = "CALLBACK_SESSION_RATE"] = 3; + values[valuesById[4] = "ABANDONED_SESSION_RATE"] = 4; + values[valuesById[5] = "SESSION_END_RATE"] = 5; + return values; + })(); + + /** + * CountType enum. + * @name google.cloud.dialogflow.cx.v3.Experiment.Result.CountType + * @enum {number} + * @property {number} COUNT_TYPE_UNSPECIFIED=0 COUNT_TYPE_UNSPECIFIED value + * @property {number} TOTAL_NO_MATCH_COUNT=1 TOTAL_NO_MATCH_COUNT value + * @property {number} TOTAL_TURN_COUNT=2 TOTAL_TURN_COUNT value + * @property {number} AVERAGE_TURN_COUNT=3 AVERAGE_TURN_COUNT value + */ + Result.CountType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COUNT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOTAL_NO_MATCH_COUNT"] = 1; + values[valuesById[2] = "TOTAL_TURN_COUNT"] = 2; + values[valuesById[3] = "AVERAGE_TURN_COUNT"] = 3; + return values; + })(); + + Result.ConfidenceInterval = (function() { + + /** + * Properties of a ConfidenceInterval. + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @interface IConfidenceInterval + * @property {number|null} [confidenceLevel] ConfidenceInterval confidenceLevel + * @property {number|null} [ratio] ConfidenceInterval ratio + * @property {number|null} [lowerBound] ConfidenceInterval lowerBound + * @property {number|null} [upperBound] ConfidenceInterval upperBound + */ + + /** + * Constructs a new ConfidenceInterval. + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @classdesc Represents a ConfidenceInterval. + * @implements IConfidenceInterval + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval=} [properties] Properties to set + */ + function ConfidenceInterval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceInterval confidenceLevel. + * @member {number} confidenceLevel + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.confidenceLevel = 0; + + /** + * ConfidenceInterval ratio. + * @member {number} ratio + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.ratio = 0; + + /** + * ConfidenceInterval lowerBound. + * @member {number} lowerBound + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.lowerBound = 0; + + /** + * ConfidenceInterval upperBound. + * @member {number} upperBound + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.upperBound = 0; + + /** + * Creates a new ConfidenceInterval instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval} ConfidenceInterval instance + */ + ConfidenceInterval.create = function create(properties) { + return new ConfidenceInterval(properties); + }; + + /** + * Encodes the specified ConfidenceInterval message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval} message ConfidenceInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceInterval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceLevel != null && Object.hasOwnProperty.call(message, "confidenceLevel")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.confidenceLevel); + if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.ratio); + if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.lowerBound); + if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.upperBound); + return writer; + }; + + /** + * Encodes the specified ConfidenceInterval message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval} message ConfidenceInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceInterval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval} ConfidenceInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceInterval.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidenceLevel = reader.double(); + break; + } + case 2: { + message.ratio = reader.double(); + break; + } + case 3: { + message.lowerBound = reader.double(); + break; + } + case 4: { + message.upperBound = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval} ConfidenceInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceInterval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceInterval message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceInterval.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + if (typeof message.confidenceLevel !== "number") + return "confidenceLevel: number expected"; + if (message.ratio != null && message.hasOwnProperty("ratio")) + if (typeof message.ratio !== "number") + return "ratio: number expected"; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + if (typeof message.lowerBound !== "number") + return "lowerBound: number expected"; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + if (typeof message.upperBound !== "number") + return "upperBound: number expected"; + return null; + }; + + /** + * Creates a ConfidenceInterval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval} ConfidenceInterval + */ + ConfidenceInterval.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval(); + if (object.confidenceLevel != null) + message.confidenceLevel = Number(object.confidenceLevel); + if (object.ratio != null) + message.ratio = Number(object.ratio); + if (object.lowerBound != null) + message.lowerBound = Number(object.lowerBound); + if (object.upperBound != null) + message.upperBound = Number(object.upperBound); + return message; + }; + + /** + * Creates a plain object from a ConfidenceInterval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval} message ConfidenceInterval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceInterval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceLevel = 0; + object.ratio = 0; + object.lowerBound = 0; + object.upperBound = 0; + } + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + object.confidenceLevel = options.json && !isFinite(message.confidenceLevel) ? String(message.confidenceLevel) : message.confidenceLevel; + if (message.ratio != null && message.hasOwnProperty("ratio")) + object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + object.lowerBound = options.json && !isFinite(message.lowerBound) ? String(message.lowerBound) : message.lowerBound; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + object.upperBound = options.json && !isFinite(message.upperBound) ? String(message.upperBound) : message.upperBound; + return object; + }; + + /** + * Converts this ConfidenceInterval to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @instance + * @returns {Object.} JSON object + */ + ConfidenceInterval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceInterval + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceInterval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval"; + }; + + return ConfidenceInterval; + })(); + + Result.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @interface IMetric + * @property {google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType|null} [type] Metric type + * @property {google.cloud.dialogflow.cx.v3.Experiment.Result.CountType|null} [countType] Metric countType + * @property {number|null} [ratio] Metric ratio + * @property {number|null} [count] Metric count + * @property {google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval|null} [confidenceInterval] Metric confidenceInterval + */ + + /** + * Constructs a new Metric. + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric=} [properties] Properties to set + */ + function Metric(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metric type. + * @member {google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType} type + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @instance + */ + Metric.prototype.type = 0; + + /** + * Metric countType. + * @member {google.cloud.dialogflow.cx.v3.Experiment.Result.CountType} countType + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @instance + */ + Metric.prototype.countType = 0; + + /** + * Metric ratio. + * @member {number|null|undefined} ratio + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @instance + */ + Metric.prototype.ratio = null; + + /** + * Metric count. + * @member {number|null|undefined} count + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @instance + */ + Metric.prototype.count = null; + + /** + * Metric confidenceInterval. + * @member {google.cloud.dialogflow.cx.v3.Experiment.Result.IConfidenceInterval|null|undefined} confidenceInterval + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @instance + */ + Metric.prototype.confidenceInterval = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Metric value. + * @member {"ratio"|"count"|undefined} value + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @instance + */ + Object.defineProperty(Metric.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["ratio", "count"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.ratio); + if (message.confidenceInterval != null && Object.hasOwnProperty.call(message, "confidenceInterval")) + $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.encode(message.confidenceInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.count); + if (message.countType != null && Object.hasOwnProperty.call(message, "countType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.countType); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 5: { + message.countType = reader.int32(); + break; + } + case 2: { + message.ratio = reader.double(); + break; + } + case 4: { + message.count = reader.double(); + break; + } + case 3: { + message.confidenceInterval = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metric message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.countType != null && message.hasOwnProperty("countType")) + switch (message.countType) { + default: + return "countType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.ratio != null && message.hasOwnProperty("ratio")) { + properties.value = 1; + if (typeof message.ratio !== "number") + return "ratio: number expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.count !== "number") + return "count: number expected"; + } + if (message.confidenceInterval != null && message.hasOwnProperty("confidenceInterval")) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.verify(message.confidenceInterval, long + 1); + if (error) + return "confidenceInterval." + error; + } + return null; + }; + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.Metric} Metric + */ + Metric.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "METRIC_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CONTAINED_SESSION_NO_CALLBACK_RATE": + case 1: + message.type = 1; + break; + case "LIVE_AGENT_HANDOFF_RATE": + case 2: + message.type = 2; + break; + case "CALLBACK_SESSION_RATE": + case 3: + message.type = 3; + break; + case "ABANDONED_SESSION_RATE": + case 4: + message.type = 4; + break; + case "SESSION_END_RATE": + case 5: + message.type = 5; + break; + } + switch (object.countType) { + default: + if (typeof object.countType === "number") { + message.countType = object.countType; + break; + } + break; + case "COUNT_TYPE_UNSPECIFIED": + case 0: + message.countType = 0; + break; + case "TOTAL_NO_MATCH_COUNT": + case 1: + message.countType = 1; + break; + case "TOTAL_TURN_COUNT": + case 2: + message.countType = 2; + break; + case "AVERAGE_TURN_COUNT": + case 3: + message.countType = 3; + break; + } + if (object.ratio != null) + message.ratio = Number(object.ratio); + if (object.count != null) + message.count = Number(object.count); + if (object.confidenceInterval != null) { + if (typeof object.confidenceInterval !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.confidenceInterval: object expected"); + message.confidenceInterval = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.fromObject(object.confidenceInterval, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "METRIC_UNSPECIFIED" : 0; + object.confidenceInterval = null; + object.countType = options.enums === String ? "COUNT_TYPE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType[message.type] : message.type; + if (message.ratio != null && message.hasOwnProperty("ratio")) { + object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; + if (options.oneofs) + object.value = "ratio"; + } + if (message.confidenceInterval != null && message.hasOwnProperty("confidenceInterval")) + object.confidenceInterval = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval.toObject(message.confidenceInterval, options); + if (message.count != null && message.hasOwnProperty("count")) { + object.count = options.json && !isFinite(message.count) ? String(message.count) : message.count; + if (options.oneofs) + object.value = "count"; + } + if (message.countType != null && message.hasOwnProperty("countType")) + object.countType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Experiment.Result.CountType[message.countType] === undefined ? message.countType : $root.google.cloud.dialogflow.cx.v3.Experiment.Result.CountType[message.countType] : message.countType; + return object; + }; + + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Experiment.Result.Metric"; + }; + + return Metric; + })(); + + Result.VersionMetrics = (function() { + + /** + * Properties of a VersionMetrics. + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @interface IVersionMetrics + * @property {string|null} [version] VersionMetrics version + * @property {Array.|null} [metrics] VersionMetrics metrics + * @property {number|null} [sessionCount] VersionMetrics sessionCount + */ + + /** + * Constructs a new VersionMetrics. + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result + * @classdesc Represents a VersionMetrics. + * @implements IVersionMetrics + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics=} [properties] Properties to set + */ + function VersionMetrics(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionMetrics version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @instance + */ + VersionMetrics.prototype.version = ""; + + /** + * VersionMetrics metrics. + * @member {Array.} metrics + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @instance + */ + VersionMetrics.prototype.metrics = $util.emptyArray; + + /** + * VersionMetrics sessionCount. + * @member {number} sessionCount + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @instance + */ + VersionMetrics.prototype.sessionCount = 0; + + /** + * Creates a new VersionMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics} VersionMetrics instance + */ + VersionMetrics.create = function create(properties) { + return new VersionMetrics(properties); + }; + + /** + * Encodes the specified VersionMetrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics} message VersionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.encode(message.metrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sessionCount); + return writer; + }; + + /** + * Encodes the specified VersionMetrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.IVersionMetrics} message VersionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics} VersionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.sessionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics} VersionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionMetrics message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.verify(message.metrics[i], long + 1); + if (error) + return "metrics." + error; + } + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (!$util.isInteger(message.sessionCount)) + return "sessionCount: integer expected"; + return null; + }; + + /** + * Creates a VersionMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics} VersionMetrics + */ + VersionMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics(); + if (object.version != null) + message.version = String(object.version); + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics.metrics: object expected"); + message.metrics[i] = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.fromObject(object.metrics[i], long + 1); + } + } + if (object.sessionCount != null) + message.sessionCount = object.sessionCount | 0; + return message; + }; + + /** + * Creates a plain object from a VersionMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics} message VersionMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) { + object.version = ""; + object.sessionCount = 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric.toObject(message.metrics[j], options); + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + object.sessionCount = message.sessionCount; + return object; + }; + + /** + * Converts this VersionMetrics to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @instance + * @returns {Object.} JSON object + */ + VersionMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionMetrics + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics"; + }; + + return VersionMetrics; + })(); + + return Result; + })(); + + return Experiment; + })(); + + v3.VersionVariants = (function() { + + /** + * Properties of a VersionVariants. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IVersionVariants + * @property {Array.|null} [variants] VersionVariants variants + */ + + /** + * Constructs a new VersionVariants. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a VersionVariants. + * @implements IVersionVariants + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IVersionVariants=} [properties] Properties to set + */ + function VersionVariants(properties) { + this.variants = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionVariants variants. + * @member {Array.} variants + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @instance + */ + VersionVariants.prototype.variants = $util.emptyArray; + + /** + * Creates a new VersionVariants instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3.IVersionVariants=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants} VersionVariants instance + */ + VersionVariants.create = function create(properties) { + return new VersionVariants(properties); + }; + + /** + * Encodes the specified VersionVariants message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3.IVersionVariants} message VersionVariants message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionVariants.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.variants != null && message.variants.length) + for (var i = 0; i < message.variants.length; ++i) + $root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant.encode(message.variants[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionVariants message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3.IVersionVariants} message VersionVariants message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionVariants.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionVariants message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants} VersionVariants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionVariants.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.VersionVariants(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.variants && message.variants.length)) + message.variants = []; + message.variants.push($root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VersionVariants message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants} VersionVariants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionVariants.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionVariants message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionVariants.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.variants != null && message.hasOwnProperty("variants")) { + if (!Array.isArray(message.variants)) + return "variants: array expected"; + for (var i = 0; i < message.variants.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant.verify(message.variants[i], long + 1); + if (error) + return "variants." + error; + } + } + return null; + }; + + /** + * Creates a VersionVariants message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants} VersionVariants + */ + VersionVariants.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.VersionVariants) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.VersionVariants(); + if (object.variants) { + if (!Array.isArray(object.variants)) + throw TypeError(".google.cloud.dialogflow.cx.v3.VersionVariants.variants: array expected"); + message.variants = []; + for (var i = 0; i < object.variants.length; ++i) { + if (typeof object.variants[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.VersionVariants.variants: object expected"); + message.variants[i] = $root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant.fromObject(object.variants[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a VersionVariants message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3.VersionVariants} message VersionVariants + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionVariants.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.variants = []; + if (message.variants && message.variants.length) { + object.variants = []; + for (var j = 0; j < message.variants.length; ++j) + object.variants[j] = $root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant.toObject(message.variants[j], options); + } + return object; + }; + + /** + * Converts this VersionVariants to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @instance + * @returns {Object.} JSON object + */ + VersionVariants.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionVariants + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionVariants.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.VersionVariants"; + }; + + VersionVariants.Variant = (function() { + + /** + * Properties of a Variant. + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @interface IVariant + * @property {string|null} [version] Variant version + * @property {number|null} [trafficAllocation] Variant trafficAllocation + * @property {boolean|null} [isControlGroup] Variant isControlGroup + */ + + /** + * Constructs a new Variant. + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants + * @classdesc Represents a Variant. + * @implements IVariant + * @constructor + * @param {google.cloud.dialogflow.cx.v3.VersionVariants.IVariant=} [properties] Properties to set + */ + function Variant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Variant version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @instance + */ + Variant.prototype.version = ""; + + /** + * Variant trafficAllocation. + * @member {number} trafficAllocation + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @instance + */ + Variant.prototype.trafficAllocation = 0; + + /** + * Variant isControlGroup. + * @member {boolean} isControlGroup + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @instance + */ + Variant.prototype.isControlGroup = false; + + /** + * Creates a new Variant instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3.VersionVariants.IVariant=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants.Variant} Variant instance + */ + Variant.create = function create(properties) { + return new Variant(properties); + }; + + /** + * Encodes the specified Variant message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.Variant.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3.VersionVariants.IVariant} message Variant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Variant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.trafficAllocation != null && Object.hasOwnProperty.call(message, "trafficAllocation")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.trafficAllocation); + if (message.isControlGroup != null && Object.hasOwnProperty.call(message, "isControlGroup")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isControlGroup); + return writer; + }; + + /** + * Encodes the specified Variant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VersionVariants.Variant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3.VersionVariants.IVariant} message Variant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Variant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Variant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants.Variant} Variant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Variant.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.trafficAllocation = reader.float(); + break; + } + case 3: { + message.isControlGroup = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Variant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants.Variant} Variant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Variant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Variant message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Variant.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.trafficAllocation != null && message.hasOwnProperty("trafficAllocation")) + if (typeof message.trafficAllocation !== "number") + return "trafficAllocation: number expected"; + if (message.isControlGroup != null && message.hasOwnProperty("isControlGroup")) + if (typeof message.isControlGroup !== "boolean") + return "isControlGroup: boolean expected"; + return null; + }; + + /** + * Creates a Variant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.VersionVariants.Variant} Variant + */ + Variant.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.VersionVariants.Variant(); + if (object.version != null) + message.version = String(object.version); + if (object.trafficAllocation != null) + message.trafficAllocation = Number(object.trafficAllocation); + if (object.isControlGroup != null) + message.isControlGroup = Boolean(object.isControlGroup); + return message; + }; + + /** + * Creates a plain object from a Variant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3.VersionVariants.Variant} message Variant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Variant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.trafficAllocation = 0; + object.isControlGroup = false; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.trafficAllocation != null && message.hasOwnProperty("trafficAllocation")) + object.trafficAllocation = options.json && !isFinite(message.trafficAllocation) ? String(message.trafficAllocation) : message.trafficAllocation; + if (message.isControlGroup != null && message.hasOwnProperty("isControlGroup")) + object.isControlGroup = message.isControlGroup; + return object; + }; + + /** + * Converts this Variant to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @instance + * @returns {Object.} JSON object + */ + Variant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Variant + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.VersionVariants.Variant + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Variant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.VersionVariants.Variant"; + }; + + return Variant; + })(); + + return VersionVariants; + })(); + + v3.VariantsHistory = (function() { + + /** + * Properties of a VariantsHistory. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IVariantsHistory + * @property {google.cloud.dialogflow.cx.v3.IVersionVariants|null} [versionVariants] VariantsHistory versionVariants + * @property {google.protobuf.ITimestamp|null} [updateTime] VariantsHistory updateTime + */ + + /** + * Constructs a new VariantsHistory. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a VariantsHistory. + * @implements IVariantsHistory + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IVariantsHistory=} [properties] Properties to set + */ + function VariantsHistory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VariantsHistory versionVariants. + * @member {google.cloud.dialogflow.cx.v3.IVersionVariants|null|undefined} versionVariants + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @instance + */ + VariantsHistory.prototype.versionVariants = null; + + /** + * VariantsHistory updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @instance + */ + VariantsHistory.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VariantsHistory variants. + * @member {"versionVariants"|undefined} variants + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @instance + */ + Object.defineProperty(VariantsHistory.prototype, "variants", { + get: $util.oneOfGetter($oneOfFields = ["versionVariants"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VariantsHistory instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3.IVariantsHistory=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.VariantsHistory} VariantsHistory instance + */ + VariantsHistory.create = function create(properties) { + return new VariantsHistory(properties); + }; + + /** + * Encodes the specified VariantsHistory message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VariantsHistory.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3.IVariantsHistory} message VariantsHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariantsHistory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionVariants != null && Object.hasOwnProperty.call(message, "versionVariants")) + $root.google.cloud.dialogflow.cx.v3.VersionVariants.encode(message.versionVariants, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VariantsHistory message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.VariantsHistory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3.IVariantsHistory} message VariantsHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariantsHistory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.VariantsHistory} VariantsHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariantsHistory.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.VariantsHistory(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.versionVariants = $root.google.cloud.dialogflow.cx.v3.VersionVariants.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.VariantsHistory} VariantsHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariantsHistory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VariantsHistory message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VariantsHistory.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + properties.variants = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.VersionVariants.verify(message.versionVariants, long + 1); + if (error) + return "versionVariants." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a VariantsHistory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.VariantsHistory} VariantsHistory + */ + VariantsHistory.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.VariantsHistory) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.VariantsHistory(); + if (object.versionVariants != null) { + if (typeof object.versionVariants !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.VariantsHistory.versionVariants: object expected"); + message.versionVariants = $root.google.cloud.dialogflow.cx.v3.VersionVariants.fromObject(object.versionVariants, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.VariantsHistory.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a VariantsHistory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3.VariantsHistory} message VariantsHistory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VariantsHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.updateTime = null; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + object.versionVariants = $root.google.cloud.dialogflow.cx.v3.VersionVariants.toObject(message.versionVariants, options); + if (options.oneofs) + object.variants = "versionVariants"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this VariantsHistory to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @instance + * @returns {Object.} JSON object + */ + VariantsHistory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VariantsHistory + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.VariantsHistory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VariantsHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.VariantsHistory"; + }; + + return VariantsHistory; + })(); + + v3.RolloutConfig = (function() { + + /** + * Properties of a RolloutConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRolloutConfig + * @property {Array.|null} [rolloutSteps] RolloutConfig rolloutSteps + * @property {string|null} [rolloutCondition] RolloutConfig rolloutCondition + * @property {string|null} [failureCondition] RolloutConfig failureCondition + */ + + /** + * Constructs a new RolloutConfig. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RolloutConfig. + * @implements IRolloutConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRolloutConfig=} [properties] Properties to set + */ + function RolloutConfig(properties) { + this.rolloutSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutConfig rolloutSteps. + * @member {Array.} rolloutSteps + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @instance + */ + RolloutConfig.prototype.rolloutSteps = $util.emptyArray; + + /** + * RolloutConfig rolloutCondition. + * @member {string} rolloutCondition + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @instance + */ + RolloutConfig.prototype.rolloutCondition = ""; + + /** + * RolloutConfig failureCondition. + * @member {string} failureCondition + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @instance + */ + RolloutConfig.prototype.failureCondition = ""; + + /** + * Creates a new RolloutConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IRolloutConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig} RolloutConfig instance + */ + RolloutConfig.create = function create(properties) { + return new RolloutConfig(properties); + }; + + /** + * Encodes the specified RolloutConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IRolloutConfig} message RolloutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rolloutSteps != null && message.rolloutSteps.length) + for (var i = 0; i < message.rolloutSteps.length; ++i) + $root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.encode(message.rolloutSteps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rolloutCondition != null && Object.hasOwnProperty.call(message, "rolloutCondition")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rolloutCondition); + if (message.failureCondition != null && Object.hasOwnProperty.call(message, "failureCondition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.failureCondition); + return writer; + }; + + /** + * Encodes the specified RolloutConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.IRolloutConfig} message RolloutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig} RolloutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RolloutConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rolloutSteps && message.rolloutSteps.length)) + message.rolloutSteps = []; + message.rolloutSteps.push($root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.rolloutCondition = reader.string(); + break; + } + case 3: { + message.failureCondition = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig} RolloutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rolloutSteps != null && message.hasOwnProperty("rolloutSteps")) { + if (!Array.isArray(message.rolloutSteps)) + return "rolloutSteps: array expected"; + for (var i = 0; i < message.rolloutSteps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.verify(message.rolloutSteps[i], long + 1); + if (error) + return "rolloutSteps." + error; + } + } + if (message.rolloutCondition != null && message.hasOwnProperty("rolloutCondition")) + if (!$util.isString(message.rolloutCondition)) + return "rolloutCondition: string expected"; + if (message.failureCondition != null && message.hasOwnProperty("failureCondition")) + if (!$util.isString(message.failureCondition)) + return "failureCondition: string expected"; + return null; + }; + + /** + * Creates a RolloutConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig} RolloutConfig + */ + RolloutConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RolloutConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RolloutConfig(); + if (object.rolloutSteps) { + if (!Array.isArray(object.rolloutSteps)) + throw TypeError(".google.cloud.dialogflow.cx.v3.RolloutConfig.rolloutSteps: array expected"); + message.rolloutSteps = []; + for (var i = 0; i < object.rolloutSteps.length; ++i) { + if (typeof object.rolloutSteps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RolloutConfig.rolloutSteps: object expected"); + message.rolloutSteps[i] = $root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.fromObject(object.rolloutSteps[i], long + 1); + } + } + if (object.rolloutCondition != null) + message.rolloutCondition = String(object.rolloutCondition); + if (object.failureCondition != null) + message.failureCondition = String(object.failureCondition); + return message; + }; + + /** + * Creates a plain object from a RolloutConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.RolloutConfig} message RolloutConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rolloutSteps = []; + if (options.defaults) { + object.rolloutCondition = ""; + object.failureCondition = ""; + } + if (message.rolloutSteps && message.rolloutSteps.length) { + object.rolloutSteps = []; + for (var j = 0; j < message.rolloutSteps.length; ++j) + object.rolloutSteps[j] = $root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.toObject(message.rolloutSteps[j], options); + } + if (message.rolloutCondition != null && message.hasOwnProperty("rolloutCondition")) + object.rolloutCondition = message.rolloutCondition; + if (message.failureCondition != null && message.hasOwnProperty("failureCondition")) + object.failureCondition = message.failureCondition; + return object; + }; + + /** + * Converts this RolloutConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @instance + * @returns {Object.} JSON object + */ + RolloutConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RolloutConfig"; + }; + + RolloutConfig.RolloutStep = (function() { + + /** + * Properties of a RolloutStep. + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @interface IRolloutStep + * @property {string|null} [displayName] RolloutStep displayName + * @property {number|null} [trafficPercent] RolloutStep trafficPercent + * @property {google.protobuf.IDuration|null} [minDuration] RolloutStep minDuration + */ + + /** + * Constructs a new RolloutStep. + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig + * @classdesc Represents a RolloutStep. + * @implements IRolloutStep + * @constructor + * @param {google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep=} [properties] Properties to set + */ + function RolloutStep(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutStep displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @instance + */ + RolloutStep.prototype.displayName = ""; + + /** + * RolloutStep trafficPercent. + * @member {number} trafficPercent + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @instance + */ + RolloutStep.prototype.trafficPercent = 0; + + /** + * RolloutStep minDuration. + * @member {google.protobuf.IDuration|null|undefined} minDuration + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @instance + */ + RolloutStep.prototype.minDuration = null; + + /** + * Creates a new RolloutStep instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep} RolloutStep instance + */ + RolloutStep.create = function create(properties) { + return new RolloutStep(properties); + }; + + /** + * Encodes the specified RolloutStep message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep} message RolloutStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.trafficPercent != null && Object.hasOwnProperty.call(message, "trafficPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trafficPercent); + if (message.minDuration != null && Object.hasOwnProperty.call(message, "minDuration")) + $root.google.protobuf.Duration.encode(message.minDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RolloutStep message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3.RolloutConfig.IRolloutStep} message RolloutStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutStep message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep} RolloutStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutStep.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.trafficPercent = reader.int32(); + break; + } + case 3: { + message.minDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep} RolloutStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutStep message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutStep.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.trafficPercent != null && message.hasOwnProperty("trafficPercent")) + if (!$util.isInteger(message.trafficPercent)) + return "trafficPercent: integer expected"; + if (message.minDuration != null && message.hasOwnProperty("minDuration")) { + var error = $root.google.protobuf.Duration.verify(message.minDuration, long + 1); + if (error) + return "minDuration." + error; + } + return null; + }; + + /** + * Creates a RolloutStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep} RolloutStep + */ + RolloutStep.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.trafficPercent != null) + message.trafficPercent = object.trafficPercent | 0; + if (object.minDuration != null) { + if (typeof object.minDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep.minDuration: object expected"); + message.minDuration = $root.google.protobuf.Duration.fromObject(object.minDuration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RolloutStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep} message RolloutStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.trafficPercent = 0; + object.minDuration = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.trafficPercent != null && message.hasOwnProperty("trafficPercent")) + object.trafficPercent = message.trafficPercent; + if (message.minDuration != null && message.hasOwnProperty("minDuration")) + object.minDuration = $root.google.protobuf.Duration.toObject(message.minDuration, options); + return object; + }; + + /** + * Converts this RolloutStep to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @instance + * @returns {Object.} JSON object + */ + RolloutStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutStep + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep"; + }; + + return RolloutStep; + })(); + + return RolloutConfig; + })(); + + v3.RolloutState = (function() { + + /** + * Properties of a RolloutState. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRolloutState + * @property {string|null} [step] RolloutState step + * @property {number|null} [stepIndex] RolloutState stepIndex + * @property {google.protobuf.ITimestamp|null} [startTime] RolloutState startTime + */ + + /** + * Constructs a new RolloutState. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RolloutState. + * @implements IRolloutState + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRolloutState=} [properties] Properties to set + */ + function RolloutState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutState step. + * @member {string} step + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @instance + */ + RolloutState.prototype.step = ""; + + /** + * RolloutState stepIndex. + * @member {number} stepIndex + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @instance + */ + RolloutState.prototype.stepIndex = 0; + + /** + * RolloutState startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @instance + */ + RolloutState.prototype.startTime = null; + + /** + * Creates a new RolloutState instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3.IRolloutState=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RolloutState} RolloutState instance + */ + RolloutState.create = function create(properties) { + return new RolloutState(properties); + }; + + /** + * Encodes the specified RolloutState message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutState.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3.IRolloutState} message RolloutState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.step); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.stepIndex != null && Object.hasOwnProperty.call(message, "stepIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.stepIndex); + return writer; + }; + + /** + * Encodes the specified RolloutState message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RolloutState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3.IRolloutState} message RolloutState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RolloutState} RolloutState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutState.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RolloutState(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.step = reader.string(); + break; + } + case 3: { + message.stepIndex = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RolloutState} RolloutState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutState message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutState.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.step != null && message.hasOwnProperty("step")) + if (!$util.isString(message.step)) + return "step: string expected"; + if (message.stepIndex != null && message.hasOwnProperty("stepIndex")) + if (!$util.isInteger(message.stepIndex)) + return "stepIndex: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a RolloutState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RolloutState} RolloutState + */ + RolloutState.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RolloutState) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RolloutState(); + if (object.step != null) + message.step = String(object.step); + if (object.stepIndex != null) + message.stepIndex = object.stepIndex | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RolloutState.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RolloutState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3.RolloutState} message RolloutState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.step = ""; + object.startTime = null; + object.stepIndex = 0; + } + if (message.step != null && message.hasOwnProperty("step")) + object.step = message.step; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.stepIndex != null && message.hasOwnProperty("stepIndex")) + object.stepIndex = message.stepIndex; + return object; + }; + + /** + * Converts this RolloutState to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @instance + * @returns {Object.} JSON object + */ + RolloutState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutState + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RolloutState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RolloutState"; + }; + + return RolloutState; + })(); + + v3.ListExperimentsRequest = (function() { + + /** + * Properties of a ListExperimentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListExperimentsRequest + * @property {string|null} [parent] ListExperimentsRequest parent + * @property {number|null} [pageSize] ListExperimentsRequest pageSize + * @property {string|null} [pageToken] ListExperimentsRequest pageToken + */ + + /** + * Constructs a new ListExperimentsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListExperimentsRequest. + * @implements IListExperimentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsRequest=} [properties] Properties to set + */ + function ListExperimentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExperimentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @instance + */ + ListExperimentsRequest.prototype.parent = ""; + + /** + * ListExperimentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @instance + */ + ListExperimentsRequest.prototype.pageSize = 0; + + /** + * ListExperimentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @instance + */ + ListExperimentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListExperimentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsRequest} ListExperimentsRequest instance + */ + ListExperimentsRequest.create = function create(properties) { + return new ListExperimentsRequest(properties); + }; + + /** + * Encodes the specified ListExperimentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsRequest} message ListExperimentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsRequest} message ListExperimentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsRequest} ListExperimentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsRequest} ListExperimentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExperimentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExperimentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListExperimentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsRequest} ListExperimentsRequest + */ + ListExperimentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListExperimentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListExperimentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListExperimentsRequest} message ListExperimentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExperimentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListExperimentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListExperimentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExperimentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExperimentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListExperimentsRequest"; + }; + + return ListExperimentsRequest; + })(); + + v3.ListExperimentsResponse = (function() { + + /** + * Properties of a ListExperimentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListExperimentsResponse + * @property {Array.|null} [experiments] ListExperimentsResponse experiments + * @property {string|null} [nextPageToken] ListExperimentsResponse nextPageToken + */ + + /** + * Constructs a new ListExperimentsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListExperimentsResponse. + * @implements IListExperimentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsResponse=} [properties] Properties to set + */ + function ListExperimentsResponse(properties) { + this.experiments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExperimentsResponse experiments. + * @member {Array.} experiments + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @instance + */ + ListExperimentsResponse.prototype.experiments = $util.emptyArray; + + /** + * ListExperimentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @instance + */ + ListExperimentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExperimentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsResponse} ListExperimentsResponse instance + */ + ListExperimentsResponse.create = function create(properties) { + return new ListExperimentsResponse(properties); + }; + + /** + * Encodes the specified ListExperimentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsResponse} message ListExperimentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.experiments != null && message.experiments.length) + for (var i = 0; i < message.experiments.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Experiment.encode(message.experiments[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 ListExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListExperimentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListExperimentsResponse} message ListExperimentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsResponse} ListExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListExperimentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.experiments && message.experiments.length)) + message.experiments = []; + message.experiments.push($root.google.cloud.dialogflow.cx.v3.Experiment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsResponse} ListExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExperimentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExperimentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.experiments != null && message.hasOwnProperty("experiments")) { + if (!Array.isArray(message.experiments)) + return "experiments: array expected"; + for (var i = 0; i < message.experiments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.verify(message.experiments[i], long + 1); + if (error) + return "experiments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListExperimentsResponse} ListExperimentsResponse + */ + ListExperimentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListExperimentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListExperimentsResponse(); + if (object.experiments) { + if (!Array.isArray(object.experiments)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListExperimentsResponse.experiments: array expected"); + message.experiments = []; + for (var i = 0; i < object.experiments.length; ++i) { + if (typeof object.experiments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListExperimentsResponse.experiments: object expected"); + message.experiments[i] = $root.google.cloud.dialogflow.cx.v3.Experiment.fromObject(object.experiments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExperimentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListExperimentsResponse} message ListExperimentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExperimentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.experiments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.experiments && message.experiments.length) { + object.experiments = []; + for (var j = 0; j < message.experiments.length; ++j) + object.experiments[j] = $root.google.cloud.dialogflow.cx.v3.Experiment.toObject(message.experiments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExperimentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListExperimentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExperimentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListExperimentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExperimentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListExperimentsResponse"; + }; + + return ListExperimentsResponse; + })(); + + v3.GetExperimentRequest = (function() { + + /** + * Properties of a GetExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetExperimentRequest + * @property {string|null} [name] GetExperimentRequest name + */ + + /** + * Constructs a new GetExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetExperimentRequest. + * @implements IGetExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetExperimentRequest=} [properties] Properties to set + */ + function GetExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @instance + */ + GetExperimentRequest.prototype.name = ""; + + /** + * Creates a new GetExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetExperimentRequest} GetExperimentRequest instance + */ + GetExperimentRequest.create = function create(properties) { + return new GetExperimentRequest(properties); + }; + + /** + * Encodes the specified GetExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetExperimentRequest} message GetExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExperimentRequest.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 GetExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetExperimentRequest} message GetExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetExperimentRequest} GetExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetExperimentRequest} GetExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetExperimentRequest} GetExperimentRequest + */ + GetExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetExperimentRequest} message GetExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExperimentRequest.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 GetExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + GetExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetExperimentRequest"; + }; + + return GetExperimentRequest; + })(); + + v3.CreateExperimentRequest = (function() { + + /** + * Properties of a CreateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateExperimentRequest + * @property {string|null} [parent] CreateExperimentRequest parent + * @property {google.cloud.dialogflow.cx.v3.IExperiment|null} [experiment] CreateExperimentRequest experiment + */ + + /** + * Constructs a new CreateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateExperimentRequest. + * @implements ICreateExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateExperimentRequest=} [properties] Properties to set + */ + function CreateExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExperimentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @instance + */ + CreateExperimentRequest.prototype.parent = ""; + + /** + * CreateExperimentRequest experiment. + * @member {google.cloud.dialogflow.cx.v3.IExperiment|null|undefined} experiment + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @instance + */ + CreateExperimentRequest.prototype.experiment = null; + + /** + * Creates a new CreateExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateExperimentRequest} CreateExperimentRequest instance + */ + CreateExperimentRequest.create = function create(properties) { + return new CreateExperimentRequest(properties); + }; + + /** + * Encodes the specified CreateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateExperimentRequest} message CreateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExperimentRequest.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.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + $root.google.cloud.dialogflow.cx.v3.Experiment.encode(message.experiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateExperimentRequest} message CreateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateExperimentRequest} CreateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.experiment = $root.google.cloud.dialogflow.cx.v3.Experiment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateExperimentRequest} CreateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.experiment != null && message.hasOwnProperty("experiment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.verify(message.experiment, long + 1); + if (error) + return "experiment." + error; + } + return null; + }; + + /** + * Creates a CreateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateExperimentRequest} CreateExperimentRequest + */ + CreateExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateExperimentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.experiment != null) { + if (typeof object.experiment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateExperimentRequest.experiment: object expected"); + message.experiment = $root.google.cloud.dialogflow.cx.v3.Experiment.fromObject(object.experiment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateExperimentRequest} message CreateExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExperimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.experiment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = $root.google.cloud.dialogflow.cx.v3.Experiment.toObject(message.experiment, options); + return object; + }; + + /** + * Converts this CreateExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateExperimentRequest"; + }; + + return CreateExperimentRequest; + })(); + + v3.UpdateExperimentRequest = (function() { + + /** + * Properties of an UpdateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateExperimentRequest + * @property {google.cloud.dialogflow.cx.v3.IExperiment|null} [experiment] UpdateExperimentRequest experiment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExperimentRequest updateMask + */ + + /** + * Constructs a new UpdateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateExperimentRequest. + * @implements IUpdateExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest=} [properties] Properties to set + */ + function UpdateExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExperimentRequest experiment. + * @member {google.cloud.dialogflow.cx.v3.IExperiment|null|undefined} experiment + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @instance + */ + UpdateExperimentRequest.prototype.experiment = null; + + /** + * UpdateExperimentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @instance + */ + UpdateExperimentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateExperimentRequest} UpdateExperimentRequest instance + */ + UpdateExperimentRequest.create = function create(properties) { + return new UpdateExperimentRequest(properties); + }; + + /** + * Encodes the specified UpdateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest} message UpdateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExperimentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + $root.google.cloud.dialogflow.cx.v3.Experiment.encode(message.experiment, 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 UpdateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest} message UpdateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateExperimentRequest} UpdateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.experiment = $root.google.cloud.dialogflow.cx.v3.Experiment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateExperimentRequest} UpdateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.experiment != null && message.hasOwnProperty("experiment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Experiment.verify(message.experiment, long + 1); + if (error) + return "experiment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateExperimentRequest} UpdateExperimentRequest + */ + UpdateExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest(); + if (object.experiment != null) { + if (typeof object.experiment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateExperimentRequest.experiment: object expected"); + message.experiment = $root.google.cloud.dialogflow.cx.v3.Experiment.fromObject(object.experiment, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateExperimentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateExperimentRequest} message UpdateExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExperimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.experiment = null; + object.updateMask = null; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = $root.google.cloud.dialogflow.cx.v3.Experiment.toObject(message.experiment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateExperimentRequest"; + }; + + return UpdateExperimentRequest; + })(); + + v3.DeleteExperimentRequest = (function() { + + /** + * Properties of a DeleteExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteExperimentRequest + * @property {string|null} [name] DeleteExperimentRequest name + */ + + /** + * Constructs a new DeleteExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteExperimentRequest. + * @implements IDeleteExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest=} [properties] Properties to set + */ + function DeleteExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @instance + */ + DeleteExperimentRequest.prototype.name = ""; + + /** + * Creates a new DeleteExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteExperimentRequest} DeleteExperimentRequest instance + */ + DeleteExperimentRequest.create = function create(properties) { + return new DeleteExperimentRequest(properties); + }; + + /** + * Encodes the specified DeleteExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest} message DeleteExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExperimentRequest.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 DeleteExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest} message DeleteExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteExperimentRequest} DeleteExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteExperimentRequest} DeleteExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteExperimentRequest} DeleteExperimentRequest + */ + DeleteExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteExperimentRequest} message DeleteExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExperimentRequest.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 DeleteExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteExperimentRequest"; + }; + + return DeleteExperimentRequest; + })(); + + v3.StartExperimentRequest = (function() { + + /** + * Properties of a StartExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IStartExperimentRequest + * @property {string|null} [name] StartExperimentRequest name + */ + + /** + * Constructs a new StartExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a StartExperimentRequest. + * @implements IStartExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IStartExperimentRequest=} [properties] Properties to set + */ + function StartExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @instance + */ + StartExperimentRequest.prototype.name = ""; + + /** + * Creates a new StartExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStartExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.StartExperimentRequest} StartExperimentRequest instance + */ + StartExperimentRequest.create = function create(properties) { + return new StartExperimentRequest(properties); + }; + + /** + * Encodes the specified StartExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StartExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStartExperimentRequest} message StartExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartExperimentRequest.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 StartExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StartExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStartExperimentRequest} message StartExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.StartExperimentRequest} StartExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.StartExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.StartExperimentRequest} StartExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a StartExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.StartExperimentRequest} StartExperimentRequest + */ + StartExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.StartExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.StartExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StartExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.StartExperimentRequest} message StartExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartExperimentRequest.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 StartExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + StartExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.StartExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.StartExperimentRequest"; + }; + + return StartExperimentRequest; + })(); + + v3.StopExperimentRequest = (function() { + + /** + * Properties of a StopExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IStopExperimentRequest + * @property {string|null} [name] StopExperimentRequest name + */ + + /** + * Constructs a new StopExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a StopExperimentRequest. + * @implements IStopExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IStopExperimentRequest=} [properties] Properties to set + */ + function StopExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @instance + */ + StopExperimentRequest.prototype.name = ""; + + /** + * Creates a new StopExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStopExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.StopExperimentRequest} StopExperimentRequest instance + */ + StopExperimentRequest.create = function create(properties) { + return new StopExperimentRequest(properties); + }; + + /** + * Encodes the specified StopExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StopExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStopExperimentRequest} message StopExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopExperimentRequest.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 StopExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.StopExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IStopExperimentRequest} message StopExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.StopExperimentRequest} StopExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.StopExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.StopExperimentRequest} StopExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a StopExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.StopExperimentRequest} StopExperimentRequest + */ + StopExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.StopExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.StopExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StopExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.StopExperimentRequest} message StopExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopExperimentRequest.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 StopExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + StopExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.StopExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.StopExperimentRequest"; + }; + + return StopExperimentRequest; + })(); + + v3.Generators = (function() { + + /** + * Constructs a new Generators service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Generators + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Generators(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Generators.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Generators; + + /** + * Creates new Generators service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Generators} RPC service. Useful where requests and/or responses are streamed. + */ + Generators.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|listGenerators}. + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @typedef ListGeneratorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListGeneratorsResponse} [response] ListGeneratorsResponse + */ + + /** + * Calls ListGenerators. + * @function listGenerators + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsRequest} request ListGeneratorsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Generators.ListGeneratorsCallback} callback Node-style callback called with the error, if any, and ListGeneratorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.listGenerators = function listGenerators(request, callback) { + return this.rpcCall(listGenerators, $root.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest, $root.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse, request, callback); + }, "name", { value: "ListGenerators" }); + + /** + * Calls ListGenerators. + * @function listGenerators + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsRequest} request ListGeneratorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|getGenerator}. + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @typedef GetGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Generator} [response] Generator + */ + + /** + * Calls GetGenerator. + * @function getGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetGeneratorRequest} request GetGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Generators.GetGeneratorCallback} callback Node-style callback called with the error, if any, and Generator + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.getGenerator = function getGenerator(request, callback) { + return this.rpcCall(getGenerator, $root.google.cloud.dialogflow.cx.v3.GetGeneratorRequest, $root.google.cloud.dialogflow.cx.v3.Generator, request, callback); + }, "name", { value: "GetGenerator" }); + + /** + * Calls GetGenerator. + * @function getGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetGeneratorRequest} request GetGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|createGenerator}. + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @typedef CreateGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Generator} [response] Generator + */ + + /** + * Calls CreateGenerator. + * @function createGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest} request CreateGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Generators.CreateGeneratorCallback} callback Node-style callback called with the error, if any, and Generator + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.createGenerator = function createGenerator(request, callback) { + return this.rpcCall(createGenerator, $root.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest, $root.google.cloud.dialogflow.cx.v3.Generator, request, callback); + }, "name", { value: "CreateGenerator" }); + + /** + * Calls CreateGenerator. + * @function createGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest} request CreateGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|updateGenerator}. + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @typedef UpdateGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Generator} [response] Generator + */ + + /** + * Calls UpdateGenerator. + * @function updateGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest} request UpdateGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Generators.UpdateGeneratorCallback} callback Node-style callback called with the error, if any, and Generator + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.updateGenerator = function updateGenerator(request, callback) { + return this.rpcCall(updateGenerator, $root.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest, $root.google.cloud.dialogflow.cx.v3.Generator, request, callback); + }, "name", { value: "UpdateGenerator" }); + + /** + * Calls UpdateGenerator. + * @function updateGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest} request UpdateGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Generators|deleteGenerator}. + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @typedef DeleteGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteGenerator. + * @function deleteGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest} request DeleteGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Generators.DeleteGeneratorCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.deleteGenerator = function deleteGenerator(request, callback) { + return this.rpcCall(deleteGenerator, $root.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteGenerator" }); + + /** + * Calls DeleteGenerator. + * @function deleteGenerator + * @memberof google.cloud.dialogflow.cx.v3.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest} request DeleteGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Generators; + })(); + + v3.Generator = (function() { + + /** + * Properties of a Generator. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGenerator + * @property {string|null} [name] Generator name + * @property {string|null} [displayName] Generator displayName + * @property {google.cloud.dialogflow.cx.v3.IPhrase|null} [promptText] Generator promptText + * @property {Array.|null} [placeholders] Generator placeholders + * @property {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null} [llmModelSettings] Generator llmModelSettings + * @property {google.cloud.dialogflow.cx.v3.Generator.IModelParameter|null} [modelParameter] Generator modelParameter + */ + + /** + * Constructs a new Generator. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Generator. + * @implements IGenerator + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGenerator=} [properties] Properties to set + */ + function Generator(properties) { + this.placeholders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Generator name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @instance + */ + Generator.prototype.name = ""; + + /** + * Generator displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @instance + */ + Generator.prototype.displayName = ""; + + /** + * Generator promptText. + * @member {google.cloud.dialogflow.cx.v3.IPhrase|null|undefined} promptText + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @instance + */ + Generator.prototype.promptText = null; + + /** + * Generator placeholders. + * @member {Array.} placeholders + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @instance + */ + Generator.prototype.placeholders = $util.emptyArray; + + /** + * Generator llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @instance + */ + Generator.prototype.llmModelSettings = null; + + /** + * Generator modelParameter. + * @member {google.cloud.dialogflow.cx.v3.Generator.IModelParameter|null|undefined} modelParameter + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @instance + */ + Generator.prototype.modelParameter = null; + + /** + * Creates a new Generator instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3.IGenerator=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Generator} Generator instance + */ + Generator.create = function create(properties) { + return new Generator(properties); + }; + + /** + * Encodes the specified Generator message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3.IGenerator} message Generator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Generator.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.promptText != null && Object.hasOwnProperty.call(message, "promptText")) + $root.google.cloud.dialogflow.cx.v3.Phrase.encode(message.promptText, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.placeholders != null && message.placeholders.length) + for (var i = 0; i < message.placeholders.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Generator.Placeholder.encode(message.placeholders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.modelParameter != null && Object.hasOwnProperty.call(message, "modelParameter")) + $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter.encode(message.modelParameter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Generator message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3.IGenerator} message Generator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Generator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Generator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Generator} Generator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Generator.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Generator(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.promptText = $root.google.cloud.dialogflow.cx.v3.Phrase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.placeholders && message.placeholders.length)) + message.placeholders = []; + message.placeholders.push($root.google.cloud.dialogflow.cx.v3.Generator.Placeholder.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 9: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.modelParameter = $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Generator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Generator} Generator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Generator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Generator message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Generator.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.promptText != null && message.hasOwnProperty("promptText")) { + var error = $root.google.cloud.dialogflow.cx.v3.Phrase.verify(message.promptText, long + 1); + if (error) + return "promptText." + error; + } + if (message.placeholders != null && message.hasOwnProperty("placeholders")) { + if (!Array.isArray(message.placeholders)) + return "placeholders: array expected"; + for (var i = 0; i < message.placeholders.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Generator.Placeholder.verify(message.placeholders[i], long + 1); + if (error) + return "placeholders." + error; + } + } + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + if (message.modelParameter != null && message.hasOwnProperty("modelParameter")) { + var error = $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter.verify(message.modelParameter, long + 1); + if (error) + return "modelParameter." + error; + } + return null; + }; + + /** + * Creates a Generator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Generator} Generator + */ + Generator.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Generator) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Generator(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.promptText != null) { + if (typeof object.promptText !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Generator.promptText: object expected"); + message.promptText = $root.google.cloud.dialogflow.cx.v3.Phrase.fromObject(object.promptText, long + 1); + } + if (object.placeholders) { + if (!Array.isArray(object.placeholders)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Generator.placeholders: array expected"); + message.placeholders = []; + for (var i = 0; i < object.placeholders.length; ++i) { + if (typeof object.placeholders[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Generator.placeholders: object expected"); + message.placeholders[i] = $root.google.cloud.dialogflow.cx.v3.Generator.Placeholder.fromObject(object.placeholders[i], long + 1); + } + } + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Generator.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + if (object.modelParameter != null) { + if (typeof object.modelParameter !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Generator.modelParameter: object expected"); + message.modelParameter = $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter.fromObject(object.modelParameter, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Generator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator} message Generator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Generator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.placeholders = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.promptText = null; + object.modelParameter = null; + object.llmModelSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.promptText != null && message.hasOwnProperty("promptText")) + object.promptText = $root.google.cloud.dialogflow.cx.v3.Phrase.toObject(message.promptText, options); + if (message.placeholders && message.placeholders.length) { + object.placeholders = []; + for (var j = 0; j < message.placeholders.length; ++j) + object.placeholders[j] = $root.google.cloud.dialogflow.cx.v3.Generator.Placeholder.toObject(message.placeholders[j], options); + } + if (message.modelParameter != null && message.hasOwnProperty("modelParameter")) + object.modelParameter = $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter.toObject(message.modelParameter, options); + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.toObject(message.llmModelSettings, options); + return object; + }; + + /** + * Converts this Generator to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @instance + * @returns {Object.} JSON object + */ + Generator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Generator + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Generator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Generator"; + }; + + Generator.Placeholder = (function() { + + /** + * Properties of a Placeholder. + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @interface IPlaceholder + * @property {string|null} [id] Placeholder id + * @property {string|null} [name] Placeholder name + */ + + /** + * Constructs a new Placeholder. + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @classdesc Represents a Placeholder. + * @implements IPlaceholder + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Generator.IPlaceholder=} [properties] Properties to set + */ + function Placeholder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Placeholder id. + * @member {string} id + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @instance + */ + Placeholder.prototype.id = ""; + + /** + * Placeholder name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @instance + */ + Placeholder.prototype.name = ""; + + /** + * Creates a new Placeholder instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.IPlaceholder=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Generator.Placeholder} Placeholder instance + */ + Placeholder.create = function create(properties) { + return new Placeholder(properties); + }; + + /** + * Encodes the specified Placeholder message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.Placeholder.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.IPlaceholder} message Placeholder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Placeholder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified Placeholder message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.Placeholder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.IPlaceholder} message Placeholder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Placeholder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Placeholder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Generator.Placeholder} Placeholder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Placeholder.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Generator.Placeholder(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Placeholder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Generator.Placeholder} Placeholder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Placeholder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Placeholder message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Placeholder.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Placeholder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Generator.Placeholder} Placeholder + */ + Placeholder.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Generator.Placeholder) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Generator.Placeholder(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Placeholder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.Placeholder} message Placeholder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Placeholder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Placeholder to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @instance + * @returns {Object.} JSON object + */ + Placeholder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Placeholder + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Generator.Placeholder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Placeholder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Generator.Placeholder"; + }; + + return Placeholder; + })(); + + Generator.ModelParameter = (function() { + + /** + * Properties of a ModelParameter. + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @interface IModelParameter + * @property {number|null} [temperature] ModelParameter temperature + * @property {number|null} [maxDecodeSteps] ModelParameter maxDecodeSteps + * @property {number|null} [topP] ModelParameter topP + * @property {number|null} [topK] ModelParameter topK + */ + + /** + * Constructs a new ModelParameter. + * @memberof google.cloud.dialogflow.cx.v3.Generator + * @classdesc Represents a ModelParameter. + * @implements IModelParameter + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Generator.IModelParameter=} [properties] Properties to set + */ + function ModelParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelParameter temperature. + * @member {number|null|undefined} temperature + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.temperature = null; + + /** + * ModelParameter maxDecodeSteps. + * @member {number|null|undefined} maxDecodeSteps + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.maxDecodeSteps = null; + + /** + * ModelParameter topP. + * @member {number|null|undefined} topP + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.topP = null; + + /** + * ModelParameter topK. + * @member {number|null|undefined} topK + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.topK = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_maxDecodeSteps", { + get: $util.oneOfGetter($oneOfFields = ["maxDecodeSteps"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelParameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.IModelParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Generator.ModelParameter} ModelParameter instance + */ + ModelParameter.create = function create(properties) { + return new ModelParameter(properties); + }; + + /** + * Encodes the specified ModelParameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.ModelParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.IModelParameter} message ModelParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.temperature); + if (message.maxDecodeSteps != null && Object.hasOwnProperty.call(message, "maxDecodeSteps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDecodeSteps); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.topK); + return writer; + }; + + /** + * Encodes the specified ModelParameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Generator.ModelParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.IModelParameter} message ModelParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Generator.ModelParameter} ModelParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelParameter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.temperature = reader.float(); + break; + } + case 2: { + message.maxDecodeSteps = reader.int32(); + break; + } + case 3: { + message.topP = reader.float(); + break; + } + case 4: { + message.topK = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ModelParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Generator.ModelParameter} ModelParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelParameter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelParameter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.maxDecodeSteps != null && message.hasOwnProperty("maxDecodeSteps")) { + properties._maxDecodeSteps = 1; + if (!$util.isInteger(message.maxDecodeSteps)) + return "maxDecodeSteps: integer expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + return null; + }; + + /** + * Creates a ModelParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Generator.ModelParameter} ModelParameter + */ + ModelParameter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Generator.ModelParameter(); + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.maxDecodeSteps != null) + message.maxDecodeSteps = object.maxDecodeSteps | 0; + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + return message; + }; + + /** + * Creates a plain object from a ModelParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3.Generator.ModelParameter} message ModelParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.maxDecodeSteps != null && message.hasOwnProperty("maxDecodeSteps")) { + object.maxDecodeSteps = message.maxDecodeSteps; + if (options.oneofs) + object._maxDecodeSteps = "maxDecodeSteps"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + return object; + }; + + /** + * Converts this ModelParameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @instance + * @returns {Object.} JSON object + */ + ModelParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelParameter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Generator.ModelParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Generator.ModelParameter"; + }; + + return ModelParameter; + })(); + + return Generator; + })(); + + v3.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPhrase + * @property {string|null} [text] Phrase text + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @instance + */ + Phrase.prototype.text = ""; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.IPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Phrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Phrase(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Phrase"; + }; + + return Phrase; + })(); + + v3.ListGeneratorsRequest = (function() { + + /** + * Properties of a ListGeneratorsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListGeneratorsRequest + * @property {string|null} [parent] ListGeneratorsRequest parent + * @property {string|null} [languageCode] ListGeneratorsRequest languageCode + * @property {number|null} [pageSize] ListGeneratorsRequest pageSize + * @property {string|null} [pageToken] ListGeneratorsRequest pageToken + */ + + /** + * Constructs a new ListGeneratorsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListGeneratorsRequest. + * @implements IListGeneratorsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsRequest=} [properties] Properties to set + */ + function ListGeneratorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGeneratorsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.parent = ""; + + /** + * ListGeneratorsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.languageCode = ""; + + /** + * ListGeneratorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.pageSize = 0; + + /** + * ListGeneratorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListGeneratorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsRequest} ListGeneratorsRequest instance + */ + ListGeneratorsRequest.create = function create(properties) { + return new ListGeneratorsRequest(properties); + }; + + /** + * Encodes the specified ListGeneratorsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsRequest} message ListGeneratorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListGeneratorsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsRequest} message ListGeneratorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsRequest} ListGeneratorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsRequest} ListGeneratorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGeneratorsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGeneratorsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: 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"; + return null; + }; + + /** + * Creates a ListGeneratorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsRequest} ListGeneratorsRequest + */ + ListGeneratorsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListGeneratorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListGeneratorsRequest} message ListGeneratorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGeneratorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListGeneratorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGeneratorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGeneratorsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGeneratorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListGeneratorsRequest"; + }; + + return ListGeneratorsRequest; + })(); + + v3.ListGeneratorsResponse = (function() { + + /** + * Properties of a ListGeneratorsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListGeneratorsResponse + * @property {Array.|null} [generators] ListGeneratorsResponse generators + * @property {string|null} [nextPageToken] ListGeneratorsResponse nextPageToken + */ + + /** + * Constructs a new ListGeneratorsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListGeneratorsResponse. + * @implements IListGeneratorsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsResponse=} [properties] Properties to set + */ + function ListGeneratorsResponse(properties) { + this.generators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGeneratorsResponse generators. + * @member {Array.} generators + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @instance + */ + ListGeneratorsResponse.prototype.generators = $util.emptyArray; + + /** + * ListGeneratorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @instance + */ + ListGeneratorsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGeneratorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsResponse} ListGeneratorsResponse instance + */ + ListGeneratorsResponse.create = function create(properties) { + return new ListGeneratorsResponse(properties); + }; + + /** + * Encodes the specified ListGeneratorsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsResponse} message ListGeneratorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generators != null && message.generators.length) + for (var i = 0; i < message.generators.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Generator.encode(message.generators[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 ListGeneratorsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListGeneratorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListGeneratorsResponse} message ListGeneratorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsResponse} ListGeneratorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.generators && message.generators.length)) + message.generators = []; + message.generators.push($root.google.cloud.dialogflow.cx.v3.Generator.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsResponse} ListGeneratorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGeneratorsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGeneratorsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generators != null && message.hasOwnProperty("generators")) { + if (!Array.isArray(message.generators)) + return "generators: array expected"; + for (var i = 0; i < message.generators.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Generator.verify(message.generators[i], long + 1); + if (error) + return "generators." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGeneratorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListGeneratorsResponse} ListGeneratorsResponse + */ + ListGeneratorsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse(); + if (object.generators) { + if (!Array.isArray(object.generators)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListGeneratorsResponse.generators: array expected"); + message.generators = []; + for (var i = 0; i < object.generators.length; ++i) { + if (typeof object.generators[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListGeneratorsResponse.generators: object expected"); + message.generators[i] = $root.google.cloud.dialogflow.cx.v3.Generator.fromObject(object.generators[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGeneratorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListGeneratorsResponse} message ListGeneratorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGeneratorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.generators = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.generators && message.generators.length) { + object.generators = []; + for (var j = 0; j < message.generators.length; ++j) + object.generators[j] = $root.google.cloud.dialogflow.cx.v3.Generator.toObject(message.generators[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGeneratorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGeneratorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGeneratorsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListGeneratorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGeneratorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListGeneratorsResponse"; + }; + + return ListGeneratorsResponse; + })(); + + v3.GetGeneratorRequest = (function() { + + /** + * Properties of a GetGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetGeneratorRequest + * @property {string|null} [name] GetGeneratorRequest name + * @property {string|null} [languageCode] GetGeneratorRequest languageCode + */ + + /** + * Constructs a new GetGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetGeneratorRequest. + * @implements IGetGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetGeneratorRequest=} [properties] Properties to set + */ + function GetGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGeneratorRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @instance + */ + GetGeneratorRequest.prototype.name = ""; + + /** + * GetGeneratorRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @instance + */ + GetGeneratorRequest.prototype.languageCode = ""; + + /** + * Creates a new GetGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetGeneratorRequest} GetGeneratorRequest instance + */ + GetGeneratorRequest.create = function create(properties) { + return new GetGeneratorRequest(properties); + }; + + /** + * Encodes the specified GetGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetGeneratorRequest} message GetGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGeneratorRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetGeneratorRequest} message GetGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetGeneratorRequest} GetGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetGeneratorRequest} GetGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetGeneratorRequest} GetGeneratorRequest + */ + GetGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetGeneratorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetGeneratorRequest} message GetGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + GetGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetGeneratorRequest"; + }; + + return GetGeneratorRequest; + })(); + + v3.CreateGeneratorRequest = (function() { + + /** + * Properties of a CreateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateGeneratorRequest + * @property {string|null} [parent] CreateGeneratorRequest parent + * @property {google.cloud.dialogflow.cx.v3.IGenerator|null} [generator] CreateGeneratorRequest generator + * @property {string|null} [languageCode] CreateGeneratorRequest languageCode + */ + + /** + * Constructs a new CreateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateGeneratorRequest. + * @implements ICreateGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest=} [properties] Properties to set + */ + function CreateGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGeneratorRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @instance + */ + CreateGeneratorRequest.prototype.parent = ""; + + /** + * CreateGeneratorRequest generator. + * @member {google.cloud.dialogflow.cx.v3.IGenerator|null|undefined} generator + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @instance + */ + CreateGeneratorRequest.prototype.generator = null; + + /** + * CreateGeneratorRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @instance + */ + CreateGeneratorRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateGeneratorRequest} CreateGeneratorRequest instance + */ + CreateGeneratorRequest.create = function create(properties) { + return new CreateGeneratorRequest(properties); + }; + + /** + * Encodes the specified CreateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest} message CreateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGeneratorRequest.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.generator != null && Object.hasOwnProperty.call(message, "generator")) + $root.google.cloud.dialogflow.cx.v3.Generator.encode(message.generator, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest} message CreateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateGeneratorRequest} CreateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.generator = $root.google.cloud.dialogflow.cx.v3.Generator.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateGeneratorRequest} CreateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.generator != null && message.hasOwnProperty("generator")) { + var error = $root.google.cloud.dialogflow.cx.v3.Generator.verify(message.generator, long + 1); + if (error) + return "generator." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateGeneratorRequest} CreateGeneratorRequest + */ + CreateGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.generator != null) { + if (typeof object.generator !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateGeneratorRequest.generator: object expected"); + message.generator = $root.google.cloud.dialogflow.cx.v3.Generator.fromObject(object.generator, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateGeneratorRequest} message CreateGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.generator = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.generator != null && message.hasOwnProperty("generator")) + object.generator = $root.google.cloud.dialogflow.cx.v3.Generator.toObject(message.generator, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateGeneratorRequest"; + }; + + return CreateGeneratorRequest; + })(); + + v3.UpdateGeneratorRequest = (function() { + + /** + * Properties of an UpdateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateGeneratorRequest + * @property {google.cloud.dialogflow.cx.v3.IGenerator|null} [generator] UpdateGeneratorRequest generator + * @property {string|null} [languageCode] UpdateGeneratorRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGeneratorRequest updateMask + */ + + /** + * Constructs a new UpdateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateGeneratorRequest. + * @implements IUpdateGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest=} [properties] Properties to set + */ + function UpdateGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGeneratorRequest generator. + * @member {google.cloud.dialogflow.cx.v3.IGenerator|null|undefined} generator + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @instance + */ + UpdateGeneratorRequest.prototype.generator = null; + + /** + * UpdateGeneratorRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @instance + */ + UpdateGeneratorRequest.prototype.languageCode = ""; + + /** + * UpdateGeneratorRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @instance + */ + UpdateGeneratorRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest} UpdateGeneratorRequest instance + */ + UpdateGeneratorRequest.create = function create(properties) { + return new UpdateGeneratorRequest(properties); + }; + + /** + * Encodes the specified UpdateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest} message UpdateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGeneratorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generator != null && Object.hasOwnProperty.call(message, "generator")) + $root.google.cloud.dialogflow.cx.v3.Generator.encode(message.generator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest} message UpdateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest} UpdateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generator = $root.google.cloud.dialogflow.cx.v3.Generator.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest} UpdateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generator != null && message.hasOwnProperty("generator")) { + var error = $root.google.cloud.dialogflow.cx.v3.Generator.verify(message.generator, long + 1); + if (error) + return "generator." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest} UpdateGeneratorRequest + */ + UpdateGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest(); + if (object.generator != null) { + if (typeof object.generator !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest.generator: object expected"); + message.generator = $root.google.cloud.dialogflow.cx.v3.Generator.fromObject(object.generator, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest} message UpdateGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.generator = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.generator != null && message.hasOwnProperty("generator")) + object.generator = $root.google.cloud.dialogflow.cx.v3.Generator.toObject(message.generator, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest"; + }; + + return UpdateGeneratorRequest; + })(); + + v3.DeleteGeneratorRequest = (function() { + + /** + * Properties of a DeleteGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteGeneratorRequest + * @property {string|null} [name] DeleteGeneratorRequest name + * @property {boolean|null} [force] DeleteGeneratorRequest force + */ + + /** + * Constructs a new DeleteGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteGeneratorRequest. + * @implements IDeleteGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest=} [properties] Properties to set + */ + function DeleteGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGeneratorRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @instance + */ + DeleteGeneratorRequest.prototype.name = ""; + + /** + * DeleteGeneratorRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @instance + */ + DeleteGeneratorRequest.prototype.force = false; + + /** + * Creates a new DeleteGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest} DeleteGeneratorRequest instance + */ + DeleteGeneratorRequest.create = function create(properties) { + return new DeleteGeneratorRequest(properties); + }; + + /** + * Encodes the specified DeleteGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest} message DeleteGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGeneratorRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest} message DeleteGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest} DeleteGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest} DeleteGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest} DeleteGeneratorRequest + */ + DeleteGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest} message DeleteGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest"; + }; + + return DeleteGeneratorRequest; + })(); + + v3.Playbooks = (function() { + + /** + * Constructs a new Playbooks service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Playbooks + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Playbooks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Playbooks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Playbooks; + + /** + * Creates new Playbooks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Playbooks} RPC service. Useful where requests and/or responses are streamed. + */ + Playbooks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|createPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef CreatePlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Playbook} [response] Playbook + */ + + /** + * Calls CreatePlaybook. + * @function createPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest} request CreatePlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookCallback} callback Node-style callback called with the error, if any, and Playbook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.createPlaybook = function createPlaybook(request, callback) { + return this.rpcCall(createPlaybook, $root.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest, $root.google.cloud.dialogflow.cx.v3.Playbook, request, callback); + }, "name", { value: "CreatePlaybook" }); + + /** + * Calls CreatePlaybook. + * @function createPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest} request CreatePlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|deletePlaybook}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef DeletePlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePlaybook. + * @function deletePlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest} request DeletePlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.deletePlaybook = function deletePlaybook(request, callback) { + return this.rpcCall(deletePlaybook, $root.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePlaybook" }); + + /** + * Calls DeletePlaybook. + * @function deletePlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest} request DeletePlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|listPlaybooks}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef ListPlaybooksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListPlaybooksResponse} [response] ListPlaybooksResponse + */ + + /** + * Calls ListPlaybooks. + * @function listPlaybooks + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksRequest} request ListPlaybooksRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybooksCallback} callback Node-style callback called with the error, if any, and ListPlaybooksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.listPlaybooks = function listPlaybooks(request, callback) { + return this.rpcCall(listPlaybooks, $root.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest, $root.google.cloud.dialogflow.cx.v3.ListPlaybooksResponse, request, callback); + }, "name", { value: "ListPlaybooks" }); + + /** + * Calls ListPlaybooks. + * @function listPlaybooks + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksRequest} request ListPlaybooksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|getPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef GetPlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Playbook} [response] Playbook + */ + + /** + * Calls GetPlaybook. + * @function getPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookRequest} request GetPlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookCallback} callback Node-style callback called with the error, if any, and Playbook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.getPlaybook = function getPlaybook(request, callback) { + return this.rpcCall(getPlaybook, $root.google.cloud.dialogflow.cx.v3.GetPlaybookRequest, $root.google.cloud.dialogflow.cx.v3.Playbook, request, callback); + }, "name", { value: "GetPlaybook" }); + + /** + * Calls GetPlaybook. + * @function getPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookRequest} request GetPlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|exportPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef ExportPlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportPlaybook. + * @function exportPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookRequest} request ExportPlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.ExportPlaybookCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.exportPlaybook = function exportPlaybook(request, callback) { + return this.rpcCall(exportPlaybook, $root.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportPlaybook" }); + + /** + * Calls ExportPlaybook. + * @function exportPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookRequest} request ExportPlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|importPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef ImportPlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportPlaybook. + * @function importPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookRequest} request ImportPlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.ImportPlaybookCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.importPlaybook = function importPlaybook(request, callback) { + return this.rpcCall(importPlaybook, $root.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportPlaybook" }); + + /** + * Calls ImportPlaybook. + * @function importPlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookRequest} request ImportPlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|updatePlaybook}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef UpdatePlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Playbook} [response] Playbook + */ + + /** + * Calls UpdatePlaybook. + * @function updatePlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest} request UpdatePlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.UpdatePlaybookCallback} callback Node-style callback called with the error, if any, and Playbook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.updatePlaybook = function updatePlaybook(request, callback) { + return this.rpcCall(updatePlaybook, $root.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest, $root.google.cloud.dialogflow.cx.v3.Playbook, request, callback); + }, "name", { value: "UpdatePlaybook" }); + + /** + * Calls UpdatePlaybook. + * @function updatePlaybook + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest} request UpdatePlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|createPlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef CreatePlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.PlaybookVersion} [response] PlaybookVersion + */ + + /** + * Calls CreatePlaybookVersion. + * @function createPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest} request CreatePlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookVersionCallback} callback Node-style callback called with the error, if any, and PlaybookVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.createPlaybookVersion = function createPlaybookVersion(request, callback) { + return this.rpcCall(createPlaybookVersion, $root.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest, $root.google.cloud.dialogflow.cx.v3.PlaybookVersion, request, callback); + }, "name", { value: "CreatePlaybookVersion" }); + + /** + * Calls CreatePlaybookVersion. + * @function createPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest} request CreatePlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|getPlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef GetPlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.PlaybookVersion} [response] PlaybookVersion + */ + + /** + * Calls GetPlaybookVersion. + * @function getPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest} request GetPlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookVersionCallback} callback Node-style callback called with the error, if any, and PlaybookVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.getPlaybookVersion = function getPlaybookVersion(request, callback) { + return this.rpcCall(getPlaybookVersion, $root.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest, $root.google.cloud.dialogflow.cx.v3.PlaybookVersion, request, callback); + }, "name", { value: "GetPlaybookVersion" }); + + /** + * Calls GetPlaybookVersion. + * @function getPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest} request GetPlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|restorePlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef RestorePlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse} [response] RestorePlaybookVersionResponse + */ + + /** + * Calls RestorePlaybookVersion. + * @function restorePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest} request RestorePlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.RestorePlaybookVersionCallback} callback Node-style callback called with the error, if any, and RestorePlaybookVersionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.restorePlaybookVersion = function restorePlaybookVersion(request, callback) { + return this.rpcCall(restorePlaybookVersion, $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest, $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse, request, callback); + }, "name", { value: "RestorePlaybookVersion" }); + + /** + * Calls RestorePlaybookVersion. + * @function restorePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest} request RestorePlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|listPlaybookVersions}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef ListPlaybookVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse} [response] ListPlaybookVersionsResponse + */ + + /** + * Calls ListPlaybookVersions. + * @function listPlaybookVersions + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest} request ListPlaybookVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybookVersionsCallback} callback Node-style callback called with the error, if any, and ListPlaybookVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.listPlaybookVersions = function listPlaybookVersions(request, callback) { + return this.rpcCall(listPlaybookVersions, $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest, $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse, request, callback); + }, "name", { value: "ListPlaybookVersions" }); + + /** + * Calls ListPlaybookVersions. + * @function listPlaybookVersions + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest} request ListPlaybookVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Playbooks|deletePlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @typedef DeletePlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePlaybookVersion. + * @function deletePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest} request DeletePlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.deletePlaybookVersion = function deletePlaybookVersion(request, callback) { + return this.rpcCall(deletePlaybookVersion, $root.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePlaybookVersion" }); + + /** + * Calls DeletePlaybookVersion. + * @function deletePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest} request DeletePlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Playbooks; + })(); + + v3.CreatePlaybookRequest = (function() { + + /** + * Properties of a CreatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreatePlaybookRequest + * @property {string|null} [parent] CreatePlaybookRequest parent + * @property {google.cloud.dialogflow.cx.v3.IPlaybook|null} [playbook] CreatePlaybookRequest playbook + */ + + /** + * Constructs a new CreatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreatePlaybookRequest. + * @implements ICreatePlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest=} [properties] Properties to set + */ + function CreatePlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePlaybookRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @instance + */ + CreatePlaybookRequest.prototype.parent = ""; + + /** + * CreatePlaybookRequest playbook. + * @member {google.cloud.dialogflow.cx.v3.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @instance + */ + CreatePlaybookRequest.prototype.playbook = null; + + /** + * Creates a new CreatePlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookRequest} CreatePlaybookRequest instance + */ + CreatePlaybookRequest.create = function create(properties) { + return new CreatePlaybookRequest(properties); + }; + + /** + * Encodes the specified CreatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest} message CreatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookRequest.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.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3.Playbook.encode(message.playbook, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest} message CreatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookRequest} CreatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookRequest} CreatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + return null; + }; + + /** + * Creates a CreatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookRequest} CreatePlaybookRequest + */ + CreatePlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreatePlaybookRequest.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.fromObject(object.playbook, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreatePlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreatePlaybookRequest} message CreatePlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.playbook = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.toObject(message.playbook, options); + return object; + }; + + /** + * Converts this CreatePlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreatePlaybookRequest"; + }; + + return CreatePlaybookRequest; + })(); + + v3.DeletePlaybookRequest = (function() { + + /** + * Properties of a DeletePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeletePlaybookRequest + * @property {string|null} [name] DeletePlaybookRequest name + */ + + /** + * Constructs a new DeletePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeletePlaybookRequest. + * @implements IDeletePlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest=} [properties] Properties to set + */ + function DeletePlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePlaybookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @instance + */ + DeletePlaybookRequest.prototype.name = ""; + + /** + * Creates a new DeletePlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookRequest} DeletePlaybookRequest instance + */ + DeletePlaybookRequest.create = function create(properties) { + return new DeletePlaybookRequest(properties); + }; + + /** + * Encodes the specified DeletePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest} message DeletePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookRequest.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 DeletePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest} message DeletePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookRequest} DeletePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookRequest} DeletePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookRequest} DeletePlaybookRequest + */ + DeletePlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeletePlaybookRequest} message DeletePlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePlaybookRequest.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 DeletePlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeletePlaybookRequest"; + }; + + return DeletePlaybookRequest; + })(); + + v3.ListPlaybooksRequest = (function() { + + /** + * Properties of a ListPlaybooksRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListPlaybooksRequest + * @property {string|null} [parent] ListPlaybooksRequest parent + * @property {number|null} [pageSize] ListPlaybooksRequest pageSize + * @property {string|null} [pageToken] ListPlaybooksRequest pageToken + */ + + /** + * Constructs a new ListPlaybooksRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListPlaybooksRequest. + * @implements IListPlaybooksRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksRequest=} [properties] Properties to set + */ + function ListPlaybooksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybooksRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @instance + */ + ListPlaybooksRequest.prototype.parent = ""; + + /** + * ListPlaybooksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @instance + */ + ListPlaybooksRequest.prototype.pageSize = 0; + + /** + * ListPlaybooksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @instance + */ + ListPlaybooksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPlaybooksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksRequest} ListPlaybooksRequest instance + */ + ListPlaybooksRequest.create = function create(properties) { + return new ListPlaybooksRequest(properties); + }; + + /** + * Encodes the specified ListPlaybooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksRequest} message ListPlaybooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksRequest.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); + return writer; + }; + + /** + * Encodes the specified ListPlaybooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksRequest} message ListPlaybooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksRequest} ListPlaybooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksRequest} ListPlaybooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybooksRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybooksRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListPlaybooksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksRequest} ListPlaybooksRequest + */ + ListPlaybooksRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListPlaybooksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListPlaybooksRequest} message ListPlaybooksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybooksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListPlaybooksRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @instance + * @returns {Object.} JSON object + */ + ListPlaybooksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybooksRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybooksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListPlaybooksRequest"; + }; + + return ListPlaybooksRequest; + })(); + + v3.ListPlaybooksResponse = (function() { + + /** + * Properties of a ListPlaybooksResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListPlaybooksResponse + * @property {Array.|null} [playbooks] ListPlaybooksResponse playbooks + * @property {string|null} [nextPageToken] ListPlaybooksResponse nextPageToken + */ + + /** + * Constructs a new ListPlaybooksResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListPlaybooksResponse. + * @implements IListPlaybooksResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksResponse=} [properties] Properties to set + */ + function ListPlaybooksResponse(properties) { + this.playbooks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybooksResponse playbooks. + * @member {Array.} playbooks + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @instance + */ + ListPlaybooksResponse.prototype.playbooks = $util.emptyArray; + + /** + * ListPlaybooksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @instance + */ + ListPlaybooksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPlaybooksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksResponse} ListPlaybooksResponse instance + */ + ListPlaybooksResponse.create = function create(properties) { + return new ListPlaybooksResponse(properties); + }; + + /** + * Encodes the specified ListPlaybooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksResponse} message ListPlaybooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbooks != null && message.playbooks.length) + for (var i = 0; i < message.playbooks.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Playbook.encode(message.playbooks[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 ListPlaybooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybooksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybooksResponse} message ListPlaybooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksResponse} ListPlaybooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybooksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.playbooks && message.playbooks.length)) + message.playbooks = []; + message.playbooks.push($root.google.cloud.dialogflow.cx.v3.Playbook.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksResponse} ListPlaybooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybooksResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybooksResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbooks != null && message.hasOwnProperty("playbooks")) { + if (!Array.isArray(message.playbooks)) + return "playbooks: array expected"; + for (var i = 0; i < message.playbooks.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.verify(message.playbooks[i], long + 1); + if (error) + return "playbooks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPlaybooksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybooksResponse} ListPlaybooksResponse + */ + ListPlaybooksResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListPlaybooksResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybooksResponse(); + if (object.playbooks) { + if (!Array.isArray(object.playbooks)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListPlaybooksResponse.playbooks: array expected"); + message.playbooks = []; + for (var i = 0; i < object.playbooks.length; ++i) { + if (typeof object.playbooks[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListPlaybooksResponse.playbooks: object expected"); + message.playbooks[i] = $root.google.cloud.dialogflow.cx.v3.Playbook.fromObject(object.playbooks[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPlaybooksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListPlaybooksResponse} message ListPlaybooksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybooksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.playbooks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.playbooks && message.playbooks.length) { + object.playbooks = []; + for (var j = 0; j < message.playbooks.length; ++j) + object.playbooks[j] = $root.google.cloud.dialogflow.cx.v3.Playbook.toObject(message.playbooks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPlaybooksResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @instance + * @returns {Object.} JSON object + */ + ListPlaybooksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybooksResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybooksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybooksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListPlaybooksResponse"; + }; + + return ListPlaybooksResponse; + })(); + + v3.GetPlaybookRequest = (function() { + + /** + * Properties of a GetPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetPlaybookRequest + * @property {string|null} [name] GetPlaybookRequest name + */ + + /** + * Constructs a new GetPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetPlaybookRequest. + * @implements IGetPlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookRequest=} [properties] Properties to set + */ + function GetPlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPlaybookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @instance + */ + GetPlaybookRequest.prototype.name = ""; + + /** + * Creates a new GetPlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookRequest} GetPlaybookRequest instance + */ + GetPlaybookRequest.create = function create(properties) { + return new GetPlaybookRequest(properties); + }; + + /** + * Encodes the specified GetPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookRequest} message GetPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookRequest.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 GetPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookRequest} message GetPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookRequest} GetPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetPlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookRequest} GetPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookRequest} GetPlaybookRequest + */ + GetPlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetPlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetPlaybookRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetPlaybookRequest} message GetPlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPlaybookRequest.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 GetPlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + GetPlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetPlaybookRequest"; + }; + + return GetPlaybookRequest; + })(); + + v3.UpdatePlaybookRequest = (function() { + + /** + * Properties of an UpdatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdatePlaybookRequest + * @property {google.cloud.dialogflow.cx.v3.IPlaybook|null} [playbook] UpdatePlaybookRequest playbook + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePlaybookRequest updateMask + */ + + /** + * Constructs a new UpdatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdatePlaybookRequest. + * @implements IUpdatePlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest=} [properties] Properties to set + */ + function UpdatePlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePlaybookRequest playbook. + * @member {google.cloud.dialogflow.cx.v3.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @instance + */ + UpdatePlaybookRequest.prototype.playbook = null; + + /** + * UpdatePlaybookRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @instance + */ + UpdatePlaybookRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest} UpdatePlaybookRequest instance + */ + UpdatePlaybookRequest.create = function create(properties) { + return new UpdatePlaybookRequest(properties); + }; + + /** + * Encodes the specified UpdatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest} message UpdatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePlaybookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3.Playbook.encode(message.playbook, 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 UpdatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest} message UpdatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest} UpdatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest} UpdatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest} UpdatePlaybookRequest + */ + UpdatePlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest(); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.fromObject(object.playbook, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest} message UpdatePlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = null; + object.updateMask = null; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.toObject(message.playbook, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest"; + }; + + return UpdatePlaybookRequest; + })(); + + v3.Playbook = (function() { + + /** + * Properties of a Playbook. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybook + * @property {string|null} [name] Playbook name + * @property {string|null} [displayName] Playbook displayName + * @property {string|null} [goal] Playbook goal + * @property {Array.|null} [inputParameterDefinitions] Playbook inputParameterDefinitions + * @property {Array.|null} [outputParameterDefinitions] Playbook outputParameterDefinitions + * @property {google.cloud.dialogflow.cx.v3.Playbook.IInstruction|null} [instruction] Playbook instruction + * @property {number|Long|null} [tokenCount] Playbook tokenCount + * @property {google.protobuf.ITimestamp|null} [createTime] Playbook createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Playbook updateTime + * @property {Array.|null} [referencedPlaybooks] Playbook referencedPlaybooks + * @property {Array.|null} [referencedFlows] Playbook referencedFlows + * @property {Array.|null} [referencedTools] Playbook referencedTools + * @property {Array.|null} [inlineActions] Playbook inlineActions + * @property {google.cloud.dialogflow.cx.v3.ICodeBlock|null} [codeBlock] Playbook codeBlock + * @property {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null} [llmModelSettings] Playbook llmModelSettings + * @property {Array.|null} [handlers] Playbook handlers + * @property {google.cloud.dialogflow.cx.v3.Playbook.PlaybookType|null} [playbookType] Playbook playbookType + */ + + /** + * Constructs a new Playbook. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Playbook. + * @implements IPlaybook + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybook=} [properties] Properties to set + */ + function Playbook(properties) { + this.inputParameterDefinitions = []; + this.outputParameterDefinitions = []; + this.referencedPlaybooks = []; + this.referencedFlows = []; + this.referencedTools = []; + this.inlineActions = []; + this.handlers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Playbook name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.name = ""; + + /** + * Playbook displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.displayName = ""; + + /** + * Playbook goal. + * @member {string} goal + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.goal = ""; + + /** + * Playbook inputParameterDefinitions. + * @member {Array.} inputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.inputParameterDefinitions = $util.emptyArray; + + /** + * Playbook outputParameterDefinitions. + * @member {Array.} outputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.outputParameterDefinitions = $util.emptyArray; + + /** + * Playbook instruction. + * @member {google.cloud.dialogflow.cx.v3.Playbook.IInstruction|null|undefined} instruction + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.instruction = null; + + /** + * Playbook tokenCount. + * @member {number|Long} tokenCount + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.tokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Playbook createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.createTime = null; + + /** + * Playbook updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.updateTime = null; + + /** + * Playbook referencedPlaybooks. + * @member {Array.} referencedPlaybooks + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.referencedPlaybooks = $util.emptyArray; + + /** + * Playbook referencedFlows. + * @member {Array.} referencedFlows + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.referencedFlows = $util.emptyArray; + + /** + * Playbook referencedTools. + * @member {Array.} referencedTools + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.referencedTools = $util.emptyArray; + + /** + * Playbook inlineActions. + * @member {Array.} inlineActions + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.inlineActions = $util.emptyArray; + + /** + * Playbook codeBlock. + * @member {google.cloud.dialogflow.cx.v3.ICodeBlock|null|undefined} codeBlock + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.codeBlock = null; + + /** + * Playbook llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.llmModelSettings = null; + + /** + * Playbook handlers. + * @member {Array.} handlers + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.handlers = $util.emptyArray; + + /** + * Playbook playbookType. + * @member {google.cloud.dialogflow.cx.v3.Playbook.PlaybookType} playbookType + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + */ + Playbook.prototype.playbookType = 0; + + /** + * Creates a new Playbook instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybook=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Playbook} Playbook instance + */ + Playbook.create = function create(properties) { + return new Playbook(properties); + }; + + /** + * Encodes the specified Playbook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybook} message Playbook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Playbook.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.goal != null && Object.hasOwnProperty.call(message, "goal")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.goal); + if (message.inputParameterDefinitions != null && message.inputParameterDefinitions.length) + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.encode(message.inputParameterDefinitions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputParameterDefinitions != null && message.outputParameterDefinitions.length) + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.encode(message.outputParameterDefinitions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.tokenCount); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.referencedPlaybooks != null && message.referencedPlaybooks.length) + for (var i = 0; i < message.referencedPlaybooks.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencedPlaybooks[i]); + if (message.referencedFlows != null && message.referencedFlows.length) + for (var i = 0; i < message.referencedFlows.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.referencedFlows[i]); + if (message.referencedTools != null && message.referencedTools.length) + for (var i = 0; i < message.referencedTools.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.referencedTools[i]); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.handlers != null && message.handlers.length) + for (var i = 0; i < message.handlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Handler.encode(message.handlers[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction.encode(message.instruction, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.playbookType != null && Object.hasOwnProperty.call(message, "playbookType")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.playbookType); + if (message.codeBlock != null && Object.hasOwnProperty.call(message, "codeBlock")) + $root.google.cloud.dialogflow.cx.v3.CodeBlock.encode(message.codeBlock, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.inlineActions != null && message.inlineActions.length) + for (var i = 0; i < message.inlineActions.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.inlineActions[i]); + return writer; + }; + + /** + * Encodes the specified Playbook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybook} message Playbook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Playbook.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Playbook message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Playbook} Playbook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Playbook.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Playbook(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.goal = reader.string(); + break; + } + case 5: { + if (!(message.inputParameterDefinitions && message.inputParameterDefinitions.length)) + message.inputParameterDefinitions = []; + message.inputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.outputParameterDefinitions && message.outputParameterDefinitions.length)) + message.outputParameterDefinitions = []; + message.outputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 17: { + message.instruction = $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.tokenCount = reader.int64(); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + if (!(message.referencedPlaybooks && message.referencedPlaybooks.length)) + message.referencedPlaybooks = []; + message.referencedPlaybooks.push(reader.string()); + break; + } + case 12: { + if (!(message.referencedFlows && message.referencedFlows.length)) + message.referencedFlows = []; + message.referencedFlows.push(reader.string()); + break; + } + case 13: { + if (!(message.referencedTools && message.referencedTools.length)) + message.referencedTools = []; + message.referencedTools.push(reader.string()); + break; + } + case 22: { + if (!(message.inlineActions && message.inlineActions.length)) + message.inlineActions = []; + message.inlineActions.push(reader.string()); + break; + } + case 21: { + message.codeBlock = $root.google.cloud.dialogflow.cx.v3.CodeBlock.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + if (!(message.handlers && message.handlers.length)) + message.handlers = []; + message.handlers.push($root.google.cloud.dialogflow.cx.v3.Handler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 19: { + message.playbookType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Playbook message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Playbook} Playbook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Playbook.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Playbook message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Playbook.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.goal != null && message.hasOwnProperty("goal")) + if (!$util.isString(message.goal)) + return "goal: string expected"; + if (message.inputParameterDefinitions != null && message.hasOwnProperty("inputParameterDefinitions")) { + if (!Array.isArray(message.inputParameterDefinitions)) + return "inputParameterDefinitions: array expected"; + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.verify(message.inputParameterDefinitions[i], long + 1); + if (error) + return "inputParameterDefinitions." + error; + } + } + if (message.outputParameterDefinitions != null && message.hasOwnProperty("outputParameterDefinitions")) { + if (!Array.isArray(message.outputParameterDefinitions)) + return "outputParameterDefinitions: array expected"; + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.verify(message.outputParameterDefinitions[i], long + 1); + if (error) + return "outputParameterDefinitions." + error; + } + } + if (message.instruction != null && message.hasOwnProperty("instruction")) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction.verify(message.instruction, long + 1); + if (error) + return "instruction." + error; + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount) && !(message.tokenCount && $util.isInteger(message.tokenCount.low) && $util.isInteger(message.tokenCount.high))) + return "tokenCount: integer|Long expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.referencedPlaybooks != null && message.hasOwnProperty("referencedPlaybooks")) { + if (!Array.isArray(message.referencedPlaybooks)) + return "referencedPlaybooks: array expected"; + for (var i = 0; i < message.referencedPlaybooks.length; ++i) + if (!$util.isString(message.referencedPlaybooks[i])) + return "referencedPlaybooks: string[] expected"; + } + if (message.referencedFlows != null && message.hasOwnProperty("referencedFlows")) { + if (!Array.isArray(message.referencedFlows)) + return "referencedFlows: array expected"; + for (var i = 0; i < message.referencedFlows.length; ++i) + if (!$util.isString(message.referencedFlows[i])) + return "referencedFlows: string[] expected"; + } + if (message.referencedTools != null && message.hasOwnProperty("referencedTools")) { + if (!Array.isArray(message.referencedTools)) + return "referencedTools: array expected"; + for (var i = 0; i < message.referencedTools.length; ++i) + if (!$util.isString(message.referencedTools[i])) + return "referencedTools: string[] expected"; + } + if (message.inlineActions != null && message.hasOwnProperty("inlineActions")) { + if (!Array.isArray(message.inlineActions)) + return "inlineActions: array expected"; + for (var i = 0; i < message.inlineActions.length; ++i) + if (!$util.isString(message.inlineActions[i])) + return "inlineActions: string[] expected"; + } + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + var error = $root.google.cloud.dialogflow.cx.v3.CodeBlock.verify(message.codeBlock, long + 1); + if (error) + return "codeBlock." + error; + } + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + if (message.handlers != null && message.hasOwnProperty("handlers")) { + if (!Array.isArray(message.handlers)) + return "handlers: array expected"; + for (var i = 0; i < message.handlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Handler.verify(message.handlers[i], long + 1); + if (error) + return "handlers." + error; + } + } + if (message.playbookType != null && message.hasOwnProperty("playbookType")) + switch (message.playbookType) { + default: + return "playbookType: enum value expected"; + case 0: + case 1: + case 3: + break; + } + return null; + }; + + /** + * Creates a Playbook message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Playbook} Playbook + */ + Playbook.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Playbook) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Playbook(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.goal != null) + message.goal = String(object.goal); + if (object.inputParameterDefinitions) { + if (!Array.isArray(object.inputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.inputParameterDefinitions: array expected"); + message.inputParameterDefinitions = []; + for (var i = 0; i < object.inputParameterDefinitions.length; ++i) { + if (typeof object.inputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.inputParameterDefinitions: object expected"); + message.inputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.fromObject(object.inputParameterDefinitions[i], long + 1); + } + } + if (object.outputParameterDefinitions) { + if (!Array.isArray(object.outputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.outputParameterDefinitions: array expected"); + message.outputParameterDefinitions = []; + for (var i = 0; i < object.outputParameterDefinitions.length; ++i) { + if (typeof object.outputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.outputParameterDefinitions: object expected"); + message.outputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.fromObject(object.outputParameterDefinitions[i], long + 1); + } + } + if (object.instruction != null) { + if (typeof object.instruction !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.instruction: object expected"); + message.instruction = $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction.fromObject(object.instruction, long + 1); + } + if (object.tokenCount != null) + if ($util.Long) + (message.tokenCount = $util.Long.fromValue(object.tokenCount)).unsigned = false; + else if (typeof object.tokenCount === "string") + message.tokenCount = parseInt(object.tokenCount, 10); + else if (typeof object.tokenCount === "number") + message.tokenCount = object.tokenCount; + else if (typeof object.tokenCount === "object") + message.tokenCount = new $util.LongBits(object.tokenCount.low >>> 0, object.tokenCount.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.referencedPlaybooks) { + if (!Array.isArray(object.referencedPlaybooks)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.referencedPlaybooks: array expected"); + message.referencedPlaybooks = []; + for (var i = 0; i < object.referencedPlaybooks.length; ++i) + message.referencedPlaybooks[i] = String(object.referencedPlaybooks[i]); + } + if (object.referencedFlows) { + if (!Array.isArray(object.referencedFlows)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.referencedFlows: array expected"); + message.referencedFlows = []; + for (var i = 0; i < object.referencedFlows.length; ++i) + message.referencedFlows[i] = String(object.referencedFlows[i]); + } + if (object.referencedTools) { + if (!Array.isArray(object.referencedTools)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.referencedTools: array expected"); + message.referencedTools = []; + for (var i = 0; i < object.referencedTools.length; ++i) + message.referencedTools[i] = String(object.referencedTools[i]); + } + if (object.inlineActions) { + if (!Array.isArray(object.inlineActions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.inlineActions: array expected"); + message.inlineActions = []; + for (var i = 0; i < object.inlineActions.length; ++i) + message.inlineActions[i] = String(object.inlineActions[i]); + } + if (object.codeBlock != null) { + if (typeof object.codeBlock !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.codeBlock: object expected"); + message.codeBlock = $root.google.cloud.dialogflow.cx.v3.CodeBlock.fromObject(object.codeBlock, long + 1); + } + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + if (object.handlers) { + if (!Array.isArray(object.handlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.handlers: array expected"); + message.handlers = []; + for (var i = 0; i < object.handlers.length; ++i) { + if (typeof object.handlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.handlers: object expected"); + message.handlers[i] = $root.google.cloud.dialogflow.cx.v3.Handler.fromObject(object.handlers[i], long + 1); + } + } + switch (object.playbookType) { + default: + if (typeof object.playbookType === "number") { + message.playbookType = object.playbookType; + break; + } + break; + case "PLAYBOOK_TYPE_UNSPECIFIED": + case 0: + message.playbookType = 0; + break; + case "TASK": + case 1: + message.playbookType = 1; + break; + case "ROUTINE": + case 3: + message.playbookType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Playbook message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook} message Playbook + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Playbook.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputParameterDefinitions = []; + object.outputParameterDefinitions = []; + object.referencedPlaybooks = []; + object.referencedFlows = []; + object.referencedTools = []; + object.handlers = []; + object.inlineActions = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.goal = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.tokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tokenCount = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.llmModelSettings = null; + object.instruction = null; + object.playbookType = options.enums === String ? "PLAYBOOK_TYPE_UNSPECIFIED" : 0; + object.codeBlock = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.goal != null && message.hasOwnProperty("goal")) + object.goal = message.goal; + if (message.inputParameterDefinitions && message.inputParameterDefinitions.length) { + object.inputParameterDefinitions = []; + for (var j = 0; j < message.inputParameterDefinitions.length; ++j) + object.inputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.toObject(message.inputParameterDefinitions[j], options); + } + if (message.outputParameterDefinitions && message.outputParameterDefinitions.length) { + object.outputParameterDefinitions = []; + for (var j = 0; j < message.outputParameterDefinitions.length; ++j) + object.outputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3.ParameterDefinition.toObject(message.outputParameterDefinitions[j], options); + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (typeof message.tokenCount === "number") + object.tokenCount = options.longs === String ? String(message.tokenCount) : message.tokenCount; + else + object.tokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.tokenCount) : options.longs === Number ? new $util.LongBits(message.tokenCount.low >>> 0, message.tokenCount.high >>> 0).toNumber() : message.tokenCount; + if (message.createTime != null && message.hasOwnProperty("createTime")) + 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.referencedPlaybooks && message.referencedPlaybooks.length) { + object.referencedPlaybooks = []; + for (var j = 0; j < message.referencedPlaybooks.length; ++j) + object.referencedPlaybooks[j] = message.referencedPlaybooks[j]; + } + if (message.referencedFlows && message.referencedFlows.length) { + object.referencedFlows = []; + for (var j = 0; j < message.referencedFlows.length; ++j) + object.referencedFlows[j] = message.referencedFlows[j]; + } + if (message.referencedTools && message.referencedTools.length) { + object.referencedTools = []; + for (var j = 0; j < message.referencedTools.length; ++j) + object.referencedTools[j] = message.referencedTools[j]; + } + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3.LlmModelSettings.toObject(message.llmModelSettings, options); + if (message.handlers && message.handlers.length) { + object.handlers = []; + for (var j = 0; j < message.handlers.length; ++j) + object.handlers[j] = $root.google.cloud.dialogflow.cx.v3.Handler.toObject(message.handlers[j], options); + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction.toObject(message.instruction, options); + if (message.playbookType != null && message.hasOwnProperty("playbookType")) + object.playbookType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Playbook.PlaybookType[message.playbookType] === undefined ? message.playbookType : $root.google.cloud.dialogflow.cx.v3.Playbook.PlaybookType[message.playbookType] : message.playbookType; + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) + object.codeBlock = $root.google.cloud.dialogflow.cx.v3.CodeBlock.toObject(message.codeBlock, options); + if (message.inlineActions && message.inlineActions.length) { + object.inlineActions = []; + for (var j = 0; j < message.inlineActions.length; ++j) + object.inlineActions[j] = message.inlineActions[j]; + } + return object; + }; + + /** + * Converts this Playbook to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @instance + * @returns {Object.} JSON object + */ + Playbook.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Playbook + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Playbook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Playbook"; + }; + + Playbook.Step = (function() { + + /** + * Properties of a Step. + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @interface IStep + * @property {string|null} [text] Step text + * @property {Array.|null} [steps] Step steps + */ + + /** + * Constructs a new Step. + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @classdesc Represents a Step. + * @implements IStep + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Playbook.IStep=} [properties] Properties to set + */ + function Step(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Step text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @instance + */ + Step.prototype.text = null; + + /** + * Step steps. + * @member {Array.} steps + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @instance + */ + Step.prototype.steps = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Step instruction. + * @member {"text"|undefined} instruction + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @instance + */ + Object.defineProperty(Step.prototype, "instruction", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Step instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.IStep=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Step} Step instance + */ + Step.create = function create(properties) { + return new Step(properties); + }; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Step.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Playbook.Step.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Step.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Step message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Playbook.Step(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.dialogflow.cx.v3.Playbook.Step.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Step message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Step.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.instruction = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.Step.verify(message.steps[i], long + 1); + if (error) + return "steps." + error; + } + } + return null; + }; + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Step} Step + */ + Step.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Playbook.Step) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Playbook.Step(); + if (object.text != null) + message.text = String(object.text); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.Step.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.Step.steps: object expected"); + message.steps[i] = $root.google.cloud.dialogflow.cx.v3.Playbook.Step.fromObject(object.steps[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.Step} message Step + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Step.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.instruction = "text"; + } + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.dialogflow.cx.v3.Playbook.Step.toObject(message.steps[j], options); + } + return object; + }; + + /** + * Converts this Step to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @instance + * @returns {Object.} JSON object + */ + Step.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Step + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Step + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Step.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Playbook.Step"; + }; + + return Step; + })(); + + Playbook.Instruction = (function() { + + /** + * Properties of an Instruction. + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @interface IInstruction + * @property {string|null} [guidelines] Instruction guidelines + * @property {Array.|null} [steps] Instruction steps + */ + + /** + * Constructs a new Instruction. + * @memberof google.cloud.dialogflow.cx.v3.Playbook + * @classdesc Represents an Instruction. + * @implements IInstruction + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Playbook.IInstruction=} [properties] Properties to set + */ + function Instruction(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instruction guidelines. + * @member {string} guidelines + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @instance + */ + Instruction.prototype.guidelines = ""; + + /** + * Instruction steps. + * @member {Array.} steps + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @instance + */ + Instruction.prototype.steps = $util.emptyArray; + + /** + * Creates a new Instruction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.IInstruction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Instruction} Instruction instance + */ + Instruction.create = function create(properties) { + return new Instruction(properties); + }; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Instruction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guidelines != null && Object.hasOwnProperty.call(message, "guidelines")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.guidelines); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Playbook.Step.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Playbook.Instruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.guidelines = reader.string(); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.dialogflow.cx.v3.Playbook.Step.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instruction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instruction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.guidelines != null && message.hasOwnProperty("guidelines")) + if (!$util.isString(message.guidelines)) + return "guidelines: string expected"; + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.Step.verify(message.steps[i], long + 1); + if (error) + return "steps." + error; + } + } + return null; + }; + + /** + * Creates an Instruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Playbook.Instruction} Instruction + */ + Instruction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Playbook.Instruction(); + if (object.guidelines != null) + message.guidelines = String(object.guidelines); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.Instruction.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Playbook.Instruction.steps: object expected"); + message.steps[i] = $root.google.cloud.dialogflow.cx.v3.Playbook.Step.fromObject(object.steps[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3.Playbook.Instruction} message Instruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (options.defaults) + object.guidelines = ""; + if (message.guidelines != null && message.hasOwnProperty("guidelines")) + object.guidelines = message.guidelines; + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.dialogflow.cx.v3.Playbook.Step.toObject(message.steps[j], options); + } + return object; + }; + + /** + * Converts this Instruction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @instance + * @returns {Object.} JSON object + */ + Instruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instruction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Playbook.Instruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Playbook.Instruction"; + }; + + return Instruction; + })(); + + /** + * PlaybookType enum. + * @name google.cloud.dialogflow.cx.v3.Playbook.PlaybookType + * @enum {number} + * @property {number} PLAYBOOK_TYPE_UNSPECIFIED=0 PLAYBOOK_TYPE_UNSPECIFIED value + * @property {number} TASK=1 TASK value + * @property {number} ROUTINE=3 ROUTINE value + */ + Playbook.PlaybookType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PLAYBOOK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TASK"] = 1; + values[valuesById[3] = "ROUTINE"] = 3; + return values; + })(); + + return Playbook; + })(); + + v3.CreatePlaybookVersionRequest = (function() { + + /** + * Properties of a CreatePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreatePlaybookVersionRequest + * @property {string|null} [parent] CreatePlaybookVersionRequest parent + * @property {google.cloud.dialogflow.cx.v3.IPlaybookVersion|null} [playbookVersion] CreatePlaybookVersionRequest playbookVersion + */ + + /** + * Constructs a new CreatePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreatePlaybookVersionRequest. + * @implements ICreatePlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest=} [properties] Properties to set + */ + function CreatePlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePlaybookVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @instance + */ + CreatePlaybookVersionRequest.prototype.parent = ""; + + /** + * CreatePlaybookVersionRequest playbookVersion. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookVersion|null|undefined} playbookVersion + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @instance + */ + CreatePlaybookVersionRequest.prototype.playbookVersion = null; + + /** + * Creates a new CreatePlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest instance + */ + CreatePlaybookVersionRequest.create = function create(properties) { + return new CreatePlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified CreatePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest} message CreatePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookVersionRequest.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.playbookVersion != null && Object.hasOwnProperty.call(message, "playbookVersion")) + $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.encode(message.playbookVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest} message CreatePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.playbookVersion = $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.playbookVersion != null && message.hasOwnProperty("playbookVersion")) { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.verify(message.playbookVersion, long + 1); + if (error) + return "playbookVersion." + error; + } + return null; + }; + + /** + * Creates a CreatePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest + */ + CreatePlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.playbookVersion != null) { + if (typeof object.playbookVersion !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest.playbookVersion: object expected"); + message.playbookVersion = $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.fromObject(object.playbookVersion, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreatePlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest} message CreatePlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePlaybookVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.playbookVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.playbookVersion != null && message.hasOwnProperty("playbookVersion")) + object.playbookVersion = $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.toObject(message.playbookVersion, options); + return object; + }; + + /** + * Converts this CreatePlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest"; + }; + + return CreatePlaybookVersionRequest; + })(); + + v3.PlaybookVersion = (function() { + + /** + * Properties of a PlaybookVersion. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybookVersion + * @property {string|null} [name] PlaybookVersion name + * @property {string|null} [description] PlaybookVersion description + * @property {google.cloud.dialogflow.cx.v3.IPlaybook|null} [playbook] PlaybookVersion playbook + * @property {Array.|null} [examples] PlaybookVersion examples + * @property {google.protobuf.ITimestamp|null} [updateTime] PlaybookVersion updateTime + */ + + /** + * Constructs a new PlaybookVersion. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PlaybookVersion. + * @implements IPlaybookVersion + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybookVersion=} [properties] Properties to set + */ + function PlaybookVersion(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookVersion name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.name = ""; + + /** + * PlaybookVersion description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.description = ""; + + /** + * PlaybookVersion playbook. + * @member {google.cloud.dialogflow.cx.v3.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.playbook = null; + + /** + * PlaybookVersion examples. + * @member {Array.} examples + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.examples = $util.emptyArray; + + /** + * PlaybookVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.updateTime = null; + + /** + * Creates a new PlaybookVersion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookVersion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PlaybookVersion} PlaybookVersion instance + */ + PlaybookVersion.create = function create(properties) { + return new PlaybookVersion(properties); + }; + + /** + * Encodes the specified PlaybookVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookVersion} message PlaybookVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookVersion.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3.Playbook.encode(message.playbook, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Example.encode(message.examples[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PlaybookVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookVersion} message PlaybookVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PlaybookVersion} PlaybookVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookVersion.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PlaybookVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.dialogflow.cx.v3.Example.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PlaybookVersion} PlaybookVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookVersion message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookVersion.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Example.verify(message.examples[i], long + 1); + if (error) + return "examples." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a PlaybookVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PlaybookVersion} PlaybookVersion + */ + PlaybookVersion.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PlaybookVersion) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PlaybookVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PlaybookVersion.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.fromObject(object.playbook, long + 1); + } + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.dialogflow.cx.v3.PlaybookVersion.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PlaybookVersion.examples: object expected"); + message.examples[i] = $root.google.cloud.dialogflow.cx.v3.Example.fromObject(object.examples[i], long + 1); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.PlaybookVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PlaybookVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.PlaybookVersion} message PlaybookVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.playbook = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.toObject(message.playbook, options); + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.dialogflow.cx.v3.Example.toObject(message.examples[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this PlaybookVersion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @instance + * @returns {Object.} JSON object + */ + PlaybookVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookVersion + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PlaybookVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PlaybookVersion"; + }; + + return PlaybookVersion; + })(); + + v3.GetPlaybookVersionRequest = (function() { + + /** + * Properties of a GetPlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetPlaybookVersionRequest + * @property {string|null} [name] GetPlaybookVersionRequest name + */ + + /** + * Constructs a new GetPlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetPlaybookVersionRequest. + * @implements IGetPlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest=} [properties] Properties to set + */ + function GetPlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPlaybookVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @instance + */ + GetPlaybookVersionRequest.prototype.name = ""; + + /** + * Creates a new GetPlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest} GetPlaybookVersionRequest instance + */ + GetPlaybookVersionRequest.create = function create(properties) { + return new GetPlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified GetPlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest} message GetPlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookVersionRequest.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 GetPlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest} message GetPlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest} GetPlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest} GetPlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest} GetPlaybookVersionRequest + */ + GetPlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest} message GetPlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPlaybookVersionRequest.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 GetPlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetPlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest"; + }; + + return GetPlaybookVersionRequest; + })(); + + v3.RestorePlaybookVersionRequest = (function() { + + /** + * Properties of a RestorePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRestorePlaybookVersionRequest + * @property {string|null} [name] RestorePlaybookVersionRequest name + */ + + /** + * Constructs a new RestorePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RestorePlaybookVersionRequest. + * @implements IRestorePlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest=} [properties] Properties to set + */ + function RestorePlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestorePlaybookVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @instance + */ + RestorePlaybookVersionRequest.prototype.name = ""; + + /** + * Creates a new RestorePlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest instance + */ + RestorePlaybookVersionRequest.create = function create(properties) { + return new RestorePlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified RestorePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest} message RestorePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionRequest.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 RestorePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest} message RestorePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestorePlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestorePlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a RestorePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest + */ + RestorePlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestorePlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest} message RestorePlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestorePlaybookVersionRequest.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 RestorePlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestorePlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestorePlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestorePlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest"; + }; + + return RestorePlaybookVersionRequest; + })(); + + v3.RestorePlaybookVersionResponse = (function() { + + /** + * Properties of a RestorePlaybookVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRestorePlaybookVersionResponse + * @property {google.cloud.dialogflow.cx.v3.IPlaybook|null} [playbook] RestorePlaybookVersionResponse playbook + */ + + /** + * Constructs a new RestorePlaybookVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RestorePlaybookVersionResponse. + * @implements IRestorePlaybookVersionResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse=} [properties] Properties to set + */ + function RestorePlaybookVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestorePlaybookVersionResponse playbook. + * @member {google.cloud.dialogflow.cx.v3.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @instance + */ + RestorePlaybookVersionResponse.prototype.playbook = null; + + /** + * Creates a new RestorePlaybookVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse instance + */ + RestorePlaybookVersionResponse.create = function create(properties) { + return new RestorePlaybookVersionResponse(properties); + }; + + /** + * Encodes the specified RestorePlaybookVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse} message RestorePlaybookVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3.Playbook.encode(message.playbook, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestorePlaybookVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse} message RestorePlaybookVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestorePlaybookVersionResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestorePlaybookVersionResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + return null; + }; + + /** + * Creates a RestorePlaybookVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse + */ + RestorePlaybookVersionResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse(); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.fromObject(object.playbook, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RestorePlaybookVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse} message RestorePlaybookVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestorePlaybookVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.playbook = null; + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3.Playbook.toObject(message.playbook, options); + return object; + }; + + /** + * Converts this RestorePlaybookVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @instance + * @returns {Object.} JSON object + */ + RestorePlaybookVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestorePlaybookVersionResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestorePlaybookVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse"; + }; + + return RestorePlaybookVersionResponse; + })(); + + v3.ListPlaybookVersionsRequest = (function() { + + /** + * Properties of a ListPlaybookVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListPlaybookVersionsRequest + * @property {string|null} [parent] ListPlaybookVersionsRequest parent + * @property {number|null} [pageSize] ListPlaybookVersionsRequest pageSize + * @property {string|null} [pageToken] ListPlaybookVersionsRequest pageToken + */ + + /** + * Constructs a new ListPlaybookVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListPlaybookVersionsRequest. + * @implements IListPlaybookVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest=} [properties] Properties to set + */ + function ListPlaybookVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybookVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @instance + */ + ListPlaybookVersionsRequest.prototype.parent = ""; + + /** + * ListPlaybookVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @instance + */ + ListPlaybookVersionsRequest.prototype.pageSize = 0; + + /** + * ListPlaybookVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @instance + */ + ListPlaybookVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPlaybookVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest instance + */ + ListPlaybookVersionsRequest.create = function create(properties) { + return new ListPlaybookVersionsRequest(properties); + }; + + /** + * Encodes the specified ListPlaybookVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest} message ListPlaybookVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListPlaybookVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest} message ListPlaybookVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybookVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybookVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListPlaybookVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest + */ + ListPlaybookVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListPlaybookVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest} message ListPlaybookVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybookVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListPlaybookVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPlaybookVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybookVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybookVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest"; + }; + + return ListPlaybookVersionsRequest; + })(); + + v3.ListPlaybookVersionsResponse = (function() { + + /** + * Properties of a ListPlaybookVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListPlaybookVersionsResponse + * @property {Array.|null} [playbookVersions] ListPlaybookVersionsResponse playbookVersions + * @property {string|null} [nextPageToken] ListPlaybookVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListPlaybookVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListPlaybookVersionsResponse. + * @implements IListPlaybookVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse=} [properties] Properties to set + */ + function ListPlaybookVersionsResponse(properties) { + this.playbookVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybookVersionsResponse playbookVersions. + * @member {Array.} playbookVersions + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @instance + */ + ListPlaybookVersionsResponse.prototype.playbookVersions = $util.emptyArray; + + /** + * ListPlaybookVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @instance + */ + ListPlaybookVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPlaybookVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse instance + */ + ListPlaybookVersionsResponse.create = function create(properties) { + return new ListPlaybookVersionsResponse(properties); + }; + + /** + * Encodes the specified ListPlaybookVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse} message ListPlaybookVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbookVersions != null && message.playbookVersions.length) + for (var i = 0; i < message.playbookVersions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.encode(message.playbookVersions[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 ListPlaybookVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse} message ListPlaybookVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.playbookVersions && message.playbookVersions.length)) + message.playbookVersions = []; + message.playbookVersions.push($root.google.cloud.dialogflow.cx.v3.PlaybookVersion.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybookVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybookVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbookVersions != null && message.hasOwnProperty("playbookVersions")) { + if (!Array.isArray(message.playbookVersions)) + return "playbookVersions: array expected"; + for (var i = 0; i < message.playbookVersions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.verify(message.playbookVersions[i], long + 1); + if (error) + return "playbookVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPlaybookVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse + */ + ListPlaybookVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse(); + if (object.playbookVersions) { + if (!Array.isArray(object.playbookVersions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse.playbookVersions: array expected"); + message.playbookVersions = []; + for (var i = 0; i < object.playbookVersions.length; ++i) { + if (typeof object.playbookVersions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse.playbookVersions: object expected"); + message.playbookVersions[i] = $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.fromObject(object.playbookVersions[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPlaybookVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse} message ListPlaybookVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybookVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.playbookVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.playbookVersions && message.playbookVersions.length) { + object.playbookVersions = []; + for (var j = 0; j < message.playbookVersions.length; ++j) + object.playbookVersions[j] = $root.google.cloud.dialogflow.cx.v3.PlaybookVersion.toObject(message.playbookVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPlaybookVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPlaybookVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybookVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybookVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse"; + }; + + return ListPlaybookVersionsResponse; + })(); + + v3.DeletePlaybookVersionRequest = (function() { + + /** + * Properties of a DeletePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeletePlaybookVersionRequest + * @property {string|null} [name] DeletePlaybookVersionRequest name + */ + + /** + * Constructs a new DeletePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeletePlaybookVersionRequest. + * @implements IDeletePlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest=} [properties] Properties to set + */ + function DeletePlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePlaybookVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @instance + */ + DeletePlaybookVersionRequest.prototype.name = ""; + + /** + * Creates a new DeletePlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest instance + */ + DeletePlaybookVersionRequest.create = function create(properties) { + return new DeletePlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified DeletePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest} message DeletePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookVersionRequest.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 DeletePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest} message DeletePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest + */ + DeletePlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest} message DeletePlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePlaybookVersionRequest.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 DeletePlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest"; + }; + + return DeletePlaybookVersionRequest; + })(); + + v3.ExportPlaybookRequest = (function() { + + /** + * Properties of an ExportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportPlaybookRequest + * @property {string|null} [name] ExportPlaybookRequest name + * @property {string|null} [playbookUri] ExportPlaybookRequest playbookUri + * @property {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat|null} [dataFormat] ExportPlaybookRequest dataFormat + */ + + /** + * Constructs a new ExportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportPlaybookRequest. + * @implements IExportPlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookRequest=} [properties] Properties to set + */ + function ExportPlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportPlaybookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @instance + */ + ExportPlaybookRequest.prototype.name = ""; + + /** + * ExportPlaybookRequest playbookUri. + * @member {string} playbookUri + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @instance + */ + ExportPlaybookRequest.prototype.playbookUri = ""; + + /** + * ExportPlaybookRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @instance + */ + ExportPlaybookRequest.prototype.dataFormat = 0; + + /** + * Creates a new ExportPlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest} ExportPlaybookRequest instance + */ + ExportPlaybookRequest.create = function create(properties) { + return new ExportPlaybookRequest(properties); + }; + + /** + * Encodes the specified ExportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookRequest} message ExportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookRequest.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.playbookUri != null && Object.hasOwnProperty.call(message, "playbookUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.playbookUri); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified ExportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookRequest} message ExportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest} ExportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.playbookUri = reader.string(); + break; + } + case 3: { + message.dataFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest} ExportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportPlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportPlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) + if (!$util.isString(message.playbookUri)) + return "playbookUri: string expected"; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ExportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest} ExportPlaybookRequest + */ + ExportPlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.playbookUri != null) + message.playbookUri = String(object.playbookUri); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON": + case 2: + message.dataFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExportPlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest} message ExportPlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportPlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.playbookUri = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) + object.playbookUri = message.playbookUri; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this ExportPlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + ExportPlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportPlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportPlaybookRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON=2 JSON value + */ + ExportPlaybookRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); + + return ExportPlaybookRequest; + })(); + + v3.ImportPlaybookRequest = (function() { + + /** + * Properties of an ImportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportPlaybookRequest + * @property {string|null} [parent] ImportPlaybookRequest parent + * @property {string|null} [playbookUri] ImportPlaybookRequest playbookUri + * @property {Uint8Array|null} [playbookContent] ImportPlaybookRequest playbookContent + * @property {google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy|null} [importStrategy] ImportPlaybookRequest importStrategy + */ + + /** + * Constructs a new ImportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportPlaybookRequest. + * @implements IImportPlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookRequest=} [properties] Properties to set + */ + function ImportPlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportPlaybookRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.parent = ""; + + /** + * ImportPlaybookRequest playbookUri. + * @member {string|null|undefined} playbookUri + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.playbookUri = null; + + /** + * ImportPlaybookRequest playbookContent. + * @member {Uint8Array|null|undefined} playbookContent + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.playbookContent = null; + + /** + * ImportPlaybookRequest importStrategy. + * @member {google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy|null|undefined} importStrategy + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.importStrategy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportPlaybookRequest playbook. + * @member {"playbookUri"|"playbookContent"|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @instance + */ + Object.defineProperty(ImportPlaybookRequest.prototype, "playbook", { + get: $util.oneOfGetter($oneOfFields = ["playbookUri", "playbookContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportPlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookRequest} ImportPlaybookRequest instance + */ + ImportPlaybookRequest.create = function create(properties) { + return new ImportPlaybookRequest(properties); + }; + + /** + * Encodes the specified ImportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookRequest} message ImportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookRequest.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.playbookUri != null && Object.hasOwnProperty.call(message, "playbookUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.playbookUri); + if (message.playbookContent != null && Object.hasOwnProperty.call(message, "playbookContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.playbookContent); + if (message.importStrategy != null && Object.hasOwnProperty.call(message, "importStrategy")) + $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.encode(message.importStrategy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookRequest} message ImportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookRequest} ImportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.playbookUri = reader.string(); + break; + } + case 3: { + message.playbookContent = reader.bytes(); + break; + } + case 4: { + message.importStrategy = $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookRequest} ImportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportPlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportPlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + properties.playbook = 1; + if (!$util.isString(message.playbookUri)) + return "playbookUri: string expected"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + if (properties.playbook === 1) + return "playbook: multiple values"; + properties.playbook = 1; + if (!(message.playbookContent && typeof message.playbookContent.length === "number" || $util.isString(message.playbookContent))) + return "playbookContent: buffer expected"; + } + if (message.importStrategy != null && message.hasOwnProperty("importStrategy")) { + var error = $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.verify(message.importStrategy, long + 1); + if (error) + return "importStrategy." + error; + } + return null; + }; + + /** + * Creates an ImportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookRequest} ImportPlaybookRequest + */ + ImportPlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.playbookUri != null) + message.playbookUri = String(object.playbookUri); + if (object.playbookContent != null) + if (typeof object.playbookContent === "string") + $util.base64.decode(object.playbookContent, message.playbookContent = $util.newBuffer($util.base64.length(object.playbookContent)), 0); + else if (object.playbookContent.length >= 0) + message.playbookContent = object.playbookContent; + if (object.importStrategy != null) { + if (typeof object.importStrategy !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportPlaybookRequest.importStrategy: object expected"); + message.importStrategy = $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.fromObject(object.importStrategy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportPlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportPlaybookRequest} message ImportPlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportPlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.importStrategy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + object.playbookUri = message.playbookUri; + if (options.oneofs) + object.playbook = "playbookUri"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + object.playbookContent = options.bytes === String ? $util.base64.encode(message.playbookContent, 0, message.playbookContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.playbookContent) : message.playbookContent; + if (options.oneofs) + object.playbook = "playbookContent"; + } + if (message.importStrategy != null && message.hasOwnProperty("importStrategy")) + object.importStrategy = $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.toObject(message.importStrategy, options); + return object; + }; + + /** + * Converts this ImportPlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + ImportPlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportPlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportPlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportPlaybookRequest"; + }; + + return ImportPlaybookRequest; + })(); + + v3.PlaybookImportStrategy = (function() { + + /** + * Properties of a PlaybookImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IPlaybookImportStrategy + * @property {google.cloud.dialogflow.cx.v3.ImportStrategy|null} [mainPlaybookImportStrategy] PlaybookImportStrategy mainPlaybookImportStrategy + * @property {google.cloud.dialogflow.cx.v3.ImportStrategy|null} [nestedResourceImportStrategy] PlaybookImportStrategy nestedResourceImportStrategy + * @property {google.cloud.dialogflow.cx.v3.ImportStrategy|null} [toolImportStrategy] PlaybookImportStrategy toolImportStrategy + */ + + /** + * Constructs a new PlaybookImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a PlaybookImportStrategy. + * @implements IPlaybookImportStrategy + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy=} [properties] Properties to set + */ + function PlaybookImportStrategy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookImportStrategy mainPlaybookImportStrategy. + * @member {google.cloud.dialogflow.cx.v3.ImportStrategy} mainPlaybookImportStrategy + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @instance + */ + PlaybookImportStrategy.prototype.mainPlaybookImportStrategy = 0; + + /** + * PlaybookImportStrategy nestedResourceImportStrategy. + * @member {google.cloud.dialogflow.cx.v3.ImportStrategy} nestedResourceImportStrategy + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @instance + */ + PlaybookImportStrategy.prototype.nestedResourceImportStrategy = 0; + + /** + * PlaybookImportStrategy toolImportStrategy. + * @member {google.cloud.dialogflow.cx.v3.ImportStrategy} toolImportStrategy + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @instance + */ + PlaybookImportStrategy.prototype.toolImportStrategy = 0; + + /** + * Creates a new PlaybookImportStrategy instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.PlaybookImportStrategy} PlaybookImportStrategy instance + */ + PlaybookImportStrategy.create = function create(properties) { + return new PlaybookImportStrategy(properties); + }; + + /** + * Encodes the specified PlaybookImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy} message PlaybookImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookImportStrategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainPlaybookImportStrategy != null && Object.hasOwnProperty.call(message, "mainPlaybookImportStrategy")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mainPlaybookImportStrategy); + if (message.nestedResourceImportStrategy != null && Object.hasOwnProperty.call(message, "nestedResourceImportStrategy")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nestedResourceImportStrategy); + if (message.toolImportStrategy != null && Object.hasOwnProperty.call(message, "toolImportStrategy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.toolImportStrategy); + return writer; + }; + + /** + * Encodes the specified PlaybookImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.PlaybookImportStrategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.IPlaybookImportStrategy} message PlaybookImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookImportStrategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.PlaybookImportStrategy} PlaybookImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookImportStrategy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.mainPlaybookImportStrategy = reader.int32(); + break; + } + case 5: { + message.nestedResourceImportStrategy = reader.int32(); + break; + } + case 6: { + message.toolImportStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.PlaybookImportStrategy} PlaybookImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookImportStrategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookImportStrategy message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookImportStrategy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.mainPlaybookImportStrategy != null && message.hasOwnProperty("mainPlaybookImportStrategy")) + switch (message.mainPlaybookImportStrategy) { + default: + return "mainPlaybookImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.nestedResourceImportStrategy != null && message.hasOwnProperty("nestedResourceImportStrategy")) + switch (message.nestedResourceImportStrategy) { + default: + return "nestedResourceImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.toolImportStrategy != null && message.hasOwnProperty("toolImportStrategy")) + switch (message.toolImportStrategy) { + default: + return "toolImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a PlaybookImportStrategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.PlaybookImportStrategy} PlaybookImportStrategy + */ + PlaybookImportStrategy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.PlaybookImportStrategy(); + switch (object.mainPlaybookImportStrategy) { + default: + if (typeof object.mainPlaybookImportStrategy === "number") { + message.mainPlaybookImportStrategy = object.mainPlaybookImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.mainPlaybookImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.mainPlaybookImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.mainPlaybookImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.mainPlaybookImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.mainPlaybookImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.mainPlaybookImportStrategy = 5; + break; + } + switch (object.nestedResourceImportStrategy) { + default: + if (typeof object.nestedResourceImportStrategy === "number") { + message.nestedResourceImportStrategy = object.nestedResourceImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.nestedResourceImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.nestedResourceImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.nestedResourceImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.nestedResourceImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.nestedResourceImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.nestedResourceImportStrategy = 5; + break; + } + switch (object.toolImportStrategy) { + default: + if (typeof object.toolImportStrategy === "number") { + message.toolImportStrategy = object.toolImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.toolImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.toolImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.toolImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.toolImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.toolImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.toolImportStrategy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a PlaybookImportStrategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3.PlaybookImportStrategy} message PlaybookImportStrategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookImportStrategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mainPlaybookImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + object.nestedResourceImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + object.toolImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + } + if (message.mainPlaybookImportStrategy != null && message.hasOwnProperty("mainPlaybookImportStrategy")) + object.mainPlaybookImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.mainPlaybookImportStrategy] === undefined ? message.mainPlaybookImportStrategy : $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.mainPlaybookImportStrategy] : message.mainPlaybookImportStrategy; + if (message.nestedResourceImportStrategy != null && message.hasOwnProperty("nestedResourceImportStrategy")) + object.nestedResourceImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.nestedResourceImportStrategy] === undefined ? message.nestedResourceImportStrategy : $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.nestedResourceImportStrategy] : message.nestedResourceImportStrategy; + if (message.toolImportStrategy != null && message.hasOwnProperty("toolImportStrategy")) + object.toolImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.toolImportStrategy] === undefined ? message.toolImportStrategy : $root.google.cloud.dialogflow.cx.v3.ImportStrategy[message.toolImportStrategy] : message.toolImportStrategy; + return object; + }; + + /** + * Converts this PlaybookImportStrategy to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @instance + * @returns {Object.} JSON object + */ + PlaybookImportStrategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookImportStrategy + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.PlaybookImportStrategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookImportStrategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.PlaybookImportStrategy"; + }; + + return PlaybookImportStrategy; + })(); + + v3.ImportPlaybookResponse = (function() { + + /** + * Properties of an ImportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IImportPlaybookResponse + * @property {string|null} [playbook] ImportPlaybookResponse playbook + * @property {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources|null} [conflictingResources] ImportPlaybookResponse conflictingResources + */ + + /** + * Constructs a new ImportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ImportPlaybookResponse. + * @implements IImportPlaybookResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookResponse=} [properties] Properties to set + */ + function ImportPlaybookResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportPlaybookResponse playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @instance + */ + ImportPlaybookResponse.prototype.playbook = ""; + + /** + * ImportPlaybookResponse conflictingResources. + * @member {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources|null|undefined} conflictingResources + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @instance + */ + ImportPlaybookResponse.prototype.conflictingResources = null; + + /** + * Creates a new ImportPlaybookResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse} ImportPlaybookResponse instance + */ + ImportPlaybookResponse.create = function create(properties) { + return new ImportPlaybookResponse(properties); + }; + + /** + * Encodes the specified ImportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookResponse} message ImportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.conflictingResources != null && Object.hasOwnProperty.call(message, "conflictingResources")) + $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.encode(message.conflictingResources, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IImportPlaybookResponse} message ImportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse} ImportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 2: { + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse} ImportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportPlaybookResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportPlaybookResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) { + var error = $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.verify(message.conflictingResources, long + 1); + if (error) + return "conflictingResources." + error; + } + return null; + }; + + /** + * Creates an ImportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse} ImportPlaybookResponse + */ + ImportPlaybookResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.conflictingResources != null) { + if (typeof object.conflictingResources !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.conflictingResources: object expected"); + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.fromObject(object.conflictingResources, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportPlaybookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse} message ImportPlaybookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportPlaybookResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.conflictingResources = null; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) + object.conflictingResources = $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.toObject(message.conflictingResources, options); + return object; + }; + + /** + * Converts this ImportPlaybookResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @instance + * @returns {Object.} JSON object + */ + ImportPlaybookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportPlaybookResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportPlaybookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportPlaybookResponse"; + }; + + ImportPlaybookResponse.ConflictingResources = (function() { + + /** + * Properties of a ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @interface IConflictingResources + * @property {string|null} [mainPlaybookDisplayName] ConflictingResources mainPlaybookDisplayName + * @property {Array.|null} [nestedPlaybookDisplayNames] ConflictingResources nestedPlaybookDisplayNames + * @property {Array.|null} [toolDisplayNames] ConflictingResources toolDisplayNames + */ + + /** + * Constructs a new ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse + * @classdesc Represents a ConflictingResources. + * @implements IConflictingResources + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources=} [properties] Properties to set + */ + function ConflictingResources(properties) { + this.nestedPlaybookDisplayNames = []; + this.toolDisplayNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConflictingResources mainPlaybookDisplayName. + * @member {string} mainPlaybookDisplayName + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.mainPlaybookDisplayName = ""; + + /** + * ConflictingResources nestedPlaybookDisplayNames. + * @member {Array.} nestedPlaybookDisplayNames + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.nestedPlaybookDisplayNames = $util.emptyArray; + + /** + * ConflictingResources toolDisplayNames. + * @member {Array.} toolDisplayNames + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.toolDisplayNames = $util.emptyArray; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources} ConflictingResources instance + */ + ConflictingResources.create = function create(properties) { + return new ConflictingResources(properties); + }; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainPlaybookDisplayName != null && Object.hasOwnProperty.call(message, "mainPlaybookDisplayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainPlaybookDisplayName); + if (message.nestedPlaybookDisplayNames != null && message.nestedPlaybookDisplayNames.length) + for (var i = 0; i < message.nestedPlaybookDisplayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nestedPlaybookDisplayNames[i]); + if (message.toolDisplayNames != null && message.toolDisplayNames.length) + for (var i = 0; i < message.toolDisplayNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolDisplayNames[i]); + return writer; + }; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainPlaybookDisplayName = reader.string(); + break; + } + case 2: { + if (!(message.nestedPlaybookDisplayNames && message.nestedPlaybookDisplayNames.length)) + message.nestedPlaybookDisplayNames = []; + message.nestedPlaybookDisplayNames.push(reader.string()); + break; + } + case 3: { + if (!(message.toolDisplayNames && message.toolDisplayNames.length)) + message.toolDisplayNames = []; + message.toolDisplayNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConflictingResources message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConflictingResources.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.mainPlaybookDisplayName != null && message.hasOwnProperty("mainPlaybookDisplayName")) + if (!$util.isString(message.mainPlaybookDisplayName)) + return "mainPlaybookDisplayName: string expected"; + if (message.nestedPlaybookDisplayNames != null && message.hasOwnProperty("nestedPlaybookDisplayNames")) { + if (!Array.isArray(message.nestedPlaybookDisplayNames)) + return "nestedPlaybookDisplayNames: array expected"; + for (var i = 0; i < message.nestedPlaybookDisplayNames.length; ++i) + if (!$util.isString(message.nestedPlaybookDisplayNames[i])) + return "nestedPlaybookDisplayNames: string[] expected"; + } + if (message.toolDisplayNames != null && message.hasOwnProperty("toolDisplayNames")) { + if (!Array.isArray(message.toolDisplayNames)) + return "toolDisplayNames: array expected"; + for (var i = 0; i < message.toolDisplayNames.length; ++i) + if (!$util.isString(message.toolDisplayNames[i])) + return "toolDisplayNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources} ConflictingResources + */ + ConflictingResources.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources(); + if (object.mainPlaybookDisplayName != null) + message.mainPlaybookDisplayName = String(object.mainPlaybookDisplayName); + if (object.nestedPlaybookDisplayNames) { + if (!Array.isArray(object.nestedPlaybookDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.nestedPlaybookDisplayNames: array expected"); + message.nestedPlaybookDisplayNames = []; + for (var i = 0; i < object.nestedPlaybookDisplayNames.length; ++i) + message.nestedPlaybookDisplayNames[i] = String(object.nestedPlaybookDisplayNames[i]); + } + if (object.toolDisplayNames) { + if (!Array.isArray(object.toolDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources.toolDisplayNames: array expected"); + message.toolDisplayNames = []; + for (var i = 0; i < object.toolDisplayNames.length; ++i) + message.toolDisplayNames[i] = String(object.toolDisplayNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources} message ConflictingResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConflictingResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nestedPlaybookDisplayNames = []; + object.toolDisplayNames = []; + } + if (options.defaults) + object.mainPlaybookDisplayName = ""; + if (message.mainPlaybookDisplayName != null && message.hasOwnProperty("mainPlaybookDisplayName")) + object.mainPlaybookDisplayName = message.mainPlaybookDisplayName; + if (message.nestedPlaybookDisplayNames && message.nestedPlaybookDisplayNames.length) { + object.nestedPlaybookDisplayNames = []; + for (var j = 0; j < message.nestedPlaybookDisplayNames.length; ++j) + object.nestedPlaybookDisplayNames[j] = message.nestedPlaybookDisplayNames[j]; + } + if (message.toolDisplayNames && message.toolDisplayNames.length) { + object.toolDisplayNames = []; + for (var j = 0; j < message.toolDisplayNames.length; ++j) + object.toolDisplayNames[j] = message.toolDisplayNames[j]; + } + return object; + }; + + /** + * Converts this ConflictingResources to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @instance + * @returns {Object.} JSON object + */ + ConflictingResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConflictingResources + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConflictingResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources"; + }; + + return ConflictingResources; + })(); + + return ImportPlaybookResponse; + })(); + + v3.ExportPlaybookResponse = (function() { + + /** + * Properties of an ExportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IExportPlaybookResponse + * @property {string|null} [playbookUri] ExportPlaybookResponse playbookUri + * @property {Uint8Array|null} [playbookContent] ExportPlaybookResponse playbookContent + */ + + /** + * Constructs a new ExportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an ExportPlaybookResponse. + * @implements IExportPlaybookResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookResponse=} [properties] Properties to set + */ + function ExportPlaybookResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportPlaybookResponse playbookUri. + * @member {string|null|undefined} playbookUri + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @instance + */ + ExportPlaybookResponse.prototype.playbookUri = null; + + /** + * ExportPlaybookResponse playbookContent. + * @member {Uint8Array|null|undefined} playbookContent + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @instance + */ + ExportPlaybookResponse.prototype.playbookContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportPlaybookResponse playbook. + * @member {"playbookUri"|"playbookContent"|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @instance + */ + Object.defineProperty(ExportPlaybookResponse.prototype, "playbook", { + get: $util.oneOfGetter($oneOfFields = ["playbookUri", "playbookContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportPlaybookResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookResponse} ExportPlaybookResponse instance + */ + ExportPlaybookResponse.create = function create(properties) { + return new ExportPlaybookResponse(properties); + }; + + /** + * Encodes the specified ExportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookResponse} message ExportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbookUri != null && Object.hasOwnProperty.call(message, "playbookUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbookUri); + if (message.playbookContent != null && Object.hasOwnProperty.call(message, "playbookContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.playbookContent); + return writer; + }; + + /** + * Encodes the specified ExportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ExportPlaybookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IExportPlaybookResponse} message ExportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookResponse} ExportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ExportPlaybookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbookUri = reader.string(); + break; + } + case 2: { + message.playbookContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookResponse} ExportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportPlaybookResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportPlaybookResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + properties.playbook = 1; + if (!$util.isString(message.playbookUri)) + return "playbookUri: string expected"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + if (properties.playbook === 1) + return "playbook: multiple values"; + properties.playbook = 1; + if (!(message.playbookContent && typeof message.playbookContent.length === "number" || $util.isString(message.playbookContent))) + return "playbookContent: buffer expected"; + } + return null; + }; + + /** + * Creates an ExportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ExportPlaybookResponse} ExportPlaybookResponse + */ + ExportPlaybookResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ExportPlaybookResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ExportPlaybookResponse(); + if (object.playbookUri != null) + message.playbookUri = String(object.playbookUri); + if (object.playbookContent != null) + if (typeof object.playbookContent === "string") + $util.base64.decode(object.playbookContent, message.playbookContent = $util.newBuffer($util.base64.length(object.playbookContent)), 0); + else if (object.playbookContent.length >= 0) + message.playbookContent = object.playbookContent; + return message; + }; + + /** + * Creates a plain object from an ExportPlaybookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ExportPlaybookResponse} message ExportPlaybookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportPlaybookResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + object.playbookUri = message.playbookUri; + if (options.oneofs) + object.playbook = "playbookUri"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + object.playbookContent = options.bytes === String ? $util.base64.encode(message.playbookContent, 0, message.playbookContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.playbookContent) : message.playbookContent; + if (options.oneofs) + object.playbook = "playbookContent"; + } + return object; + }; + + /** + * Converts this ExportPlaybookResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @instance + * @returns {Object.} JSON object + */ + ExportPlaybookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportPlaybookResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ExportPlaybookResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPlaybookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ExportPlaybookResponse"; + }; + + return ExportPlaybookResponse; + })(); + + v3.Handler = (function() { + + /** + * Properties of a Handler. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IHandler + * @property {google.cloud.dialogflow.cx.v3.Handler.IEventHandler|null} [eventHandler] Handler eventHandler + * @property {google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler|null} [lifecycleHandler] Handler lifecycleHandler + */ + + /** + * Constructs a new Handler. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Handler. + * @implements IHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IHandler=} [properties] Properties to set + */ + function Handler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Handler eventHandler. + * @member {google.cloud.dialogflow.cx.v3.Handler.IEventHandler|null|undefined} eventHandler + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @instance + */ + Handler.prototype.eventHandler = null; + + /** + * Handler lifecycleHandler. + * @member {google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler|null|undefined} lifecycleHandler + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @instance + */ + Handler.prototype.lifecycleHandler = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Handler handler. + * @member {"eventHandler"|"lifecycleHandler"|undefined} handler + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @instance + */ + Object.defineProperty(Handler.prototype, "handler", { + get: $util.oneOfGetter($oneOfFields = ["eventHandler", "lifecycleHandler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Handler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3.IHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Handler} Handler instance + */ + Handler.create = function create(properties) { + return new Handler(properties); + }; + + /** + * Encodes the specified Handler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3.IHandler} message Handler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Handler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventHandler != null && Object.hasOwnProperty.call(message, "eventHandler")) + $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler.encode(message.eventHandler, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lifecycleHandler != null && Object.hasOwnProperty.call(message, "lifecycleHandler")) + $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.encode(message.lifecycleHandler, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Handler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3.IHandler} message Handler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Handler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Handler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Handler} Handler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Handler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Handler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventHandler = $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.lifecycleHandler = $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Handler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Handler} Handler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Handler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Handler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Handler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + properties.handler = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler.verify(message.eventHandler, long + 1); + if (error) + return "eventHandler." + error; + } + } + if (message.lifecycleHandler != null && message.hasOwnProperty("lifecycleHandler")) { + if (properties.handler === 1) + return "handler: multiple values"; + properties.handler = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.verify(message.lifecycleHandler, long + 1); + if (error) + return "lifecycleHandler." + error; + } + } + return null; + }; + + /** + * Creates a Handler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Handler} Handler + */ + Handler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Handler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Handler(); + if (object.eventHandler != null) { + if (typeof object.eventHandler !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Handler.eventHandler: object expected"); + message.eventHandler = $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler.fromObject(object.eventHandler, long + 1); + } + if (object.lifecycleHandler != null) { + if (typeof object.lifecycleHandler !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Handler.lifecycleHandler: object expected"); + message.lifecycleHandler = $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.fromObject(object.lifecycleHandler, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Handler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler} message Handler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Handler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + object.eventHandler = $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler.toObject(message.eventHandler, options); + if (options.oneofs) + object.handler = "eventHandler"; + } + if (message.lifecycleHandler != null && message.hasOwnProperty("lifecycleHandler")) { + object.lifecycleHandler = $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.toObject(message.lifecycleHandler, options); + if (options.oneofs) + object.handler = "lifecycleHandler"; + } + return object; + }; + + /** + * Converts this Handler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @instance + * @returns {Object.} JSON object + */ + Handler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Handler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Handler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Handler"; + }; + + Handler.EventHandler = (function() { + + /** + * Properties of an EventHandler. + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @interface IEventHandler + * @property {string|null} [event] EventHandler event + * @property {string|null} [condition] EventHandler condition + * @property {google.cloud.dialogflow.cx.v3.IFulfillment|null} [fulfillment] EventHandler fulfillment + */ + + /** + * Constructs a new EventHandler. + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @classdesc Represents an EventHandler. + * @implements IEventHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Handler.IEventHandler=} [properties] Properties to set + */ + function EventHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventHandler event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @instance + */ + EventHandler.prototype.event = ""; + + /** + * EventHandler condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @instance + */ + EventHandler.prototype.condition = ""; + + /** + * EventHandler fulfillment. + * @member {google.cloud.dialogflow.cx.v3.IFulfillment|null|undefined} fulfillment + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @instance + */ + EventHandler.prototype.fulfillment = null; + + /** + * Creates a new EventHandler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.IEventHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Handler.EventHandler} EventHandler instance + */ + EventHandler.create = function create(properties) { + return new EventHandler(properties); + }; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.EventHandler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + if (message.fulfillment != null && Object.hasOwnProperty.call(message, "fulfillment")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.encode(message.fulfillment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.condition); + return writer; + }; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.EventHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Handler.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + case 3: { + message.condition = reader.string(); + break; + } + case 2: { + message.fulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Handler.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventHandler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventHandler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.verify(message.fulfillment, long + 1); + if (error) + return "fulfillment." + error; + } + return null; + }; + + /** + * Creates an EventHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Handler.EventHandler} EventHandler + */ + EventHandler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Handler.EventHandler(); + if (object.event != null) + message.event = String(object.event); + if (object.condition != null) + message.condition = String(object.condition); + if (object.fulfillment != null) { + if (typeof object.fulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Handler.EventHandler.fulfillment: object expected"); + message.fulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.fromObject(object.fulfillment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.EventHandler} message EventHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.event = ""; + object.fulfillment = null; + object.condition = ""; + } + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) + object.fulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.toObject(message.fulfillment, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + return object; + }; + + /** + * Converts this EventHandler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @instance + * @returns {Object.} JSON object + */ + EventHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventHandler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Handler.EventHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Handler.EventHandler"; + }; + + return EventHandler; + })(); + + Handler.LifecycleHandler = (function() { + + /** + * Properties of a LifecycleHandler. + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @interface ILifecycleHandler + * @property {string|null} [lifecycleStage] LifecycleHandler lifecycleStage + * @property {string|null} [condition] LifecycleHandler condition + * @property {google.cloud.dialogflow.cx.v3.IFulfillment|null} [fulfillment] LifecycleHandler fulfillment + */ + + /** + * Constructs a new LifecycleHandler. + * @memberof google.cloud.dialogflow.cx.v3.Handler + * @classdesc Represents a LifecycleHandler. + * @implements ILifecycleHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler=} [properties] Properties to set + */ + function LifecycleHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LifecycleHandler lifecycleStage. + * @member {string} lifecycleStage + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @instance + */ + LifecycleHandler.prototype.lifecycleStage = ""; + + /** + * LifecycleHandler condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @instance + */ + LifecycleHandler.prototype.condition = ""; + + /** + * LifecycleHandler fulfillment. + * @member {google.cloud.dialogflow.cx.v3.IFulfillment|null|undefined} fulfillment + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @instance + */ + LifecycleHandler.prototype.fulfillment = null; + + /** + * Creates a new LifecycleHandler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler} LifecycleHandler instance + */ + LifecycleHandler.create = function create(properties) { + return new LifecycleHandler(properties); + }; + + /** + * Encodes the specified LifecycleHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler} message LifecycleHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecycleHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lifecycleStage != null && Object.hasOwnProperty.call(message, "lifecycleStage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.lifecycleStage); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.condition); + if (message.fulfillment != null && Object.hasOwnProperty.call(message, "fulfillment")) + $root.google.cloud.dialogflow.cx.v3.Fulfillment.encode(message.fulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LifecycleHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.ILifecycleHandler} message LifecycleHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecycleHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler} LifecycleHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecycleHandler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lifecycleStage = reader.string(); + break; + } + case 2: { + message.condition = reader.string(); + break; + } + case 3: { + message.fulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler} LifecycleHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecycleHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LifecycleHandler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LifecycleHandler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.lifecycleStage != null && message.hasOwnProperty("lifecycleStage")) + if (!$util.isString(message.lifecycleStage)) + return "lifecycleStage: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3.Fulfillment.verify(message.fulfillment, long + 1); + if (error) + return "fulfillment." + error; + } + return null; + }; + + /** + * Creates a LifecycleHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler} LifecycleHandler + */ + LifecycleHandler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler(); + if (object.lifecycleStage != null) + message.lifecycleStage = String(object.lifecycleStage); + if (object.condition != null) + message.condition = String(object.condition); + if (object.fulfillment != null) { + if (typeof object.fulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler.fulfillment: object expected"); + message.fulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.fromObject(object.fulfillment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LifecycleHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler} message LifecycleHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LifecycleHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lifecycleStage = ""; + object.condition = ""; + object.fulfillment = null; + } + if (message.lifecycleStage != null && message.hasOwnProperty("lifecycleStage")) + object.lifecycleStage = message.lifecycleStage; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) + object.fulfillment = $root.google.cloud.dialogflow.cx.v3.Fulfillment.toObject(message.fulfillment, options); + return object; + }; + + /** + * Converts this LifecycleHandler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @instance + * @returns {Object.} JSON object + */ + LifecycleHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LifecycleHandler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LifecycleHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler"; + }; + + return LifecycleHandler; + })(); + + return Handler; + })(); + + v3.SecuritySettingsService = (function() { + + /** + * Constructs a new SecuritySettingsService service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SecuritySettingsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SecuritySettingsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecuritySettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecuritySettingsService; + + /** + * Creates new SecuritySettingsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SecuritySettingsService} RPC service. Useful where requests and/or responses are streamed. + */ + SecuritySettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|createSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @typedef CreateSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls CreateSecuritySettings. + * @function createSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest} request CreateSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SecuritySettingsService.CreateSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.createSecuritySettings = function createSecuritySettings(request, callback) { + return this.rpcCall(createSecuritySettings, $root.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3.SecuritySettings, request, callback); + }, "name", { value: "CreateSecuritySettings" }); + + /** + * Calls CreateSecuritySettings. + * @function createSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest} request CreateSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|getSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @typedef GetSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls GetSecuritySettings. + * @function getSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest} request GetSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.getSecuritySettings = function getSecuritySettings(request, callback) { + return this.rpcCall(getSecuritySettings, $root.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3.SecuritySettings, request, callback); + }, "name", { value: "GetSecuritySettings" }); + + /** + * Calls GetSecuritySettings. + * @function getSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest} request GetSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|updateSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @typedef UpdateSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls UpdateSecuritySettings. + * @function updateSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest} request UpdateSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.updateSecuritySettings = function updateSecuritySettings(request, callback) { + return this.rpcCall(updateSecuritySettings, $root.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3.SecuritySettings, request, callback); + }, "name", { value: "UpdateSecuritySettings" }); + + /** + * Calls UpdateSecuritySettings. + * @function updateSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest} request UpdateSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|listSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @typedef ListSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse} [response] ListSecuritySettingsResponse + */ + + /** + * Calls ListSecuritySettings. + * @function listSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest} request ListSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SecuritySettingsService.ListSecuritySettingsCallback} callback Node-style callback called with the error, if any, and ListSecuritySettingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.listSecuritySettings = function listSecuritySettings(request, callback) { + return this.rpcCall(listSecuritySettings, $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse, request, callback); + }, "name", { value: "ListSecuritySettings" }); + + /** + * Calls ListSecuritySettings. + * @function listSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest} request ListSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.SecuritySettingsService|deleteSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @typedef DeleteSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSecuritySettings. + * @function deleteSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest} request DeleteSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.SecuritySettingsService.DeleteSecuritySettingsCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.deleteSecuritySettings = function deleteSecuritySettings(request, callback) { + return this.rpcCall(deleteSecuritySettings, $root.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSecuritySettings" }); + + /** + * Calls DeleteSecuritySettings. + * @function deleteSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest} request DeleteSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecuritySettingsService; + })(); + + v3.GetSecuritySettingsRequest = (function() { + + /** + * Properties of a GetSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetSecuritySettingsRequest + * @property {string|null} [name] GetSecuritySettingsRequest name + */ + + /** + * Constructs a new GetSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetSecuritySettingsRequest. + * @implements IGetSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest=} [properties] Properties to set + */ + function GetSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSecuritySettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @instance + */ + GetSecuritySettingsRequest.prototype.name = ""; + + /** + * Creates a new GetSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest} GetSecuritySettingsRequest instance + */ + GetSecuritySettingsRequest.create = function create(properties) { + return new GetSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified GetSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest} message GetSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecuritySettingsRequest.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 GetSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest} message GetSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest} GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest} GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest} GetSecuritySettingsRequest + */ + GetSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest} message GetSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSecuritySettingsRequest.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 GetSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest"; + }; + + return GetSecuritySettingsRequest; + })(); + + v3.UpdateSecuritySettingsRequest = (function() { + + /** + * Properties of an UpdateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateSecuritySettingsRequest + * @property {google.cloud.dialogflow.cx.v3.ISecuritySettings|null} [securitySettings] UpdateSecuritySettingsRequest securitySettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecuritySettingsRequest updateMask + */ + + /** + * Constructs a new UpdateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateSecuritySettingsRequest. + * @implements IUpdateSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest=} [properties] Properties to set + */ + function UpdateSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecuritySettingsRequest securitySettings. + * @member {google.cloud.dialogflow.cx.v3.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @instance + */ + UpdateSecuritySettingsRequest.prototype.securitySettings = null; + + /** + * UpdateSecuritySettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @instance + */ + UpdateSecuritySettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest instance + */ + UpdateSecuritySettingsRequest.create = function create(properties) { + return new UpdateSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecuritySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.dialogflow.cx.v3.SecuritySettings.encode(message.securitySettings, 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 UpdateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.securitySettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.verify(message.securitySettings, long + 1); + if (error) + return "securitySettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + */ + UpdateSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest(); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.fromObject(object.securitySettings, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securitySettings = null; + object.updateMask = null; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.toObject(message.securitySettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest"; + }; + + return UpdateSecuritySettingsRequest; + })(); + + v3.ListSecuritySettingsRequest = (function() { + + /** + * Properties of a ListSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListSecuritySettingsRequest + * @property {string|null} [parent] ListSecuritySettingsRequest parent + * @property {number|null} [pageSize] ListSecuritySettingsRequest pageSize + * @property {string|null} [pageToken] ListSecuritySettingsRequest pageToken + */ + + /** + * Constructs a new ListSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListSecuritySettingsRequest. + * @implements IListSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest=} [properties] Properties to set + */ + function ListSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecuritySettingsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.parent = ""; + + /** + * ListSecuritySettingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.pageSize = 0; + + /** + * ListSecuritySettingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest} ListSecuritySettingsRequest instance + */ + ListSecuritySettingsRequest.create = function create(properties) { + return new ListSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified ListSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest} message ListSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest} message ListSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest} ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest} ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest} ListSecuritySettingsRequest + */ + ListSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest} message ListSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest"; + }; + + return ListSecuritySettingsRequest; + })(); + + v3.ListSecuritySettingsResponse = (function() { + + /** + * Properties of a ListSecuritySettingsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListSecuritySettingsResponse + * @property {Array.|null} [securitySettings] ListSecuritySettingsResponse securitySettings + * @property {string|null} [nextPageToken] ListSecuritySettingsResponse nextPageToken + */ + + /** + * Constructs a new ListSecuritySettingsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListSecuritySettingsResponse. + * @implements IListSecuritySettingsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse=} [properties] Properties to set + */ + function ListSecuritySettingsResponse(properties) { + this.securitySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecuritySettingsResponse securitySettings. + * @member {Array.} securitySettings + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @instance + */ + ListSecuritySettingsResponse.prototype.securitySettings = $util.emptyArray; + + /** + * ListSecuritySettingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @instance + */ + ListSecuritySettingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSecuritySettingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse} ListSecuritySettingsResponse instance + */ + ListSecuritySettingsResponse.create = function create(properties) { + return new ListSecuritySettingsResponse(properties); + }; + + /** + * Encodes the specified ListSecuritySettingsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse} message ListSecuritySettingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securitySettings != null && message.securitySettings.length) + for (var i = 0; i < message.securitySettings.length; ++i) + $root.google.cloud.dialogflow.cx.v3.SecuritySettings.encode(message.securitySettings[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 ListSecuritySettingsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse} message ListSecuritySettingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse} ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.securitySettings && message.securitySettings.length)) + message.securitySettings = []; + message.securitySettings.push($root.google.cloud.dialogflow.cx.v3.SecuritySettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse} ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecuritySettingsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecuritySettingsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + if (!Array.isArray(message.securitySettings)) + return "securitySettings: array expected"; + for (var i = 0; i < message.securitySettings.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.verify(message.securitySettings[i], long + 1); + if (error) + return "securitySettings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSecuritySettingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse} ListSecuritySettingsResponse + */ + ListSecuritySettingsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse(); + if (object.securitySettings) { + if (!Array.isArray(object.securitySettings)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse.securitySettings: array expected"); + message.securitySettings = []; + for (var i = 0; i < object.securitySettings.length; ++i) { + if (typeof object.securitySettings[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse.securitySettings: object expected"); + message.securitySettings[i] = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.fromObject(object.securitySettings[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSecuritySettingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse} message ListSecuritySettingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecuritySettingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.securitySettings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.securitySettings && message.securitySettings.length) { + object.securitySettings = []; + for (var j = 0; j < message.securitySettings.length; ++j) + object.securitySettings[j] = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.toObject(message.securitySettings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSecuritySettingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSecuritySettingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecuritySettingsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecuritySettingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse"; + }; + + return ListSecuritySettingsResponse; + })(); + + v3.CreateSecuritySettingsRequest = (function() { + + /** + * Properties of a CreateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateSecuritySettingsRequest + * @property {string|null} [parent] CreateSecuritySettingsRequest parent + * @property {google.cloud.dialogflow.cx.v3.ISecuritySettings|null} [securitySettings] CreateSecuritySettingsRequest securitySettings + */ + + /** + * Constructs a new CreateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateSecuritySettingsRequest. + * @implements ICreateSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest=} [properties] Properties to set + */ + function CreateSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecuritySettingsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @instance + */ + CreateSecuritySettingsRequest.prototype.parent = ""; + + /** + * CreateSecuritySettingsRequest securitySettings. + * @member {google.cloud.dialogflow.cx.v3.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @instance + */ + CreateSecuritySettingsRequest.prototype.securitySettings = null; + + /** + * Creates a new CreateSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest instance + */ + CreateSecuritySettingsRequest.create = function create(properties) { + return new CreateSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified CreateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest} message CreateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecuritySettingsRequest.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.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.dialogflow.cx.v3.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest} message CreateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.securitySettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.verify(message.securitySettings, long + 1); + if (error) + return "securitySettings." + error; + } + return null; + }; + + /** + * Creates a CreateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + */ + CreateSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.fromObject(object.securitySettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest} message CreateSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.securitySettings = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.toObject(message.securitySettings, options); + return object; + }; + + /** + * Converts this CreateSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest"; + }; + + return CreateSecuritySettingsRequest; + })(); + + v3.DeleteSecuritySettingsRequest = (function() { + + /** + * Properties of a DeleteSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteSecuritySettingsRequest + * @property {string|null} [name] DeleteSecuritySettingsRequest name + */ + + /** + * Constructs a new DeleteSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteSecuritySettingsRequest. + * @implements IDeleteSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest=} [properties] Properties to set + */ + function DeleteSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSecuritySettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @instance + */ + DeleteSecuritySettingsRequest.prototype.name = ""; + + /** + * Creates a new DeleteSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest instance + */ + DeleteSecuritySettingsRequest.create = function create(properties) { + return new DeleteSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecuritySettingsRequest.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 DeleteSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + */ + DeleteSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSecuritySettingsRequest.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 DeleteSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest"; + }; + + return DeleteSecuritySettingsRequest; + })(); + + v3.SecuritySettings = (function() { + + /** + * Properties of a SecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ISecuritySettings + * @property {string|null} [name] SecuritySettings name + * @property {string|null} [displayName] SecuritySettings displayName + * @property {google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy|null} [redactionStrategy] SecuritySettings redactionStrategy + * @property {google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope|null} [redactionScope] SecuritySettings redactionScope + * @property {string|null} [inspectTemplate] SecuritySettings inspectTemplate + * @property {string|null} [deidentifyTemplate] SecuritySettings deidentifyTemplate + * @property {number|null} [retentionWindowDays] SecuritySettings retentionWindowDays + * @property {google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy|null} [retentionStrategy] SecuritySettings retentionStrategy + * @property {Array.|null} [purgeDataTypes] SecuritySettings purgeDataTypes + * @property {google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings|null} [audioExportSettings] SecuritySettings audioExportSettings + * @property {google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings|null} [insightsExportSettings] SecuritySettings insightsExportSettings + */ + + /** + * Constructs a new SecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a SecuritySettings. + * @implements ISecuritySettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ISecuritySettings=} [properties] Properties to set + */ + function SecuritySettings(properties) { + this.purgeDataTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecuritySettings name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.name = ""; + + /** + * SecuritySettings displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.displayName = ""; + + /** + * SecuritySettings redactionStrategy. + * @member {google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy} redactionStrategy + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.redactionStrategy = 0; + + /** + * SecuritySettings redactionScope. + * @member {google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope} redactionScope + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.redactionScope = 0; + + /** + * SecuritySettings inspectTemplate. + * @member {string} inspectTemplate + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.inspectTemplate = ""; + + /** + * SecuritySettings deidentifyTemplate. + * @member {string} deidentifyTemplate + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.deidentifyTemplate = ""; + + /** + * SecuritySettings retentionWindowDays. + * @member {number|null|undefined} retentionWindowDays + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.retentionWindowDays = null; + + /** + * SecuritySettings retentionStrategy. + * @member {google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy|null|undefined} retentionStrategy + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.retentionStrategy = null; + + /** + * SecuritySettings purgeDataTypes. + * @member {Array.} purgeDataTypes + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.purgeDataTypes = $util.emptyArray; + + /** + * SecuritySettings audioExportSettings. + * @member {google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings|null|undefined} audioExportSettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.audioExportSettings = null; + + /** + * SecuritySettings insightsExportSettings. + * @member {google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings|null|undefined} insightsExportSettings + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + SecuritySettings.prototype.insightsExportSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecuritySettings dataRetention. + * @member {"retentionWindowDays"|"retentionStrategy"|undefined} dataRetention + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + */ + Object.defineProperty(SecuritySettings.prototype, "dataRetention", { + get: $util.oneOfGetter($oneOfFields = ["retentionWindowDays", "retentionStrategy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISecuritySettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings} SecuritySettings instance + */ + SecuritySettings.create = function create(properties) { + return new SecuritySettings(properties); + }; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.redactionStrategy != null && Object.hasOwnProperty.call(message, "redactionStrategy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.redactionStrategy); + if (message.redactionScope != null && Object.hasOwnProperty.call(message, "redactionScope")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.redactionScope); + if (message.retentionWindowDays != null && Object.hasOwnProperty.call(message, "retentionWindowDays")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.retentionWindowDays); + if (message.retentionStrategy != null && Object.hasOwnProperty.call(message, "retentionStrategy")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.retentionStrategy); + if (message.purgeDataTypes != null && message.purgeDataTypes.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.purgeDataTypes.length; ++i) + writer.int32(message.purgeDataTypes[i]); + writer.ldelim(); + } + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.inspectTemplate); + if (message.audioExportSettings != null && Object.hasOwnProperty.call(message, "audioExportSettings")) + $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.encode(message.audioExportSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.insightsExportSettings != null && Object.hasOwnProperty.call(message, "insightsExportSettings")) + $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.encode(message.insightsExportSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.deidentifyTemplate); + return writer; + }; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.redactionStrategy = reader.int32(); + break; + } + case 4: { + message.redactionScope = reader.int32(); + break; + } + case 9: { + message.inspectTemplate = reader.string(); + break; + } + case 17: { + message.deidentifyTemplate = reader.string(); + break; + } + case 6: { + message.retentionWindowDays = reader.int32(); + break; + } + case 7: { + message.retentionStrategy = reader.int32(); + break; + } + case 8: { + if (!(message.purgeDataTypes && message.purgeDataTypes.length)) + message.purgeDataTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.purgeDataTypes.push(reader.int32()); + } else + message.purgeDataTypes.push(reader.int32()); + break; + } + case 12: { + message.audioExportSettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecuritySettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecuritySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.redactionStrategy != null && message.hasOwnProperty("redactionStrategy")) + switch (message.redactionStrategy) { + default: + return "redactionStrategy: enum value expected"; + case 0: + case 1: + break; + } + if (message.redactionScope != null && message.hasOwnProperty("redactionScope")) + switch (message.redactionScope) { + default: + return "redactionScope: enum value expected"; + case 0: + case 2: + break; + } + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + if (!$util.isString(message.inspectTemplate)) + return "inspectTemplate: string expected"; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + if (!$util.isString(message.deidentifyTemplate)) + return "deidentifyTemplate: string expected"; + if (message.retentionWindowDays != null && message.hasOwnProperty("retentionWindowDays")) { + properties.dataRetention = 1; + if (!$util.isInteger(message.retentionWindowDays)) + return "retentionWindowDays: integer expected"; + } + if (message.retentionStrategy != null && message.hasOwnProperty("retentionStrategy")) { + if (properties.dataRetention === 1) + return "dataRetention: multiple values"; + properties.dataRetention = 1; + switch (message.retentionStrategy) { + default: + return "retentionStrategy: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.purgeDataTypes != null && message.hasOwnProperty("purgeDataTypes")) { + if (!Array.isArray(message.purgeDataTypes)) + return "purgeDataTypes: array expected"; + for (var i = 0; i < message.purgeDataTypes.length; ++i) + switch (message.purgeDataTypes[i]) { + default: + return "purgeDataTypes: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.audioExportSettings != null && message.hasOwnProperty("audioExportSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.verify(message.audioExportSettings, long + 1); + if (error) + return "audioExportSettings." + error; + } + if (message.insightsExportSettings != null && message.hasOwnProperty("insightsExportSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.verify(message.insightsExportSettings, long + 1); + if (error) + return "insightsExportSettings." + error; + } + return null; + }; + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings} SecuritySettings + */ + SecuritySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SecuritySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SecuritySettings(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.redactionStrategy) { + default: + if (typeof object.redactionStrategy === "number") { + message.redactionStrategy = object.redactionStrategy; + break; + } + break; + case "REDACTION_STRATEGY_UNSPECIFIED": + case 0: + message.redactionStrategy = 0; + break; + case "REDACT_WITH_SERVICE": + case 1: + message.redactionStrategy = 1; + break; + } + switch (object.redactionScope) { + default: + if (typeof object.redactionScope === "number") { + message.redactionScope = object.redactionScope; + break; + } + break; + case "REDACTION_SCOPE_UNSPECIFIED": + case 0: + message.redactionScope = 0; + break; + case "REDACT_DISK_STORAGE": + case 2: + message.redactionScope = 2; + break; + } + if (object.inspectTemplate != null) + message.inspectTemplate = String(object.inspectTemplate); + if (object.deidentifyTemplate != null) + message.deidentifyTemplate = String(object.deidentifyTemplate); + if (object.retentionWindowDays != null) + message.retentionWindowDays = object.retentionWindowDays | 0; + switch (object.retentionStrategy) { + default: + if (typeof object.retentionStrategy === "number") { + message.retentionStrategy = object.retentionStrategy; + break; + } + break; + case "RETENTION_STRATEGY_UNSPECIFIED": + case 0: + message.retentionStrategy = 0; + break; + case "REMOVE_AFTER_CONVERSATION": + case 1: + message.retentionStrategy = 1; + break; + } + if (object.purgeDataTypes) { + if (!Array.isArray(object.purgeDataTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.SecuritySettings.purgeDataTypes: array expected"); + message.purgeDataTypes = []; + for (var i = 0; i < object.purgeDataTypes.length; ++i) + switch (object.purgeDataTypes[i]) { + default: + if (typeof object.purgeDataTypes[i] === "number") { + message.purgeDataTypes[i] = object.purgeDataTypes[i]; + break; + } + case "PURGE_DATA_TYPE_UNSPECIFIED": + case 0: + message.purgeDataTypes[i] = 0; + break; + case "DIALOGFLOW_HISTORY": + case 1: + message.purgeDataTypes[i] = 1; + break; + } + } + if (object.audioExportSettings != null) { + if (typeof object.audioExportSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SecuritySettings.audioExportSettings: object expected"); + message.audioExportSettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.fromObject(object.audioExportSettings, long + 1); + } + if (object.insightsExportSettings != null) { + if (typeof object.insightsExportSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.SecuritySettings.insightsExportSettings: object expected"); + message.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.fromObject(object.insightsExportSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings} message SecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purgeDataTypes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.redactionStrategy = options.enums === String ? "REDACTION_STRATEGY_UNSPECIFIED" : 0; + object.redactionScope = options.enums === String ? "REDACTION_SCOPE_UNSPECIFIED" : 0; + object.inspectTemplate = ""; + object.audioExportSettings = null; + object.insightsExportSettings = null; + object.deidentifyTemplate = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.redactionStrategy != null && message.hasOwnProperty("redactionStrategy")) + object.redactionStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy[message.redactionStrategy] === undefined ? message.redactionStrategy : $root.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy[message.redactionStrategy] : message.redactionStrategy; + if (message.redactionScope != null && message.hasOwnProperty("redactionScope")) + object.redactionScope = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope[message.redactionScope] === undefined ? message.redactionScope : $root.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope[message.redactionScope] : message.redactionScope; + if (message.retentionWindowDays != null && message.hasOwnProperty("retentionWindowDays")) { + object.retentionWindowDays = message.retentionWindowDays; + if (options.oneofs) + object.dataRetention = "retentionWindowDays"; + } + if (message.retentionStrategy != null && message.hasOwnProperty("retentionStrategy")) { + object.retentionStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy[message.retentionStrategy] === undefined ? message.retentionStrategy : $root.google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy[message.retentionStrategy] : message.retentionStrategy; + if (options.oneofs) + object.dataRetention = "retentionStrategy"; + } + if (message.purgeDataTypes && message.purgeDataTypes.length) { + object.purgeDataTypes = []; + for (var j = 0; j < message.purgeDataTypes.length; ++j) + object.purgeDataTypes[j] = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType[message.purgeDataTypes[j]] === undefined ? message.purgeDataTypes[j] : $root.google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType[message.purgeDataTypes[j]] : message.purgeDataTypes[j]; + } + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = message.inspectTemplate; + if (message.audioExportSettings != null && message.hasOwnProperty("audioExportSettings")) + object.audioExportSettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.toObject(message.audioExportSettings, options); + if (message.insightsExportSettings != null && message.hasOwnProperty("insightsExportSettings")) + object.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.toObject(message.insightsExportSettings, options); + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + object.deidentifyTemplate = message.deidentifyTemplate; + return object; + }; + + /** + * Converts this SecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @instance + * @returns {Object.} JSON object + */ + SecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecuritySettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SecuritySettings"; + }; + + /** + * RedactionStrategy enum. + * @name google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy + * @enum {number} + * @property {number} REDACTION_STRATEGY_UNSPECIFIED=0 REDACTION_STRATEGY_UNSPECIFIED value + * @property {number} REDACT_WITH_SERVICE=1 REDACT_WITH_SERVICE value + */ + SecuritySettings.RedactionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDACTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REDACT_WITH_SERVICE"] = 1; + return values; + })(); + + /** + * RedactionScope enum. + * @name google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope + * @enum {number} + * @property {number} REDACTION_SCOPE_UNSPECIFIED=0 REDACTION_SCOPE_UNSPECIFIED value + * @property {number} REDACT_DISK_STORAGE=2 REDACT_DISK_STORAGE value + */ + SecuritySettings.RedactionScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDACTION_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[2] = "REDACT_DISK_STORAGE"] = 2; + return values; + })(); + + /** + * RetentionStrategy enum. + * @name google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy + * @enum {number} + * @property {number} RETENTION_STRATEGY_UNSPECIFIED=0 RETENTION_STRATEGY_UNSPECIFIED value + * @property {number} REMOVE_AFTER_CONVERSATION=1 REMOVE_AFTER_CONVERSATION value + */ + SecuritySettings.RetentionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REMOVE_AFTER_CONVERSATION"] = 1; + return values; + })(); + + /** + * PurgeDataType enum. + * @name google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType + * @enum {number} + * @property {number} PURGE_DATA_TYPE_UNSPECIFIED=0 PURGE_DATA_TYPE_UNSPECIFIED value + * @property {number} DIALOGFLOW_HISTORY=1 DIALOGFLOW_HISTORY value + */ + SecuritySettings.PurgeDataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PURGE_DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIALOGFLOW_HISTORY"] = 1; + return values; + })(); + + SecuritySettings.AudioExportSettings = (function() { + + /** + * Properties of an AudioExportSettings. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @interface IAudioExportSettings + * @property {string|null} [gcsBucket] AudioExportSettings gcsBucket + * @property {string|null} [audioExportPattern] AudioExportSettings audioExportPattern + * @property {boolean|null} [enableAudioRedaction] AudioExportSettings enableAudioRedaction + * @property {google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat|null} [audioFormat] AudioExportSettings audioFormat + * @property {boolean|null} [storeTtsAudio] AudioExportSettings storeTtsAudio + */ + + /** + * Constructs a new AudioExportSettings. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @classdesc Represents an AudioExportSettings. + * @implements IAudioExportSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings=} [properties] Properties to set + */ + function AudioExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioExportSettings gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.gcsBucket = ""; + + /** + * AudioExportSettings audioExportPattern. + * @member {string} audioExportPattern + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.audioExportPattern = ""; + + /** + * AudioExportSettings enableAudioRedaction. + * @member {boolean} enableAudioRedaction + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.enableAudioRedaction = false; + + /** + * AudioExportSettings audioFormat. + * @member {google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat} audioFormat + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.audioFormat = 0; + + /** + * AudioExportSettings storeTtsAudio. + * @member {boolean} storeTtsAudio + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.storeTtsAudio = false; + + /** + * Creates a new AudioExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings} AudioExportSettings instance + */ + AudioExportSettings.create = function create(properties) { + return new AudioExportSettings(properties); + }; + + /** + * Encodes the specified AudioExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings} message AudioExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioExportSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); + if (message.audioExportPattern != null && Object.hasOwnProperty.call(message, "audioExportPattern")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audioExportPattern); + if (message.enableAudioRedaction != null && Object.hasOwnProperty.call(message, "enableAudioRedaction")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableAudioRedaction); + if (message.audioFormat != null && Object.hasOwnProperty.call(message, "audioFormat")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.audioFormat); + if (message.storeTtsAudio != null && Object.hasOwnProperty.call(message, "storeTtsAudio")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.storeTtsAudio); + return writer; + }; + + /** + * Encodes the specified AudioExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IAudioExportSettings} message AudioExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings} AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioExportSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsBucket = reader.string(); + break; + } + case 2: { + message.audioExportPattern = reader.string(); + break; + } + case 3: { + message.enableAudioRedaction = reader.bool(); + break; + } + case 4: { + message.audioFormat = reader.int32(); + break; + } + case 6: { + message.storeTtsAudio = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings} AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioExportSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioExportSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.audioExportPattern != null && message.hasOwnProperty("audioExportPattern")) + if (!$util.isString(message.audioExportPattern)) + return "audioExportPattern: string expected"; + if (message.enableAudioRedaction != null && message.hasOwnProperty("enableAudioRedaction")) + if (typeof message.enableAudioRedaction !== "boolean") + return "enableAudioRedaction: boolean expected"; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) + switch (message.audioFormat) { + default: + return "audioFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.storeTtsAudio != null && message.hasOwnProperty("storeTtsAudio")) + if (typeof message.storeTtsAudio !== "boolean") + return "storeTtsAudio: boolean expected"; + return null; + }; + + /** + * Creates an AudioExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings} AudioExportSettings + */ + AudioExportSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings(); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.audioExportPattern != null) + message.audioExportPattern = String(object.audioExportPattern); + if (object.enableAudioRedaction != null) + message.enableAudioRedaction = Boolean(object.enableAudioRedaction); + switch (object.audioFormat) { + default: + if (typeof object.audioFormat === "number") { + message.audioFormat = object.audioFormat; + break; + } + break; + case "AUDIO_FORMAT_UNSPECIFIED": + case 0: + message.audioFormat = 0; + break; + case "MULAW": + case 1: + message.audioFormat = 1; + break; + case "MP3": + case 2: + message.audioFormat = 2; + break; + case "OGG": + case 3: + message.audioFormat = 3; + break; + } + if (object.storeTtsAudio != null) + message.storeTtsAudio = Boolean(object.storeTtsAudio); + return message; + }; + + /** + * Creates a plain object from an AudioExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings} message AudioExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsBucket = ""; + object.audioExportPattern = ""; + object.enableAudioRedaction = false; + object.audioFormat = options.enums === String ? "AUDIO_FORMAT_UNSPECIFIED" : 0; + object.storeTtsAudio = false; + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.audioExportPattern != null && message.hasOwnProperty("audioExportPattern")) + object.audioExportPattern = message.audioExportPattern; + if (message.enableAudioRedaction != null && message.hasOwnProperty("enableAudioRedaction")) + object.enableAudioRedaction = message.enableAudioRedaction; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) + object.audioFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat[message.audioFormat] === undefined ? message.audioFormat : $root.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat[message.audioFormat] : message.audioFormat; + if (message.storeTtsAudio != null && message.hasOwnProperty("storeTtsAudio")) + object.storeTtsAudio = message.storeTtsAudio; + return object; + }; + + /** + * Converts this AudioExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @instance + * @returns {Object.} JSON object + */ + AudioExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioExportSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings"; + }; + + /** + * AudioFormat enum. + * @name google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat + * @enum {number} + * @property {number} AUDIO_FORMAT_UNSPECIFIED=0 AUDIO_FORMAT_UNSPECIFIED value + * @property {number} MULAW=1 MULAW value + * @property {number} MP3=2 MP3 value + * @property {number} OGG=3 OGG value + */ + AudioExportSettings.AudioFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULAW"] = 1; + values[valuesById[2] = "MP3"] = 2; + values[valuesById[3] = "OGG"] = 3; + return values; + })(); + + return AudioExportSettings; + })(); + + SecuritySettings.InsightsExportSettings = (function() { + + /** + * Properties of an InsightsExportSettings. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @interface IInsightsExportSettings + * @property {boolean|null} [enableInsightsExport] InsightsExportSettings enableInsightsExport + */ + + /** + * Constructs a new InsightsExportSettings. + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings + * @classdesc Represents an InsightsExportSettings. + * @implements IInsightsExportSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings=} [properties] Properties to set + */ + function InsightsExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsightsExportSettings enableInsightsExport. + * @member {boolean} enableInsightsExport + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @instance + */ + InsightsExportSettings.prototype.enableInsightsExport = false; + + /** + * Creates a new InsightsExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings} InsightsExportSettings instance + */ + InsightsExportSettings.create = function create(properties) { + return new InsightsExportSettings(properties); + }; + + /** + * Encodes the specified InsightsExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings} message InsightsExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightsExportSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableInsightsExport != null && Object.hasOwnProperty.call(message, "enableInsightsExport")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableInsightsExport); + return writer; + }; + + /** + * Encodes the specified InsightsExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.IInsightsExportSettings} message InsightsExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightsExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings} InsightsExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightsExportSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableInsightsExport = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings} InsightsExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightsExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsightsExportSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsightsExportSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableInsightsExport != null && message.hasOwnProperty("enableInsightsExport")) + if (typeof message.enableInsightsExport !== "boolean") + return "enableInsightsExport: boolean expected"; + return null; + }; + + /** + * Creates an InsightsExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings} InsightsExportSettings + */ + InsightsExportSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings(); + if (object.enableInsightsExport != null) + message.enableInsightsExport = Boolean(object.enableInsightsExport); + return message; + }; + + /** + * Creates a plain object from an InsightsExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings} message InsightsExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsightsExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableInsightsExport = false; + if (message.enableInsightsExport != null && message.hasOwnProperty("enableInsightsExport")) + object.enableInsightsExport = message.enableInsightsExport; + return object; + }; + + /** + * Converts this InsightsExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @instance + * @returns {Object.} JSON object + */ + InsightsExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsightsExportSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsightsExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings"; + }; + + return InsightsExportSettings; + })(); + + return SecuritySettings; + })(); + + v3.Tools = (function() { + + /** + * Constructs a new Tools service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Tools + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Tools(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Tools.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Tools; + + /** + * Creates new Tools service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Tools} RPC service. Useful where requests and/or responses are streamed. + */ + Tools.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|createTool}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef CreateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Tool} [response] Tool + */ + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateToolRequest} request CreateToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.CreateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.createTool = function createTool(request, callback) { + return this.rpcCall(createTool, $root.google.cloud.dialogflow.cx.v3.CreateToolRequest, $root.google.cloud.dialogflow.cx.v3.Tool, request, callback); + }, "name", { value: "CreateTool" }); + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateToolRequest} request CreateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|listTools}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef ListToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListToolsResponse} [response] ListToolsResponse + */ + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListToolsRequest} request ListToolsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.ListToolsCallback} callback Node-style callback called with the error, if any, and ListToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.listTools = function listTools(request, callback) { + return this.rpcCall(listTools, $root.google.cloud.dialogflow.cx.v3.ListToolsRequest, $root.google.cloud.dialogflow.cx.v3.ListToolsResponse, request, callback); + }, "name", { value: "ListTools" }); + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListToolsRequest} request ListToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|getTool}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef GetToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Tool} [response] Tool + */ + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetToolRequest} request GetToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.GetToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.getTool = function getTool(request, callback) { + return this.rpcCall(getTool, $root.google.cloud.dialogflow.cx.v3.GetToolRequest, $root.google.cloud.dialogflow.cx.v3.Tool, request, callback); + }, "name", { value: "GetTool" }); + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetToolRequest} request GetToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|updateTool}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef UpdateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Tool} [response] Tool + */ + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.UpdateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.updateTool = function updateTool(request, callback) { + return this.rpcCall(updateTool, $root.google.cloud.dialogflow.cx.v3.UpdateToolRequest, $root.google.cloud.dialogflow.cx.v3.Tool, request, callback); + }, "name", { value: "UpdateTool" }); + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|deleteTool}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef DeleteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.DeleteToolCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.deleteTool = function deleteTool(request, callback) { + return this.rpcCall(deleteTool, $root.google.cloud.dialogflow.cx.v3.DeleteToolRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTool" }); + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|listToolVersions}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef ListToolVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListToolVersionsResponse} [response] ListToolVersionsResponse + */ + + /** + * Calls ListToolVersions. + * @function listToolVersions + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsRequest} request ListToolVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.ListToolVersionsCallback} callback Node-style callback called with the error, if any, and ListToolVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.listToolVersions = function listToolVersions(request, callback) { + return this.rpcCall(listToolVersions, $root.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest, $root.google.cloud.dialogflow.cx.v3.ListToolVersionsResponse, request, callback); + }, "name", { value: "ListToolVersions" }); + + /** + * Calls ListToolVersions. + * @function listToolVersions + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsRequest} request ListToolVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|createToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef CreateToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ToolVersion} [response] ToolVersion + */ + + /** + * Calls CreateToolVersion. + * @function createToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest} request CreateToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.CreateToolVersionCallback} callback Node-style callback called with the error, if any, and ToolVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.createToolVersion = function createToolVersion(request, callback) { + return this.rpcCall(createToolVersion, $root.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest, $root.google.cloud.dialogflow.cx.v3.ToolVersion, request, callback); + }, "name", { value: "CreateToolVersion" }); + + /** + * Calls CreateToolVersion. + * @function createToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest} request CreateToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|getToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef GetToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ToolVersion} [response] ToolVersion + */ + + /** + * Calls GetToolVersion. + * @function getToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetToolVersionRequest} request GetToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.GetToolVersionCallback} callback Node-style callback called with the error, if any, and ToolVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.getToolVersion = function getToolVersion(request, callback) { + return this.rpcCall(getToolVersion, $root.google.cloud.dialogflow.cx.v3.GetToolVersionRequest, $root.google.cloud.dialogflow.cx.v3.ToolVersion, request, callback); + }, "name", { value: "GetToolVersion" }); + + /** + * Calls GetToolVersion. + * @function getToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetToolVersionRequest} request GetToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|deleteToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef DeleteToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteToolVersion. + * @function deleteToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest} request DeleteToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.DeleteToolVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.deleteToolVersion = function deleteToolVersion(request, callback) { + return this.rpcCall(deleteToolVersion, $root.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteToolVersion" }); + + /** + * Calls DeleteToolVersion. + * @function deleteToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest} request DeleteToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Tools|restoreToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @typedef RestoreToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse} [response] RestoreToolVersionResponse + */ + + /** + * Calls RestoreToolVersion. + * @function restoreToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest} request RestoreToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Tools.RestoreToolVersionCallback} callback Node-style callback called with the error, if any, and RestoreToolVersionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.restoreToolVersion = function restoreToolVersion(request, callback) { + return this.rpcCall(restoreToolVersion, $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest, $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse, request, callback); + }, "name", { value: "RestoreToolVersion" }); + + /** + * Calls RestoreToolVersion. + * @function restoreToolVersion + * @memberof google.cloud.dialogflow.cx.v3.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest} request RestoreToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Tools; + })(); + + v3.CreateToolRequest = (function() { + + /** + * Properties of a CreateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateToolRequest + * @property {string|null} [parent] CreateToolRequest parent + * @property {google.cloud.dialogflow.cx.v3.ITool|null} [tool] CreateToolRequest tool + */ + + /** + * Constructs a new CreateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateToolRequest. + * @implements ICreateToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateToolRequest=} [properties] Properties to set + */ + function CreateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.parent = ""; + + /** + * CreateToolRequest tool. + * @member {google.cloud.dialogflow.cx.v3.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.tool = null; + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateToolRequest} CreateToolRequest instance + */ + CreateToolRequest.create = function create(properties) { + return new CreateToolRequest(properties); + }; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.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.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3.Tool.encode(message.tool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + return null; + }; + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateToolRequest} CreateToolRequest + */ + CreateToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateToolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.fromObject(object.tool, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateToolRequest} message CreateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tool = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3.Tool.toObject(message.tool, options); + return object; + }; + + /** + * Converts this CreateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateToolRequest"; + }; + + return CreateToolRequest; + })(); + + v3.ListToolsRequest = (function() { + + /** + * Properties of a ListToolsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListToolsRequest + * @property {string|null} [parent] ListToolsRequest parent + * @property {number|null} [pageSize] ListToolsRequest pageSize + * @property {string|null} [pageToken] ListToolsRequest pageToken + */ + + /** + * Constructs a new ListToolsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListToolsRequest. + * @implements IListToolsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListToolsRequest=} [properties] Properties to set + */ + function ListToolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.parent = ""; + + /** + * ListToolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageSize = 0; + + /** + * ListToolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListToolsRequest} ListToolsRequest instance + */ + ListToolsRequest.create = function create(properties) { + return new ListToolsRequest(properties); + }; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListToolsRequest} ListToolsRequest + */ + ListToolsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListToolsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListToolsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListToolsRequest} message ListToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListToolsRequest"; + }; + + return ListToolsRequest; + })(); + + v3.ListToolsResponse = (function() { + + /** + * Properties of a ListToolsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListToolsResponse + * @property {Array.|null} [tools] ListToolsResponse tools + * @property {string|null} [nextPageToken] ListToolsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListToolsResponse. + * @implements IListToolsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListToolsResponse=} [properties] Properties to set + */ + function ListToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.tools = $util.emptyArray; + + /** + * ListToolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListToolsResponse} ListToolsResponse instance + */ + ListToolsResponse.create = function create(properties) { + return new ListToolsResponse(properties); + }; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Tool.encode(message.tools[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 ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.dialogflow.cx.v3.Tool.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.verify(message.tools[i], long + 1); + if (error) + return "tools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListToolsResponse} ListToolsResponse + */ + ListToolsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListToolsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.dialogflow.cx.v3.Tool.fromObject(object.tools[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListToolsResponse} message ListToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.dialogflow.cx.v3.Tool.toObject(message.tools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListToolsResponse"; + }; + + return ListToolsResponse; + })(); + + v3.GetToolRequest = (function() { + + /** + * Properties of a GetToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetToolRequest + * @property {string|null} [name] GetToolRequest name + */ + + /** + * Constructs a new GetToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetToolRequest. + * @implements IGetToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetToolRequest=} [properties] Properties to set + */ + function GetToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @instance + */ + GetToolRequest.prototype.name = ""; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetToolRequest} GetToolRequest instance + */ + GetToolRequest.create = function create(properties) { + return new GetToolRequest(properties); + }; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.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 GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetToolRequest} GetToolRequest + */ + GetToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetToolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetToolRequest} message GetToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolRequest.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 GetToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetToolRequest"; + }; + + return GetToolRequest; + })(); + + v3.UpdateToolRequest = (function() { + + /** + * Properties of an UpdateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateToolRequest + * @property {google.cloud.dialogflow.cx.v3.ITool|null} [tool] UpdateToolRequest tool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolRequest updateMask + */ + + /** + * Constructs a new UpdateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateToolRequest. + * @implements IUpdateToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateToolRequest=} [properties] Properties to set + */ + function UpdateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolRequest tool. + * @member {google.cloud.dialogflow.cx.v3.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.tool = null; + + /** + * UpdateToolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateToolRequest} UpdateToolRequest instance + */ + UpdateToolRequest.create = function create(properties) { + return new UpdateToolRequest(properties); + }; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3.Tool.encode(message.tool, 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 UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateToolRequest} UpdateToolRequest + */ + UpdateToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateToolRequest(); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.fromObject(object.tool, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateToolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateToolRequest} message UpdateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = null; + object.updateMask = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3.Tool.toObject(message.tool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateToolRequest"; + }; + + return UpdateToolRequest; + })(); + + v3.DeleteToolRequest = (function() { + + /** + * Properties of a DeleteToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteToolRequest + * @property {string|null} [name] DeleteToolRequest name + * @property {boolean|null} [force] DeleteToolRequest force + */ + + /** + * Constructs a new DeleteToolRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteToolRequest. + * @implements IDeleteToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolRequest=} [properties] Properties to set + */ + function DeleteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.name = ""; + + /** + * DeleteToolRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.force = false; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolRequest} DeleteToolRequest instance + */ + DeleteToolRequest.create = function create(properties) { + return new DeleteToolRequest(properties); + }; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolRequest} DeleteToolRequest + */ + DeleteToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteToolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteToolRequest} message DeleteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteToolRequest"; + }; + + return DeleteToolRequest; + })(); + + v3.Tool = (function() { + + /** + * Properties of a Tool. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ITool + * @property {string|null} [name] Tool name + * @property {string|null} [displayName] Tool displayName + * @property {string|null} [description] Tool description + * @property {google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool|null} [openApiSpec] Tool openApiSpec + * @property {google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool|null} [dataStoreSpec] Tool dataStoreSpec + * @property {google.cloud.dialogflow.cx.v3.Tool.IFunctionTool|null} [functionSpec] Tool functionSpec + * @property {google.cloud.dialogflow.cx.v3.Tool.ToolType|null} [toolType] Tool toolType + */ + + /** + * Constructs a new Tool. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Tool. + * @implements ITool + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ITool=} [properties] Properties to set + */ + function Tool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tool name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Tool.prototype.name = ""; + + /** + * Tool displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Tool.prototype.displayName = ""; + + /** + * Tool description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Tool.prototype.description = ""; + + /** + * Tool openApiSpec. + * @member {google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool|null|undefined} openApiSpec + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Tool.prototype.openApiSpec = null; + + /** + * Tool dataStoreSpec. + * @member {google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool|null|undefined} dataStoreSpec + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Tool.prototype.dataStoreSpec = null; + + /** + * Tool functionSpec. + * @member {google.cloud.dialogflow.cx.v3.Tool.IFunctionTool|null|undefined} functionSpec + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Tool.prototype.functionSpec = null; + + /** + * Tool toolType. + * @member {google.cloud.dialogflow.cx.v3.Tool.ToolType} toolType + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Tool.prototype.toolType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Tool specification. + * @member {"openApiSpec"|"dataStoreSpec"|"functionSpec"|undefined} specification + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + */ + Object.defineProperty(Tool.prototype, "specification", { + get: $util.oneOfGetter($oneOfFields = ["openApiSpec", "dataStoreSpec", "functionSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Tool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3.ITool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool} Tool instance + */ + Tool.create = function create(properties) { + return new Tool(properties); + }; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.openApiSpec != null && Object.hasOwnProperty.call(message, "openApiSpec")) + $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.encode(message.openApiSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dataStoreSpec != null && Object.hasOwnProperty.call(message, "dataStoreSpec")) + $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.encode(message.dataStoreSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.toolType != null && Object.hasOwnProperty.call(message, "toolType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.toolType); + if (message.functionSpec != null && Object.hasOwnProperty.call(message, "functionSpec")) + $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool.encode(message.functionSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.openApiSpec = $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.dataStoreSpec = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.functionSpec = $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.toolType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.openApiSpec != null && message.hasOwnProperty("openApiSpec")) { + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.verify(message.openApiSpec, long + 1); + if (error) + return "openApiSpec." + error; + } + } + if (message.dataStoreSpec != null && message.hasOwnProperty("dataStoreSpec")) { + if (properties.specification === 1) + return "specification: multiple values"; + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.verify(message.dataStoreSpec, long + 1); + if (error) + return "dataStoreSpec." + error; + } + } + if (message.functionSpec != null && message.hasOwnProperty("functionSpec")) { + if (properties.specification === 1) + return "specification: multiple values"; + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool.verify(message.functionSpec, long + 1); + if (error) + return "functionSpec." + error; + } + } + if (message.toolType != null && message.hasOwnProperty("toolType")) + switch (message.toolType) { + default: + return "toolType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool} Tool + */ + Tool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.openApiSpec != null) { + if (typeof object.openApiSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.openApiSpec: object expected"); + message.openApiSpec = $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.fromObject(object.openApiSpec, long + 1); + } + if (object.dataStoreSpec != null) { + if (typeof object.dataStoreSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.dataStoreSpec: object expected"); + message.dataStoreSpec = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.fromObject(object.dataStoreSpec, long + 1); + } + if (object.functionSpec != null) { + if (typeof object.functionSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.functionSpec: object expected"); + message.functionSpec = $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool.fromObject(object.functionSpec, long + 1); + } + switch (object.toolType) { + default: + if (typeof object.toolType === "number") { + message.toolType = object.toolType; + break; + } + break; + case "TOOL_TYPE_UNSPECIFIED": + case 0: + message.toolType = 0; + break; + case "CUSTOMIZED_TOOL": + case 1: + message.toolType = 1; + break; + case "BUILTIN_TOOL": + case 2: + message.toolType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool} message Tool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.toolType = options.enums === String ? "TOOL_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.openApiSpec != null && message.hasOwnProperty("openApiSpec")) { + object.openApiSpec = $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.toObject(message.openApiSpec, options); + if (options.oneofs) + object.specification = "openApiSpec"; + } + if (message.dataStoreSpec != null && message.hasOwnProperty("dataStoreSpec")) { + object.dataStoreSpec = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.toObject(message.dataStoreSpec, options); + if (options.oneofs) + object.specification = "dataStoreSpec"; + } + if (message.toolType != null && message.hasOwnProperty("toolType")) + object.toolType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Tool.ToolType[message.toolType] === undefined ? message.toolType : $root.google.cloud.dialogflow.cx.v3.Tool.ToolType[message.toolType] : message.toolType; + if (message.functionSpec != null && message.hasOwnProperty("functionSpec")) { + object.functionSpec = $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool.toObject(message.functionSpec, options); + if (options.oneofs) + object.specification = "functionSpec"; + } + return object; + }; + + /** + * Converts this Tool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @instance + * @returns {Object.} JSON object + */ + Tool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool"; + }; + + Tool.OpenApiTool = (function() { + + /** + * Properties of an OpenApiTool. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @interface IOpenApiTool + * @property {string|null} [textSchema] OpenApiTool textSchema + * @property {google.cloud.dialogflow.cx.v3.Tool.IAuthentication|null} [authentication] OpenApiTool authentication + * @property {google.cloud.dialogflow.cx.v3.Tool.ITLSConfig|null} [tlsConfig] OpenApiTool tlsConfig + * @property {google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiTool serviceDirectoryConfig + */ + + /** + * Constructs a new OpenApiTool. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @classdesc Represents an OpenApiTool. + * @implements IOpenApiTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool=} [properties] Properties to set + */ + function OpenApiTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiTool textSchema. + * @member {string|null|undefined} textSchema + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.textSchema = null; + + /** + * OpenApiTool authentication. + * @member {google.cloud.dialogflow.cx.v3.Tool.IAuthentication|null|undefined} authentication + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.authentication = null; + + /** + * OpenApiTool tlsConfig. + * @member {google.cloud.dialogflow.cx.v3.Tool.ITLSConfig|null|undefined} tlsConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.tlsConfig = null; + + /** + * OpenApiTool serviceDirectoryConfig. + * @member {google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.serviceDirectoryConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OpenApiTool schema. + * @member {"textSchema"|undefined} schema + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @instance + */ + Object.defineProperty(OpenApiTool.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["textSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.OpenApiTool} OpenApiTool instance + */ + OpenApiTool.create = function create(properties) { + return new OpenApiTool(properties); + }; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSchema != null && Object.hasOwnProperty.call(message, "textSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textSchema); + if (message.authentication != null && Object.hasOwnProperty.call(message, "authentication")) + $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.encode(message.authentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.encode(message.tlsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textSchema = reader.string(); + break; + } + case 2: { + message.authentication = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.tlsConfig = $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.serviceDirectoryConfig = $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.textSchema != null && message.hasOwnProperty("textSchema")) { + properties.schema = 1; + if (!$util.isString(message.textSchema)) + return "textSchema: string expected"; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.verify(message.authentication, long + 1); + if (error) + return "authentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.verify(message.tlsConfig, long + 1); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig, long + 1); + if (error) + return "serviceDirectoryConfig." + error; + } + return null; + }; + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.OpenApiTool} OpenApiTool + */ + OpenApiTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool(); + if (object.textSchema != null) + message.textSchema = String(object.textSchema); + if (object.authentication != null) { + if (typeof object.authentication !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.authentication: object expected"); + message.authentication = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.fromObject(object.authentication, long + 1); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.fromObject(object.tlsConfig, long + 1); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.OpenApiTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.OpenApiTool} message OpenApiTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.authentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + } + if (message.textSchema != null && message.hasOwnProperty("textSchema")) { + object.textSchema = message.textSchema; + if (options.oneofs) + object.schema = "textSchema"; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) + object.authentication = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.toObject(message.authentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + return object; + }; + + /** + * Converts this OpenApiTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @instance + * @returns {Object.} JSON object + */ + OpenApiTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.OpenApiTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.OpenApiTool"; + }; + + return OpenApiTool; + })(); + + Tool.DataStoreTool = (function() { + + /** + * Properties of a DataStoreTool. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @interface IDataStoreTool + * @property {Array.|null} [dataStoreConnections] DataStoreTool dataStoreConnections + * @property {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt|null} [fallbackPrompt] DataStoreTool fallbackPrompt + */ + + /** + * Constructs a new DataStoreTool. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @classdesc Represents a DataStoreTool. + * @implements IDataStoreTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool=} [properties] Properties to set + */ + function DataStoreTool(properties) { + this.dataStoreConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreTool dataStoreConnections. + * @member {Array.} dataStoreConnections + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @instance + */ + DataStoreTool.prototype.dataStoreConnections = $util.emptyArray; + + /** + * DataStoreTool fallbackPrompt. + * @member {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt|null|undefined} fallbackPrompt + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @instance + */ + DataStoreTool.prototype.fallbackPrompt = null; + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool} DataStoreTool instance + */ + DataStoreTool.create = function create(properties) { + return new DataStoreTool(properties); + }; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStoreConnections != null && message.dataStoreConnections.length) + for (var i = 0; i < message.dataStoreConnections.length; ++i) + $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.encode(message.dataStoreConnections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fallbackPrompt != null && Object.hasOwnProperty.call(message, "fallbackPrompt")) + $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.encode(message.fallbackPrompt, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStoreConnections && message.dataStoreConnections.length)) + message.dataStoreConnections = []; + message.dataStoreConnections.push($root.google.cloud.dialogflow.cx.v3.DataStoreConnection.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.fallbackPrompt = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStoreConnections != null && message.hasOwnProperty("dataStoreConnections")) { + if (!Array.isArray(message.dataStoreConnections)) + return "dataStoreConnections: array expected"; + for (var i = 0; i < message.dataStoreConnections.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.verify(message.dataStoreConnections[i], long + 1); + if (error) + return "dataStoreConnections." + error; + } + } + if (message.fallbackPrompt != null && message.hasOwnProperty("fallbackPrompt")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.verify(message.fallbackPrompt, long + 1); + if (error) + return "fallbackPrompt." + error; + } + return null; + }; + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool} DataStoreTool + */ + DataStoreTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool(); + if (object.dataStoreConnections) { + if (!Array.isArray(object.dataStoreConnections)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.dataStoreConnections: array expected"); + message.dataStoreConnections = []; + for (var i = 0; i < object.dataStoreConnections.length; ++i) { + if (typeof object.dataStoreConnections[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.dataStoreConnections: object expected"); + message.dataStoreConnections[i] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.fromObject(object.dataStoreConnections[i], long + 1); + } + } + if (object.fallbackPrompt != null) { + if (typeof object.fallbackPrompt !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.fallbackPrompt: object expected"); + message.fallbackPrompt = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.fromObject(object.fallbackPrompt, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool} message DataStoreTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStoreConnections = []; + if (options.defaults) + object.fallbackPrompt = null; + if (message.dataStoreConnections && message.dataStoreConnections.length) { + object.dataStoreConnections = []; + for (var j = 0; j < message.dataStoreConnections.length; ++j) + object.dataStoreConnections[j] = $root.google.cloud.dialogflow.cx.v3.DataStoreConnection.toObject(message.dataStoreConnections[j], options); + } + if (message.fallbackPrompt != null && message.hasOwnProperty("fallbackPrompt")) + object.fallbackPrompt = $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.toObject(message.fallbackPrompt, options); + return object; + }; + + /** + * Converts this DataStoreTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @instance + * @returns {Object.} JSON object + */ + DataStoreTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.DataStoreTool"; + }; + + DataStoreTool.FallbackPrompt = (function() { + + /** + * Properties of a FallbackPrompt. + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @interface IFallbackPrompt + */ + + /** + * Constructs a new FallbackPrompt. + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool + * @classdesc Represents a FallbackPrompt. + * @implements IFallbackPrompt + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt=} [properties] Properties to set + */ + function FallbackPrompt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new FallbackPrompt instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt instance + */ + FallbackPrompt.create = function create(properties) { + return new FallbackPrompt(properties); + }; + + /** + * Encodes the specified FallbackPrompt message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt} message FallbackPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackPrompt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified FallbackPrompt message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.IFallbackPrompt} message FallbackPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackPrompt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackPrompt.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackPrompt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FallbackPrompt message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FallbackPrompt.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a FallbackPrompt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt + */ + FallbackPrompt.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt(); + }; + + /** + * Creates a plain object from a FallbackPrompt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt} message FallbackPrompt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FallbackPrompt.toObject = function toObject() { + return {}; + }; + + /** + * Converts this FallbackPrompt to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @instance + * @returns {Object.} JSON object + */ + FallbackPrompt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FallbackPrompt + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FallbackPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt"; + }; + + return FallbackPrompt; + })(); + + return DataStoreTool; + })(); + + Tool.FunctionTool = (function() { + + /** + * Properties of a FunctionTool. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @interface IFunctionTool + * @property {google.protobuf.IStruct|null} [inputSchema] FunctionTool inputSchema + * @property {google.protobuf.IStruct|null} [outputSchema] FunctionTool outputSchema + */ + + /** + * Constructs a new FunctionTool. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @classdesc Represents a FunctionTool. + * @implements IFunctionTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.IFunctionTool=} [properties] Properties to set + */ + function FunctionTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionTool inputSchema. + * @member {google.protobuf.IStruct|null|undefined} inputSchema + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @instance + */ + FunctionTool.prototype.inputSchema = null; + + /** + * FunctionTool outputSchema. + * @member {google.protobuf.IStruct|null|undefined} outputSchema + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @instance + */ + FunctionTool.prototype.outputSchema = null; + + /** + * Creates a new FunctionTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IFunctionTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.FunctionTool} FunctionTool instance + */ + FunctionTool.create = function create(properties) { + return new FunctionTool(properties); + }; + + /** + * Encodes the specified FunctionTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.FunctionTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IFunctionTool} message FunctionTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.protobuf.Struct.encode(message.inputSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.protobuf.Struct.encode(message.outputSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunctionTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.FunctionTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IFunctionTool} message FunctionTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.FunctionTool} FunctionTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputSchema = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.outputSchema = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.FunctionTool} FunctionTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.protobuf.Struct.verify(message.inputSchema, long + 1); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.protobuf.Struct.verify(message.outputSchema, long + 1); + if (error) + return "outputSchema." + error; + } + return null; + }; + + /** + * Creates a FunctionTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.FunctionTool} FunctionTool + */ + FunctionTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.FunctionTool(); + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.FunctionTool.inputSchema: object expected"); + message.inputSchema = $root.google.protobuf.Struct.fromObject(object.inputSchema, long + 1); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.FunctionTool.outputSchema: object expected"); + message.outputSchema = $root.google.protobuf.Struct.fromObject(object.outputSchema, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FunctionTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.FunctionTool} message FunctionTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputSchema = null; + object.outputSchema = null; + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.protobuf.Struct.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.protobuf.Struct.toObject(message.outputSchema, options); + return object; + }; + + /** + * Converts this FunctionTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @instance + * @returns {Object.} JSON object + */ + FunctionTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.FunctionTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.FunctionTool"; + }; + + return FunctionTool; + })(); + + Tool.Authentication = (function() { + + /** + * Properties of an Authentication. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @interface IAuthentication + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig|null} [apiKeyConfig] Authentication apiKeyConfig + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig|null} [oauthConfig] Authentication oauthConfig + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig|null} [serviceAgentAuthConfig] Authentication serviceAgentAuthConfig + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig|null} [bearerTokenConfig] Authentication bearerTokenConfig + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] Authentication serviceAccountAuthConfig + */ + + /** + * Constructs a new Authentication. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @classdesc Represents an Authentication. + * @implements IAuthentication + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.IAuthentication=} [properties] Properties to set + */ + function Authentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Authentication apiKeyConfig. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @instance + */ + Authentication.prototype.apiKeyConfig = null; + + /** + * Authentication oauthConfig. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig|null|undefined} oauthConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @instance + */ + Authentication.prototype.oauthConfig = null; + + /** + * Authentication serviceAgentAuthConfig. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig|null|undefined} serviceAgentAuthConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @instance + */ + Authentication.prototype.serviceAgentAuthConfig = null; + + /** + * Authentication bearerTokenConfig. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig|null|undefined} bearerTokenConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @instance + */ + Authentication.prototype.bearerTokenConfig = null; + + /** + * Authentication serviceAccountAuthConfig. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @instance + */ + Authentication.prototype.serviceAccountAuthConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Authentication authConfig. + * @member {"apiKeyConfig"|"oauthConfig"|"serviceAgentAuthConfig"|"bearerTokenConfig"|"serviceAccountAuthConfig"|undefined} authConfig + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @instance + */ + Object.defineProperty(Authentication.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig", "oauthConfig", "serviceAgentAuthConfig", "bearerTokenConfig", "serviceAccountAuthConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Authentication instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IAuthentication=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication} Authentication instance + */ + Authentication.create = function create(properties) { + return new Authentication(properties); + }; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) + $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceAgentAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAgentAuthConfig")) + $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.encode(message.serviceAgentAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bearerTokenConfig != null && Object.hasOwnProperty.call(message, "bearerTokenConfig")) + $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.encode(message.bearerTokenConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) + $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.apiKeyConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.serviceAgentAuthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.bearerTokenConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Authentication message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Authentication.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.verify(message.apiKeyConfig, long + 1); + if (error) + return "apiKeyConfig." + error; + } + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.verify(message.oauthConfig, long + 1); + if (error) + return "oauthConfig." + error; + } + } + if (message.serviceAgentAuthConfig != null && message.hasOwnProperty("serviceAgentAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.verify(message.serviceAgentAuthConfig, long + 1); + if (error) + return "serviceAgentAuthConfig." + error; + } + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.verify(message.bearerTokenConfig, long + 1); + if (error) + return "bearerTokenConfig." + error; + } + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig, long + 1); + if (error) + return "serviceAccountAuthConfig." + error; + } + } + return null; + }; + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication} Authentication + */ + Authentication.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.Authentication) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication(); + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.Authentication.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.fromObject(object.apiKeyConfig, long + 1); + } + if (object.oauthConfig != null) { + if (typeof object.oauthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.Authentication.oauthConfig: object expected"); + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.fromObject(object.oauthConfig, long + 1); + } + if (object.serviceAgentAuthConfig != null) { + if (typeof object.serviceAgentAuthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.Authentication.serviceAgentAuthConfig: object expected"); + message.serviceAgentAuthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.fromObject(object.serviceAgentAuthConfig, long + 1); + } + if (object.bearerTokenConfig != null) { + if (typeof object.bearerTokenConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.Authentication.bearerTokenConfig: object expected"); + message.bearerTokenConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.fromObject(object.bearerTokenConfig, long + 1); + } + if (object.serviceAccountAuthConfig != null) { + if (typeof object.serviceAccountAuthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.Authentication.serviceAccountAuthConfig: object expected"); + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication} message Authentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Authentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + object.apiKeyConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.toObject(message.apiKeyConfig, options); + if (options.oneofs) + object.authConfig = "apiKeyConfig"; + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + object.oauthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.toObject(message.oauthConfig, options); + if (options.oneofs) + object.authConfig = "oauthConfig"; + } + if (message.serviceAgentAuthConfig != null && message.hasOwnProperty("serviceAgentAuthConfig")) { + object.serviceAgentAuthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.toObject(message.serviceAgentAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAgentAuthConfig"; + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + object.bearerTokenConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.toObject(message.bearerTokenConfig, options); + if (options.oneofs) + object.authConfig = "bearerTokenConfig"; + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + object.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAccountAuthConfig"; + } + return object; + }; + + /** + * Converts this Authentication to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @instance + * @returns {Object.} JSON object + */ + Authentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Authentication + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Authentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.Authentication"; + }; + + Authentication.ApiKeyConfig = (function() { + + /** + * Properties of an ApiKeyConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @interface IApiKeyConfig + * @property {string|null} [keyName] ApiKeyConfig keyName + * @property {string|null} [apiKey] ApiKeyConfig apiKey + * @property {string|null} [secretVersionForApiKey] ApiKeyConfig secretVersionForApiKey + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation|null} [requestLocation] ApiKeyConfig requestLocation + */ + + /** + * Constructs a new ApiKeyConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @classdesc Represents an ApiKeyConfig. + * @implements IApiKeyConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig=} [properties] Properties to set + */ + function ApiKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiKeyConfig keyName. + * @member {string} keyName + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.keyName = ""; + + /** + * ApiKeyConfig apiKey. + * @member {string} apiKey + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.apiKey = ""; + + /** + * ApiKeyConfig secretVersionForApiKey. + * @member {string} secretVersionForApiKey + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.secretVersionForApiKey = ""; + + /** + * ApiKeyConfig requestLocation. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation} requestLocation + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.requestLocation = 0; + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig} ApiKeyConfig instance + */ + ApiKeyConfig.create = function create(properties) { + return new ApiKeyConfig(properties); + }; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.apiKey != null && Object.hasOwnProperty.call(message, "apiKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiKey); + if (message.requestLocation != null && Object.hasOwnProperty.call(message, "requestLocation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestLocation); + if (message.secretVersionForApiKey != null && Object.hasOwnProperty.call(message, "secretVersionForApiKey")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.secretVersionForApiKey); + return writer; + }; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.apiKey = reader.string(); + break; + } + case 4: { + message.secretVersionForApiKey = reader.string(); + break; + } + case 3: { + message.requestLocation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiKeyConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiKeyConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.apiKey != null && message.hasOwnProperty("apiKey")) + if (!$util.isString(message.apiKey)) + return "apiKey: string expected"; + if (message.secretVersionForApiKey != null && message.hasOwnProperty("secretVersionForApiKey")) + if (!$util.isString(message.secretVersionForApiKey)) + return "secretVersionForApiKey: string expected"; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + switch (message.requestLocation) { + default: + return "requestLocation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig} ApiKeyConfig + */ + ApiKeyConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.apiKey != null) + message.apiKey = String(object.apiKey); + if (object.secretVersionForApiKey != null) + message.secretVersionForApiKey = String(object.secretVersionForApiKey); + switch (object.requestLocation) { + default: + if (typeof object.requestLocation === "number") { + message.requestLocation = object.requestLocation; + break; + } + break; + case "REQUEST_LOCATION_UNSPECIFIED": + case 0: + message.requestLocation = 0; + break; + case "HEADER": + case 1: + message.requestLocation = 1; + break; + case "QUERY_STRING": + case 2: + message.requestLocation = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig} message ApiKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.apiKey = ""; + object.requestLocation = options.enums === String ? "REQUEST_LOCATION_UNSPECIFIED" : 0; + object.secretVersionForApiKey = ""; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.apiKey != null && message.hasOwnProperty("apiKey")) + object.apiKey = message.apiKey; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + object.requestLocation = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation[message.requestLocation] === undefined ? message.requestLocation : $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation[message.requestLocation] : message.requestLocation; + if (message.secretVersionForApiKey != null && message.hasOwnProperty("secretVersionForApiKey")) + object.secretVersionForApiKey = message.secretVersionForApiKey; + return object; + }; + + /** + * Converts this ApiKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @instance + * @returns {Object.} JSON object + */ + ApiKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiKeyConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig"; + }; + + return ApiKeyConfig; + })(); + + /** + * RequestLocation enum. + * @name google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation + * @enum {number} + * @property {number} REQUEST_LOCATION_UNSPECIFIED=0 REQUEST_LOCATION_UNSPECIFIED value + * @property {number} HEADER=1 HEADER value + * @property {number} QUERY_STRING=2 QUERY_STRING value + */ + Authentication.RequestLocation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_LOCATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HEADER"] = 1; + values[valuesById[2] = "QUERY_STRING"] = 2; + return values; + })(); + + Authentication.OAuthConfig = (function() { + + /** + * Properties of a OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @interface IOAuthConfig + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType|null} [oauthGrantType] OAuthConfig oauthGrantType + * @property {string|null} [clientId] OAuthConfig clientId + * @property {string|null} [clientSecret] OAuthConfig clientSecret + * @property {string|null} [secretVersionForClientSecret] OAuthConfig secretVersionForClientSecret + * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint + * @property {Array.|null} [scopes] OAuthConfig scopes + */ + + /** + * Constructs a new OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @classdesc Represents a OAuthConfig. + * @implements IOAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig=} [properties] Properties to set + */ + function OAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthConfig oauthGrantType. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType} oauthGrantType + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.oauthGrantType = 0; + + /** + * OAuthConfig clientId. + * @member {string} clientId + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientId = ""; + + /** + * OAuthConfig clientSecret. + * @member {string} clientSecret + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientSecret = ""; + + /** + * OAuthConfig secretVersionForClientSecret. + * @member {string} secretVersionForClientSecret + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.secretVersionForClientSecret = ""; + + /** + * OAuthConfig tokenEndpoint. + * @member {string} tokenEndpoint + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.tokenEndpoint = ""; + + /** + * OAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig} OAuthConfig instance + */ + OAuthConfig.create = function create(properties) { + return new OAuthConfig(properties); + }; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthGrantType != null && Object.hasOwnProperty.call(message, "oauthGrantType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.oauthGrantType); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.clientSecret != null && Object.hasOwnProperty.call(message, "clientSecret")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientSecret); + if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tokenEndpoint); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.scopes[i]); + if (message.secretVersionForClientSecret != null && Object.hasOwnProperty.call(message, "secretVersionForClientSecret")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.secretVersionForClientSecret); + return writer; + }; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthGrantType = reader.int32(); + break; + } + case 2: { + message.clientId = reader.string(); + break; + } + case 3: { + message.clientSecret = reader.string(); + break; + } + case 6: { + message.secretVersionForClientSecret = reader.string(); + break; + } + case 4: { + message.tokenEndpoint = reader.string(); + break; + } + case 5: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + switch (message.oauthGrantType) { + default: + return "oauthGrantType: enum value expected"; + case 0: + case 1: + break; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + if (!$util.isString(message.clientSecret)) + return "clientSecret: string expected"; + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + if (!$util.isString(message.secretVersionForClientSecret)) + return "secretVersionForClientSecret: string expected"; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + if (!$util.isString(message.tokenEndpoint)) + return "tokenEndpoint: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig} OAuthConfig + */ + OAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig(); + switch (object.oauthGrantType) { + default: + if (typeof object.oauthGrantType === "number") { + message.oauthGrantType = object.oauthGrantType; + break; + } + break; + case "OAUTH_GRANT_TYPE_UNSPECIFIED": + case 0: + message.oauthGrantType = 0; + break; + case "CLIENT_CREDENTIAL": + case 1: + message.oauthGrantType = 1; + break; + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecret != null) + message.clientSecret = String(object.clientSecret); + if (object.secretVersionForClientSecret != null) + message.secretVersionForClientSecret = String(object.secretVersionForClientSecret); + if (object.tokenEndpoint != null) + message.tokenEndpoint = String(object.tokenEndpoint); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig} message OAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.oauthGrantType = options.enums === String ? "OAUTH_GRANT_TYPE_UNSPECIFIED" : 0; + object.clientId = ""; + object.clientSecret = ""; + object.tokenEndpoint = ""; + object.secretVersionForClientSecret = ""; + } + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + object.oauthGrantType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType[message.oauthGrantType] === undefined ? message.oauthGrantType : $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType[message.oauthGrantType] : message.oauthGrantType; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + object.clientSecret = message.clientSecret; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + object.tokenEndpoint = message.tokenEndpoint; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + object.secretVersionForClientSecret = message.secretVersionForClientSecret; + return object; + }; + + /** + * Converts this OAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @instance + * @returns {Object.} JSON object + */ + OAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig"; + }; + + /** + * OauthGrantType enum. + * @name google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType + * @enum {number} + * @property {number} OAUTH_GRANT_TYPE_UNSPECIFIED=0 OAUTH_GRANT_TYPE_UNSPECIFIED value + * @property {number} CLIENT_CREDENTIAL=1 CLIENT_CREDENTIAL value + */ + OAuthConfig.OauthGrantType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OAUTH_GRANT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLIENT_CREDENTIAL"] = 1; + return values; + })(); + + return OAuthConfig; + })(); + + Authentication.ServiceAgentAuthConfig = (function() { + + /** + * Properties of a ServiceAgentAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @interface IServiceAgentAuthConfig + * @property {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|null} [serviceAgentAuth] ServiceAgentAuthConfig serviceAgentAuth + */ + + /** + * Constructs a new ServiceAgentAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @classdesc Represents a ServiceAgentAuthConfig. + * @implements IServiceAgentAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig=} [properties] Properties to set + */ + function ServiceAgentAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAgentAuthConfig serviceAgentAuth. + * @member {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth} serviceAgentAuth + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @instance + */ + ServiceAgentAuthConfig.prototype.serviceAgentAuth = 0; + + /** + * Creates a new ServiceAgentAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig instance + */ + ServiceAgentAuthConfig.create = function create(properties) { + return new ServiceAgentAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAgentAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig} message ServiceAgentAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAgentAuth != null && Object.hasOwnProperty.call(message, "serviceAgentAuth")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.serviceAgentAuth); + return writer; + }; + + /** + * Encodes the specified ServiceAgentAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAgentAuthConfig} message ServiceAgentAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAgentAuth = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAgentAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAgentAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + switch (message.serviceAgentAuth) { + default: + return "serviceAgentAuth: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ServiceAgentAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig + */ + ServiceAgentAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig(); + switch (object.serviceAgentAuth) { + default: + if (typeof object.serviceAgentAuth === "number") { + message.serviceAgentAuth = object.serviceAgentAuth; + break; + } + break; + case "SERVICE_AGENT_AUTH_UNSPECIFIED": + case 0: + message.serviceAgentAuth = 0; + break; + case "ID_TOKEN": + case 1: + message.serviceAgentAuth = 1; + break; + case "ACCESS_TOKEN": + case 2: + message.serviceAgentAuth = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ServiceAgentAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig} message ServiceAgentAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAgentAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceAgentAuth = options.enums === String ? "SERVICE_AGENT_AUTH_UNSPECIFIED" : 0; + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + object.serviceAgentAuth = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth[message.serviceAgentAuth] === undefined ? message.serviceAgentAuth : $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth[message.serviceAgentAuth] : message.serviceAgentAuth; + return object; + }; + + /** + * Converts this ServiceAgentAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAgentAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAgentAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAgentAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig"; + }; + + /** + * ServiceAgentAuth enum. + * @name google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth + * @enum {number} + * @property {number} SERVICE_AGENT_AUTH_UNSPECIFIED=0 SERVICE_AGENT_AUTH_UNSPECIFIED value + * @property {number} ID_TOKEN=1 ID_TOKEN value + * @property {number} ACCESS_TOKEN=2 ACCESS_TOKEN value + */ + ServiceAgentAuthConfig.ServiceAgentAuth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_AGENT_AUTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "ID_TOKEN"] = 1; + values[valuesById[2] = "ACCESS_TOKEN"] = 2; + return values; + })(); + + return ServiceAgentAuthConfig; + })(); + + Authentication.BearerTokenConfig = (function() { + + /** + * Properties of a BearerTokenConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @interface IBearerTokenConfig + * @property {string|null} [token] BearerTokenConfig token + * @property {string|null} [secretVersionForToken] BearerTokenConfig secretVersionForToken + */ + + /** + * Constructs a new BearerTokenConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @classdesc Represents a BearerTokenConfig. + * @implements IBearerTokenConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig=} [properties] Properties to set + */ + function BearerTokenConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BearerTokenConfig token. + * @member {string} token + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @instance + */ + BearerTokenConfig.prototype.token = ""; + + /** + * BearerTokenConfig secretVersionForToken. + * @member {string} secretVersionForToken + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @instance + */ + BearerTokenConfig.prototype.secretVersionForToken = ""; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig} BearerTokenConfig instance + */ + BearerTokenConfig.create = function create(properties) { + return new BearerTokenConfig(properties); + }; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.secretVersionForToken != null && Object.hasOwnProperty.call(message, "secretVersionForToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretVersionForToken); + return writer; + }; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + case 2: { + message.secretVersionForToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BearerTokenConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BearerTokenConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.secretVersionForToken != null && message.hasOwnProperty("secretVersionForToken")) + if (!$util.isString(message.secretVersionForToken)) + return "secretVersionForToken: string expected"; + return null; + }; + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig} BearerTokenConfig + */ + BearerTokenConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig(); + if (object.token != null) + message.token = String(object.token); + if (object.secretVersionForToken != null) + message.secretVersionForToken = String(object.secretVersionForToken); + return message; + }; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig} message BearerTokenConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BearerTokenConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.token = ""; + object.secretVersionForToken = ""; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.secretVersionForToken != null && message.hasOwnProperty("secretVersionForToken")) + object.secretVersionForToken = message.secretVersionForToken; + return object; + }; + + /** + * Converts this BearerTokenConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @instance + * @returns {Object.} JSON object + */ + BearerTokenConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BearerTokenConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BearerTokenConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig"; + }; + + return BearerTokenConfig; + })(); + + Authentication.ServiceAccountAuthConfig = (function() { + + /** + * Properties of a ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @interface IServiceAccountAuthConfig + * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount + */ + + /** + * Constructs a new ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication + * @classdesc Represents a ServiceAccountAuthConfig. + * @implements IServiceAccountAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig=} [properties] Properties to set + */ + function ServiceAccountAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountAuthConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.serviceAccount = ""; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance + */ + ServiceAccountAuthConfig.create = function create(properties) { + return new ServiceAccountAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig + */ + ServiceAccountAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig} message ServiceAccountAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceAccount = ""; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig"; + }; + + return ServiceAccountAuthConfig; + })(); + + return Authentication; + })(); + + Tool.TLSConfig = (function() { + + /** + * Properties of a TLSConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @interface ITLSConfig + * @property {Array.|null} [caCerts] TLSConfig caCerts + */ + + /** + * Constructs a new TLSConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @classdesc Represents a TLSConfig. + * @implements ITLSConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.ITLSConfig=} [properties] Properties to set + */ + function TLSConfig(properties) { + this.caCerts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TLSConfig caCerts. + * @member {Array.} caCerts + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @instance + */ + TLSConfig.prototype.caCerts = $util.emptyArray; + + /** + * Creates a new TLSConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.ITLSConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig} TLSConfig instance + */ + TLSConfig.create = function create(properties) { + return new TLSConfig(properties); + }; + + /** + * Encodes the specified TLSConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.ITLSConfig} message TLSConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TLSConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCerts != null && message.caCerts.length) + for (var i = 0; i < message.caCerts.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TLSConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.ITLSConfig} message TLSConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TLSConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TLSConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig} TLSConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TLSConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caCerts && message.caCerts.length)) + message.caCerts = []; + message.caCerts.push($root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TLSConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig} TLSConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TLSConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TLSConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TLSConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (!Array.isArray(message.caCerts)) + return "caCerts: array expected"; + for (var i = 0; i < message.caCerts.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.verify(message.caCerts[i], long + 1); + if (error) + return "caCerts." + error; + } + } + return null; + }; + + /** + * Creates a TLSConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig} TLSConfig + */ + TLSConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig(); + if (object.caCerts) { + if (!Array.isArray(object.caCerts)) + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.TLSConfig.caCerts: array expected"); + message.caCerts = []; + for (var i = 0; i < object.caCerts.length; ++i) { + if (typeof object.caCerts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Tool.TLSConfig.caCerts: object expected"); + message.caCerts[i] = $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.fromObject(object.caCerts[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TLSConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.TLSConfig} message TLSConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TLSConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caCerts = []; + if (message.caCerts && message.caCerts.length) { + object.caCerts = []; + for (var j = 0; j < message.caCerts.length; ++j) + object.caCerts[j] = $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.toObject(message.caCerts[j], options); + } + return object; + }; + + /** + * Converts this TLSConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @instance + * @returns {Object.} JSON object + */ + TLSConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TLSConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TLSConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.TLSConfig"; + }; + + TLSConfig.CACert = (function() { + + /** + * Properties of a CACert. + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @interface ICACert + * @property {string|null} [displayName] CACert displayName + * @property {Uint8Array|null} [cert] CACert cert + */ + + /** + * Constructs a new CACert. + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig + * @classdesc Represents a CACert. + * @implements ICACert + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert=} [properties] Properties to set + */ + function CACert(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CACert displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @instance + */ + CACert.prototype.displayName = ""; + + /** + * CACert cert. + * @member {Uint8Array} cert + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @instance + */ + CACert.prototype.cert = $util.newBuffer([]); + + /** + * Creates a new CACert instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert} CACert instance + */ + CACert.create = function create(properties) { + return new CACert(properties); + }; + + /** + * Encodes the specified CACert message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert} message CACert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CACert.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cert); + return writer; + }; + + /** + * Encodes the specified CACert message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.ICACert} message CACert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CACert.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CACert message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert} CACert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CACert.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.cert = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CACert message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert} CACert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CACert.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CACert message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CACert.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cert != null && message.hasOwnProperty("cert")) + if (!(message.cert && typeof message.cert.length === "number" || $util.isString(message.cert))) + return "cert: buffer expected"; + return null; + }; + + /** + * Creates a CACert message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert} CACert + */ + CACert.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cert != null) + if (typeof object.cert === "string") + $util.base64.decode(object.cert, message.cert = $util.newBuffer($util.base64.length(object.cert)), 0); + else if (object.cert.length >= 0) + message.cert = object.cert; + return message; + }; + + /** + * Creates a plain object from a CACert message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert} message CACert + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CACert.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + if (options.bytes === String) + object.cert = ""; + else { + object.cert = []; + if (options.bytes !== Array) + object.cert = $util.newBuffer(object.cert); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cert != null && message.hasOwnProperty("cert")) + object.cert = options.bytes === String ? $util.base64.encode(message.cert, 0, message.cert.length) : options.bytes === Array ? Array.prototype.slice.call(message.cert) : message.cert; + return object; + }; + + /** + * Converts this CACert to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @instance + * @returns {Object.} JSON object + */ + CACert.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CACert + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CACert.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert"; + }; + + return CACert; + })(); + + return TLSConfig; + })(); + + Tool.ServiceDirectoryConfig = (function() { + + /** + * Properties of a ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @interface IServiceDirectoryConfig + * @property {string|null} [service] ServiceDirectoryConfig service + */ + + /** + * Constructs a new ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3.Tool + * @classdesc Represents a ServiceDirectoryConfig. + * @implements IServiceDirectoryConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig=} [properties] Properties to set + */ + function ServiceDirectoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDirectoryConfig service. + * @member {string} service + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.service = ""; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig instance + */ + ServiceDirectoryConfig.create = function create(properties) { + return new ServiceDirectoryConfig(properties); + }; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDirectoryConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDirectoryConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig + */ + ServiceDirectoryConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig} message ServiceDirectoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDirectoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceDirectoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig"; + }; + + return ServiceDirectoryConfig; + })(); + + /** + * ToolType enum. + * @name google.cloud.dialogflow.cx.v3.Tool.ToolType + * @enum {number} + * @property {number} TOOL_TYPE_UNSPECIFIED=0 TOOL_TYPE_UNSPECIFIED value + * @property {number} CUSTOMIZED_TOOL=1 CUSTOMIZED_TOOL value + * @property {number} BUILTIN_TOOL=2 BUILTIN_TOOL value + */ + Tool.ToolType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOOL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUSTOMIZED_TOOL"] = 1; + values[valuesById[2] = "BUILTIN_TOOL"] = 2; + return values; + })(); + + return Tool; + })(); + + v3.ListToolVersionsRequest = (function() { + + /** + * Properties of a ListToolVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListToolVersionsRequest + * @property {string|null} [parent] ListToolVersionsRequest parent + * @property {number|null} [pageSize] ListToolVersionsRequest pageSize + * @property {string|null} [pageToken] ListToolVersionsRequest pageToken + */ + + /** + * Constructs a new ListToolVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListToolVersionsRequest. + * @implements IListToolVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsRequest=} [properties] Properties to set + */ + function ListToolVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @instance + */ + ListToolVersionsRequest.prototype.parent = ""; + + /** + * ListToolVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @instance + */ + ListToolVersionsRequest.prototype.pageSize = 0; + + /** + * ListToolVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @instance + */ + ListToolVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListToolVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsRequest} ListToolVersionsRequest instance + */ + ListToolVersionsRequest.create = function create(properties) { + return new ListToolVersionsRequest(properties); + }; + + /** + * Encodes the specified ListToolVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsRequest} message ListToolVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListToolVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsRequest} message ListToolVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsRequest} ListToolVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsRequest} ListToolVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListToolVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsRequest} ListToolVersionsRequest + */ + ListToolVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListToolVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListToolVersionsRequest} message ListToolVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListToolVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListToolVersionsRequest"; + }; + + return ListToolVersionsRequest; + })(); + + v3.ListToolVersionsResponse = (function() { + + /** + * Properties of a ListToolVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListToolVersionsResponse + * @property {Array.|null} [toolVersions] ListToolVersionsResponse toolVersions + * @property {string|null} [nextPageToken] ListToolVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListToolVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListToolVersionsResponse. + * @implements IListToolVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsResponse=} [properties] Properties to set + */ + function ListToolVersionsResponse(properties) { + this.toolVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolVersionsResponse toolVersions. + * @member {Array.} toolVersions + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @instance + */ + ListToolVersionsResponse.prototype.toolVersions = $util.emptyArray; + + /** + * ListToolVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @instance + */ + ListToolVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsResponse} ListToolVersionsResponse instance + */ + ListToolVersionsResponse.create = function create(properties) { + return new ListToolVersionsResponse(properties); + }; + + /** + * Encodes the specified ListToolVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsResponse} message ListToolVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolVersions != null && message.toolVersions.length) + for (var i = 0; i < message.toolVersions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ToolVersion.encode(message.toolVersions[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 ListToolVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListToolVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListToolVersionsResponse} message ListToolVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsResponse} ListToolVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListToolVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolVersions && message.toolVersions.length)) + message.toolVersions = []; + message.toolVersions.push($root.google.cloud.dialogflow.cx.v3.ToolVersion.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsResponse} ListToolVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.toolVersions != null && message.hasOwnProperty("toolVersions")) { + if (!Array.isArray(message.toolVersions)) + return "toolVersions: array expected"; + for (var i = 0; i < message.toolVersions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ToolVersion.verify(message.toolVersions[i], long + 1); + if (error) + return "toolVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListToolVersionsResponse} ListToolVersionsResponse + */ + ListToolVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListToolVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListToolVersionsResponse(); + if (object.toolVersions) { + if (!Array.isArray(object.toolVersions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListToolVersionsResponse.toolVersions: array expected"); + message.toolVersions = []; + for (var i = 0; i < object.toolVersions.length; ++i) { + if (typeof object.toolVersions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListToolVersionsResponse.toolVersions: object expected"); + message.toolVersions[i] = $root.google.cloud.dialogflow.cx.v3.ToolVersion.fromObject(object.toolVersions[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListToolVersionsResponse} message ListToolVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.toolVersions && message.toolVersions.length) { + object.toolVersions = []; + for (var j = 0; j < message.toolVersions.length; ++j) + object.toolVersions[j] = $root.google.cloud.dialogflow.cx.v3.ToolVersion.toObject(message.toolVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListToolVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListToolVersionsResponse"; + }; + + return ListToolVersionsResponse; + })(); + + v3.CreateToolVersionRequest = (function() { + + /** + * Properties of a CreateToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateToolVersionRequest + * @property {string|null} [parent] CreateToolVersionRequest parent + * @property {google.cloud.dialogflow.cx.v3.IToolVersion|null} [toolVersion] CreateToolVersionRequest toolVersion + */ + + /** + * Constructs a new CreateToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateToolVersionRequest. + * @implements ICreateToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest=} [properties] Properties to set + */ + function CreateToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @instance + */ + CreateToolVersionRequest.prototype.parent = ""; + + /** + * CreateToolVersionRequest toolVersion. + * @member {google.cloud.dialogflow.cx.v3.IToolVersion|null|undefined} toolVersion + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @instance + */ + CreateToolVersionRequest.prototype.toolVersion = null; + + /** + * Creates a new CreateToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateToolVersionRequest} CreateToolVersionRequest instance + */ + CreateToolVersionRequest.create = function create(properties) { + return new CreateToolVersionRequest(properties); + }; + + /** + * Encodes the specified CreateToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest} message CreateToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolVersionRequest.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.toolVersion != null && Object.hasOwnProperty.call(message, "toolVersion")) + $root.google.cloud.dialogflow.cx.v3.ToolVersion.encode(message.toolVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest} message CreateToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateToolVersionRequest} CreateToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolVersion = $root.google.cloud.dialogflow.cx.v3.ToolVersion.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateToolVersionRequest} CreateToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.toolVersion != null && message.hasOwnProperty("toolVersion")) { + var error = $root.google.cloud.dialogflow.cx.v3.ToolVersion.verify(message.toolVersion, long + 1); + if (error) + return "toolVersion." + error; + } + return null; + }; + + /** + * Creates a CreateToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateToolVersionRequest} CreateToolVersionRequest + */ + CreateToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolVersion != null) { + if (typeof object.toolVersion !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateToolVersionRequest.toolVersion: object expected"); + message.toolVersion = $root.google.cloud.dialogflow.cx.v3.ToolVersion.fromObject(object.toolVersion, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateToolVersionRequest} message CreateToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolVersion != null && message.hasOwnProperty("toolVersion")) + object.toolVersion = $root.google.cloud.dialogflow.cx.v3.ToolVersion.toObject(message.toolVersion, options); + return object; + }; + + /** + * Converts this CreateToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateToolVersionRequest"; + }; + + return CreateToolVersionRequest; + })(); + + v3.GetToolVersionRequest = (function() { + + /** + * Properties of a GetToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetToolVersionRequest + * @property {string|null} [name] GetToolVersionRequest name + */ + + /** + * Constructs a new GetToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetToolVersionRequest. + * @implements IGetToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetToolVersionRequest=} [properties] Properties to set + */ + function GetToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @instance + */ + GetToolVersionRequest.prototype.name = ""; + + /** + * Creates a new GetToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetToolVersionRequest} GetToolVersionRequest instance + */ + GetToolVersionRequest.create = function create(properties) { + return new GetToolVersionRequest(properties); + }; + + /** + * Encodes the specified GetToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetToolVersionRequest} message GetToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolVersionRequest.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 GetToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetToolVersionRequest} message GetToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetToolVersionRequest} GetToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetToolVersionRequest} GetToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetToolVersionRequest} GetToolVersionRequest + */ + GetToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetToolVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetToolVersionRequest} message GetToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolVersionRequest.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 GetToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetToolVersionRequest"; + }; + + return GetToolVersionRequest; + })(); + + v3.DeleteToolVersionRequest = (function() { + + /** + * Properties of a DeleteToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteToolVersionRequest + * @property {string|null} [name] DeleteToolVersionRequest name + * @property {boolean|null} [force] DeleteToolVersionRequest force + */ + + /** + * Constructs a new DeleteToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteToolVersionRequest. + * @implements IDeleteToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest=} [properties] Properties to set + */ + function DeleteToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @instance + */ + DeleteToolVersionRequest.prototype.name = ""; + + /** + * DeleteToolVersionRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @instance + */ + DeleteToolVersionRequest.prototype.force = false; + + /** + * Creates a new DeleteToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest} DeleteToolVersionRequest instance + */ + DeleteToolVersionRequest.create = function create(properties) { + return new DeleteToolVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest} message DeleteToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolVersionRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest} message DeleteToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest} DeleteToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest} DeleteToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest} DeleteToolVersionRequest + */ + DeleteToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest} message DeleteToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest"; + }; + + return DeleteToolVersionRequest; + })(); + + v3.RestoreToolVersionRequest = (function() { + + /** + * Properties of a RestoreToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRestoreToolVersionRequest + * @property {string|null} [name] RestoreToolVersionRequest name + */ + + /** + * Constructs a new RestoreToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RestoreToolVersionRequest. + * @implements IRestoreToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest=} [properties] Properties to set + */ + function RestoreToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreToolVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @instance + */ + RestoreToolVersionRequest.prototype.name = ""; + + /** + * Creates a new RestoreToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest} RestoreToolVersionRequest instance + */ + RestoreToolVersionRequest.create = function create(properties) { + return new RestoreToolVersionRequest(properties); + }; + + /** + * Encodes the specified RestoreToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest} message RestoreToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionRequest.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 RestoreToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest} message RestoreToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest} RestoreToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest} RestoreToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a RestoreToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest} RestoreToolVersionRequest + */ + RestoreToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestoreToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest} message RestoreToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreToolVersionRequest.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 RestoreToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest"; + }; + + return RestoreToolVersionRequest; + })(); + + v3.RestoreToolVersionResponse = (function() { + + /** + * Properties of a RestoreToolVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRestoreToolVersionResponse + * @property {google.cloud.dialogflow.cx.v3.ITool|null} [tool] RestoreToolVersionResponse tool + */ + + /** + * Constructs a new RestoreToolVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RestoreToolVersionResponse. + * @implements IRestoreToolVersionResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse=} [properties] Properties to set + */ + function RestoreToolVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreToolVersionResponse tool. + * @member {google.cloud.dialogflow.cx.v3.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @instance + */ + RestoreToolVersionResponse.prototype.tool = null; + + /** + * Creates a new RestoreToolVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse} RestoreToolVersionResponse instance + */ + RestoreToolVersionResponse.create = function create(properties) { + return new RestoreToolVersionResponse(properties); + }; + + /** + * Encodes the specified RestoreToolVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse} message RestoreToolVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3.Tool.encode(message.tool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreToolVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse} message RestoreToolVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse} RestoreToolVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse} RestoreToolVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreToolVersionResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreToolVersionResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + return null; + }; + + /** + * Creates a RestoreToolVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse} RestoreToolVersionResponse + */ + RestoreToolVersionResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse(); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.fromObject(object.tool, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RestoreToolVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse} message RestoreToolVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreToolVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tool = null; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3.Tool.toObject(message.tool, options); + return object; + }; + + /** + * Converts this RestoreToolVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreToolVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreToolVersionResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreToolVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse"; + }; + + return RestoreToolVersionResponse; + })(); + + v3.ToolVersion = (function() { + + /** + * Properties of a ToolVersion. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IToolVersion + * @property {string|null} [name] ToolVersion name + * @property {string|null} [displayName] ToolVersion displayName + * @property {google.cloud.dialogflow.cx.v3.ITool|null} [tool] ToolVersion tool + * @property {google.protobuf.ITimestamp|null} [createTime] ToolVersion createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ToolVersion updateTime + */ + + /** + * Constructs a new ToolVersion. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ToolVersion. + * @implements IToolVersion + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IToolVersion=} [properties] Properties to set + */ + function ToolVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolVersion name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @instance + */ + ToolVersion.prototype.name = ""; + + /** + * ToolVersion displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @instance + */ + ToolVersion.prototype.displayName = ""; + + /** + * ToolVersion tool. + * @member {google.cloud.dialogflow.cx.v3.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @instance + */ + ToolVersion.prototype.tool = null; + + /** + * ToolVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @instance + */ + ToolVersion.prototype.createTime = null; + + /** + * ToolVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @instance + */ + ToolVersion.prototype.updateTime = null; + + /** + * Creates a new ToolVersion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolVersion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ToolVersion} ToolVersion instance + */ + ToolVersion.create = function create(properties) { + return new ToolVersion(properties); + }; + + /** + * Encodes the specified ToolVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolVersion} message ToolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolVersion.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3.Tool.encode(message.tool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ToolVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.IToolVersion} message ToolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ToolVersion} ToolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolVersion.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ToolVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ToolVersion} ToolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolVersion message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolVersion.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a ToolVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ToolVersion} ToolVersion + */ + ToolVersion.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ToolVersion) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ToolVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolVersion.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3.Tool.fromObject(object.tool, long + 1); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ToolVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3.ToolVersion} message ToolVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.tool = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3.Tool.toObject(message.tool, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + 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); + return object; + }; + + /** + * Converts this ToolVersion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @instance + * @returns {Object.} JSON object + */ + ToolVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolVersion + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ToolVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ToolVersion"; + }; + + return ToolVersion; + })(); + + v3.Versions = (function() { + + /** + * Constructs a new Versions service. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Versions + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Versions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Versions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Versions; + + /** + * Creates new Versions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Versions} RPC service. Useful where requests and/or responses are streamed. + */ + Versions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|listVersions}. + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @typedef ListVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListVersionsResponse} [response] ListVersionsResponse + */ + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListVersionsRequest} request ListVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Versions.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.listVersions = function listVersions(request, callback) { + return this.rpcCall(listVersions, $root.google.cloud.dialogflow.cx.v3.ListVersionsRequest, $root.google.cloud.dialogflow.cx.v3.ListVersionsResponse, request, callback); + }, "name", { value: "ListVersions" }); + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListVersionsRequest} request ListVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|getVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @typedef GetVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Version} [response] Version + */ + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetVersionRequest} request GetVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Versions.GetVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.getVersion = function getVersion(request, callback) { + return this.rpcCall(getVersion, $root.google.cloud.dialogflow.cx.v3.GetVersionRequest, $root.google.cloud.dialogflow.cx.v3.Version, request, callback); + }, "name", { value: "GetVersion" }); + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IGetVersionRequest} request GetVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|createVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @typedef CreateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Versions.CreateVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.createVersion = function createVersion(request, callback) { + return this.rpcCall(createVersion, $root.google.cloud.dialogflow.cx.v3.CreateVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateVersion" }); + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|updateVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @typedef UpdateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.Version} [response] Version + */ + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Versions.UpdateVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.updateVersion = function updateVersion(request, callback) { + return this.rpcCall(updateVersion, $root.google.cloud.dialogflow.cx.v3.UpdateVersionRequest, $root.google.cloud.dialogflow.cx.v3.Version, request, callback); + }, "name", { value: "UpdateVersion" }); + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|deleteVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @typedef DeleteVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Versions.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.deleteVersion = function deleteVersion(request, callback) { + return this.rpcCall(deleteVersion, $root.google.cloud.dialogflow.cx.v3.DeleteVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteVersion" }); + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|loadVersion}. + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @typedef LoadVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LoadVersion. + * @function loadVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ILoadVersionRequest} request LoadVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Versions.LoadVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.loadVersion = function loadVersion(request, callback) { + return this.rpcCall(loadVersion, $root.google.cloud.dialogflow.cx.v3.LoadVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LoadVersion" }); + + /** + * Calls LoadVersion. + * @function loadVersion + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ILoadVersionRequest} request LoadVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Versions|compareVersions}. + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @typedef CompareVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.CompareVersionsResponse} [response] CompareVersionsResponse + */ + + /** + * Calls CompareVersions. + * @function compareVersions + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsRequest} request CompareVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Versions.CompareVersionsCallback} callback Node-style callback called with the error, if any, and CompareVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.compareVersions = function compareVersions(request, callback) { + return this.rpcCall(compareVersions, $root.google.cloud.dialogflow.cx.v3.CompareVersionsRequest, $root.google.cloud.dialogflow.cx.v3.CompareVersionsResponse, request, callback); + }, "name", { value: "CompareVersions" }); + + /** + * Calls CompareVersions. + * @function compareVersions + * @memberof google.cloud.dialogflow.cx.v3.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsRequest} request CompareVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Versions; + })(); + + v3.CreateVersionOperationMetadata = (function() { + + /** + * Properties of a CreateVersionOperationMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateVersionOperationMetadata + * @property {string|null} [version] CreateVersionOperationMetadata version + */ + + /** + * Constructs a new CreateVersionOperationMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateVersionOperationMetadata. + * @implements ICreateVersionOperationMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata=} [properties] Properties to set + */ + function CreateVersionOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVersionOperationMetadata version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @instance + */ + CreateVersionOperationMetadata.prototype.version = ""; + + /** + * Creates a new CreateVersionOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata} CreateVersionOperationMetadata instance + */ + CreateVersionOperationMetadata.create = function create(properties) { + return new CreateVersionOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateVersionOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata} message CreateVersionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + return writer; + }; + + /** + * Encodes the specified CreateVersionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata} message CreateVersionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata} CreateVersionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionOperationMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata} CreateVersionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionOperationMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionOperationMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a CreateVersionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata} CreateVersionOperationMetadata + */ + CreateVersionOperationMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata(); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a CreateVersionOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata} message CreateVersionOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.version = ""; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this CreateVersionOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateVersionOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata"; + }; + + return CreateVersionOperationMetadata; + })(); + + v3.Version = (function() { + + /** + * Properties of a Version. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IVersion + * @property {string|null} [name] Version name + * @property {string|null} [displayName] Version displayName + * @property {string|null} [description] Version description + * @property {google.cloud.dialogflow.cx.v3.INluSettings|null} [nluSettings] Version nluSettings + * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime + * @property {google.cloud.dialogflow.cx.v3.Version.State|null} [state] Version state + */ + + /** + * Constructs a new Version. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IVersion=} [properties] Properties to set + */ + function Version(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.Version + * @instance + */ + Version.prototype.name = ""; + + /** + * Version displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3.Version + * @instance + */ + Version.prototype.displayName = ""; + + /** + * Version description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3.Version + * @instance + */ + Version.prototype.description = ""; + + /** + * Version nluSettings. + * @member {google.cloud.dialogflow.cx.v3.INluSettings|null|undefined} nluSettings + * @memberof google.cloud.dialogflow.cx.v3.Version + * @instance + */ + Version.prototype.nluSettings = null; + + /** + * Version createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3.Version + * @instance + */ + Version.prototype.createTime = null; + + /** + * Version state. + * @member {google.cloud.dialogflow.cx.v3.Version.State} state + * @memberof google.cloud.dialogflow.cx.v3.Version + * @instance + */ + Version.prototype.state = 0; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {google.cloud.dialogflow.cx.v3.IVersion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Version.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {google.cloud.dialogflow.cx.v3.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.nluSettings != null && Object.hasOwnProperty.call(message, "nluSettings")) + $root.google.cloud.dialogflow.cx.v3.NluSettings.encode(message.nluSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {google.cloud.dialogflow.cx.v3.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.nluSettings = $root.google.cloud.dialogflow.cx.v3.NluSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3.NluSettings.verify(message.nluSettings, long + 1); + if (error) + return "nluSettings." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.Version} Version + */ + Version.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.Version) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.Version(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.nluSettings != null) { + if (typeof object.nluSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Version.nluSettings: object expected"); + message.nluSettings = $root.google.cloud.dialogflow.cx.v3.NluSettings.fromObject(object.nluSettings, long + 1); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Version.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {google.cloud.dialogflow.cx.v3.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.nluSettings = null; + object.createTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) + object.nluSettings = $root.google.cloud.dialogflow.cx.v3.NluSettings.toObject(message.nluSettings, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Version.State[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3.Version.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Version + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.Version + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Version"; + }; + + /** + * State enum. + * @name google.cloud.dialogflow.cx.v3.Version.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + Version.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return Version; + })(); + + v3.ListVersionsRequest = (function() { + + /** + * Properties of a ListVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListVersionsRequest + * @property {string|null} [parent] ListVersionsRequest parent + * @property {number|null} [pageSize] ListVersionsRequest pageSize + * @property {string|null} [pageToken] ListVersionsRequest pageToken + */ + + /** + * Constructs a new ListVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListVersionsRequest. + * @implements IListVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListVersionsRequest=} [properties] Properties to set + */ + function ListVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.parent = ""; + + /** + * ListVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageSize = 0; + + /** + * ListVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsRequest} ListVersionsRequest instance + */ + ListVersionsRequest.create = function create(properties) { + return new ListVersionsRequest(properties); + }; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsRequest} ListVersionsRequest + */ + ListVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListVersionsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListVersionsRequest} message ListVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListVersionsRequest"; + }; + + return ListVersionsRequest; + })(); + + v3.ListVersionsResponse = (function() { + + /** + * Properties of a ListVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListVersionsResponse + * @property {Array.|null} [versions] ListVersionsResponse versions + * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListVersionsResponse. + * @implements IListVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListVersionsResponse=} [properties] Properties to set + */ + function ListVersionsResponse(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsResponse versions. + * @member {Array.} versions + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.versions = $util.emptyArray; + + /** + * ListVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsResponse} ListVersionsResponse instance + */ + ListVersionsResponse.create = function create(properties) { + return new ListVersionsResponse(properties); + }; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.cloud.dialogflow.cx.v3.Version.encode(message.versions[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 ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.ListVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.cloud.dialogflow.cx.v3.Version.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.Version.verify(message.versions[i], long + 1); + if (error) + return "versions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListVersionsResponse} ListVersionsResponse + */ + ListVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.ListVersionsResponse(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListVersionsResponse.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListVersionsResponse.versions: object expected"); + message.versions[i] = $root.google.cloud.dialogflow.cx.v3.Version.fromObject(object.versions[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListVersionsResponse} message ListVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.cloud.dialogflow.cx.v3.Version.toObject(message.versions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.ListVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.ListVersionsResponse"; + }; + + return ListVersionsResponse; + })(); + + v3.GetVersionRequest = (function() { + + /** + * Properties of a GetVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IGetVersionRequest + * @property {string|null} [name] GetVersionRequest name + */ + + /** + * Constructs a new GetVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a GetVersionRequest. + * @implements IGetVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IGetVersionRequest=} [properties] Properties to set + */ + function GetVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @instance + */ + GetVersionRequest.prototype.name = ""; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.GetVersionRequest} GetVersionRequest instance + */ + GetVersionRequest.create = function create(properties) { + return new GetVersionRequest(properties); + }; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.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 GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.GetVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.GetVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.GetVersionRequest} GetVersionRequest + */ + GetVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.GetVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.GetVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.GetVersionRequest} message GetVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVersionRequest.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 GetVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.GetVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.GetVersionRequest"; + }; + + return GetVersionRequest; + })(); + + v3.CreateVersionRequest = (function() { + + /** + * Properties of a CreateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICreateVersionRequest + * @property {string|null} [parent] CreateVersionRequest parent + * @property {google.cloud.dialogflow.cx.v3.IVersion|null} [version] CreateVersionRequest version + */ + + /** + * Constructs a new CreateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CreateVersionRequest. + * @implements ICreateVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionRequest=} [properties] Properties to set + */ + function CreateVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.parent = ""; + + /** + * CreateVersionRequest version. + * @member {google.cloud.dialogflow.cx.v3.IVersion|null|undefined} version + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.version = null; + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionRequest} CreateVersionRequest instance + */ + CreateVersionRequest.create = function create(properties) { + return new CreateVersionRequest(properties); + }; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.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.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.dialogflow.cx.v3.Version.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CreateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CreateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.version = $root.google.cloud.dialogflow.cx.v3.Version.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.dialogflow.cx.v3.Version.verify(message.version, long + 1); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CreateVersionRequest} CreateVersionRequest + */ + CreateVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CreateVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CreateVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CreateVersionRequest.version: object expected"); + message.version = $root.google.cloud.dialogflow.cx.v3.Version.fromObject(object.version, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CreateVersionRequest} message CreateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.version = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.dialogflow.cx.v3.Version.toObject(message.version, options); + return object; + }; + + /** + * Converts this CreateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CreateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CreateVersionRequest"; + }; + + return CreateVersionRequest; + })(); + + v3.UpdateVersionRequest = (function() { + + /** + * Properties of an UpdateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IUpdateVersionRequest + * @property {google.cloud.dialogflow.cx.v3.IVersion|null} [version] UpdateVersionRequest version + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVersionRequest updateMask + */ + + /** + * Constructs a new UpdateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents an UpdateVersionRequest. + * @implements IUpdateVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IUpdateVersionRequest=} [properties] Properties to set + */ + function UpdateVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateVersionRequest version. + * @member {google.cloud.dialogflow.cx.v3.IVersion|null|undefined} version + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.version = null; + + /** + * UpdateVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.UpdateVersionRequest} UpdateVersionRequest instance + */ + UpdateVersionRequest.create = function create(properties) { + return new UpdateVersionRequest(properties); + }; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.dialogflow.cx.v3.Version.encode(message.version, 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 UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.UpdateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.UpdateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = $root.google.cloud.dialogflow.cx.v3.Version.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.dialogflow.cx.v3.Version.verify(message.version, long + 1); + if (error) + return "version." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.UpdateVersionRequest} UpdateVersionRequest + */ + UpdateVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.UpdateVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.UpdateVersionRequest(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateVersionRequest.version: object expected"); + message.version = $root.google.cloud.dialogflow.cx.v3.Version.fromObject(object.version, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.UpdateVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.UpdateVersionRequest} message UpdateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.updateMask = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.dialogflow.cx.v3.Version.toObject(message.version, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.UpdateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.UpdateVersionRequest"; + }; + + return UpdateVersionRequest; + })(); + + v3.DeleteVersionRequest = (function() { + + /** + * Properties of a DeleteVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IDeleteVersionRequest + * @property {string|null} [name] DeleteVersionRequest name + */ + + /** + * Constructs a new DeleteVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a DeleteVersionRequest. + * @implements IDeleteVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IDeleteVersionRequest=} [properties] Properties to set + */ + function DeleteVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @instance + */ + DeleteVersionRequest.prototype.name = ""; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.DeleteVersionRequest} DeleteVersionRequest instance + */ + DeleteVersionRequest.create = function create(properties) { + return new DeleteVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.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 DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.DeleteVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.DeleteVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.DeleteVersionRequest} DeleteVersionRequest + */ + DeleteVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.DeleteVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.DeleteVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.DeleteVersionRequest} message DeleteVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVersionRequest.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 DeleteVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.DeleteVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.DeleteVersionRequest"; + }; + + return DeleteVersionRequest; + })(); + + v3.LoadVersionRequest = (function() { + + /** + * Properties of a LoadVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ILoadVersionRequest + * @property {string|null} [name] LoadVersionRequest name + * @property {boolean|null} [allowOverrideAgentResources] LoadVersionRequest allowOverrideAgentResources + */ + + /** + * Constructs a new LoadVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a LoadVersionRequest. + * @implements ILoadVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ILoadVersionRequest=} [properties] Properties to set + */ + function LoadVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoadVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @instance + */ + LoadVersionRequest.prototype.name = ""; + + /** + * LoadVersionRequest allowOverrideAgentResources. + * @member {boolean} allowOverrideAgentResources + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @instance + */ + LoadVersionRequest.prototype.allowOverrideAgentResources = false; + + /** + * Creates a new LoadVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ILoadVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.LoadVersionRequest} LoadVersionRequest instance + */ + LoadVersionRequest.create = function create(properties) { + return new LoadVersionRequest(properties); + }; + + /** + * Encodes the specified LoadVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LoadVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ILoadVersionRequest} message LoadVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadVersionRequest.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.allowOverrideAgentResources != null && Object.hasOwnProperty.call(message, "allowOverrideAgentResources")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowOverrideAgentResources); + return writer; + }; + + /** + * Encodes the specified LoadVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.LoadVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ILoadVersionRequest} message LoadVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.LoadVersionRequest} LoadVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.LoadVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.allowOverrideAgentResources = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.LoadVersionRequest} LoadVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.allowOverrideAgentResources != null && message.hasOwnProperty("allowOverrideAgentResources")) + if (typeof message.allowOverrideAgentResources !== "boolean") + return "allowOverrideAgentResources: boolean expected"; + return null; + }; + + /** + * Creates a LoadVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.LoadVersionRequest} LoadVersionRequest + */ + LoadVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.LoadVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.LoadVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.allowOverrideAgentResources != null) + message.allowOverrideAgentResources = Boolean(object.allowOverrideAgentResources); + return message; + }; + + /** + * Creates a plain object from a LoadVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.LoadVersionRequest} message LoadVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.allowOverrideAgentResources = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.allowOverrideAgentResources != null && message.hasOwnProperty("allowOverrideAgentResources")) + object.allowOverrideAgentResources = message.allowOverrideAgentResources; + return object; + }; + + /** + * Converts this LoadVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @instance + * @returns {Object.} JSON object + */ + LoadVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.LoadVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.LoadVersionRequest"; + }; + + return LoadVersionRequest; + })(); + + v3.CompareVersionsRequest = (function() { + + /** + * Properties of a CompareVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICompareVersionsRequest + * @property {string|null} [baseVersion] CompareVersionsRequest baseVersion + * @property {string|null} [targetVersion] CompareVersionsRequest targetVersion + * @property {string|null} [languageCode] CompareVersionsRequest languageCode + */ + + /** + * Constructs a new CompareVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CompareVersionsRequest. + * @implements ICompareVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsRequest=} [properties] Properties to set + */ + function CompareVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompareVersionsRequest baseVersion. + * @member {string} baseVersion + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @instance + */ + CompareVersionsRequest.prototype.baseVersion = ""; + + /** + * CompareVersionsRequest targetVersion. + * @member {string} targetVersion + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @instance + */ + CompareVersionsRequest.prototype.targetVersion = ""; + + /** + * CompareVersionsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @instance + */ + CompareVersionsRequest.prototype.languageCode = ""; + + /** + * Creates a new CompareVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsRequest} CompareVersionsRequest instance + */ + CompareVersionsRequest.create = function create(properties) { + return new CompareVersionsRequest(properties); + }; + + /** + * Encodes the specified CompareVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsRequest} message CompareVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseVersion != null && Object.hasOwnProperty.call(message, "baseVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseVersion); + if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetVersion); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CompareVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsRequest} message CompareVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsRequest} CompareVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CompareVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseVersion = reader.string(); + break; + } + case 2: { + message.targetVersion = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsRequest} CompareVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompareVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompareVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) + if (!$util.isString(message.baseVersion)) + return "baseVersion: string expected"; + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + if (!$util.isString(message.targetVersion)) + return "targetVersion: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CompareVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsRequest} CompareVersionsRequest + */ + CompareVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CompareVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CompareVersionsRequest(); + if (object.baseVersion != null) + message.baseVersion = String(object.baseVersion); + if (object.targetVersion != null) + message.targetVersion = String(object.targetVersion); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CompareVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.CompareVersionsRequest} message CompareVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompareVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseVersion = ""; + object.targetVersion = ""; + object.languageCode = ""; + } + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) + object.baseVersion = message.baseVersion; + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + object.targetVersion = message.targetVersion; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CompareVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + CompareVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompareVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompareVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CompareVersionsRequest"; + }; + + return CompareVersionsRequest; + })(); + + v3.CompareVersionsResponse = (function() { + + /** + * Properties of a CompareVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface ICompareVersionsResponse + * @property {string|null} [baseVersionContentJson] CompareVersionsResponse baseVersionContentJson + * @property {string|null} [targetVersionContentJson] CompareVersionsResponse targetVersionContentJson + * @property {google.protobuf.ITimestamp|null} [compareTime] CompareVersionsResponse compareTime + */ + + /** + * Constructs a new CompareVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a CompareVersionsResponse. + * @implements ICompareVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsResponse=} [properties] Properties to set + */ + function CompareVersionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompareVersionsResponse baseVersionContentJson. + * @member {string} baseVersionContentJson + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @instance + */ + CompareVersionsResponse.prototype.baseVersionContentJson = ""; + + /** + * CompareVersionsResponse targetVersionContentJson. + * @member {string} targetVersionContentJson + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @instance + */ + CompareVersionsResponse.prototype.targetVersionContentJson = ""; + + /** + * CompareVersionsResponse compareTime. + * @member {google.protobuf.ITimestamp|null|undefined} compareTime + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @instance + */ + CompareVersionsResponse.prototype.compareTime = null; + + /** + * Creates a new CompareVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsResponse} CompareVersionsResponse instance + */ + CompareVersionsResponse.create = function create(properties) { + return new CompareVersionsResponse(properties); + }; + + /** + * Encodes the specified CompareVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsResponse} message CompareVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseVersionContentJson != null && Object.hasOwnProperty.call(message, "baseVersionContentJson")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseVersionContentJson); + if (message.targetVersionContentJson != null && Object.hasOwnProperty.call(message, "targetVersionContentJson")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetVersionContentJson); + if (message.compareTime != null && Object.hasOwnProperty.call(message, "compareTime")) + $root.google.protobuf.Timestamp.encode(message.compareTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompareVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.CompareVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ICompareVersionsResponse} message CompareVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsResponse} CompareVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.CompareVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseVersionContentJson = reader.string(); + break; + } + case 2: { + message.targetVersionContentJson = reader.string(); + break; + } + case 3: { + message.compareTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsResponse} CompareVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompareVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompareVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.baseVersionContentJson != null && message.hasOwnProperty("baseVersionContentJson")) + if (!$util.isString(message.baseVersionContentJson)) + return "baseVersionContentJson: string expected"; + if (message.targetVersionContentJson != null && message.hasOwnProperty("targetVersionContentJson")) + if (!$util.isString(message.targetVersionContentJson)) + return "targetVersionContentJson: string expected"; + if (message.compareTime != null && message.hasOwnProperty("compareTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.compareTime, long + 1); + if (error) + return "compareTime." + error; + } + return null; + }; + + /** + * Creates a CompareVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.CompareVersionsResponse} CompareVersionsResponse + */ + CompareVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.CompareVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3.CompareVersionsResponse(); + if (object.baseVersionContentJson != null) + message.baseVersionContentJson = String(object.baseVersionContentJson); + if (object.targetVersionContentJson != null) + message.targetVersionContentJson = String(object.targetVersionContentJson); + if (object.compareTime != null) { + if (typeof object.compareTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.CompareVersionsResponse.compareTime: object expected"); + message.compareTime = $root.google.protobuf.Timestamp.fromObject(object.compareTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CompareVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.CompareVersionsResponse} message CompareVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompareVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseVersionContentJson = ""; + object.targetVersionContentJson = ""; + object.compareTime = null; + } + if (message.baseVersionContentJson != null && message.hasOwnProperty("baseVersionContentJson")) + object.baseVersionContentJson = message.baseVersionContentJson; + if (message.targetVersionContentJson != null && message.hasOwnProperty("targetVersionContentJson")) + object.targetVersionContentJson = message.targetVersionContentJson; + if (message.compareTime != null && message.hasOwnProperty("compareTime")) + object.compareTime = $root.google.protobuf.Timestamp.toObject(message.compareTime, options); + return object; + }; + + /** + * Converts this CompareVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + CompareVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompareVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3.CompareVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompareVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.CompareVersionsResponse"; + }; + + return CompareVersionsResponse; + })(); + + return v3; + })(); + + cx.v3beta1 = (function() { + + /** + * Namespace v3beta1. + * @memberof google.cloud.dialogflow.cx + * @namespace + */ + var v3beta1 = {}; + + v3beta1.AdvancedSettings = (function() { + + /** + * Properties of an AdvancedSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IAdvancedSettings + * @property {google.cloud.dialogflow.cx.v3beta1.IGcsDestination|null} [audioExportGcsDestination] AdvancedSettings audioExportGcsDestination + * @property {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null} [speechSettings] AdvancedSettings speechSettings + * @property {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings|null} [dtmfSettings] AdvancedSettings dtmfSettings + * @property {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings|null} [loggingSettings] AdvancedSettings loggingSettings + */ + + /** + * Constructs a new AdvancedSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an AdvancedSettings. + * @implements IAdvancedSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings=} [properties] Properties to set + */ + function AdvancedSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedSettings audioExportGcsDestination. + * @member {google.cloud.dialogflow.cx.v3beta1.IGcsDestination|null|undefined} audioExportGcsDestination + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.audioExportGcsDestination = null; + + /** + * AdvancedSettings speechSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null|undefined} speechSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.speechSettings = null; + + /** + * AdvancedSettings dtmfSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings|null|undefined} dtmfSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.dtmfSettings = null; + + /** + * AdvancedSettings loggingSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings|null|undefined} loggingSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @instance + */ + AdvancedSettings.prototype.loggingSettings = null; + + /** + * Creates a new AdvancedSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings} AdvancedSettings instance + */ + AdvancedSettings.create = function create(properties) { + return new AdvancedSettings(properties); + }; + + /** + * Encodes the specified AdvancedSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings} message AdvancedSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioExportGcsDestination != null && Object.hasOwnProperty.call(message, "audioExportGcsDestination")) + $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination.encode(message.audioExportGcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speechSettings != null && Object.hasOwnProperty.call(message, "speechSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.encode(message.speechSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dtmfSettings != null && Object.hasOwnProperty.call(message, "dtmfSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.encode(message.dtmfSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AdvancedSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings} message AdvancedSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings} AdvancedSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.speechSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.dtmfSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.loggingSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings} AdvancedSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioExportGcsDestination != null && message.hasOwnProperty("audioExportGcsDestination")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination.verify(message.audioExportGcsDestination, long + 1); + if (error) + return "audioExportGcsDestination." + error; + } + if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.verify(message.speechSettings, long + 1); + if (error) + return "speechSettings." + error; + } + if (message.dtmfSettings != null && message.hasOwnProperty("dtmfSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.verify(message.dtmfSettings, long + 1); + if (error) + return "dtmfSettings." + error; + } + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.verify(message.loggingSettings, long + 1); + if (error) + return "loggingSettings." + error; + } + return null; + }; + + /** + * Creates an AdvancedSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings} AdvancedSettings + */ + AdvancedSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings(); + if (object.audioExportGcsDestination != null) { + if (typeof object.audioExportGcsDestination !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.audioExportGcsDestination: object expected"); + message.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination.fromObject(object.audioExportGcsDestination, long + 1); + } + if (object.speechSettings != null) { + if (typeof object.speechSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.speechSettings: object expected"); + message.speechSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.fromObject(object.speechSettings, long + 1); + } + if (object.dtmfSettings != null) { + if (typeof object.dtmfSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.dtmfSettings: object expected"); + message.dtmfSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.fromObject(object.dtmfSettings, long + 1); + } + if (object.loggingSettings != null) { + if (typeof object.loggingSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.loggingSettings: object expected"); + message.loggingSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.fromObject(object.loggingSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AdvancedSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings} message AdvancedSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioExportGcsDestination = null; + object.speechSettings = null; + object.dtmfSettings = null; + object.loggingSettings = null; + } + if (message.audioExportGcsDestination != null && message.hasOwnProperty("audioExportGcsDestination")) + object.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination.toObject(message.audioExportGcsDestination, options); + if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) + object.speechSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.toObject(message.speechSettings, options); + if (message.dtmfSettings != null && message.hasOwnProperty("dtmfSettings")) + object.dtmfSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.toObject(message.dtmfSettings, options); + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) + object.loggingSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.toObject(message.loggingSettings, options); + return object; + }; + + /** + * Converts this AdvancedSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @instance + * @returns {Object.} JSON object + */ + AdvancedSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AdvancedSettings"; + }; + + AdvancedSettings.SpeechSettings = (function() { + + /** + * Properties of a SpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @interface ISpeechSettings + * @property {number|null} [endpointerSensitivity] SpeechSettings endpointerSensitivity + * @property {google.protobuf.IDuration|null} [noSpeechTimeout] SpeechSettings noSpeechTimeout + * @property {boolean|null} [useTimeoutBasedEndpointing] SpeechSettings useTimeoutBasedEndpointing + * @property {Object.|null} [models] SpeechSettings models + */ + + /** + * Constructs a new SpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @classdesc Represents a SpeechSettings. + * @implements ISpeechSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings=} [properties] Properties to set + */ + function SpeechSettings(properties) { + this.models = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechSettings endpointerSensitivity. + * @member {number} endpointerSensitivity + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.endpointerSensitivity = 0; + + /** + * SpeechSettings noSpeechTimeout. + * @member {google.protobuf.IDuration|null|undefined} noSpeechTimeout + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.noSpeechTimeout = null; + + /** + * SpeechSettings useTimeoutBasedEndpointing. + * @member {boolean} useTimeoutBasedEndpointing + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.useTimeoutBasedEndpointing = false; + + /** + * SpeechSettings models. + * @member {Object.} models + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @instance + */ + SpeechSettings.prototype.models = $util.emptyObject; + + /** + * Creates a new SpeechSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings} SpeechSettings instance + */ + SpeechSettings.create = function create(properties) { + return new SpeechSettings(properties); + }; + + /** + * Encodes the specified SpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings} message SpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpointerSensitivity != null && Object.hasOwnProperty.call(message, "endpointerSensitivity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.endpointerSensitivity); + if (message.noSpeechTimeout != null && Object.hasOwnProperty.call(message, "noSpeechTimeout")) + $root.google.protobuf.Duration.encode(message.noSpeechTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.useTimeoutBasedEndpointing != null && Object.hasOwnProperty.call(message, "useTimeoutBasedEndpointing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useTimeoutBasedEndpointing); + if (message.models != null && Object.hasOwnProperty.call(message, "models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings} message SpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings} SpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.endpointerSensitivity = reader.int32(); + break; + } + case 2: { + message.noSpeechTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.useTimeoutBasedEndpointing = reader.bool(); + break; + } + case 5: { + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.models, key); + message.models[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings} SpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.endpointerSensitivity != null && message.hasOwnProperty("endpointerSensitivity")) + if (!$util.isInteger(message.endpointerSensitivity)) + return "endpointerSensitivity: integer expected"; + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.noSpeechTimeout, long + 1); + if (error) + return "noSpeechTimeout." + error; + } + if (message.useTimeoutBasedEndpointing != null && message.hasOwnProperty("useTimeoutBasedEndpointing")) + if (typeof message.useTimeoutBasedEndpointing !== "boolean") + return "useTimeoutBasedEndpointing: boolean expected"; + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SpeechSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings} SpeechSettings + */ + SpeechSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings(); + if (object.endpointerSensitivity != null) + message.endpointerSensitivity = object.endpointerSensitivity | 0; + if (object.noSpeechTimeout != null) { + if (typeof object.noSpeechTimeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.noSpeechTimeout: object expected"); + message.noSpeechTimeout = $root.google.protobuf.Duration.fromObject(object.noSpeechTimeout, long + 1); + } + if (object.useTimeoutBasedEndpointing != null) + message.useTimeoutBasedEndpointing = Boolean(object.useTimeoutBasedEndpointing); + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.models, keys[i]); + message.models[keys[i]] = String(object.models[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings} message SpeechSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.models = {}; + if (options.defaults) { + object.endpointerSensitivity = 0; + object.noSpeechTimeout = null; + object.useTimeoutBasedEndpointing = false; + } + if (message.endpointerSensitivity != null && message.hasOwnProperty("endpointerSensitivity")) + object.endpointerSensitivity = message.endpointerSensitivity; + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) + object.noSpeechTimeout = $root.google.protobuf.Duration.toObject(message.noSpeechTimeout, options); + if (message.useTimeoutBasedEndpointing != null && message.hasOwnProperty("useTimeoutBasedEndpointing")) + object.useTimeoutBasedEndpointing = message.useTimeoutBasedEndpointing; + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.models, keys2[j]); + object.models[keys2[j]] = message.models[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this SpeechSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @instance + * @returns {Object.} JSON object + */ + SpeechSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings"; + }; + + return SpeechSettings; + })(); + + AdvancedSettings.DtmfSettings = (function() { + + /** + * Properties of a DtmfSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @interface IDtmfSettings + * @property {boolean|null} [enabled] DtmfSettings enabled + * @property {number|null} [maxDigits] DtmfSettings maxDigits + * @property {string|null} [finishDigit] DtmfSettings finishDigit + * @property {google.protobuf.IDuration|null} [interdigitTimeoutDuration] DtmfSettings interdigitTimeoutDuration + * @property {google.protobuf.IDuration|null} [endpointingTimeoutDuration] DtmfSettings endpointingTimeoutDuration + */ + + /** + * Constructs a new DtmfSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @classdesc Represents a DtmfSettings. + * @implements IDtmfSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings=} [properties] Properties to set + */ + function DtmfSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DtmfSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.enabled = false; + + /** + * DtmfSettings maxDigits. + * @member {number} maxDigits + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.maxDigits = 0; + + /** + * DtmfSettings finishDigit. + * @member {string} finishDigit + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.finishDigit = ""; + + /** + * DtmfSettings interdigitTimeoutDuration. + * @member {google.protobuf.IDuration|null|undefined} interdigitTimeoutDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.interdigitTimeoutDuration = null; + + /** + * DtmfSettings endpointingTimeoutDuration. + * @member {google.protobuf.IDuration|null|undefined} endpointingTimeoutDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.endpointingTimeoutDuration = null; + + /** + * Creates a new DtmfSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings} DtmfSettings instance + */ + DtmfSettings.create = function create(properties) { + return new DtmfSettings(properties); + }; + + /** + * Encodes the specified DtmfSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings} message DtmfSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.maxDigits != null && Object.hasOwnProperty.call(message, "maxDigits")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDigits); + if (message.finishDigit != null && Object.hasOwnProperty.call(message, "finishDigit")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.finishDigit); + if (message.interdigitTimeoutDuration != null && Object.hasOwnProperty.call(message, "interdigitTimeoutDuration")) + $root.google.protobuf.Duration.encode(message.interdigitTimeoutDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endpointingTimeoutDuration != null && Object.hasOwnProperty.call(message, "endpointingTimeoutDuration")) + $root.google.protobuf.Duration.encode(message.endpointingTimeoutDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DtmfSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.IDtmfSettings} message DtmfSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings} DtmfSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.maxDigits = reader.int32(); + break; + } + case 3: { + message.finishDigit = reader.string(); + break; + } + case 6: { + message.interdigitTimeoutDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.endpointingTimeoutDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DtmfSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings} DtmfSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DtmfSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DtmfSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.maxDigits != null && message.hasOwnProperty("maxDigits")) + if (!$util.isInteger(message.maxDigits)) + return "maxDigits: integer expected"; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + if (!$util.isString(message.finishDigit)) + return "finishDigit: string expected"; + if (message.interdigitTimeoutDuration != null && message.hasOwnProperty("interdigitTimeoutDuration")) { + var error = $root.google.protobuf.Duration.verify(message.interdigitTimeoutDuration, long + 1); + if (error) + return "interdigitTimeoutDuration." + error; + } + if (message.endpointingTimeoutDuration != null && message.hasOwnProperty("endpointingTimeoutDuration")) { + var error = $root.google.protobuf.Duration.verify(message.endpointingTimeoutDuration, long + 1); + if (error) + return "endpointingTimeoutDuration." + error; + } + return null; + }; + + /** + * Creates a DtmfSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings} DtmfSettings + */ + DtmfSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.maxDigits != null) + message.maxDigits = object.maxDigits | 0; + if (object.finishDigit != null) + message.finishDigit = String(object.finishDigit); + if (object.interdigitTimeoutDuration != null) { + if (typeof object.interdigitTimeoutDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.interdigitTimeoutDuration: object expected"); + message.interdigitTimeoutDuration = $root.google.protobuf.Duration.fromObject(object.interdigitTimeoutDuration, long + 1); + } + if (object.endpointingTimeoutDuration != null) { + if (typeof object.endpointingTimeoutDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.endpointingTimeoutDuration: object expected"); + message.endpointingTimeoutDuration = $root.google.protobuf.Duration.fromObject(object.endpointingTimeoutDuration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DtmfSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings} message DtmfSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DtmfSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.maxDigits = 0; + object.finishDigit = ""; + object.interdigitTimeoutDuration = null; + object.endpointingTimeoutDuration = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.maxDigits != null && message.hasOwnProperty("maxDigits")) + object.maxDigits = message.maxDigits; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + object.finishDigit = message.finishDigit; + if (message.interdigitTimeoutDuration != null && message.hasOwnProperty("interdigitTimeoutDuration")) + object.interdigitTimeoutDuration = $root.google.protobuf.Duration.toObject(message.interdigitTimeoutDuration, options); + if (message.endpointingTimeoutDuration != null && message.hasOwnProperty("endpointingTimeoutDuration")) + object.endpointingTimeoutDuration = $root.google.protobuf.Duration.toObject(message.endpointingTimeoutDuration, options); + return object; + }; + + /** + * Converts this DtmfSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + * @returns {Object.} JSON object + */ + DtmfSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DtmfSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DtmfSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings"; + }; + + return DtmfSettings; + })(); + + AdvancedSettings.LoggingSettings = (function() { + + /** + * Properties of a LoggingSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @interface ILoggingSettings + * @property {boolean|null} [enableStackdriverLogging] LoggingSettings enableStackdriverLogging + * @property {boolean|null} [enableInteractionLogging] LoggingSettings enableInteractionLogging + * @property {boolean|null} [enableConsentBasedRedaction] LoggingSettings enableConsentBasedRedaction + */ + + /** + * Constructs a new LoggingSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings + * @classdesc Represents a LoggingSettings. + * @implements ILoggingSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings=} [properties] Properties to set + */ + function LoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingSettings enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @instance + */ + LoggingSettings.prototype.enableStackdriverLogging = false; + + /** + * LoggingSettings enableInteractionLogging. + * @member {boolean} enableInteractionLogging + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @instance + */ + LoggingSettings.prototype.enableInteractionLogging = false; + + /** + * LoggingSettings enableConsentBasedRedaction. + * @member {boolean} enableConsentBasedRedaction + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @instance + */ + LoggingSettings.prototype.enableConsentBasedRedaction = false; + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings} LoggingSettings instance + */ + LoggingSettings.create = function create(properties) { + return new LoggingSettings(properties); + }; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableStackdriverLogging); + if (message.enableInteractionLogging != null && Object.hasOwnProperty.call(message, "enableInteractionLogging")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableInteractionLogging); + if (message.enableConsentBasedRedaction != null && Object.hasOwnProperty.call(message, "enableConsentBasedRedaction")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableConsentBasedRedaction); + return writer; + }; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.enableStackdriverLogging = reader.bool(); + break; + } + case 3: { + message.enableInteractionLogging = reader.bool(); + break; + } + case 4: { + message.enableConsentBasedRedaction = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; + if (message.enableInteractionLogging != null && message.hasOwnProperty("enableInteractionLogging")) + if (typeof message.enableInteractionLogging !== "boolean") + return "enableInteractionLogging: boolean expected"; + if (message.enableConsentBasedRedaction != null && message.hasOwnProperty("enableConsentBasedRedaction")) + if (typeof message.enableConsentBasedRedaction !== "boolean") + return "enableConsentBasedRedaction: boolean expected"; + return null; + }; + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings} LoggingSettings + */ + LoggingSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings(); + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); + if (object.enableInteractionLogging != null) + message.enableInteractionLogging = Boolean(object.enableInteractionLogging); + if (object.enableConsentBasedRedaction != null) + message.enableConsentBasedRedaction = Boolean(object.enableConsentBasedRedaction); + return message; + }; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings} message LoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableStackdriverLogging = false; + object.enableInteractionLogging = false; + object.enableConsentBasedRedaction = false; + } + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; + if (message.enableInteractionLogging != null && message.hasOwnProperty("enableInteractionLogging")) + object.enableInteractionLogging = message.enableInteractionLogging; + if (message.enableConsentBasedRedaction != null && message.hasOwnProperty("enableConsentBasedRedaction")) + object.enableConsentBasedRedaction = message.enableConsentBasedRedaction; + return object; + }; + + /** + * Converts this LoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @instance + * @returns {Object.} JSON object + */ + LoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.LoggingSettings"; + }; + + return LoggingSettings; + })(); + + return AdvancedSettings; + })(); + + v3beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v3beta1.Agents = (function() { + + /** + * Constructs a new Agents service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Agents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Agents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Agents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Agents; + + /** + * Creates new Agents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Agents} RPC service. Useful where requests and/or responses are streamed. + */ + Agents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|listAgents}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef ListAgentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} [response] ListAgentsResponse + */ + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest} request ListAgentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.ListAgentsCallback} callback Node-style callback called with the error, if any, and ListAgentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.listAgents = function listAgents(request, callback) { + return this.rpcCall(listAgents, $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse, request, callback); + }, "name", { value: "ListAgents" }); + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest} request ListAgentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|getAgent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef GetAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Agent} [response] Agent + */ + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest} request GetAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getAgent = function getAgent(request, callback) { + return this.rpcCall(getAgent, $root.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Agent, request, callback); + }, "name", { value: "GetAgent" }); + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest} request GetAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|createAgent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef CreateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Agent} [response] Agent + */ + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.createAgent = function createAgent(request, callback) { + return this.rpcCall(createAgent, $root.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Agent, request, callback); + }, "name", { value: "CreateAgent" }); + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|updateAgent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef UpdateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Agent} [response] Agent + */ + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.updateAgent = function updateAgent(request, callback) { + return this.rpcCall(updateAgent, $root.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Agent, request, callback); + }, "name", { value: "UpdateAgent" }); + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|deleteAgent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef DeleteAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.deleteAgent = function deleteAgent(request, callback) { + return this.rpcCall(deleteAgent, $root.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgent" }); + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|exportAgent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef ExportAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAgent. + * @function exportAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest} request ExportAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.exportAgent = function exportAgent(request, callback) { + return this.rpcCall(exportAgent, $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAgent" }); + + /** + * Calls ExportAgent. + * @function exportAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest} request ExportAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|restoreAgent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef RestoreAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreAgent. + * @function restoreAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest} request RestoreAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.restoreAgent = function restoreAgent(request, callback) { + return this.rpcCall(restoreAgent, $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreAgent" }); + + /** + * Calls RestoreAgent. + * @function restoreAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest} request RestoreAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|validateAgent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef ValidateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.AgentValidationResult} [response] AgentValidationResult + */ + + /** + * Calls ValidateAgent. + * @function validateAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest} request ValidateAgentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.ValidateAgentCallback} callback Node-style callback called with the error, if any, and AgentValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.validateAgent = function validateAgent(request, callback) { + return this.rpcCall(validateAgent, $root.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest, $root.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult, request, callback); + }, "name", { value: "ValidateAgent" }); + + /** + * Calls ValidateAgent. + * @function validateAgent + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest} request ValidateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|getAgentValidationResult}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef GetAgentValidationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.AgentValidationResult} [response] AgentValidationResult + */ + + /** + * Calls GetAgentValidationResult. + * @function getAgentValidationResult + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest} request GetAgentValidationResultRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentValidationResultCallback} callback Node-style callback called with the error, if any, and AgentValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getAgentValidationResult = function getAgentValidationResult(request, callback) { + return this.rpcCall(getAgentValidationResult, $root.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest, $root.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult, request, callback); + }, "name", { value: "GetAgentValidationResult" }); + + /** + * Calls GetAgentValidationResult. + * @function getAgentValidationResult + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest} request GetAgentValidationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|getGenerativeSettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef GetGenerativeSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} [response] GenerativeSettings + */ + + /** + * Calls GetGenerativeSettings. + * @function getGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest} request GetGenerativeSettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.GetGenerativeSettingsCallback} callback Node-style callback called with the error, if any, and GenerativeSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getGenerativeSettings = function getGenerativeSettings(request, callback) { + return this.rpcCall(getGenerativeSettings, $root.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings, request, callback); + }, "name", { value: "GetGenerativeSettings" }); + + /** + * Calls GetGenerativeSettings. + * @function getGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest} request GetGenerativeSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Agents|updateGenerativeSettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @typedef UpdateGenerativeSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} [response] GenerativeSettings + */ + + /** + * Calls UpdateGenerativeSettings. + * @function updateGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest} request UpdateGenerativeSettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Agents.UpdateGenerativeSettingsCallback} callback Node-style callback called with the error, if any, and GenerativeSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.updateGenerativeSettings = function updateGenerativeSettings(request, callback) { + return this.rpcCall(updateGenerativeSettings, $root.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings, request, callback); + }, "name", { value: "UpdateGenerativeSettings" }); + + /** + * Calls UpdateGenerativeSettings. + * @function updateGenerativeSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest} request UpdateGenerativeSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Agents; + })(); + + v3beta1.SpeechToTextSettings = (function() { + + /** + * Properties of a SpeechToTextSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISpeechToTextSettings + * @property {boolean|null} [enableSpeechAdaptation] SpeechToTextSettings enableSpeechAdaptation + */ + + /** + * Constructs a new SpeechToTextSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SpeechToTextSettings. + * @implements ISpeechToTextSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings=} [properties] Properties to set + */ + function SpeechToTextSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechToTextSettings enableSpeechAdaptation. + * @member {boolean} enableSpeechAdaptation + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @instance + */ + SpeechToTextSettings.prototype.enableSpeechAdaptation = false; + + /** + * Creates a new SpeechToTextSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings} SpeechToTextSettings instance + */ + SpeechToTextSettings.create = function create(properties) { + return new SpeechToTextSettings(properties); + }; + + /** + * Encodes the specified SpeechToTextSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings} message SpeechToTextSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSpeechAdaptation != null && Object.hasOwnProperty.call(message, "enableSpeechAdaptation")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeechAdaptation); + return writer; + }; + + /** + * Encodes the specified SpeechToTextSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings} message SpeechToTextSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings} SpeechToTextSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableSpeechAdaptation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechToTextSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings} SpeechToTextSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechToTextSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechToTextSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableSpeechAdaptation != null && message.hasOwnProperty("enableSpeechAdaptation")) + if (typeof message.enableSpeechAdaptation !== "boolean") + return "enableSpeechAdaptation: boolean expected"; + return null; + }; + + /** + * Creates a SpeechToTextSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings} SpeechToTextSettings + */ + SpeechToTextSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings(); + if (object.enableSpeechAdaptation != null) + message.enableSpeechAdaptation = Boolean(object.enableSpeechAdaptation); + return message; + }; + + /** + * Creates a plain object from a SpeechToTextSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings} message SpeechToTextSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechToTextSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableSpeechAdaptation = false; + if (message.enableSpeechAdaptation != null && message.hasOwnProperty("enableSpeechAdaptation")) + object.enableSpeechAdaptation = message.enableSpeechAdaptation; + return object; + }; + + /** + * Converts this SpeechToTextSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @instance + * @returns {Object.} JSON object + */ + SpeechToTextSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechToTextSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechToTextSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings"; + }; + + return SpeechToTextSettings; + })(); + + v3beta1.Agent = (function() { + + /** + * Properties of an Agent. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IAgent + * @property {string|null} [name] Agent name + * @property {string|null} [displayName] Agent displayName + * @property {string|null} [defaultLanguageCode] Agent defaultLanguageCode + * @property {Array.|null} [supportedLanguageCodes] Agent supportedLanguageCodes + * @property {string|null} [timeZone] Agent timeZone + * @property {string|null} [description] Agent description + * @property {string|null} [avatarUri] Agent avatarUri + * @property {google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings|null} [speechToTextSettings] Agent speechToTextSettings + * @property {string|null} [startFlow] Agent startFlow + * @property {string|null} [startPlaybook] Agent startPlaybook + * @property {string|null} [securitySettings] Agent securitySettings + * @property {boolean|null} [enableStackdriverLogging] Agent enableStackdriverLogging + * @property {boolean|null} [enableSpellCorrection] Agent enableSpellCorrection + * @property {boolean|null} [enableMultiLanguageTraining] Agent enableMultiLanguageTraining + * @property {boolean|null} [locked] Agent locked + * @property {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null} [advancedSettings] Agent advancedSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings|null} [gitIntegrationSettings] Agent gitIntegrationSettings + * @property {google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings|null} [bigqueryExportSettings] Agent bigqueryExportSettings + * @property {google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings|null} [textToSpeechSettings] Agent textToSpeechSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings|null} [genAppBuilderSettings] Agent genAppBuilderSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings|null} [answerFeedbackSettings] Agent answerFeedbackSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings|null} [personalizationSettings] Agent personalizationSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings|null} [clientCertificateSettings] Agent clientCertificateSettings + * @property {boolean|null} [satisfiesPzs] Agent satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Agent satisfiesPzi + */ + + /** + * Constructs a new Agent. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Agent. + * @implements IAgent + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IAgent=} [properties] Properties to set + */ + function Agent(properties) { + this.supportedLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Agent name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.name = ""; + + /** + * Agent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.displayName = ""; + + /** + * Agent defaultLanguageCode. + * @member {string} defaultLanguageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.defaultLanguageCode = ""; + + /** + * Agent supportedLanguageCodes. + * @member {Array.} supportedLanguageCodes + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.supportedLanguageCodes = $util.emptyArray; + + /** + * Agent timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.timeZone = ""; + + /** + * Agent description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.description = ""; + + /** + * Agent avatarUri. + * @member {string} avatarUri + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.avatarUri = ""; + + /** + * Agent speechToTextSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings|null|undefined} speechToTextSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.speechToTextSettings = null; + + /** + * Agent startFlow. + * @member {string|null|undefined} startFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.startFlow = null; + + /** + * Agent startPlaybook. + * @member {string|null|undefined} startPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.startPlaybook = null; + + /** + * Agent securitySettings. + * @member {string} securitySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.securitySettings = ""; + + /** + * Agent enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.enableStackdriverLogging = false; + + /** + * Agent enableSpellCorrection. + * @member {boolean} enableSpellCorrection + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.enableSpellCorrection = false; + + /** + * Agent enableMultiLanguageTraining. + * @member {boolean} enableMultiLanguageTraining + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.enableMultiLanguageTraining = false; + + /** + * Agent locked. + * @member {boolean} locked + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.locked = false; + + /** + * Agent advancedSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.advancedSettings = null; + + /** + * Agent gitIntegrationSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings|null|undefined} gitIntegrationSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.gitIntegrationSettings = null; + + /** + * Agent bigqueryExportSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings|null|undefined} bigqueryExportSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.bigqueryExportSettings = null; + + /** + * Agent textToSpeechSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings|null|undefined} textToSpeechSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.textToSpeechSettings = null; + + /** + * Agent genAppBuilderSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings|null|undefined} genAppBuilderSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.genAppBuilderSettings = null; + + /** + * Agent answerFeedbackSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings|null|undefined} answerFeedbackSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.answerFeedbackSettings = null; + + /** + * Agent personalizationSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings|null|undefined} personalizationSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.personalizationSettings = null; + + /** + * Agent clientCertificateSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings|null|undefined} clientCertificateSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.clientCertificateSettings = null; + + /** + * Agent satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.satisfiesPzs = null; + + /** + * Agent satisfiesPzi. + * @member {boolean|null|undefined} satisfiesPzi + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Agent.prototype.satisfiesPzi = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Agent sessionEntryResource. + * @member {"startFlow"|"startPlaybook"|undefined} sessionEntryResource + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Object.defineProperty(Agent.prototype, "sessionEntryResource", { + get: $util.oneOfGetter($oneOfFields = ["startFlow", "startPlaybook"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Agent.prototype, "_genAppBuilderSettings", { + get: $util.oneOfGetter($oneOfFields = ["genAppBuilderSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Agent.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Agent.prototype, "_satisfiesPzi", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Agent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent} Agent instance + */ + Agent.create = function create(properties) { + return new Agent(properties); + }; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultLanguageCode); + if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.supportedLanguageCodes[i]); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.avatarUri != null && Object.hasOwnProperty.call(message, "avatarUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.avatarUri); + if (message.speechToTextSettings != null && Object.hasOwnProperty.call(message, "speechToTextSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.encode(message.speechToTextSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.startFlow != null && Object.hasOwnProperty.call(message, "startFlow")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.startFlow); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.securitySettings); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableStackdriverLogging); + if (message.enableSpellCorrection != null && Object.hasOwnProperty.call(message, "enableSpellCorrection")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.enableSpellCorrection); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.locked); + if (message.bigqueryExportSettings != null && Object.hasOwnProperty.call(message, "bigqueryExportSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.encode(message.bigqueryExportSettings, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.gitIntegrationSettings != null && Object.hasOwnProperty.call(message, "gitIntegrationSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.encode(message.gitIntegrationSettings, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.textToSpeechSettings != null && Object.hasOwnProperty.call(message, "textToSpeechSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.encode(message.textToSpeechSettings, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.genAppBuilderSettings != null && Object.hasOwnProperty.call(message, "genAppBuilderSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.encode(message.genAppBuilderSettings, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.answerFeedbackSettings != null && Object.hasOwnProperty.call(message, "answerFeedbackSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.encode(message.answerFeedbackSettings, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.startPlaybook != null && Object.hasOwnProperty.call(message, "startPlaybook")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.startPlaybook); + if (message.enableMultiLanguageTraining != null && Object.hasOwnProperty.call(message, "enableMultiLanguageTraining")) + writer.uint32(/* id 40, wireType 0 =*/320).bool(message.enableMultiLanguageTraining); + if (message.personalizationSettings != null && Object.hasOwnProperty.call(message, "personalizationSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.encode(message.personalizationSettings, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.clientCertificateSettings != null && Object.hasOwnProperty.call(message, "clientCertificateSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.encode(message.clientCertificateSettings, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 45, wireType 0 =*/360).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 46, wireType 0 =*/368).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.defaultLanguageCode = reader.string(); + break; + } + case 4: { + if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) + message.supportedLanguageCodes = []; + message.supportedLanguageCodes.push(reader.string()); + break; + } + case 5: { + message.timeZone = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.avatarUri = reader.string(); + break; + } + case 13: { + message.speechToTextSettings = $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.startFlow = reader.string(); + break; + } + case 39: { + message.startPlaybook = reader.string(); + break; + } + case 17: { + message.securitySettings = reader.string(); + break; + } + case 18: { + message.enableStackdriverLogging = reader.bool(); + break; + } + case 20: { + message.enableSpellCorrection = reader.bool(); + break; + } + case 40: { + message.enableMultiLanguageTraining = reader.bool(); + break; + } + case 27: { + message.locked = reader.bool(); + break; + } + case 22: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.gitIntegrationSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 29: { + message.bigqueryExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.textToSpeechSettings = $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.genAppBuilderSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 38: { + message.answerFeedbackSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 42: { + message.personalizationSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 43: { + message.clientCertificateSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 45: { + message.satisfiesPzs = reader.bool(); + break; + } + case 46: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Agent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Agent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + if (!$util.isString(message.defaultLanguageCode)) + return "defaultLanguageCode: string expected"; + if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { + if (!Array.isArray(message.supportedLanguageCodes)) + return "supportedLanguageCodes: array expected"; + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + if (!$util.isString(message.supportedLanguageCodes[i])) + return "supportedLanguageCodes: string[] expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) + if (!$util.isString(message.avatarUri)) + return "avatarUri: string expected"; + if (message.speechToTextSettings != null && message.hasOwnProperty("speechToTextSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.verify(message.speechToTextSettings, long + 1); + if (error) + return "speechToTextSettings." + error; + } + if (message.startFlow != null && message.hasOwnProperty("startFlow")) { + properties.sessionEntryResource = 1; + if (!$util.isString(message.startFlow)) + return "startFlow: string expected"; + } + if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) { + if (properties.sessionEntryResource === 1) + return "sessionEntryResource: multiple values"; + properties.sessionEntryResource = 1; + if (!$util.isString(message.startPlaybook)) + return "startPlaybook: string expected"; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + if (!$util.isString(message.securitySettings)) + return "securitySettings: string expected"; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; + if (message.enableSpellCorrection != null && message.hasOwnProperty("enableSpellCorrection")) + if (typeof message.enableSpellCorrection !== "boolean") + return "enableSpellCorrection: boolean expected"; + if (message.enableMultiLanguageTraining != null && message.hasOwnProperty("enableMultiLanguageTraining")) + if (typeof message.enableMultiLanguageTraining !== "boolean") + return "enableMultiLanguageTraining: boolean expected"; + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.gitIntegrationSettings != null && message.hasOwnProperty("gitIntegrationSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.verify(message.gitIntegrationSettings, long + 1); + if (error) + return "gitIntegrationSettings." + error; + } + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.verify(message.bigqueryExportSettings, long + 1); + if (error) + return "bigqueryExportSettings." + error; + } + if (message.textToSpeechSettings != null && message.hasOwnProperty("textToSpeechSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.verify(message.textToSpeechSettings, long + 1); + if (error) + return "textToSpeechSettings." + error; + } + if (message.genAppBuilderSettings != null && message.hasOwnProperty("genAppBuilderSettings")) { + properties._genAppBuilderSettings = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.verify(message.genAppBuilderSettings, long + 1); + if (error) + return "genAppBuilderSettings." + error; + } + } + if (message.answerFeedbackSettings != null && message.hasOwnProperty("answerFeedbackSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.verify(message.answerFeedbackSettings, long + 1); + if (error) + return "answerFeedbackSettings." + error; + } + if (message.personalizationSettings != null && message.hasOwnProperty("personalizationSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.verify(message.personalizationSettings, long + 1); + if (error) + return "personalizationSettings." + error; + } + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.verify(message.clientCertificateSettings, long + 1); + if (error) + return "clientCertificateSettings." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + properties._satisfiesPzi = 1; + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + } + return null; + }; + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent} Agent + */ + Agent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.defaultLanguageCode != null) + message.defaultLanguageCode = String(object.defaultLanguageCode); + if (object.supportedLanguageCodes) { + if (!Array.isArray(object.supportedLanguageCodes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.supportedLanguageCodes: array expected"); + message.supportedLanguageCodes = []; + for (var i = 0; i < object.supportedLanguageCodes.length; ++i) + message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.description != null) + message.description = String(object.description); + if (object.avatarUri != null) + message.avatarUri = String(object.avatarUri); + if (object.speechToTextSettings != null) { + if (typeof object.speechToTextSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.speechToTextSettings: object expected"); + message.speechToTextSettings = $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.fromObject(object.speechToTextSettings, long + 1); + } + if (object.startFlow != null) + message.startFlow = String(object.startFlow); + if (object.startPlaybook != null) + message.startPlaybook = String(object.startPlaybook); + if (object.securitySettings != null) + message.securitySettings = String(object.securitySettings); + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); + if (object.enableSpellCorrection != null) + message.enableSpellCorrection = Boolean(object.enableSpellCorrection); + if (object.enableMultiLanguageTraining != null) + message.enableMultiLanguageTraining = Boolean(object.enableMultiLanguageTraining); + if (object.locked != null) + message.locked = Boolean(object.locked); + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.gitIntegrationSettings != null) { + if (typeof object.gitIntegrationSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.gitIntegrationSettings: object expected"); + message.gitIntegrationSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.fromObject(object.gitIntegrationSettings, long + 1); + } + if (object.bigqueryExportSettings != null) { + if (typeof object.bigqueryExportSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.bigqueryExportSettings: object expected"); + message.bigqueryExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.fromObject(object.bigqueryExportSettings, long + 1); + } + if (object.textToSpeechSettings != null) { + if (typeof object.textToSpeechSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.textToSpeechSettings: object expected"); + message.textToSpeechSettings = $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.fromObject(object.textToSpeechSettings, long + 1); + } + if (object.genAppBuilderSettings != null) { + if (typeof object.genAppBuilderSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.genAppBuilderSettings: object expected"); + message.genAppBuilderSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.fromObject(object.genAppBuilderSettings, long + 1); + } + if (object.answerFeedbackSettings != null) { + if (typeof object.answerFeedbackSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.answerFeedbackSettings: object expected"); + message.answerFeedbackSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.fromObject(object.answerFeedbackSettings, long + 1); + } + if (object.personalizationSettings != null) { + if (typeof object.personalizationSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.personalizationSettings: object expected"); + message.personalizationSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.fromObject(object.personalizationSettings, long + 1); + } + if (object.clientCertificateSettings != null) { + if (typeof object.clientCertificateSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.clientCertificateSettings: object expected"); + message.clientCertificateSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.fromObject(object.clientCertificateSettings, long + 1); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent} message Agent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Agent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedLanguageCodes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.defaultLanguageCode = ""; + object.timeZone = ""; + object.description = ""; + object.avatarUri = ""; + object.speechToTextSettings = null; + object.securitySettings = ""; + object.enableStackdriverLogging = false; + object.enableSpellCorrection = false; + object.advancedSettings = null; + object.locked = false; + object.bigqueryExportSettings = null; + object.gitIntegrationSettings = null; + object.textToSpeechSettings = null; + object.answerFeedbackSettings = null; + object.enableMultiLanguageTraining = false; + object.personalizationSettings = null; + object.clientCertificateSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + object.defaultLanguageCode = message.defaultLanguageCode; + if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { + object.supportedLanguageCodes = []; + for (var j = 0; j < message.supportedLanguageCodes.length; ++j) + object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) + object.avatarUri = message.avatarUri; + if (message.speechToTextSettings != null && message.hasOwnProperty("speechToTextSettings")) + object.speechToTextSettings = $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.toObject(message.speechToTextSettings, options); + if (message.startFlow != null && message.hasOwnProperty("startFlow")) { + object.startFlow = message.startFlow; + if (options.oneofs) + object.sessionEntryResource = "startFlow"; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = message.securitySettings; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; + if (message.enableSpellCorrection != null && message.hasOwnProperty("enableSpellCorrection")) + object.enableSpellCorrection = message.enableSpellCorrection; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) + object.bigqueryExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.toObject(message.bigqueryExportSettings, options); + if (message.gitIntegrationSettings != null && message.hasOwnProperty("gitIntegrationSettings")) + object.gitIntegrationSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.toObject(message.gitIntegrationSettings, options); + if (message.textToSpeechSettings != null && message.hasOwnProperty("textToSpeechSettings")) + object.textToSpeechSettings = $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.toObject(message.textToSpeechSettings, options); + if (message.genAppBuilderSettings != null && message.hasOwnProperty("genAppBuilderSettings")) { + object.genAppBuilderSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.toObject(message.genAppBuilderSettings, options); + if (options.oneofs) + object._genAppBuilderSettings = "genAppBuilderSettings"; + } + if (message.answerFeedbackSettings != null && message.hasOwnProperty("answerFeedbackSettings")) + object.answerFeedbackSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.toObject(message.answerFeedbackSettings, options); + if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) { + object.startPlaybook = message.startPlaybook; + if (options.oneofs) + object.sessionEntryResource = "startPlaybook"; + } + if (message.enableMultiLanguageTraining != null && message.hasOwnProperty("enableMultiLanguageTraining")) + object.enableMultiLanguageTraining = message.enableMultiLanguageTraining; + if (message.personalizationSettings != null && message.hasOwnProperty("personalizationSettings")) + object.personalizationSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.toObject(message.personalizationSettings, options); + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) + object.clientCertificateSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.toObject(message.clientCertificateSettings, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + object.satisfiesPzi = message.satisfiesPzi; + if (options.oneofs) + object._satisfiesPzi = "satisfiesPzi"; + } + return object; + }; + + /** + * Converts this Agent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + * @returns {Object.} JSON object + */ + Agent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Agent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Agent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent"; + }; + + Agent.GitIntegrationSettings = (function() { + + /** + * Properties of a GitIntegrationSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @interface IGitIntegrationSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings|null} [githubSettings] GitIntegrationSettings githubSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings|null} [gitConnectionSettings] GitIntegrationSettings gitConnectionSettings + */ + + /** + * Constructs a new GitIntegrationSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @classdesc Represents a GitIntegrationSettings. + * @implements IGitIntegrationSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings=} [properties] Properties to set + */ + function GitIntegrationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitIntegrationSettings githubSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings|null|undefined} githubSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @instance + */ + GitIntegrationSettings.prototype.githubSettings = null; + + /** + * GitIntegrationSettings gitConnectionSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings|null|undefined} gitConnectionSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @instance + */ + GitIntegrationSettings.prototype.gitConnectionSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GitIntegrationSettings gitSettings. + * @member {"githubSettings"|"gitConnectionSettings"|undefined} gitSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @instance + */ + Object.defineProperty(GitIntegrationSettings.prototype, "gitSettings", { + get: $util.oneOfGetter($oneOfFields = ["githubSettings", "gitConnectionSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GitIntegrationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings} GitIntegrationSettings instance + */ + GitIntegrationSettings.create = function create(properties) { + return new GitIntegrationSettings(properties); + }; + + /** + * Encodes the specified GitIntegrationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings} message GitIntegrationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitIntegrationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.githubSettings != null && Object.hasOwnProperty.call(message, "githubSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.encode(message.githubSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gitConnectionSettings != null && Object.hasOwnProperty.call(message, "gitConnectionSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.encode(message.gitConnectionSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GitIntegrationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGitIntegrationSettings} message GitIntegrationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitIntegrationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings} GitIntegrationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitIntegrationSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.githubSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.gitConnectionSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GitIntegrationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings} GitIntegrationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitIntegrationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitIntegrationSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitIntegrationSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.githubSettings != null && message.hasOwnProperty("githubSettings")) { + properties.gitSettings = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.verify(message.githubSettings, long + 1); + if (error) + return "githubSettings." + error; + } + } + if (message.gitConnectionSettings != null && message.hasOwnProperty("gitConnectionSettings")) { + if (properties.gitSettings === 1) + return "gitSettings: multiple values"; + properties.gitSettings = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.verify(message.gitConnectionSettings, long + 1); + if (error) + return "gitConnectionSettings." + error; + } + } + return null; + }; + + /** + * Creates a GitIntegrationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings} GitIntegrationSettings + */ + GitIntegrationSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings(); + if (object.githubSettings != null) { + if (typeof object.githubSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.githubSettings: object expected"); + message.githubSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.fromObject(object.githubSettings, long + 1); + } + if (object.gitConnectionSettings != null) { + if (typeof object.gitConnectionSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.gitConnectionSettings: object expected"); + message.gitConnectionSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.fromObject(object.gitConnectionSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GitIntegrationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings} message GitIntegrationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitIntegrationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.githubSettings != null && message.hasOwnProperty("githubSettings")) { + object.githubSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.toObject(message.githubSettings, options); + if (options.oneofs) + object.gitSettings = "githubSettings"; + } + if (message.gitConnectionSettings != null && message.hasOwnProperty("gitConnectionSettings")) { + object.gitConnectionSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.toObject(message.gitConnectionSettings, options); + if (options.oneofs) + object.gitSettings = "gitConnectionSettings"; + } + return object; + }; + + /** + * Converts this GitIntegrationSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @instance + * @returns {Object.} JSON object + */ + GitIntegrationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitIntegrationSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitIntegrationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings"; + }; + + GitIntegrationSettings.GithubSettings = (function() { + + /** + * Properties of a GithubSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @interface IGithubSettings + * @property {string|null} [displayName] GithubSettings displayName + * @property {string|null} [repositoryUri] GithubSettings repositoryUri + * @property {string|null} [trackingBranch] GithubSettings trackingBranch + * @property {string|null} [accessToken] GithubSettings accessToken + * @property {Array.|null} [branches] GithubSettings branches + */ + + /** + * Constructs a new GithubSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @classdesc Represents a GithubSettings. + * @implements IGithubSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings=} [properties] Properties to set + */ + function GithubSettings(properties) { + this.branches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GithubSettings displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.displayName = ""; + + /** + * GithubSettings repositoryUri. + * @member {string} repositoryUri + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.repositoryUri = ""; + + /** + * GithubSettings trackingBranch. + * @member {string} trackingBranch + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.trackingBranch = ""; + + /** + * GithubSettings accessToken. + * @member {string} accessToken + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.accessToken = ""; + + /** + * GithubSettings branches. + * @member {Array.} branches + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @instance + */ + GithubSettings.prototype.branches = $util.emptyArray; + + /** + * Creates a new GithubSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings} GithubSettings instance + */ + GithubSettings.create = function create(properties) { + return new GithubSettings(properties); + }; + + /** + * Encodes the specified GithubSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings} message GithubSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GithubSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.repositoryUri != null && Object.hasOwnProperty.call(message, "repositoryUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.repositoryUri); + if (message.trackingBranch != null && Object.hasOwnProperty.call(message, "trackingBranch")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.trackingBranch); + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.accessToken); + if (message.branches != null && message.branches.length) + for (var i = 0; i < message.branches.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.branches[i]); + return writer; + }; + + /** + * Encodes the specified GithubSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGithubSettings} message GithubSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GithubSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GithubSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings} GithubSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GithubSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.repositoryUri = reader.string(); + break; + } + case 3: { + message.trackingBranch = reader.string(); + break; + } + case 4: { + message.accessToken = reader.string(); + break; + } + case 5: { + if (!(message.branches && message.branches.length)) + message.branches = []; + message.branches.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GithubSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings} GithubSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GithubSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GithubSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GithubSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.repositoryUri != null && message.hasOwnProperty("repositoryUri")) + if (!$util.isString(message.repositoryUri)) + return "repositoryUri: string expected"; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + if (!$util.isString(message.trackingBranch)) + return "trackingBranch: string expected"; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (!$util.isString(message.accessToken)) + return "accessToken: string expected"; + if (message.branches != null && message.hasOwnProperty("branches")) { + if (!Array.isArray(message.branches)) + return "branches: array expected"; + for (var i = 0; i < message.branches.length; ++i) + if (!$util.isString(message.branches[i])) + return "branches: string[] expected"; + } + return null; + }; + + /** + * Creates a GithubSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings} GithubSettings + */ + GithubSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.repositoryUri != null) + message.repositoryUri = String(object.repositoryUri); + if (object.trackingBranch != null) + message.trackingBranch = String(object.trackingBranch); + if (object.accessToken != null) + message.accessToken = String(object.accessToken); + if (object.branches) { + if (!Array.isArray(object.branches)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings.branches: array expected"); + message.branches = []; + for (var i = 0; i < object.branches.length; ++i) + message.branches[i] = String(object.branches[i]); + } + return message; + }; + + /** + * Creates a plain object from a GithubSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings} message GithubSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GithubSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.branches = []; + if (options.defaults) { + object.displayName = ""; + object.repositoryUri = ""; + object.trackingBranch = ""; + object.accessToken = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.repositoryUri != null && message.hasOwnProperty("repositoryUri")) + object.repositoryUri = message.repositoryUri; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + object.trackingBranch = message.trackingBranch; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + object.accessToken = message.accessToken; + if (message.branches && message.branches.length) { + object.branches = []; + for (var j = 0; j < message.branches.length; ++j) + object.branches[j] = message.branches[j]; + } + return object; + }; + + /** + * Converts this GithubSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @instance + * @returns {Object.} JSON object + */ + GithubSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GithubSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GithubSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GithubSettings"; + }; + + return GithubSettings; + })(); + + GitIntegrationSettings.GitConnectionSettings = (function() { + + /** + * Properties of a GitConnectionSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @interface IGitConnectionSettings + * @property {string|null} [displayName] GitConnectionSettings displayName + * @property {string|null} [repositoryUri] GitConnectionSettings repositoryUri + * @property {string|null} [trackingBranch] GitConnectionSettings trackingBranch + * @property {Array.|null} [branches] GitConnectionSettings branches + * @property {string|null} [accessTokenSecret] GitConnectionSettings accessTokenSecret + */ + + /** + * Constructs a new GitConnectionSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings + * @classdesc Represents a GitConnectionSettings. + * @implements IGitConnectionSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings=} [properties] Properties to set + */ + function GitConnectionSettings(properties) { + this.branches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitConnectionSettings displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @instance + */ + GitConnectionSettings.prototype.displayName = ""; + + /** + * GitConnectionSettings repositoryUri. + * @member {string} repositoryUri + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @instance + */ + GitConnectionSettings.prototype.repositoryUri = ""; + + /** + * GitConnectionSettings trackingBranch. + * @member {string} trackingBranch + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @instance + */ + GitConnectionSettings.prototype.trackingBranch = ""; + + /** + * GitConnectionSettings branches. + * @member {Array.} branches + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @instance + */ + GitConnectionSettings.prototype.branches = $util.emptyArray; + + /** + * GitConnectionSettings accessTokenSecret. + * @member {string|null|undefined} accessTokenSecret + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @instance + */ + GitConnectionSettings.prototype.accessTokenSecret = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GitConnectionSettings gitAuthentication. + * @member {"accessTokenSecret"|undefined} gitAuthentication + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @instance + */ + Object.defineProperty(GitConnectionSettings.prototype, "gitAuthentication", { + get: $util.oneOfGetter($oneOfFields = ["accessTokenSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GitConnectionSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings} GitConnectionSettings instance + */ + GitConnectionSettings.create = function create(properties) { + return new GitConnectionSettings(properties); + }; + + /** + * Encodes the specified GitConnectionSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings} message GitConnectionSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitConnectionSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.repositoryUri != null && Object.hasOwnProperty.call(message, "repositoryUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.repositoryUri); + if (message.trackingBranch != null && Object.hasOwnProperty.call(message, "trackingBranch")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.trackingBranch); + if (message.branches != null && message.branches.length) + for (var i = 0; i < message.branches.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.branches[i]); + if (message.accessTokenSecret != null && Object.hasOwnProperty.call(message, "accessTokenSecret")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.accessTokenSecret); + return writer; + }; + + /** + * Encodes the specified GitConnectionSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.IGitConnectionSettings} message GitConnectionSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitConnectionSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitConnectionSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings} GitConnectionSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitConnectionSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.repositoryUri = reader.string(); + break; + } + case 3: { + message.trackingBranch = reader.string(); + break; + } + case 4: { + if (!(message.branches && message.branches.length)) + message.branches = []; + message.branches.push(reader.string()); + break; + } + case 5: { + message.accessTokenSecret = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GitConnectionSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings} GitConnectionSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitConnectionSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitConnectionSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitConnectionSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.repositoryUri != null && message.hasOwnProperty("repositoryUri")) + if (!$util.isString(message.repositoryUri)) + return "repositoryUri: string expected"; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + if (!$util.isString(message.trackingBranch)) + return "trackingBranch: string expected"; + if (message.branches != null && message.hasOwnProperty("branches")) { + if (!Array.isArray(message.branches)) + return "branches: array expected"; + for (var i = 0; i < message.branches.length; ++i) + if (!$util.isString(message.branches[i])) + return "branches: string[] expected"; + } + if (message.accessTokenSecret != null && message.hasOwnProperty("accessTokenSecret")) { + properties.gitAuthentication = 1; + if (!$util.isString(message.accessTokenSecret)) + return "accessTokenSecret: string expected"; + } + return null; + }; + + /** + * Creates a GitConnectionSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings} GitConnectionSettings + */ + GitConnectionSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.repositoryUri != null) + message.repositoryUri = String(object.repositoryUri); + if (object.trackingBranch != null) + message.trackingBranch = String(object.trackingBranch); + if (object.branches) { + if (!Array.isArray(object.branches)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings.branches: array expected"); + message.branches = []; + for (var i = 0; i < object.branches.length; ++i) + message.branches[i] = String(object.branches[i]); + } + if (object.accessTokenSecret != null) + message.accessTokenSecret = String(object.accessTokenSecret); + return message; + }; + + /** + * Creates a plain object from a GitConnectionSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings} message GitConnectionSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitConnectionSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.branches = []; + if (options.defaults) { + object.displayName = ""; + object.repositoryUri = ""; + object.trackingBranch = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.repositoryUri != null && message.hasOwnProperty("repositoryUri")) + object.repositoryUri = message.repositoryUri; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + object.trackingBranch = message.trackingBranch; + if (message.branches && message.branches.length) { + object.branches = []; + for (var j = 0; j < message.branches.length; ++j) + object.branches[j] = message.branches[j]; + } + if (message.accessTokenSecret != null && message.hasOwnProperty("accessTokenSecret")) { + object.accessTokenSecret = message.accessTokenSecret; + if (options.oneofs) + object.gitAuthentication = "accessTokenSecret"; + } + return object; + }; + + /** + * Converts this GitConnectionSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @instance + * @returns {Object.} JSON object + */ + GitConnectionSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitConnectionSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitConnectionSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent.GitIntegrationSettings.GitConnectionSettings"; + }; + + return GitConnectionSettings; + })(); + + return GitIntegrationSettings; + })(); + + Agent.GenAppBuilderSettings = (function() { + + /** + * Properties of a GenAppBuilderSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @interface IGenAppBuilderSettings + * @property {string|null} [engine] GenAppBuilderSettings engine + */ + + /** + * Constructs a new GenAppBuilderSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @classdesc Represents a GenAppBuilderSettings. + * @implements IGenAppBuilderSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings=} [properties] Properties to set + */ + function GenAppBuilderSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAppBuilderSettings engine. + * @member {string} engine + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @instance + */ + GenAppBuilderSettings.prototype.engine = ""; + + /** + * Creates a new GenAppBuilderSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings} GenAppBuilderSettings instance + */ + GenAppBuilderSettings.create = function create(properties) { + return new GenAppBuilderSettings(properties); + }; + + /** + * Encodes the specified GenAppBuilderSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings} message GenAppBuilderSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAppBuilderSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); + return writer; + }; + + /** + * Encodes the specified GenAppBuilderSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IGenAppBuilderSettings} message GenAppBuilderSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAppBuilderSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings} GenAppBuilderSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAppBuilderSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.engine = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAppBuilderSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings} GenAppBuilderSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAppBuilderSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAppBuilderSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAppBuilderSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.engine != null && message.hasOwnProperty("engine")) + if (!$util.isString(message.engine)) + return "engine: string expected"; + return null; + }; + + /** + * Creates a GenAppBuilderSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings} GenAppBuilderSettings + */ + GenAppBuilderSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings(); + if (object.engine != null) + message.engine = String(object.engine); + return message; + }; + + /** + * Creates a plain object from a GenAppBuilderSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings} message GenAppBuilderSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAppBuilderSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.engine = ""; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = message.engine; + return object; + }; + + /** + * Converts this GenAppBuilderSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @instance + * @returns {Object.} JSON object + */ + GenAppBuilderSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAppBuilderSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAppBuilderSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent.GenAppBuilderSettings"; + }; + + return GenAppBuilderSettings; + })(); + + Agent.AnswerFeedbackSettings = (function() { + + /** + * Properties of an AnswerFeedbackSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @interface IAnswerFeedbackSettings + * @property {boolean|null} [enableAnswerFeedback] AnswerFeedbackSettings enableAnswerFeedback + */ + + /** + * Constructs a new AnswerFeedbackSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @classdesc Represents an AnswerFeedbackSettings. + * @implements IAnswerFeedbackSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings=} [properties] Properties to set + */ + function AnswerFeedbackSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerFeedbackSettings enableAnswerFeedback. + * @member {boolean} enableAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @instance + */ + AnswerFeedbackSettings.prototype.enableAnswerFeedback = false; + + /** + * Creates a new AnswerFeedbackSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings instance + */ + AnswerFeedbackSettings.create = function create(properties) { + return new AnswerFeedbackSettings(properties); + }; + + /** + * Encodes the specified AnswerFeedbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings} message AnswerFeedbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedbackSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableAnswerFeedback != null && Object.hasOwnProperty.call(message, "enableAnswerFeedback")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableAnswerFeedback); + return writer; + }; + + /** + * Encodes the specified AnswerFeedbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IAnswerFeedbackSettings} message AnswerFeedbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedbackSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedbackSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableAnswerFeedback = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerFeedbackSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedbackSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerFeedbackSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerFeedbackSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableAnswerFeedback != null && message.hasOwnProperty("enableAnswerFeedback")) + if (typeof message.enableAnswerFeedback !== "boolean") + return "enableAnswerFeedback: boolean expected"; + return null; + }; + + /** + * Creates an AnswerFeedbackSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings} AnswerFeedbackSettings + */ + AnswerFeedbackSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings(); + if (object.enableAnswerFeedback != null) + message.enableAnswerFeedback = Boolean(object.enableAnswerFeedback); + return message; + }; + + /** + * Creates a plain object from an AnswerFeedbackSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings} message AnswerFeedbackSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerFeedbackSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableAnswerFeedback = false; + if (message.enableAnswerFeedback != null && message.hasOwnProperty("enableAnswerFeedback")) + object.enableAnswerFeedback = message.enableAnswerFeedback; + return object; + }; + + /** + * Converts this AnswerFeedbackSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @instance + * @returns {Object.} JSON object + */ + AnswerFeedbackSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerFeedbackSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerFeedbackSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings"; + }; + + return AnswerFeedbackSettings; + })(); + + Agent.PersonalizationSettings = (function() { + + /** + * Properties of a PersonalizationSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @interface IPersonalizationSettings + * @property {google.protobuf.IStruct|null} [defaultEndUserMetadata] PersonalizationSettings defaultEndUserMetadata + */ + + /** + * Constructs a new PersonalizationSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @classdesc Represents a PersonalizationSettings. + * @implements IPersonalizationSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings=} [properties] Properties to set + */ + function PersonalizationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonalizationSettings defaultEndUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} defaultEndUserMetadata + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @instance + */ + PersonalizationSettings.prototype.defaultEndUserMetadata = null; + + /** + * Creates a new PersonalizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings} PersonalizationSettings instance + */ + PersonalizationSettings.create = function create(properties) { + return new PersonalizationSettings(properties); + }; + + /** + * Encodes the specified PersonalizationSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings} message PersonalizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultEndUserMetadata != null && Object.hasOwnProperty.call(message, "defaultEndUserMetadata")) + $root.google.protobuf.Struct.encode(message.defaultEndUserMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PersonalizationSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings} message PersonalizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings} PersonalizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultEndUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings} PersonalizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalizationSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalizationSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.defaultEndUserMetadata != null && message.hasOwnProperty("defaultEndUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.defaultEndUserMetadata, long + 1); + if (error) + return "defaultEndUserMetadata." + error; + } + return null; + }; + + /** + * Creates a PersonalizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings} PersonalizationSettings + */ + PersonalizationSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings(); + if (object.defaultEndUserMetadata != null) { + if (typeof object.defaultEndUserMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings.defaultEndUserMetadata: object expected"); + message.defaultEndUserMetadata = $root.google.protobuf.Struct.fromObject(object.defaultEndUserMetadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PersonalizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings} message PersonalizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.defaultEndUserMetadata = null; + if (message.defaultEndUserMetadata != null && message.hasOwnProperty("defaultEndUserMetadata")) + object.defaultEndUserMetadata = $root.google.protobuf.Struct.toObject(message.defaultEndUserMetadata, options); + return object; + }; + + /** + * Converts this PersonalizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @instance + * @returns {Object.} JSON object + */ + PersonalizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonalizationSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonalizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent.PersonalizationSettings"; + }; + + return PersonalizationSettings; + })(); + + Agent.ClientCertificateSettings = (function() { + + /** + * Properties of a ClientCertificateSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @interface IClientCertificateSettings + * @property {string|null} [sslCertificate] ClientCertificateSettings sslCertificate + * @property {string|null} [privateKey] ClientCertificateSettings privateKey + * @property {string|null} [passphrase] ClientCertificateSettings passphrase + */ + + /** + * Constructs a new ClientCertificateSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @classdesc Represents a ClientCertificateSettings. + * @implements IClientCertificateSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings=} [properties] Properties to set + */ + function ClientCertificateSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientCertificateSettings sslCertificate. + * @member {string} sslCertificate + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.sslCertificate = ""; + + /** + * ClientCertificateSettings privateKey. + * @member {string} privateKey + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.privateKey = ""; + + /** + * ClientCertificateSettings passphrase. + * @member {string} passphrase + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.passphrase = ""; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings} ClientCertificateSettings instance + */ + ClientCertificateSettings.create = function create(properties) { + return new ClientCertificateSettings(properties); + }; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslCertificate != null && Object.hasOwnProperty.call(message, "sslCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sslCertificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); + if (message.passphrase != null && Object.hasOwnProperty.call(message, "passphrase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.passphrase); + return writer; + }; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sslCertificate = reader.string(); + break; + } + case 2: { + message.privateKey = reader.string(); + break; + } + case 3: { + message.passphrase = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientCertificateSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientCertificateSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + if (!$util.isString(message.sslCertificate)) + return "sslCertificate: string expected"; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + if (!$util.isString(message.passphrase)) + return "passphrase: string expected"; + return null; + }; + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings} ClientCertificateSettings + */ + ClientCertificateSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings(); + if (object.sslCertificate != null) + message.sslCertificate = String(object.sslCertificate); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + if (object.passphrase != null) + message.passphrase = String(object.passphrase); + return message; + }; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings} message ClientCertificateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientCertificateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslCertificate = ""; + object.privateKey = ""; + object.passphrase = ""; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + object.sslCertificate = message.sslCertificate; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + object.privateKey = message.privateKey; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + object.passphrase = message.passphrase; + return object; + }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @instance + * @returns {Object.} JSON object + */ + ClientCertificateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientCertificateSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientCertificateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Agent.ClientCertificateSettings"; + }; + + return ClientCertificateSettings; + })(); + + return Agent; + })(); + + v3beta1.ListAgentsRequest = (function() { + + /** + * Properties of a ListAgentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListAgentsRequest + * @property {string|null} [parent] ListAgentsRequest parent + * @property {number|null} [pageSize] ListAgentsRequest pageSize + * @property {string|null} [pageToken] ListAgentsRequest pageToken + */ + + /** + * Constructs a new ListAgentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListAgentsRequest. + * @implements IListAgentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest=} [properties] Properties to set + */ + function ListAgentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.parent = ""; + + /** + * ListAgentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageSize = 0; + + /** + * ListAgentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest} ListAgentsRequest instance + */ + ListAgentsRequest.create = function create(properties) { + return new ListAgentsRequest(properties); + }; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest} ListAgentsRequest + */ + ListAgentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest} message ListAgentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListAgentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAgentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest"; + }; + + return ListAgentsRequest; + })(); + + v3beta1.ListAgentsResponse = (function() { + + /** + * Properties of a ListAgentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListAgentsResponse + * @property {Array.|null} [agents] ListAgentsResponse agents + * @property {string|null} [nextPageToken] ListAgentsResponse nextPageToken + */ + + /** + * Constructs a new ListAgentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListAgentsResponse. + * @implements IListAgentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse=} [properties] Properties to set + */ + function ListAgentsResponse(properties) { + this.agents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsResponse agents. + * @member {Array.} agents + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.agents = $util.emptyArray; + + /** + * ListAgentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} ListAgentsResponse instance + */ + ListAgentsResponse.create = function create(properties) { + return new ListAgentsResponse(properties); + }; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.encode(message.agents[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 ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.dialogflow.cx.v3beta1.Agent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.verify(message.agents[i], long + 1); + if (error) + return "agents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} ListAgentsResponse + */ + ListAgentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse(); + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.agents: object expected"); + message.agents[i] = $root.google.cloud.dialogflow.cx.v3beta1.Agent.fromObject(object.agents[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} message ListAgentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.dialogflow.cx.v3beta1.Agent.toObject(message.agents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAgentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAgentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse"; + }; + + return ListAgentsResponse; + })(); + + v3beta1.GetAgentRequest = (function() { + + /** + * Properties of a GetAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetAgentRequest + * @property {string|null} [name] GetAgentRequest name + */ + + /** + * Constructs a new GetAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetAgentRequest. + * @implements IGetAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest=} [properties] Properties to set + */ + function GetAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @instance + */ + GetAgentRequest.prototype.name = ""; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentRequest} GetAgentRequest instance + */ + GetAgentRequest.create = function create(properties) { + return new GetAgentRequest(properties); + }; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.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 GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentRequest} GetAgentRequest + */ + GetAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetAgentRequest} message GetAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentRequest.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 GetAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetAgentRequest"; + }; + + return GetAgentRequest; + })(); + + v3beta1.CreateAgentRequest = (function() { + + /** + * Properties of a CreateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateAgentRequest + * @property {string|null} [parent] CreateAgentRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IAgent|null} [agent] CreateAgentRequest agent + */ + + /** + * Constructs a new CreateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateAgentRequest. + * @implements ICreateAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest=} [properties] Properties to set + */ + function CreateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.parent = ""; + + /** + * CreateAgentRequest agent. + * @member {google.cloud.dialogflow.cx.v3beta1.IAgent|null|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agent = null; + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest} CreateAgentRequest instance + */ + CreateAgentRequest.create = function create(properties) { + return new CreateAgentRequest(properties); + }; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.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.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.encode(message.agent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.agent = $root.google.cloud.dialogflow.cx.v3beta1.Agent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.verify(message.agent, long + 1); + if (error) + return "agent." + error; + } + return null; + }; + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest} CreateAgentRequest + */ + CreateAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.dialogflow.cx.v3beta1.Agent.fromObject(object.agent, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest} message CreateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.agent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.dialogflow.cx.v3beta1.Agent.toObject(message.agent, options); + return object; + }; + + /** + * Converts this CreateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest"; + }; + + return CreateAgentRequest; + })(); + + v3beta1.UpdateAgentRequest = (function() { + + /** + * Properties of an UpdateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateAgentRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IAgent|null} [agent] UpdateAgentRequest agent + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentRequest updateMask + */ + + /** + * Constructs a new UpdateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateAgentRequest. + * @implements IUpdateAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest=} [properties] Properties to set + */ + function UpdateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAgentRequest agent. + * @member {google.cloud.dialogflow.cx.v3beta1.IAgent|null|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.agent = null; + + /** + * UpdateAgentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest} UpdateAgentRequest instance + */ + UpdateAgentRequest.create = function create(properties) { + return new UpdateAgentRequest(properties); + }; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.dialogflow.cx.v3beta1.Agent.encode(message.agent, 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 UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = $root.google.cloud.dialogflow.cx.v3beta1.Agent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Agent.verify(message.agent, long + 1); + if (error) + return "agent." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest} UpdateAgentRequest + */ + UpdateAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.dialogflow.cx.v3beta1.Agent.fromObject(object.agent, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest} message UpdateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agent = null; + object.updateMask = null; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.dialogflow.cx.v3beta1.Agent.toObject(message.agent, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest"; + }; + + return UpdateAgentRequest; + })(); + + v3beta1.DeleteAgentRequest = (function() { + + /** + * Properties of a DeleteAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteAgentRequest + * @property {string|null} [name] DeleteAgentRequest name + */ + + /** + * Constructs a new DeleteAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteAgentRequest. + * @implements IDeleteAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest=} [properties] Properties to set + */ + function DeleteAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.name = ""; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest} DeleteAgentRequest instance + */ + DeleteAgentRequest.create = function create(properties) { + return new DeleteAgentRequest(properties); + }; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.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 DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest} DeleteAgentRequest + */ + DeleteAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest} message DeleteAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAgentRequest.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 DeleteAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest"; + }; + + return DeleteAgentRequest; + })(); + + v3beta1.ExportAgentRequest = (function() { + + /** + * Properties of an ExportAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportAgentRequest + * @property {string|null} [name] ExportAgentRequest name + * @property {string|null} [agentUri] ExportAgentRequest agentUri + * @property {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat|null} [dataFormat] ExportAgentRequest dataFormat + * @property {string|null} [environment] ExportAgentRequest environment + * @property {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination|null} [gitDestination] ExportAgentRequest gitDestination + * @property {boolean|null} [includeBigqueryExportSettings] ExportAgentRequest includeBigqueryExportSettings + */ + + /** + * Constructs a new ExportAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportAgentRequest. + * @implements IExportAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest=} [properties] Properties to set + */ + function ExportAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.name = ""; + + /** + * ExportAgentRequest agentUri. + * @member {string} agentUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.agentUri = ""; + + /** + * ExportAgentRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.dataFormat = 0; + + /** + * ExportAgentRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.environment = ""; + + /** + * ExportAgentRequest gitDestination. + * @member {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination|null|undefined} gitDestination + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.gitDestination = null; + + /** + * ExportAgentRequest includeBigqueryExportSettings. + * @member {boolean} includeBigqueryExportSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.includeBigqueryExportSettings = false; + + /** + * Creates a new ExportAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest} ExportAgentRequest instance + */ + ExportAgentRequest.create = function create(properties) { + return new ExportAgentRequest(properties); + }; + + /** + * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentRequest.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.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.environment); + if (message.gitDestination != null && Object.hasOwnProperty.call(message, "gitDestination")) + $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.encode(message.gitDestination, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.includeBigqueryExportSettings != null && Object.hasOwnProperty.call(message, "includeBigqueryExportSettings")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.includeBigqueryExportSettings); + return writer; + }; + + /** + * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest} ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.agentUri = reader.string(); + break; + } + case 3: { + message.dataFormat = reader.int32(); + break; + } + case 5: { + message.environment = reader.string(); + break; + } + case 6: { + message.gitDestination = $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.includeBigqueryExportSettings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest} ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 4: + break; + } + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.gitDestination != null && message.hasOwnProperty("gitDestination")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.verify(message.gitDestination, long + 1); + if (error) + return "gitDestination." + error; + } + if (message.includeBigqueryExportSettings != null && message.hasOwnProperty("includeBigqueryExportSettings")) + if (typeof message.includeBigqueryExportSettings !== "boolean") + return "includeBigqueryExportSettings: boolean expected"; + return null; + }; + + /** + * Creates an ExportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest} ExportAgentRequest + */ + ExportAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON_PACKAGE": + case 4: + message.dataFormat = 4; + break; + } + if (object.environment != null) + message.environment = String(object.environment); + if (object.gitDestination != null) { + if (typeof object.gitDestination !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.gitDestination: object expected"); + message.gitDestination = $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.fromObject(object.gitDestination, long + 1); + } + if (object.includeBigqueryExportSettings != null) + message.includeBigqueryExportSettings = Boolean(object.includeBigqueryExportSettings); + return message; + }; + + /** + * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest} message ExportAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.agentUri = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.environment = ""; + object.gitDestination = null; + object.includeBigqueryExportSettings = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) + object.agentUri = message.agentUri; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat[message.dataFormat] : message.dataFormat; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.gitDestination != null && message.hasOwnProperty("gitDestination")) + object.gitDestination = $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.toObject(message.gitDestination, options); + if (message.includeBigqueryExportSettings != null && message.hasOwnProperty("includeBigqueryExportSettings")) + object.includeBigqueryExportSettings = message.includeBigqueryExportSettings; + return object; + }; + + /** + * Converts this ExportAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON_PACKAGE=4 JSON_PACKAGE value + */ + ExportAgentRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[4] = "JSON_PACKAGE"] = 4; + return values; + })(); + + ExportAgentRequest.GitDestination = (function() { + + /** + * Properties of a GitDestination. + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @interface IGitDestination + * @property {string|null} [trackingBranch] GitDestination trackingBranch + * @property {string|null} [commitMessage] GitDestination commitMessage + */ + + /** + * Constructs a new GitDestination. + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + * @classdesc Represents a GitDestination. + * @implements IGitDestination + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination=} [properties] Properties to set + */ + function GitDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitDestination trackingBranch. + * @member {string} trackingBranch + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @instance + */ + GitDestination.prototype.trackingBranch = ""; + + /** + * GitDestination commitMessage. + * @member {string} commitMessage + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @instance + */ + GitDestination.prototype.commitMessage = ""; + + /** + * Creates a new GitDestination instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination} GitDestination instance + */ + GitDestination.create = function create(properties) { + return new GitDestination(properties); + }; + + /** + * Encodes the specified GitDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination} message GitDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackingBranch != null && Object.hasOwnProperty.call(message, "trackingBranch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackingBranch); + if (message.commitMessage != null && Object.hasOwnProperty.call(message, "commitMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commitMessage); + return writer; + }; + + /** + * Encodes the specified GitDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.IGitDestination} message GitDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination} GitDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitDestination.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trackingBranch = reader.string(); + break; + } + case 2: { + message.commitMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GitDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination} GitDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitDestination message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitDestination.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + if (!$util.isString(message.trackingBranch)) + return "trackingBranch: string expected"; + if (message.commitMessage != null && message.hasOwnProperty("commitMessage")) + if (!$util.isString(message.commitMessage)) + return "commitMessage: string expected"; + return null; + }; + + /** + * Creates a GitDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination} GitDestination + */ + GitDestination.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination(); + if (object.trackingBranch != null) + message.trackingBranch = String(object.trackingBranch); + if (object.commitMessage != null) + message.commitMessage = String(object.commitMessage); + return message; + }; + + /** + * Creates a plain object from a GitDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination} message GitDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trackingBranch = ""; + object.commitMessage = ""; + } + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + object.trackingBranch = message.trackingBranch; + if (message.commitMessage != null && message.hasOwnProperty("commitMessage")) + object.commitMessage = message.commitMessage; + return object; + }; + + /** + * Converts this GitDestination to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @instance + * @returns {Object.} JSON object + */ + GitDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitDestination + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination"; + }; + + return GitDestination; + })(); + + return ExportAgentRequest; + })(); + + v3beta1.ExportAgentResponse = (function() { + + /** + * Properties of an ExportAgentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportAgentResponse + * @property {string|null} [agentUri] ExportAgentResponse agentUri + * @property {Uint8Array|null} [agentContent] ExportAgentResponse agentContent + * @property {string|null} [commitSha] ExportAgentResponse commitSha + */ + + /** + * Constructs a new ExportAgentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportAgentResponse. + * @implements IExportAgentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse=} [properties] Properties to set + */ + function ExportAgentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAgentResponse agentUri. + * @member {string|null|undefined} agentUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.agentUri = null; + + /** + * ExportAgentResponse agentContent. + * @member {Uint8Array|null|undefined} agentContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.agentContent = null; + + /** + * ExportAgentResponse commitSha. + * @member {string|null|undefined} commitSha + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.commitSha = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportAgentResponse agent. + * @member {"agentUri"|"agentContent"|"commitSha"|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @instance + */ + Object.defineProperty(ExportAgentResponse.prototype, "agent", { + get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent", "commitSha"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportAgentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse} ExportAgentResponse instance + */ + ExportAgentResponse.create = function create(properties) { + return new ExportAgentResponse(properties); + }; + + /** + * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agentUri); + if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.agentContent); + if (message.commitSha != null && Object.hasOwnProperty.call(message, "commitSha")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.commitSha); + return writer; + }; + + /** + * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse} ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agentUri = reader.string(); + break; + } + case 2: { + message.agentContent = reader.bytes(); + break; + } + case 3: { + message.commitSha = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse} ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAgentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAgentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + properties.agent = 1; + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) + return "agentContent: buffer expected"; + } + if (message.commitSha != null && message.hasOwnProperty("commitSha")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!$util.isString(message.commitSha)) + return "commitSha: string expected"; + } + return null; + }; + + /** + * Creates an ExportAgentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse} ExportAgentResponse + */ + ExportAgentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse(); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + if (object.agentContent != null) + if (typeof object.agentContent === "string") + $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); + else if (object.agentContent.length >= 0) + message.agentContent = object.agentContent; + if (object.commitSha != null) + message.commitSha = String(object.commitSha); + return message; + }; + + /** + * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse} message ExportAgentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAgentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + object.agentUri = message.agentUri; + if (options.oneofs) + object.agent = "agentUri"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; + if (options.oneofs) + object.agent = "agentContent"; + } + if (message.commitSha != null && message.hasOwnProperty("commitSha")) { + object.commitSha = message.commitSha; + if (options.oneofs) + object.agent = "commitSha"; + } + return object; + }; + + /** + * Converts this ExportAgentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAgentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAgentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAgentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse"; + }; + + return ExportAgentResponse; + })(); + + v3beta1.RestoreAgentRequest = (function() { + + /** + * Properties of a RestoreAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRestoreAgentRequest + * @property {string|null} [name] RestoreAgentRequest name + * @property {string|null} [agentUri] RestoreAgentRequest agentUri + * @property {Uint8Array|null} [agentContent] RestoreAgentRequest agentContent + * @property {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource|null} [gitSource] RestoreAgentRequest gitSource + * @property {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption|null} [restoreOption] RestoreAgentRequest restoreOption + */ + + /** + * Constructs a new RestoreAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RestoreAgentRequest. + * @implements IRestoreAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest=} [properties] Properties to set + */ + function RestoreAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.name = ""; + + /** + * RestoreAgentRequest agentUri. + * @member {string|null|undefined} agentUri + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.agentUri = null; + + /** + * RestoreAgentRequest agentContent. + * @member {Uint8Array|null|undefined} agentContent + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.agentContent = null; + + /** + * RestoreAgentRequest gitSource. + * @member {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource|null|undefined} gitSource + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.gitSource = null; + + /** + * RestoreAgentRequest restoreOption. + * @member {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption} restoreOption + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.restoreOption = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreAgentRequest agent. + * @member {"agentUri"|"agentContent"|"gitSource"|undefined} agent + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @instance + */ + Object.defineProperty(RestoreAgentRequest.prototype, "agent", { + get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent", "gitSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest} RestoreAgentRequest instance + */ + RestoreAgentRequest.create = function create(properties) { + return new RestoreAgentRequest(properties); + }; + + /** + * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAgentRequest.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.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.agentContent); + if (message.restoreOption != null && Object.hasOwnProperty.call(message, "restoreOption")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.restoreOption); + if (message.gitSource != null && Object.hasOwnProperty.call(message, "gitSource")) + $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.encode(message.gitSource, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest} RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.agentUri = reader.string(); + break; + } + case 3: { + message.agentContent = reader.bytes(); + break; + } + case 6: { + message.gitSource = $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.restoreOption = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest} RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + properties.agent = 1; + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) + return "agentContent: buffer expected"; + } + if (message.gitSource != null && message.hasOwnProperty("gitSource")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.verify(message.gitSource, long + 1); + if (error) + return "gitSource." + error; + } + } + if (message.restoreOption != null && message.hasOwnProperty("restoreOption")) + switch (message.restoreOption) { + default: + return "restoreOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest} RestoreAgentRequest + */ + RestoreAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + if (object.agentContent != null) + if (typeof object.agentContent === "string") + $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); + else if (object.agentContent.length >= 0) + message.agentContent = object.agentContent; + if (object.gitSource != null) { + if (typeof object.gitSource !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.gitSource: object expected"); + message.gitSource = $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.fromObject(object.gitSource, long + 1); + } + switch (object.restoreOption) { + default: + if (typeof object.restoreOption === "number") { + message.restoreOption = object.restoreOption; + break; + } + break; + case "RESTORE_OPTION_UNSPECIFIED": + case 0: + message.restoreOption = 0; + break; + case "KEEP": + case 1: + message.restoreOption = 1; + break; + case "FALLBACK": + case 2: + message.restoreOption = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest} message RestoreAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.restoreOption = options.enums === String ? "RESTORE_OPTION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + object.agentUri = message.agentUri; + if (options.oneofs) + object.agent = "agentUri"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; + if (options.oneofs) + object.agent = "agentContent"; + } + if (message.restoreOption != null && message.hasOwnProperty("restoreOption")) + object.restoreOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption[message.restoreOption] === undefined ? message.restoreOption : $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption[message.restoreOption] : message.restoreOption; + if (message.gitSource != null && message.hasOwnProperty("gitSource")) { + object.gitSource = $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.toObject(message.gitSource, options); + if (options.oneofs) + object.agent = "gitSource"; + } + return object; + }; + + /** + * Converts this RestoreAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest"; + }; + + RestoreAgentRequest.GitSource = (function() { + + /** + * Properties of a GitSource. + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @interface IGitSource + * @property {string|null} [trackingBranch] GitSource trackingBranch + */ + + /** + * Constructs a new GitSource. + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + * @classdesc Represents a GitSource. + * @implements IGitSource + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource=} [properties] Properties to set + */ + function GitSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitSource trackingBranch. + * @member {string} trackingBranch + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @instance + */ + GitSource.prototype.trackingBranch = ""; + + /** + * Creates a new GitSource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource} GitSource instance + */ + GitSource.create = function create(properties) { + return new GitSource(properties); + }; + + /** + * Encodes the specified GitSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource} message GitSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackingBranch != null && Object.hasOwnProperty.call(message, "trackingBranch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackingBranch); + return writer; + }; + + /** + * Encodes the specified GitSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.IGitSource} message GitSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource} GitSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitSource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trackingBranch = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GitSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource} GitSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitSource message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitSource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + if (!$util.isString(message.trackingBranch)) + return "trackingBranch: string expected"; + return null; + }; + + /** + * Creates a GitSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource} GitSource + */ + GitSource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource(); + if (object.trackingBranch != null) + message.trackingBranch = String(object.trackingBranch); + return message; + }; + + /** + * Creates a plain object from a GitSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource} message GitSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.trackingBranch = ""; + if (message.trackingBranch != null && message.hasOwnProperty("trackingBranch")) + object.trackingBranch = message.trackingBranch; + return object; + }; + + /** + * Converts this GitSource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @instance + * @returns {Object.} JSON object + */ + GitSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitSource + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource"; + }; + + return GitSource; + })(); + + /** + * RestoreOption enum. + * @name google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption + * @enum {number} + * @property {number} RESTORE_OPTION_UNSPECIFIED=0 RESTORE_OPTION_UNSPECIFIED value + * @property {number} KEEP=1 KEEP value + * @property {number} FALLBACK=2 FALLBACK value + */ + RestoreAgentRequest.RestoreOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTORE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEEP"] = 1; + values[valuesById[2] = "FALLBACK"] = 2; + return values; + })(); + + return RestoreAgentRequest; + })(); + + v3beta1.ValidateAgentRequest = (function() { + + /** + * Properties of a ValidateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IValidateAgentRequest + * @property {string|null} [name] ValidateAgentRequest name + * @property {string|null} [languageCode] ValidateAgentRequest languageCode + */ + + /** + * Constructs a new ValidateAgentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ValidateAgentRequest. + * @implements IValidateAgentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest=} [properties] Properties to set + */ + function ValidateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateAgentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @instance + */ + ValidateAgentRequest.prototype.name = ""; + + /** + * ValidateAgentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @instance + */ + ValidateAgentRequest.prototype.languageCode = ""; + + /** + * Creates a new ValidateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest} ValidateAgentRequest instance + */ + ValidateAgentRequest.create = function create(properties) { + return new ValidateAgentRequest(properties); + }; + + /** + * Encodes the specified ValidateAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest} message ValidateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateAgentRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ValidateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest} message ValidateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest} ValidateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateAgentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest} ValidateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateAgentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ValidateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest} ValidateAgentRequest + */ + ValidateAgentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ValidateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest} message ValidateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ValidateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest"; + }; + + return ValidateAgentRequest; + })(); + + v3beta1.GetAgentValidationResultRequest = (function() { + + /** + * Properties of a GetAgentValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetAgentValidationResultRequest + * @property {string|null} [name] GetAgentValidationResultRequest name + * @property {string|null} [languageCode] GetAgentValidationResultRequest languageCode + */ + + /** + * Constructs a new GetAgentValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetAgentValidationResultRequest. + * @implements IGetAgentValidationResultRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest=} [properties] Properties to set + */ + function GetAgentValidationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentValidationResultRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @instance + */ + GetAgentValidationResultRequest.prototype.name = ""; + + /** + * GetAgentValidationResultRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @instance + */ + GetAgentValidationResultRequest.prototype.languageCode = ""; + + /** + * Creates a new GetAgentValidationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest} GetAgentValidationResultRequest instance + */ + GetAgentValidationResultRequest.create = function create(properties) { + return new GetAgentValidationResultRequest(properties); + }; + + /** + * Encodes the specified GetAgentValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest} message GetAgentValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentValidationResultRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetAgentValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest} message GetAgentValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentValidationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest} GetAgentValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentValidationResultRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentValidationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest} GetAgentValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentValidationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentValidationResultRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentValidationResultRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetAgentValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest} GetAgentValidationResultRequest + */ + GetAgentValidationResultRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetAgentValidationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest} message GetAgentValidationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentValidationResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetAgentValidationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentValidationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentValidationResultRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentValidationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest"; + }; + + return GetAgentValidationResultRequest; + })(); + + v3beta1.AgentValidationResult = (function() { + + /** + * Properties of an AgentValidationResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IAgentValidationResult + * @property {string|null} [name] AgentValidationResult name + * @property {Array.|null} [flowValidationResults] AgentValidationResult flowValidationResults + */ + + /** + * Constructs a new AgentValidationResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an AgentValidationResult. + * @implements IAgentValidationResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult=} [properties] Properties to set + */ + function AgentValidationResult(properties) { + this.flowValidationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentValidationResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @instance + */ + AgentValidationResult.prototype.name = ""; + + /** + * AgentValidationResult flowValidationResults. + * @member {Array.} flowValidationResults + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @instance + */ + AgentValidationResult.prototype.flowValidationResults = $util.emptyArray; + + /** + * Creates a new AgentValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentValidationResult} AgentValidationResult instance + */ + AgentValidationResult.create = function create(properties) { + return new AgentValidationResult(properties); + }; + + /** + * Encodes the specified AgentValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult} message AgentValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentValidationResult.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.flowValidationResults != null && message.flowValidationResults.length) + for (var i = 0; i < message.flowValidationResults.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.encode(message.flowValidationResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AgentValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult} message AgentValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentValidationResult} AgentValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentValidationResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.flowValidationResults && message.flowValidationResults.length)) + message.flowValidationResults = []; + message.flowValidationResults.push($root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AgentValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentValidationResult} AgentValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentValidationResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentValidationResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flowValidationResults != null && message.hasOwnProperty("flowValidationResults")) { + if (!Array.isArray(message.flowValidationResults)) + return "flowValidationResults: array expected"; + for (var i = 0; i < message.flowValidationResults.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.verify(message.flowValidationResults[i], long + 1); + if (error) + return "flowValidationResults." + error; + } + } + return null; + }; + + /** + * Creates an AgentValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentValidationResult} AgentValidationResult + */ + AgentValidationResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult(); + if (object.name != null) + message.name = String(object.name); + if (object.flowValidationResults) { + if (!Array.isArray(object.flowValidationResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AgentValidationResult.flowValidationResults: array expected"); + message.flowValidationResults = []; + for (var i = 0; i < object.flowValidationResults.length; ++i) { + if (typeof object.flowValidationResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AgentValidationResult.flowValidationResults: object expected"); + message.flowValidationResults[i] = $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.fromObject(object.flowValidationResults[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an AgentValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AgentValidationResult} message AgentValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.flowValidationResults = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flowValidationResults && message.flowValidationResults.length) { + object.flowValidationResults = []; + for (var j = 0; j < message.flowValidationResults.length; ++j) + object.flowValidationResults[j] = $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.toObject(message.flowValidationResults[j], options); + } + return object; + }; + + /** + * Converts this AgentValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @instance + * @returns {Object.} JSON object + */ + AgentValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentValidationResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentValidationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AgentValidationResult"; + }; + + return AgentValidationResult; + })(); + + v3beta1.GetGenerativeSettingsRequest = (function() { + + /** + * Properties of a GetGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetGenerativeSettingsRequest + * @property {string|null} [name] GetGenerativeSettingsRequest name + * @property {string|null} [languageCode] GetGenerativeSettingsRequest languageCode + */ + + /** + * Constructs a new GetGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetGenerativeSettingsRequest. + * @implements IGetGenerativeSettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest=} [properties] Properties to set + */ + function GetGenerativeSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGenerativeSettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @instance + */ + GetGenerativeSettingsRequest.prototype.name = ""; + + /** + * GetGenerativeSettingsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @instance + */ + GetGenerativeSettingsRequest.prototype.languageCode = ""; + + /** + * Creates a new GetGenerativeSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest instance + */ + GetGenerativeSettingsRequest.create = function create(properties) { + return new GetGenerativeSettingsRequest(properties); + }; + + /** + * Encodes the specified GetGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest} message GetGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGenerativeSettingsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest} message GetGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGenerativeSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGenerativeSettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGenerativeSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGenerativeSettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGenerativeSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest} GetGenerativeSettingsRequest + */ + GetGenerativeSettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetGenerativeSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest} message GetGenerativeSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGenerativeSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetGenerativeSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetGenerativeSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGenerativeSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGenerativeSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest"; + }; + + return GetGenerativeSettingsRequest; + })(); + + v3beta1.UpdateGenerativeSettingsRequest = (function() { + + /** + * Properties of an UpdateGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateGenerativeSettingsRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings|null} [generativeSettings] UpdateGenerativeSettingsRequest generativeSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGenerativeSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateGenerativeSettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateGenerativeSettingsRequest. + * @implements IUpdateGenerativeSettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest=} [properties] Properties to set + */ + function UpdateGenerativeSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGenerativeSettingsRequest generativeSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings|null|undefined} generativeSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @instance + */ + UpdateGenerativeSettingsRequest.prototype.generativeSettings = null; + + /** + * UpdateGenerativeSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @instance + */ + UpdateGenerativeSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGenerativeSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest instance + */ + UpdateGenerativeSettingsRequest.create = function create(properties) { + return new UpdateGenerativeSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateGenerativeSettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest} message UpdateGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGenerativeSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generativeSettings != null && Object.hasOwnProperty.call(message, "generativeSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.encode(message.generativeSettings, 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 UpdateGenerativeSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest} message UpdateGenerativeSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGenerativeSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGenerativeSettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generativeSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGenerativeSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGenerativeSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGenerativeSettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGenerativeSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generativeSettings != null && message.hasOwnProperty("generativeSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.verify(message.generativeSettings, long + 1); + if (error) + return "generativeSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateGenerativeSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest} UpdateGenerativeSettingsRequest + */ + UpdateGenerativeSettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest(); + if (object.generativeSettings != null) { + if (typeof object.generativeSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest.generativeSettings: object expected"); + message.generativeSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.fromObject(object.generativeSettings, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGenerativeSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest} message UpdateGenerativeSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGenerativeSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.generativeSettings = null; + object.updateMask = null; + } + if (message.generativeSettings != null && message.hasOwnProperty("generativeSettings")) + object.generativeSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.toObject(message.generativeSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGenerativeSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGenerativeSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGenerativeSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGenerativeSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest"; + }; + + return UpdateGenerativeSettingsRequest; + })(); + + /** + * AudioEncoding enum. + * @name google.cloud.dialogflow.cx.v3beta1.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value + * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value + * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value + * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value + * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value + * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value + * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value + * @property {number} AUDIO_ENCODING_ALAW=8 AUDIO_ENCODING_ALAW value + */ + v3beta1.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; + values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; + values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; + values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; + values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; + values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; + values[valuesById[8] = "AUDIO_ENCODING_ALAW"] = 8; + return values; + })(); + + /** + * SpeechModelVariant enum. + * @name google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant + * @enum {number} + * @property {number} SPEECH_MODEL_VARIANT_UNSPECIFIED=0 SPEECH_MODEL_VARIANT_UNSPECIFIED value + * @property {number} USE_BEST_AVAILABLE=1 USE_BEST_AVAILABLE value + * @property {number} USE_STANDARD=2 USE_STANDARD value + * @property {number} USE_ENHANCED=3 USE_ENHANCED value + */ + v3beta1.SpeechModelVariant = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_MODEL_VARIANT_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_BEST_AVAILABLE"] = 1; + values[valuesById[2] = "USE_STANDARD"] = 2; + values[valuesById[3] = "USE_ENHANCED"] = 3; + return values; + })(); + + v3beta1.SpeechWordInfo = (function() { + + /** + * Properties of a SpeechWordInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISpeechWordInfo + * @property {string|null} [word] SpeechWordInfo word + * @property {google.protobuf.IDuration|null} [startOffset] SpeechWordInfo startOffset + * @property {google.protobuf.IDuration|null} [endOffset] SpeechWordInfo endOffset + * @property {number|null} [confidence] SpeechWordInfo confidence + */ + + /** + * Constructs a new SpeechWordInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SpeechWordInfo. + * @implements ISpeechWordInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo=} [properties] Properties to set + */ + function SpeechWordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechWordInfo word. + * @member {string} word + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.word = ""; + + /** + * SpeechWordInfo startOffset. + * @member {google.protobuf.IDuration|null|undefined} startOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.startOffset = null; + + /** + * SpeechWordInfo endOffset. + * @member {google.protobuf.IDuration|null|undefined} endOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.endOffset = null; + + /** + * SpeechWordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.confidence = 0; + + /** + * Creates a new SpeechWordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo} SpeechWordInfo instance + */ + SpeechWordInfo.create = function create(properties) { + return new SpeechWordInfo(properties); + }; + + /** + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechWordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechWordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo} SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechWordInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.word = reader.string(); + break; + } + case 1: { + message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo} SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechWordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechWordInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechWordInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startOffset, long + 1); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endOffset, long + 1); + if (error) + return "endOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo} SpeechWordInfo + */ + SpeechWordInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo(); + if (object.word != null) + message.word = String(object.word); + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.startOffset: object expected"); + message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset, long + 1); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.endOffset: object expected"); + message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset, long + 1); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo} message SpeechWordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechWordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startOffset = null; + object.endOffset = null; + object.word = ""; + object.confidence = 0; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this SpeechWordInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @instance + * @returns {Object.} JSON object + */ + SpeechWordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechWordInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechWordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo"; + }; + + return SpeechWordInfo; + })(); + + v3beta1.BargeInConfig = (function() { + + /** + * Properties of a BargeInConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBargeInConfig + * @property {google.protobuf.IDuration|null} [noBargeInDuration] BargeInConfig noBargeInDuration + * @property {google.protobuf.IDuration|null} [totalDuration] BargeInConfig totalDuration + */ + + /** + * Constructs a new BargeInConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BargeInConfig. + * @implements IBargeInConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBargeInConfig=} [properties] Properties to set + */ + function BargeInConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BargeInConfig noBargeInDuration. + * @member {google.protobuf.IDuration|null|undefined} noBargeInDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @instance + */ + BargeInConfig.prototype.noBargeInDuration = null; + + /** + * BargeInConfig totalDuration. + * @member {google.protobuf.IDuration|null|undefined} totalDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @instance + */ + BargeInConfig.prototype.totalDuration = null; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBargeInConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BargeInConfig} BargeInConfig instance + */ + BargeInConfig.create = function create(properties) { + return new BargeInConfig(properties); + }; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BargeInConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.noBargeInDuration != null && Object.hasOwnProperty.call(message, "noBargeInDuration")) + $root.google.protobuf.Duration.encode(message.noBargeInDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.totalDuration != null && Object.hasOwnProperty.call(message, "totalDuration")) + $root.google.protobuf.Duration.encode(message.totalDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BargeInConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.noBargeInDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.totalDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BargeInConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BargeInConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.noBargeInDuration != null && message.hasOwnProperty("noBargeInDuration")) { + var error = $root.google.protobuf.Duration.verify(message.noBargeInDuration, long + 1); + if (error) + return "noBargeInDuration." + error; + } + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) { + var error = $root.google.protobuf.Duration.verify(message.totalDuration, long + 1); + if (error) + return "totalDuration." + error; + } + return null; + }; + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BargeInConfig} BargeInConfig + */ + BargeInConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig(); + if (object.noBargeInDuration != null) { + if (typeof object.noBargeInDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BargeInConfig.noBargeInDuration: object expected"); + message.noBargeInDuration = $root.google.protobuf.Duration.fromObject(object.noBargeInDuration, long + 1); + } + if (object.totalDuration != null) { + if (typeof object.totalDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BargeInConfig.totalDuration: object expected"); + message.totalDuration = $root.google.protobuf.Duration.fromObject(object.totalDuration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BargeInConfig} message BargeInConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BargeInConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.noBargeInDuration = null; + object.totalDuration = null; + } + if (message.noBargeInDuration != null && message.hasOwnProperty("noBargeInDuration")) + object.noBargeInDuration = $root.google.protobuf.Duration.toObject(message.noBargeInDuration, options); + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) + object.totalDuration = $root.google.protobuf.Duration.toObject(message.totalDuration, options); + return object; + }; + + /** + * Converts this BargeInConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @instance + * @returns {Object.} JSON object + */ + BargeInConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BargeInConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BargeInConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BargeInConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BargeInConfig"; + }; + + return BargeInConfig; + })(); + + v3beta1.InputAudioConfig = (function() { + + /** + * Properties of an InputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IInputAudioConfig + * @property {google.cloud.dialogflow.cx.v3beta1.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz + * @property {boolean|null} [enableWordInfo] InputAudioConfig enableWordInfo + * @property {Array.|null} [phraseHints] InputAudioConfig phraseHints + * @property {string|null} [model] InputAudioConfig model + * @property {google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant|null} [modelVariant] InputAudioConfig modelVariant + * @property {boolean|null} [singleUtterance] InputAudioConfig singleUtterance + * @property {google.cloud.dialogflow.cx.v3beta1.IBargeInConfig|null} [bargeInConfig] InputAudioConfig bargeInConfig + * @property {boolean|null} [optOutConformerModelMigration] InputAudioConfig optOutConformerModelMigration + */ + + /** + * Constructs a new InputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an InputAudioConfig. + * @implements IInputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig=} [properties] Properties to set + */ + function InputAudioConfig(properties) { + this.phraseHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.cx.v3beta1.AudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.audioEncoding = 0; + + /** + * InputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * InputAudioConfig enableWordInfo. + * @member {boolean} enableWordInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.enableWordInfo = false; + + /** + * InputAudioConfig phraseHints. + * @member {Array.} phraseHints + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.phraseHints = $util.emptyArray; + + /** + * InputAudioConfig model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.model = ""; + + /** + * InputAudioConfig modelVariant. + * @member {google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant} modelVariant + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.modelVariant = 0; + + /** + * InputAudioConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.singleUtterance = false; + + /** + * InputAudioConfig bargeInConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.IBargeInConfig|null|undefined} bargeInConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.bargeInConfig = null; + + /** + * InputAudioConfig optOutConformerModelMigration. + * @member {boolean} optOutConformerModelMigration + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.optOutConformerModelMigration = false; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.InputAudioConfig} InputAudioConfig instance + */ + InputAudioConfig.create = function create(properties) { + return new InputAudioConfig(properties); + }; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.phraseHints != null && message.phraseHints.length) + for (var i = 0; i < message.phraseHints.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.phraseHints[i]); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.model); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.singleUtterance); + if (message.modelVariant != null && Object.hasOwnProperty.call(message, "modelVariant")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.modelVariant); + if (message.enableWordInfo != null && Object.hasOwnProperty.call(message, "enableWordInfo")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.enableWordInfo); + if (message.bargeInConfig != null && Object.hasOwnProperty.call(message, "bargeInConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig.encode(message.bargeInConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.optOutConformerModelMigration != null && Object.hasOwnProperty.call(message, "optOutConformerModelMigration")) + writer.uint32(/* id 26, wireType 0 =*/208).bool(message.optOutConformerModelMigration); + return writer; + }; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 13: { + message.enableWordInfo = reader.bool(); + break; + } + case 4: { + if (!(message.phraseHints && message.phraseHints.length)) + message.phraseHints = []; + message.phraseHints.push(reader.string()); + break; + } + case 7: { + message.model = reader.string(); + break; + } + case 10: { + message.modelVariant = reader.int32(); + break; + } + case 8: { + message.singleUtterance = reader.bool(); + break; + } + case 15: { + message.bargeInConfig = $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.optOutConformerModelMigration = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAudioConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAudioConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + if (typeof message.enableWordInfo !== "boolean") + return "enableWordInfo: boolean expected"; + if (message.phraseHints != null && message.hasOwnProperty("phraseHints")) { + if (!Array.isArray(message.phraseHints)) + return "phraseHints: array expected"; + for (var i = 0; i < message.phraseHints.length; ++i) + if (!$util.isString(message.phraseHints[i])) + return "phraseHints: string[] expected"; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + switch (message.modelVariant) { + default: + return "modelVariant: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig.verify(message.bargeInConfig, long + 1); + if (error) + return "bargeInConfig." + error; + } + if (message.optOutConformerModelMigration != null && message.hasOwnProperty("optOutConformerModelMigration")) + if (typeof message.optOutConformerModelMigration !== "boolean") + return "optOutConformerModelMigration: boolean expected"; + return null; + }; + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.InputAudioConfig} InputAudioConfig + */ + InputAudioConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "AUDIO_ENCODING_LINEAR_16": + case 1: + message.audioEncoding = 1; + break; + case "AUDIO_ENCODING_FLAC": + case 2: + message.audioEncoding = 2; + break; + case "AUDIO_ENCODING_MULAW": + case 3: + message.audioEncoding = 3; + break; + case "AUDIO_ENCODING_AMR": + case 4: + message.audioEncoding = 4; + break; + case "AUDIO_ENCODING_AMR_WB": + case 5: + message.audioEncoding = 5; + break; + case "AUDIO_ENCODING_OGG_OPUS": + case 6: + message.audioEncoding = 6; + break; + case "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": + case 7: + message.audioEncoding = 7; + break; + case "AUDIO_ENCODING_ALAW": + case 8: + message.audioEncoding = 8; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.enableWordInfo != null) + message.enableWordInfo = Boolean(object.enableWordInfo); + if (object.phraseHints) { + if (!Array.isArray(object.phraseHints)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.phraseHints: array expected"); + message.phraseHints = []; + for (var i = 0; i < object.phraseHints.length; ++i) + message.phraseHints[i] = String(object.phraseHints[i]); + } + if (object.model != null) + message.model = String(object.model); + switch (object.modelVariant) { + default: + if (typeof object.modelVariant === "number") { + message.modelVariant = object.modelVariant; + break; + } + break; + case "SPEECH_MODEL_VARIANT_UNSPECIFIED": + case 0: + message.modelVariant = 0; + break; + case "USE_BEST_AVAILABLE": + case 1: + message.modelVariant = 1; + break; + case "USE_STANDARD": + case 2: + message.modelVariant = 2; + break; + case "USE_ENHANCED": + case 3: + message.modelVariant = 3; + break; + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.bargeInConfig != null) { + if (typeof object.bargeInConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.bargeInConfig: object expected"); + message.bargeInConfig = $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig.fromObject(object.bargeInConfig, long + 1); + } + if (object.optOutConformerModelMigration != null) + message.optOutConformerModelMigration = Boolean(object.optOutConformerModelMigration); + return message; + }; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.InputAudioConfig} message InputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phraseHints = []; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.model = ""; + object.singleUtterance = false; + object.modelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; + object.enableWordInfo = false; + object.bargeInConfig = null; + object.optOutConformerModelMigration = false; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.dialogflow.cx.v3beta1.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.phraseHints && message.phraseHints.length) { + object.phraseHints = []; + for (var j = 0; j < message.phraseHints.length; ++j) + object.phraseHints[j] = message.phraseHints[j]; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + object.modelVariant = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant[message.modelVariant] === undefined ? message.modelVariant : $root.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant[message.modelVariant] : message.modelVariant; + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + object.enableWordInfo = message.enableWordInfo; + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) + object.bargeInConfig = $root.google.cloud.dialogflow.cx.v3beta1.BargeInConfig.toObject(message.bargeInConfig, options); + if (message.optOutConformerModelMigration != null && message.hasOwnProperty("optOutConformerModelMigration")) + object.optOutConformerModelMigration = message.optOutConformerModelMigration; + return object; + }; + + /** + * Converts this InputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + InputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.InputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.InputAudioConfig"; + }; + + return InputAudioConfig; + })(); + + /** + * SsmlVoiceGender enum. + * @name google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender + * @enum {number} + * @property {number} SSML_VOICE_GENDER_UNSPECIFIED=0 SSML_VOICE_GENDER_UNSPECIFIED value + * @property {number} SSML_VOICE_GENDER_MALE=1 SSML_VOICE_GENDER_MALE value + * @property {number} SSML_VOICE_GENDER_FEMALE=2 SSML_VOICE_GENDER_FEMALE value + * @property {number} SSML_VOICE_GENDER_NEUTRAL=3 SSML_VOICE_GENDER_NEUTRAL value + */ + v3beta1.SsmlVoiceGender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSML_VOICE_GENDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSML_VOICE_GENDER_MALE"] = 1; + values[valuesById[2] = "SSML_VOICE_GENDER_FEMALE"] = 2; + values[valuesById[3] = "SSML_VOICE_GENDER_NEUTRAL"] = 3; + return values; + })(); + + v3beta1.VoiceSelectionParams = (function() { + + /** + * Properties of a VoiceSelectionParams. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IVoiceSelectionParams + * @property {string|null} [name] VoiceSelectionParams name + * @property {google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender + */ + + /** + * Constructs a new VoiceSelectionParams. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a VoiceSelectionParams. + * @implements IVoiceSelectionParams + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams=} [properties] Properties to set + */ + function VoiceSelectionParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceSelectionParams name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.name = ""; + + /** + * VoiceSelectionParams ssmlGender. + * @member {google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender} ssmlGender + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.ssmlGender = 0; + + /** + * Creates a new VoiceSelectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams} VoiceSelectionParams instance + */ + VoiceSelectionParams.create = function create(properties) { + return new VoiceSelectionParams(properties); + }; + + /** + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.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.ssmlGender != null && Object.hasOwnProperty.call(message, "ssmlGender")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ssmlGender); + return writer; + }; + + /** + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ssmlGender = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceSelectionParams message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceSelectionParams.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + switch (message.ssmlGender) { + default: + return "ssmlGender: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams} VoiceSelectionParams + */ + VoiceSelectionParams.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams(); + if (object.name != null) + message.name = String(object.name); + switch (object.ssmlGender) { + default: + if (typeof object.ssmlGender === "number") { + message.ssmlGender = object.ssmlGender; + break; + } + break; + case "SSML_VOICE_GENDER_UNSPECIFIED": + case 0: + message.ssmlGender = 0; + break; + case "SSML_VOICE_GENDER_MALE": + case 1: + message.ssmlGender = 1; + break; + case "SSML_VOICE_GENDER_FEMALE": + case 2: + message.ssmlGender = 2; + break; + case "SSML_VOICE_GENDER_NEUTRAL": + case 3: + message.ssmlGender = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams} message VoiceSelectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceSelectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + object.ssmlGender = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender[message.ssmlGender] === undefined ? message.ssmlGender : $root.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; + return object; + }; + + /** + * Converts this VoiceSelectionParams to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @instance + * @returns {Object.} JSON object + */ + VoiceSelectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceSelectionParams + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceSelectionParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams"; + }; + + return VoiceSelectionParams; + })(); + + v3beta1.SynthesizeSpeechConfig = (function() { + + /** + * Properties of a SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISynthesizeSpeechConfig + * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate + * @property {number|null} [pitch] SynthesizeSpeechConfig pitch + * @property {number|null} [volumeGainDb] SynthesizeSpeechConfig volumeGainDb + * @property {Array.|null} [effectsProfileId] SynthesizeSpeechConfig effectsProfileId + * @property {google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams|null} [voice] SynthesizeSpeechConfig voice + */ + + /** + * Constructs a new SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SynthesizeSpeechConfig. + * @implements ISynthesizeSpeechConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig=} [properties] Properties to set + */ + function SynthesizeSpeechConfig(properties) { + this.effectsProfileId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SynthesizeSpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.speakingRate = 0; + + /** + * SynthesizeSpeechConfig pitch. + * @member {number} pitch + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.pitch = 0; + + /** + * SynthesizeSpeechConfig volumeGainDb. + * @member {number} volumeGainDb + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.volumeGainDb = 0; + + /** + * SynthesizeSpeechConfig effectsProfileId. + * @member {Array.} effectsProfileId + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.effectsProfileId = $util.emptyArray; + + /** + * SynthesizeSpeechConfig voice. + * @member {google.cloud.dialogflow.cx.v3beta1.IVoiceSelectionParams|null|undefined} voice + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.voice = null; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + */ + SynthesizeSpeechConfig.create = function create(properties) { + return new SynthesizeSpeechConfig(properties); + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); + if (message.pitch != null && Object.hasOwnProperty.call(message, "pitch")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.pitch); + if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.encode(message.voice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.effectsProfileId != null && message.effectsProfileId.length) + for (var i = 0; i < message.effectsProfileId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.effectsProfileId[i]); + return writer; + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speakingRate = reader.double(); + break; + } + case 2: { + message.pitch = reader.double(); + break; + } + case 3: { + message.volumeGainDb = reader.double(); + break; + } + case 5: { + if (!(message.effectsProfileId && message.effectsProfileId.length)) + message.effectsProfileId = []; + message.effectsProfileId.push(reader.string()); + break; + } + case 4: { + message.voice = $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynthesizeSpeechConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + if (message.pitch != null && message.hasOwnProperty("pitch")) + if (typeof message.pitch !== "number") + return "pitch: number expected"; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + if (typeof message.volumeGainDb !== "number") + return "volumeGainDb: number expected"; + if (message.effectsProfileId != null && message.hasOwnProperty("effectsProfileId")) { + if (!Array.isArray(message.effectsProfileId)) + return "effectsProfileId: array expected"; + for (var i = 0; i < message.effectsProfileId.length; ++i) + if (!$util.isString(message.effectsProfileId[i])) + return "effectsProfileId: string[] expected"; + } + if (message.voice != null && message.hasOwnProperty("voice")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.verify(message.voice, long + 1); + if (error) + return "voice." + error; + } + return null; + }; + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + */ + SynthesizeSpeechConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig(); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + if (object.pitch != null) + message.pitch = Number(object.pitch); + if (object.volumeGainDb != null) + message.volumeGainDb = Number(object.volumeGainDb); + if (object.effectsProfileId) { + if (!Array.isArray(object.effectsProfileId)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.effectsProfileId: array expected"); + message.effectsProfileId = []; + for (var i = 0; i < object.effectsProfileId.length; ++i) + message.effectsProfileId[i] = String(object.effectsProfileId[i]); + } + if (object.voice != null) { + if (typeof object.voice !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.voice: object expected"); + message.voice = $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.fromObject(object.voice, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynthesizeSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.effectsProfileId = []; + if (options.defaults) { + object.speakingRate = 0; + object.pitch = 0; + object.volumeGainDb = 0; + object.voice = null; + } + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + if (message.pitch != null && message.hasOwnProperty("pitch")) + object.pitch = options.json && !isFinite(message.pitch) ? String(message.pitch) : message.pitch; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = $root.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.toObject(message.voice, options); + if (message.effectsProfileId && message.effectsProfileId.length) { + object.effectsProfileId = []; + for (var j = 0; j < message.effectsProfileId.length; ++j) + object.effectsProfileId[j] = message.effectsProfileId[j]; + } + return object; + }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SynthesizeSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig"; + }; + + return SynthesizeSpeechConfig; + })(); + + /** + * OutputAudioEncoding enum. + * @name google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding + * @enum {number} + * @property {number} OUTPUT_AUDIO_ENCODING_UNSPECIFIED=0 OUTPUT_AUDIO_ENCODING_UNSPECIFIED value + * @property {number} OUTPUT_AUDIO_ENCODING_LINEAR_16=1 OUTPUT_AUDIO_ENCODING_LINEAR_16 value + * @property {number} OUTPUT_AUDIO_ENCODING_MP3=2 OUTPUT_AUDIO_ENCODING_MP3 value + * @property {number} OUTPUT_AUDIO_ENCODING_MP3_64_KBPS=4 OUTPUT_AUDIO_ENCODING_MP3_64_KBPS value + * @property {number} OUTPUT_AUDIO_ENCODING_OGG_OPUS=3 OUTPUT_AUDIO_ENCODING_OGG_OPUS value + * @property {number} OUTPUT_AUDIO_ENCODING_MULAW=5 OUTPUT_AUDIO_ENCODING_MULAW value + * @property {number} OUTPUT_AUDIO_ENCODING_ALAW=6 OUTPUT_AUDIO_ENCODING_ALAW value + */ + v3beta1.OutputAudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTPUT_AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "OUTPUT_AUDIO_ENCODING_MP3"] = 2; + values[valuesById[4] = "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS"] = 4; + values[valuesById[3] = "OUTPUT_AUDIO_ENCODING_OGG_OPUS"] = 3; + values[valuesById[5] = "OUTPUT_AUDIO_ENCODING_MULAW"] = 5; + values[valuesById[6] = "OUTPUT_AUDIO_ENCODING_ALAW"] = 6; + return values; + })(); + + v3beta1.OutputAudioConfig = (function() { + + /** + * Properties of an OutputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IOutputAudioConfig + * @property {google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz + * @property {google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig|null} [synthesizeSpeechConfig] OutputAudioConfig synthesizeSpeechConfig + */ + + /** + * Constructs a new OutputAudioConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an OutputAudioConfig. + * @implements IOutputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig=} [properties] Properties to set + */ + function OutputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.audioEncoding = 0; + + /** + * OutputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * OutputAudioConfig synthesizeSpeechConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.ISynthesizeSpeechConfig|null|undefined} synthesizeSpeechConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.synthesizeSpeechConfig = null; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} OutputAudioConfig instance + */ + OutputAudioConfig.create = function create(properties) { + return new OutputAudioConfig(properties); + }; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.synthesizeSpeechConfig != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 3: { + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 3: + case 5: + case 6: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfig, long + 1); + if (error) + return "synthesizeSpeechConfig." + error; + } + return null; + }; + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} OutputAudioConfig + */ + OutputAudioConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "OUTPUT_AUDIO_ENCODING_LINEAR_16": + case 1: + message.audioEncoding = 1; + break; + case "OUTPUT_AUDIO_ENCODING_MP3": + case 2: + message.audioEncoding = 2; + break; + case "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS": + case 4: + message.audioEncoding = 4; + break; + case "OUTPUT_AUDIO_ENCODING_OGG_OPUS": + case 3: + message.audioEncoding = 3; + break; + case "OUTPUT_AUDIO_ENCODING_MULAW": + case 5: + message.audioEncoding = 5; + break; + case "OUTPUT_AUDIO_ENCODING_ALAW": + case 6: + message.audioEncoding = 6; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.synthesizeSpeechConfig != null) { + if (typeof object.synthesizeSpeechConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.synthesizeSpeechConfig: object expected"); + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} message OutputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.synthesizeSpeechConfig = null; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) + object.synthesizeSpeechConfig = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfig, options); + return object; + }; + + /** + * Converts this OutputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + OutputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig"; + }; + + return OutputAudioConfig; + })(); + + v3beta1.TextToSpeechSettings = (function() { + + /** + * Properties of a TextToSpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITextToSpeechSettings + * @property {Object.|null} [synthesizeSpeechConfigs] TextToSpeechSettings synthesizeSpeechConfigs + */ + + /** + * Constructs a new TextToSpeechSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TextToSpeechSettings. + * @implements ITextToSpeechSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings=} [properties] Properties to set + */ + function TextToSpeechSettings(properties) { + this.synthesizeSpeechConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextToSpeechSettings synthesizeSpeechConfigs. + * @member {Object.} synthesizeSpeechConfigs + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @instance + */ + TextToSpeechSettings.prototype.synthesizeSpeechConfigs = $util.emptyObject; + + /** + * Creates a new TextToSpeechSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings} TextToSpeechSettings instance + */ + TextToSpeechSettings.create = function create(properties) { + return new TextToSpeechSettings(properties); + }; + + /** + * Encodes the specified TextToSpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings} message TextToSpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextToSpeechSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synthesizeSpeechConfigs != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfigs")) + for (var keys = Object.keys(message.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TextToSpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITextToSpeechSettings} message TextToSpeechSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextToSpeechSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings} TextToSpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextToSpeechSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.synthesizeSpeechConfigs === $util.emptyObject) + message.synthesizeSpeechConfigs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.synthesizeSpeechConfigs, key); + message.synthesizeSpeechConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TextToSpeechSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings} TextToSpeechSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextToSpeechSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextToSpeechSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextToSpeechSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.synthesizeSpeechConfigs != null && message.hasOwnProperty("synthesizeSpeechConfigs")) { + if (!$util.isObject(message.synthesizeSpeechConfigs)) + return "synthesizeSpeechConfigs: object expected"; + var key = Object.keys(message.synthesizeSpeechConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfigs[key[i]], long + 1); + if (error) + return "synthesizeSpeechConfigs." + error; + } + } + return null; + }; + + /** + * Creates a TextToSpeechSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings} TextToSpeechSettings + */ + TextToSpeechSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings(); + if (object.synthesizeSpeechConfigs) { + if (typeof object.synthesizeSpeechConfigs !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs = {}; + for (var keys = Object.keys(object.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.synthesizeSpeechConfigs, keys[i]); + if (typeof object.synthesizeSpeechConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs[keys[i]] = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfigs[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TextToSpeechSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings} message TextToSpeechSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextToSpeechSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.synthesizeSpeechConfigs = {}; + var keys2; + if (message.synthesizeSpeechConfigs && (keys2 = Object.keys(message.synthesizeSpeechConfigs)).length) { + object.synthesizeSpeechConfigs = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.synthesizeSpeechConfigs, keys2[j]); + object.synthesizeSpeechConfigs[keys2[j]] = $root.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfigs[keys2[j]], options); + } + } + return object; + }; + + /** + * Converts this TextToSpeechSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @instance + * @returns {Object.} JSON object + */ + TextToSpeechSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextToSpeechSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextToSpeechSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TextToSpeechSettings"; + }; + + return TextToSpeechSettings; + })(); + + v3beta1.BigQueryExportSettings = (function() { + + /** + * Properties of a BigQueryExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBigQueryExportSettings + * @property {boolean|null} [enabled] BigQueryExportSettings enabled + * @property {string|null} [bigqueryTable] BigQueryExportSettings bigqueryTable + */ + + /** + * Constructs a new BigQueryExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BigQueryExportSettings. + * @implements IBigQueryExportSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings=} [properties] Properties to set + */ + function BigQueryExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryExportSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.enabled = false; + + /** + * BigQueryExportSettings bigqueryTable. + * @member {string} bigqueryTable + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.bigqueryTable = ""; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings} BigQueryExportSettings instance + */ + BigQueryExportSettings.create = function create(properties) { + return new BigQueryExportSettings(properties); + }; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.bigqueryTable != null && Object.hasOwnProperty.call(message, "bigqueryTable")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryTable); + return writer; + }; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.bigqueryTable = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryExportSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryExportSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.bigqueryTable != null && message.hasOwnProperty("bigqueryTable")) + if (!$util.isString(message.bigqueryTable)) + return "bigqueryTable: string expected"; + return null; + }; + + /** + * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings} BigQueryExportSettings + */ + BigQueryExportSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.bigqueryTable != null) + message.bigqueryTable = String(object.bigqueryTable); + return message; + }; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings} message BigQueryExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.bigqueryTable = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.bigqueryTable != null && message.hasOwnProperty("bigqueryTable")) + object.bigqueryTable = message.bigqueryTable; + return object; + }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @instance + * @returns {Object.} JSON object + */ + BigQueryExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryExportSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BigQueryExportSettings"; + }; + + return BigQueryExportSettings; + })(); + + v3beta1.Flows = (function() { + + /** + * Constructs a new Flows service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Flows + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Flows(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Flows.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Flows; + + /** + * Creates new Flows service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Flows} RPC service. Useful where requests and/or responses are streamed. + */ + Flows.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|createFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef CreateFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Flow} [response] Flow + */ + + /** + * Calls CreateFlow. + * @function createFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest} request CreateFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlowCallback} callback Node-style callback called with the error, if any, and Flow + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.createFlow = function createFlow(request, callback) { + return this.rpcCall(createFlow, $root.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest, $root.google.cloud.dialogflow.cx.v3beta1.Flow, request, callback); + }, "name", { value: "CreateFlow" }); + + /** + * Calls CreateFlow. + * @function createFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest} request CreateFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|deleteFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef DeleteFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFlow. + * @function deleteFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest} request DeleteFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlowCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.deleteFlow = function deleteFlow(request, callback) { + return this.rpcCall(deleteFlow, $root.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFlow" }); + + /** + * Calls DeleteFlow. + * @function deleteFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest} request DeleteFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|listFlows}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef ListFlowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} [response] ListFlowsResponse + */ + + /** + * Calls ListFlows. + * @function listFlows + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest} request ListFlowsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.ListFlowsCallback} callback Node-style callback called with the error, if any, and ListFlowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.listFlows = function listFlows(request, callback) { + return this.rpcCall(listFlows, $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse, request, callback); + }, "name", { value: "ListFlows" }); + + /** + * Calls ListFlows. + * @function listFlows + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest} request ListFlowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|getFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef GetFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Flow} [response] Flow + */ + + /** + * Calls GetFlow. + * @function getFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest} request GetFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowCallback} callback Node-style callback called with the error, if any, and Flow + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.getFlow = function getFlow(request, callback) { + return this.rpcCall(getFlow, $root.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest, $root.google.cloud.dialogflow.cx.v3beta1.Flow, request, callback); + }, "name", { value: "GetFlow" }); + + /** + * Calls GetFlow. + * @function getFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest} request GetFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|updateFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef UpdateFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Flow} [response] Flow + */ + + /** + * Calls UpdateFlow. + * @function updateFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest} request UpdateFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlowCallback} callback Node-style callback called with the error, if any, and Flow + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.updateFlow = function updateFlow(request, callback) { + return this.rpcCall(updateFlow, $root.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest, $root.google.cloud.dialogflow.cx.v3beta1.Flow, request, callback); + }, "name", { value: "UpdateFlow" }); + + /** + * Calls UpdateFlow. + * @function updateFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest} request UpdateFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|trainFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef TrainFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TrainFlow. + * @function trainFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest} request TrainFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.trainFlow = function trainFlow(request, callback) { + return this.rpcCall(trainFlow, $root.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TrainFlow" }); + + /** + * Calls TrainFlow. + * @function trainFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest} request TrainFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|validateFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef ValidateFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.FlowValidationResult} [response] FlowValidationResult + */ + + /** + * Calls ValidateFlow. + * @function validateFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest} request ValidateFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.ValidateFlowCallback} callback Node-style callback called with the error, if any, and FlowValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.validateFlow = function validateFlow(request, callback) { + return this.rpcCall(validateFlow, $root.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest, $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult, request, callback); + }, "name", { value: "ValidateFlow" }); + + /** + * Calls ValidateFlow. + * @function validateFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest} request ValidateFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|getFlowValidationResult}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef GetFlowValidationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.FlowValidationResult} [response] FlowValidationResult + */ + + /** + * Calls GetFlowValidationResult. + * @function getFlowValidationResult + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest} request GetFlowValidationResultRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowValidationResultCallback} callback Node-style callback called with the error, if any, and FlowValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.getFlowValidationResult = function getFlowValidationResult(request, callback) { + return this.rpcCall(getFlowValidationResult, $root.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest, $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult, request, callback); + }, "name", { value: "GetFlowValidationResult" }); + + /** + * Calls GetFlowValidationResult. + * @function getFlowValidationResult + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest} request GetFlowValidationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|importFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef ImportFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportFlow. + * @function importFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest} request ImportFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.importFlow = function importFlow(request, callback) { + return this.rpcCall(importFlow, $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportFlow" }); + + /** + * Calls ImportFlow. + * @function importFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest} request ImportFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Flows|exportFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @typedef ExportFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportFlow. + * @function exportFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest} request ExportFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Flows.prototype.exportFlow = function exportFlow(request, callback) { + return this.rpcCall(exportFlow, $root.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportFlow" }); + + /** + * Calls ExportFlow. + * @function exportFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Flows + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest} request ExportFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Flows; + })(); + + v3beta1.NluSettings = (function() { + + /** + * Properties of a NluSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface INluSettings + * @property {google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType|null} [modelType] NluSettings modelType + * @property {number|null} [classificationThreshold] NluSettings classificationThreshold + * @property {google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode|null} [modelTrainingMode] NluSettings modelTrainingMode + */ + + /** + * Constructs a new NluSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a NluSettings. + * @implements INluSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.INluSettings=} [properties] Properties to set + */ + function NluSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NluSettings modelType. + * @member {google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType} modelType + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @instance + */ + NluSettings.prototype.modelType = 0; + + /** + * NluSettings classificationThreshold. + * @member {number} classificationThreshold + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @instance + */ + NluSettings.prototype.classificationThreshold = 0; + + /** + * NluSettings modelTrainingMode. + * @member {google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode} modelTrainingMode + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @instance + */ + NluSettings.prototype.modelTrainingMode = 0; + + /** + * Creates a new NluSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.INluSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.NluSettings} NluSettings instance + */ + NluSettings.create = function create(properties) { + return new NluSettings(properties); + }; + + /** + * Encodes the specified NluSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NluSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.INluSettings} message NluSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NluSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); + if (message.classificationThreshold != null && Object.hasOwnProperty.call(message, "classificationThreshold")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.classificationThreshold); + if (message.modelTrainingMode != null && Object.hasOwnProperty.call(message, "modelTrainingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.modelTrainingMode); + return writer; + }; + + /** + * Encodes the specified NluSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NluSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.INluSettings} message NluSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NluSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NluSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.NluSettings} NluSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NluSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.NluSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelType = reader.int32(); + break; + } + case 3: { + message.classificationThreshold = reader.float(); + break; + } + case 4: { + message.modelTrainingMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NluSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.NluSettings} NluSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NluSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NluSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NluSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) + if (typeof message.classificationThreshold !== "number") + return "classificationThreshold: number expected"; + if (message.modelTrainingMode != null && message.hasOwnProperty("modelTrainingMode")) + switch (message.modelTrainingMode) { + default: + return "modelTrainingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NluSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.NluSettings} NluSettings + */ + NluSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.NluSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.NluSettings(); + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "MODEL_TYPE_STANDARD": + case 1: + message.modelType = 1; + break; + case "MODEL_TYPE_ADVANCED": + case 3: + message.modelType = 3; + break; + } + if (object.classificationThreshold != null) + message.classificationThreshold = Number(object.classificationThreshold); + switch (object.modelTrainingMode) { + default: + if (typeof object.modelTrainingMode === "number") { + message.modelTrainingMode = object.modelTrainingMode; + break; + } + break; + case "MODEL_TRAINING_MODE_UNSPECIFIED": + case 0: + message.modelTrainingMode = 0; + break; + case "MODEL_TRAINING_MODE_AUTOMATIC": + case 1: + message.modelTrainingMode = 1; + break; + case "MODEL_TRAINING_MODE_MANUAL": + case 2: + message.modelTrainingMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NluSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.NluSettings} message NluSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NluSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + object.classificationThreshold = 0; + object.modelTrainingMode = options.enums === String ? "MODEL_TRAINING_MODE_UNSPECIFIED" : 0; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType[message.modelType] : message.modelType; + if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) + object.classificationThreshold = options.json && !isFinite(message.classificationThreshold) ? String(message.classificationThreshold) : message.classificationThreshold; + if (message.modelTrainingMode != null && message.hasOwnProperty("modelTrainingMode")) + object.modelTrainingMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode[message.modelTrainingMode] === undefined ? message.modelTrainingMode : $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode[message.modelTrainingMode] : message.modelTrainingMode; + return object; + }; + + /** + * Converts this NluSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @instance + * @returns {Object.} JSON object + */ + NluSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NluSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.NluSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NluSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.NluSettings"; + }; + + /** + * ModelType enum. + * @name google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} MODEL_TYPE_STANDARD=1 MODEL_TYPE_STANDARD value + * @property {number} MODEL_TYPE_ADVANCED=3 MODEL_TYPE_ADVANCED value + */ + NluSettings.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_TYPE_STANDARD"] = 1; + values[valuesById[3] = "MODEL_TYPE_ADVANCED"] = 3; + return values; + })(); + + /** + * ModelTrainingMode enum. + * @name google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode + * @enum {number} + * @property {number} MODEL_TRAINING_MODE_UNSPECIFIED=0 MODEL_TRAINING_MODE_UNSPECIFIED value + * @property {number} MODEL_TRAINING_MODE_AUTOMATIC=1 MODEL_TRAINING_MODE_AUTOMATIC value + * @property {number} MODEL_TRAINING_MODE_MANUAL=2 MODEL_TRAINING_MODE_MANUAL value + */ + NluSettings.ModelTrainingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TRAINING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_TRAINING_MODE_AUTOMATIC"] = 1; + values[valuesById[2] = "MODEL_TRAINING_MODE_MANUAL"] = 2; + return values; + })(); + + return NluSettings; + })(); + + v3beta1.Flow = (function() { + + /** + * Properties of a Flow. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFlow + * @property {string|null} [name] Flow name + * @property {string|null} [displayName] Flow displayName + * @property {string|null} [description] Flow description + * @property {Array.|null} [transitionRoutes] Flow transitionRoutes + * @property {Array.|null} [eventHandlers] Flow eventHandlers + * @property {Array.|null} [transitionRouteGroups] Flow transitionRouteGroups + * @property {google.cloud.dialogflow.cx.v3beta1.INluSettings|null} [nluSettings] Flow nluSettings + * @property {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null} [advancedSettings] Flow advancedSettings + * @property {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null} [knowledgeConnectorSettings] Flow knowledgeConnectorSettings + * @property {Array.|null} [inputParameterDefinitions] Flow inputParameterDefinitions + * @property {Array.|null} [outputParameterDefinitions] Flow outputParameterDefinitions + * @property {google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings|null} [multiLanguageSettings] Flow multiLanguageSettings + * @property {boolean|null} [locked] Flow locked + */ + + /** + * Constructs a new Flow. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Flow. + * @implements IFlow + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFlow=} [properties] Properties to set + */ + function Flow(properties) { + this.transitionRoutes = []; + this.eventHandlers = []; + this.transitionRouteGroups = []; + this.inputParameterDefinitions = []; + this.outputParameterDefinitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Flow name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.name = ""; + + /** + * Flow displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.displayName = ""; + + /** + * Flow description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.description = ""; + + /** + * Flow transitionRoutes. + * @member {Array.} transitionRoutes + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.transitionRoutes = $util.emptyArray; + + /** + * Flow eventHandlers. + * @member {Array.} eventHandlers + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.eventHandlers = $util.emptyArray; + + /** + * Flow transitionRouteGroups. + * @member {Array.} transitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.transitionRouteGroups = $util.emptyArray; + + /** + * Flow nluSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.INluSettings|null|undefined} nluSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.nluSettings = null; + + /** + * Flow advancedSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.advancedSettings = null; + + /** + * Flow knowledgeConnectorSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null|undefined} knowledgeConnectorSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.knowledgeConnectorSettings = null; + + /** + * Flow inputParameterDefinitions. + * @member {Array.} inputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.inputParameterDefinitions = $util.emptyArray; + + /** + * Flow outputParameterDefinitions. + * @member {Array.} outputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.outputParameterDefinitions = $util.emptyArray; + + /** + * Flow multiLanguageSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings|null|undefined} multiLanguageSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.multiLanguageSettings = null; + + /** + * Flow locked. + * @member {boolean} locked + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + */ + Flow.prototype.locked = false; + + /** + * Creates a new Flow instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlow=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow} Flow instance + */ + Flow.create = function create(properties) { + return new Flow(properties); + }; + + /** + * Encodes the specified Flow message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlow} message Flow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Flow.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.transitionRoutes != null && message.transitionRoutes.length) + for (var i = 0; i < message.transitionRoutes.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.encode(message.transitionRoutes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.eventHandlers != null && message.eventHandlers.length) + for (var i = 0; i < message.eventHandlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.encode(message.eventHandlers[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.nluSettings != null && Object.hasOwnProperty.call(message, "nluSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.encode(message.nluSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.transitionRouteGroups != null && message.transitionRouteGroups.length) + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.transitionRouteGroups[i]); + if (message.knowledgeConnectorSettings != null && Object.hasOwnProperty.call(message, "knowledgeConnectorSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.encode(message.knowledgeConnectorSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.inputParameterDefinitions != null && message.inputParameterDefinitions.length) + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.encode(message.inputParameterDefinitions[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.outputParameterDefinitions != null && message.outputParameterDefinitions.length) + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.encode(message.outputParameterDefinitions[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.multiLanguageSettings != null && Object.hasOwnProperty.call(message, "multiLanguageSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.encode(message.multiLanguageSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.locked); + return writer; + }; + + /** + * Encodes the specified Flow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlow} message Flow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Flow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Flow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow} Flow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Flow.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Flow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.transitionRoutes && message.transitionRoutes.length)) + message.transitionRoutes = []; + message.transitionRoutes.push($root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.eventHandlers && message.eventHandlers.length)) + message.eventHandlers = []; + message.eventHandlers.push($root.google.cloud.dialogflow.cx.v3beta1.EventHandler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 15: { + if (!(message.transitionRouteGroups && message.transitionRouteGroups.length)) + message.transitionRouteGroups = []; + message.transitionRouteGroups.push(reader.string()); + break; + } + case 11: { + message.nluSettings = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + if (!(message.inputParameterDefinitions && message.inputParameterDefinitions.length)) + message.inputParameterDefinitions = []; + message.inputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 27: { + if (!(message.outputParameterDefinitions && message.outputParameterDefinitions.length)) + message.outputParameterDefinitions = []; + message.outputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 28: { + message.multiLanguageSettings = $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.locked = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Flow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow} Flow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Flow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Flow message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Flow.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.transitionRoutes != null && message.hasOwnProperty("transitionRoutes")) { + if (!Array.isArray(message.transitionRoutes)) + return "transitionRoutes: array expected"; + for (var i = 0; i < message.transitionRoutes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify(message.transitionRoutes[i], long + 1); + if (error) + return "transitionRoutes." + error; + } + } + if (message.eventHandlers != null && message.hasOwnProperty("eventHandlers")) { + if (!Array.isArray(message.eventHandlers)) + return "eventHandlers: array expected"; + for (var i = 0; i < message.eventHandlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.verify(message.eventHandlers[i], long + 1); + if (error) + return "eventHandlers." + error; + } + } + if (message.transitionRouteGroups != null && message.hasOwnProperty("transitionRouteGroups")) { + if (!Array.isArray(message.transitionRouteGroups)) + return "transitionRouteGroups: array expected"; + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + if (!$util.isString(message.transitionRouteGroups[i])) + return "transitionRouteGroups: string[] expected"; + } + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.verify(message.nluSettings, long + 1); + if (error) + return "nluSettings." + error; + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.verify(message.knowledgeConnectorSettings, long + 1); + if (error) + return "knowledgeConnectorSettings." + error; + } + if (message.inputParameterDefinitions != null && message.hasOwnProperty("inputParameterDefinitions")) { + if (!Array.isArray(message.inputParameterDefinitions)) + return "inputParameterDefinitions: array expected"; + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify(message.inputParameterDefinitions[i], long + 1); + if (error) + return "inputParameterDefinitions." + error; + } + } + if (message.outputParameterDefinitions != null && message.hasOwnProperty("outputParameterDefinitions")) { + if (!Array.isArray(message.outputParameterDefinitions)) + return "outputParameterDefinitions: array expected"; + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify(message.outputParameterDefinitions[i], long + 1); + if (error) + return "outputParameterDefinitions." + error; + } + } + if (message.multiLanguageSettings != null && message.hasOwnProperty("multiLanguageSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.verify(message.multiLanguageSettings, long + 1); + if (error) + return "multiLanguageSettings." + error; + } + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + return null; + }; + + /** + * Creates a Flow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow} Flow + */ + Flow.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Flow) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Flow(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.transitionRoutes) { + if (!Array.isArray(object.transitionRoutes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.transitionRoutes: array expected"); + message.transitionRoutes = []; + for (var i = 0; i < object.transitionRoutes.length; ++i) { + if (typeof object.transitionRoutes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.transitionRoutes: object expected"); + message.transitionRoutes[i] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.fromObject(object.transitionRoutes[i], long + 1); + } + } + if (object.eventHandlers) { + if (!Array.isArray(object.eventHandlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.eventHandlers: array expected"); + message.eventHandlers = []; + for (var i = 0; i < object.eventHandlers.length; ++i) { + if (typeof object.eventHandlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.eventHandlers: object expected"); + message.eventHandlers[i] = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.fromObject(object.eventHandlers[i], long + 1); + } + } + if (object.transitionRouteGroups) { + if (!Array.isArray(object.transitionRouteGroups)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.transitionRouteGroups: array expected"); + message.transitionRouteGroups = []; + for (var i = 0; i < object.transitionRouteGroups.length; ++i) + message.transitionRouteGroups[i] = String(object.transitionRouteGroups[i]); + } + if (object.nluSettings != null) { + if (typeof object.nluSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.nluSettings: object expected"); + message.nluSettings = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.fromObject(object.nluSettings, long + 1); + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.knowledgeConnectorSettings != null) { + if (typeof object.knowledgeConnectorSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.knowledgeConnectorSettings: object expected"); + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.fromObject(object.knowledgeConnectorSettings, long + 1); + } + if (object.inputParameterDefinitions) { + if (!Array.isArray(object.inputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.inputParameterDefinitions: array expected"); + message.inputParameterDefinitions = []; + for (var i = 0; i < object.inputParameterDefinitions.length; ++i) { + if (typeof object.inputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.inputParameterDefinitions: object expected"); + message.inputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.fromObject(object.inputParameterDefinitions[i], long + 1); + } + } + if (object.outputParameterDefinitions) { + if (!Array.isArray(object.outputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.outputParameterDefinitions: array expected"); + message.outputParameterDefinitions = []; + for (var i = 0; i < object.outputParameterDefinitions.length; ++i) { + if (typeof object.outputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.outputParameterDefinitions: object expected"); + message.outputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.fromObject(object.outputParameterDefinitions[i], long + 1); + } + } + if (object.multiLanguageSettings != null) { + if (typeof object.multiLanguageSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.multiLanguageSettings: object expected"); + message.multiLanguageSettings = $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.fromObject(object.multiLanguageSettings, long + 1); + } + if (object.locked != null) + message.locked = Boolean(object.locked); + return message; + }; + + /** + * Creates a plain object from a Flow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Flow} message Flow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Flow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.transitionRoutes = []; + object.eventHandlers = []; + object.transitionRouteGroups = []; + object.inputParameterDefinitions = []; + object.outputParameterDefinitions = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.nluSettings = null; + object.advancedSettings = null; + object.knowledgeConnectorSettings = null; + object.multiLanguageSettings = null; + object.locked = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.transitionRoutes && message.transitionRoutes.length) { + object.transitionRoutes = []; + for (var j = 0; j < message.transitionRoutes.length; ++j) + object.transitionRoutes[j] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.toObject(message.transitionRoutes[j], options); + } + if (message.eventHandlers && message.eventHandlers.length) { + object.eventHandlers = []; + for (var j = 0; j < message.eventHandlers.length; ++j) + object.eventHandlers[j] = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.toObject(message.eventHandlers[j], options); + } + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) + object.nluSettings = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.toObject(message.nluSettings, options); + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.transitionRouteGroups && message.transitionRouteGroups.length) { + object.transitionRouteGroups = []; + for (var j = 0; j < message.transitionRouteGroups.length; ++j) + object.transitionRouteGroups[j] = message.transitionRouteGroups[j]; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) + object.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.toObject(message.knowledgeConnectorSettings, options); + if (message.inputParameterDefinitions && message.inputParameterDefinitions.length) { + object.inputParameterDefinitions = []; + for (var j = 0; j < message.inputParameterDefinitions.length; ++j) + object.inputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.toObject(message.inputParameterDefinitions[j], options); + } + if (message.outputParameterDefinitions && message.outputParameterDefinitions.length) { + object.outputParameterDefinitions = []; + for (var j = 0; j < message.outputParameterDefinitions.length; ++j) + object.outputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.toObject(message.outputParameterDefinitions[j], options); + } + if (message.multiLanguageSettings != null && message.hasOwnProperty("multiLanguageSettings")) + object.multiLanguageSettings = $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.toObject(message.multiLanguageSettings, options); + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + return object; + }; + + /** + * Converts this Flow to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @instance + * @returns {Object.} JSON object + */ + Flow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Flow + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Flow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Flow"; + }; + + Flow.MultiLanguageSettings = (function() { + + /** + * Properties of a MultiLanguageSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @interface IMultiLanguageSettings + * @property {boolean|null} [enableMultiLanguageDetection] MultiLanguageSettings enableMultiLanguageDetection + * @property {Array.|null} [supportedResponseLanguageCodes] MultiLanguageSettings supportedResponseLanguageCodes + */ + + /** + * Constructs a new MultiLanguageSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow + * @classdesc Represents a MultiLanguageSettings. + * @implements IMultiLanguageSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings=} [properties] Properties to set + */ + function MultiLanguageSettings(properties) { + this.supportedResponseLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiLanguageSettings enableMultiLanguageDetection. + * @member {boolean} enableMultiLanguageDetection + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @instance + */ + MultiLanguageSettings.prototype.enableMultiLanguageDetection = false; + + /** + * MultiLanguageSettings supportedResponseLanguageCodes. + * @member {Array.} supportedResponseLanguageCodes + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @instance + */ + MultiLanguageSettings.prototype.supportedResponseLanguageCodes = $util.emptyArray; + + /** + * Creates a new MultiLanguageSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings} MultiLanguageSettings instance + */ + MultiLanguageSettings.create = function create(properties) { + return new MultiLanguageSettings(properties); + }; + + /** + * Encodes the specified MultiLanguageSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings} message MultiLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableMultiLanguageDetection != null && Object.hasOwnProperty.call(message, "enableMultiLanguageDetection")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableMultiLanguageDetection); + if (message.supportedResponseLanguageCodes != null && message.supportedResponseLanguageCodes.length) + for (var i = 0; i < message.supportedResponseLanguageCodes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.supportedResponseLanguageCodes[i]); + return writer; + }; + + /** + * Encodes the specified MultiLanguageSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Flow.IMultiLanguageSettings} message MultiLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings} MultiLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiLanguageSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableMultiLanguageDetection = reader.bool(); + break; + } + case 2: { + if (!(message.supportedResponseLanguageCodes && message.supportedResponseLanguageCodes.length)) + message.supportedResponseLanguageCodes = []; + message.supportedResponseLanguageCodes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MultiLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings} MultiLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiLanguageSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiLanguageSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableMultiLanguageDetection != null && message.hasOwnProperty("enableMultiLanguageDetection")) + if (typeof message.enableMultiLanguageDetection !== "boolean") + return "enableMultiLanguageDetection: boolean expected"; + if (message.supportedResponseLanguageCodes != null && message.hasOwnProperty("supportedResponseLanguageCodes")) { + if (!Array.isArray(message.supportedResponseLanguageCodes)) + return "supportedResponseLanguageCodes: array expected"; + for (var i = 0; i < message.supportedResponseLanguageCodes.length; ++i) + if (!$util.isString(message.supportedResponseLanguageCodes[i])) + return "supportedResponseLanguageCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a MultiLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings} MultiLanguageSettings + */ + MultiLanguageSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings(); + if (object.enableMultiLanguageDetection != null) + message.enableMultiLanguageDetection = Boolean(object.enableMultiLanguageDetection); + if (object.supportedResponseLanguageCodes) { + if (!Array.isArray(object.supportedResponseLanguageCodes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings.supportedResponseLanguageCodes: array expected"); + message.supportedResponseLanguageCodes = []; + for (var i = 0; i < object.supportedResponseLanguageCodes.length; ++i) + message.supportedResponseLanguageCodes[i] = String(object.supportedResponseLanguageCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a MultiLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings} message MultiLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedResponseLanguageCodes = []; + if (options.defaults) + object.enableMultiLanguageDetection = false; + if (message.enableMultiLanguageDetection != null && message.hasOwnProperty("enableMultiLanguageDetection")) + object.enableMultiLanguageDetection = message.enableMultiLanguageDetection; + if (message.supportedResponseLanguageCodes && message.supportedResponseLanguageCodes.length) { + object.supportedResponseLanguageCodes = []; + for (var j = 0; j < message.supportedResponseLanguageCodes.length; ++j) + object.supportedResponseLanguageCodes[j] = message.supportedResponseLanguageCodes[j]; + } + return object; + }; + + /** + * Converts this MultiLanguageSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + MultiLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiLanguageSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Flow.MultiLanguageSettings"; + }; + + return MultiLanguageSettings; + })(); + + return Flow; + })(); + + v3beta1.CreateFlowRequest = (function() { + + /** + * Properties of a CreateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateFlowRequest + * @property {string|null} [parent] CreateFlowRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IFlow|null} [flow] CreateFlowRequest flow + * @property {string|null} [languageCode] CreateFlowRequest languageCode + */ + + /** + * Constructs a new CreateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateFlowRequest. + * @implements ICreateFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest=} [properties] Properties to set + */ + function CreateFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFlowRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @instance + */ + CreateFlowRequest.prototype.parent = ""; + + /** + * CreateFlowRequest flow. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlow|null|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @instance + */ + CreateFlowRequest.prototype.flow = null; + + /** + * CreateFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @instance + */ + CreateFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest} CreateFlowRequest instance + */ + CreateFlowRequest.create = function create(properties) { + return new CreateFlowRequest(properties); + }; + + /** + * Encodes the specified CreateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest} message CreateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFlowRequest.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.flow != null && Object.hasOwnProperty.call(message, "flow")) + $root.google.cloud.dialogflow.cx.v3beta1.Flow.encode(message.flow, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest} message CreateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest} CreateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest} CreateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.flow != null && message.hasOwnProperty("flow")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Flow.verify(message.flow, long + 1); + if (error) + return "flow." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest} CreateFlowRequest + */ + CreateFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.flow != null) { + if (typeof object.flow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.flow: object expected"); + message.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.fromObject(object.flow, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest} message CreateFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.flow = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.toObject(message.flow, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest"; + }; + + return CreateFlowRequest; + })(); + + v3beta1.DeleteFlowRequest = (function() { + + /** + * Properties of a DeleteFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteFlowRequest + * @property {string|null} [name] DeleteFlowRequest name + * @property {boolean|null} [force] DeleteFlowRequest force + */ + + /** + * Constructs a new DeleteFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteFlowRequest. + * @implements IDeleteFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest=} [properties] Properties to set + */ + function DeleteFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @instance + */ + DeleteFlowRequest.prototype.name = ""; + + /** + * DeleteFlowRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @instance + */ + DeleteFlowRequest.prototype.force = false; + + /** + * Creates a new DeleteFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest} DeleteFlowRequest instance + */ + DeleteFlowRequest.create = function create(properties) { + return new DeleteFlowRequest(properties); + }; + + /** + * Encodes the specified DeleteFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest} message DeleteFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFlowRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest} message DeleteFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest} DeleteFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest} DeleteFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest} DeleteFlowRequest + */ + DeleteFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest} message DeleteFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest"; + }; + + return DeleteFlowRequest; + })(); + + v3beta1.ListFlowsRequest = (function() { + + /** + * Properties of a ListFlowsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListFlowsRequest + * @property {string|null} [parent] ListFlowsRequest parent + * @property {number|null} [pageSize] ListFlowsRequest pageSize + * @property {string|null} [pageToken] ListFlowsRequest pageToken + * @property {string|null} [languageCode] ListFlowsRequest languageCode + */ + + /** + * Constructs a new ListFlowsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListFlowsRequest. + * @implements IListFlowsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest=} [properties] Properties to set + */ + function ListFlowsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFlowsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.parent = ""; + + /** + * ListFlowsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.pageSize = 0; + + /** + * ListFlowsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.pageToken = ""; + + /** + * ListFlowsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @instance + */ + ListFlowsRequest.prototype.languageCode = ""; + + /** + * Creates a new ListFlowsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest} ListFlowsRequest instance + */ + ListFlowsRequest.create = function create(properties) { + return new ListFlowsRequest(properties); + }; + + /** + * Encodes the specified ListFlowsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest} message ListFlowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListFlowsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest} message ListFlowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest} ListFlowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFlowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest} ListFlowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFlowsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFlowsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListFlowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest} ListFlowsRequest + */ + ListFlowsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListFlowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest} message ListFlowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFlowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListFlowsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFlowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFlowsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFlowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest"; + }; + + return ListFlowsRequest; + })(); + + v3beta1.ListFlowsResponse = (function() { + + /** + * Properties of a ListFlowsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListFlowsResponse + * @property {Array.|null} [flows] ListFlowsResponse flows + * @property {string|null} [nextPageToken] ListFlowsResponse nextPageToken + */ + + /** + * Constructs a new ListFlowsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListFlowsResponse. + * @implements IListFlowsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse=} [properties] Properties to set + */ + function ListFlowsResponse(properties) { + this.flows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFlowsResponse flows. + * @member {Array.} flows + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @instance + */ + ListFlowsResponse.prototype.flows = $util.emptyArray; + + /** + * ListFlowsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @instance + */ + ListFlowsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFlowsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} ListFlowsResponse instance + */ + ListFlowsResponse.create = function create(properties) { + return new ListFlowsResponse(properties); + }; + + /** + * Encodes the specified ListFlowsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse} message ListFlowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flows != null && message.flows.length) + for (var i = 0; i < message.flows.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Flow.encode(message.flows[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 ListFlowsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse} message ListFlowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFlowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} ListFlowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.flows && message.flows.length)) + message.flows = []; + message.flows.push($root.google.cloud.dialogflow.cx.v3beta1.Flow.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFlowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} ListFlowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFlowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFlowsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFlowsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flows != null && message.hasOwnProperty("flows")) { + if (!Array.isArray(message.flows)) + return "flows: array expected"; + for (var i = 0; i < message.flows.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Flow.verify(message.flows[i], long + 1); + if (error) + return "flows." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFlowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} ListFlowsResponse + */ + ListFlowsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse(); + if (object.flows) { + if (!Array.isArray(object.flows)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.flows: array expected"); + message.flows = []; + for (var i = 0; i < object.flows.length; ++i) { + if (typeof object.flows[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.flows: object expected"); + message.flows[i] = $root.google.cloud.dialogflow.cx.v3beta1.Flow.fromObject(object.flows[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFlowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} message ListFlowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFlowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.flows = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.flows && message.flows.length) { + object.flows = []; + for (var j = 0; j < message.flows.length; ++j) + object.flows[j] = $root.google.cloud.dialogflow.cx.v3beta1.Flow.toObject(message.flows[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFlowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFlowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFlowsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFlowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse"; + }; + + return ListFlowsResponse; + })(); + + v3beta1.GetFlowRequest = (function() { + + /** + * Properties of a GetFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetFlowRequest + * @property {string|null} [name] GetFlowRequest name + * @property {string|null} [languageCode] GetFlowRequest languageCode + */ + + /** + * Constructs a new GetFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetFlowRequest. + * @implements IGetFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest=} [properties] Properties to set + */ + function GetFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @instance + */ + GetFlowRequest.prototype.name = ""; + + /** + * GetFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @instance + */ + GetFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new GetFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowRequest} GetFlowRequest instance + */ + GetFlowRequest.create = function create(properties) { + return new GetFlowRequest(properties); + }; + + /** + * Encodes the specified GetFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest} message GetFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest} message GetFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowRequest} GetFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowRequest} GetFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowRequest} GetFlowRequest + */ + GetFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetFlowRequest} message GetFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @instance + * @returns {Object.} JSON object + */ + GetFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetFlowRequest"; + }; + + return GetFlowRequest; + })(); + + v3beta1.UpdateFlowRequest = (function() { + + /** + * Properties of an UpdateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateFlowRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IFlow|null} [flow] UpdateFlowRequest flow + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFlowRequest updateMask + * @property {string|null} [languageCode] UpdateFlowRequest languageCode + */ + + /** + * Constructs a new UpdateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateFlowRequest. + * @implements IUpdateFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest=} [properties] Properties to set + */ + function UpdateFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFlowRequest flow. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlow|null|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @instance + */ + UpdateFlowRequest.prototype.flow = null; + + /** + * UpdateFlowRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @instance + */ + UpdateFlowRequest.prototype.updateMask = null; + + /** + * UpdateFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @instance + */ + UpdateFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new UpdateFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest} UpdateFlowRequest instance + */ + UpdateFlowRequest.create = function create(properties) { + return new UpdateFlowRequest(properties); + }; + + /** + * Encodes the specified UpdateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest} message UpdateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFlowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + $root.google.cloud.dialogflow.cx.v3beta1.Flow.encode(message.flow, 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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified UpdateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest} message UpdateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest} UpdateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest} UpdateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Flow.verify(message.flow, long + 1); + if (error) + return "flow." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an UpdateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest} UpdateFlowRequest + */ + UpdateFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(); + if (object.flow != null) { + if (typeof object.flow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.flow: object expected"); + message.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.fromObject(object.flow, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an UpdateFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest} message UpdateFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = null; + object.updateMask = null; + object.languageCode = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.toObject(message.flow, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this UpdateFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest"; + }; + + return UpdateFlowRequest; + })(); + + v3beta1.TrainFlowRequest = (function() { + + /** + * Properties of a TrainFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITrainFlowRequest + * @property {string|null} [name] TrainFlowRequest name + */ + + /** + * Constructs a new TrainFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TrainFlowRequest. + * @implements ITrainFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest=} [properties] Properties to set + */ + function TrainFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @instance + */ + TrainFlowRequest.prototype.name = ""; + + /** + * Creates a new TrainFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest} TrainFlowRequest instance + */ + TrainFlowRequest.create = function create(properties) { + return new TrainFlowRequest(properties); + }; + + /** + * Encodes the specified TrainFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest} message TrainFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainFlowRequest.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 TrainFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest} message TrainFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest} TrainFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TrainFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest} TrainFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a TrainFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest} TrainFlowRequest + */ + TrainFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a TrainFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest} message TrainFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainFlowRequest.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 TrainFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @instance + * @returns {Object.} JSON object + */ + TrainFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest"; + }; + + return TrainFlowRequest; + })(); + + v3beta1.ValidateFlowRequest = (function() { + + /** + * Properties of a ValidateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IValidateFlowRequest + * @property {string|null} [name] ValidateFlowRequest name + * @property {string|null} [languageCode] ValidateFlowRequest languageCode + */ + + /** + * Constructs a new ValidateFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ValidateFlowRequest. + * @implements IValidateFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest=} [properties] Properties to set + */ + function ValidateFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @instance + */ + ValidateFlowRequest.prototype.name = ""; + + /** + * ValidateFlowRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @instance + */ + ValidateFlowRequest.prototype.languageCode = ""; + + /** + * Creates a new ValidateFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest} ValidateFlowRequest instance + */ + ValidateFlowRequest.create = function create(properties) { + return new ValidateFlowRequest(properties); + }; + + /** + * Encodes the specified ValidateFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest} message ValidateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateFlowRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ValidateFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest} message ValidateFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest} ValidateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest} ValidateFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ValidateFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest} ValidateFlowRequest + */ + ValidateFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ValidateFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest} message ValidateFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ValidateFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest"; + }; + + return ValidateFlowRequest; + })(); + + v3beta1.GetFlowValidationResultRequest = (function() { + + /** + * Properties of a GetFlowValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetFlowValidationResultRequest + * @property {string|null} [name] GetFlowValidationResultRequest name + * @property {string|null} [languageCode] GetFlowValidationResultRequest languageCode + */ + + /** + * Constructs a new GetFlowValidationResultRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetFlowValidationResultRequest. + * @implements IGetFlowValidationResultRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest=} [properties] Properties to set + */ + function GetFlowValidationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFlowValidationResultRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @instance + */ + GetFlowValidationResultRequest.prototype.name = ""; + + /** + * GetFlowValidationResultRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @instance + */ + GetFlowValidationResultRequest.prototype.languageCode = ""; + + /** + * Creates a new GetFlowValidationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest} GetFlowValidationResultRequest instance + */ + GetFlowValidationResultRequest.create = function create(properties) { + return new GetFlowValidationResultRequest(properties); + }; + + /** + * Encodes the specified GetFlowValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest} message GetFlowValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowValidationResultRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetFlowValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest} message GetFlowValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFlowValidationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest} GetFlowValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowValidationResultRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetFlowValidationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest} GetFlowValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFlowValidationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFlowValidationResultRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFlowValidationResultRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetFlowValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest} GetFlowValidationResultRequest + */ + GetFlowValidationResultRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetFlowValidationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest} message GetFlowValidationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFlowValidationResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetFlowValidationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetFlowValidationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFlowValidationResultRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFlowValidationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest"; + }; + + return GetFlowValidationResultRequest; + })(); + + v3beta1.FlowValidationResult = (function() { + + /** + * Properties of a FlowValidationResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFlowValidationResult + * @property {string|null} [name] FlowValidationResult name + * @property {Array.|null} [validationMessages] FlowValidationResult validationMessages + * @property {google.protobuf.ITimestamp|null} [updateTime] FlowValidationResult updateTime + */ + + /** + * Constructs a new FlowValidationResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FlowValidationResult. + * @implements IFlowValidationResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult=} [properties] Properties to set + */ + function FlowValidationResult(properties) { + this.validationMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowValidationResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @instance + */ + FlowValidationResult.prototype.name = ""; + + /** + * FlowValidationResult validationMessages. + * @member {Array.} validationMessages + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @instance + */ + FlowValidationResult.prototype.validationMessages = $util.emptyArray; + + /** + * FlowValidationResult updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @instance + */ + FlowValidationResult.prototype.updateTime = null; + + /** + * Creates a new FlowValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowValidationResult} FlowValidationResult instance + */ + FlowValidationResult.create = function create(properties) { + return new FlowValidationResult(properties); + }; + + /** + * Encodes the specified FlowValidationResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult} message FlowValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowValidationResult.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.validationMessages != null && message.validationMessages.length) + for (var i = 0; i < message.validationMessages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.encode(message.validationMessages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FlowValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult} message FlowValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowValidationResult} FlowValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowValidationResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.validationMessages && message.validationMessages.length)) + message.validationMessages = []; + message.validationMessages.push($root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowValidationResult} FlowValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowValidationResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowValidationResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validationMessages != null && message.hasOwnProperty("validationMessages")) { + if (!Array.isArray(message.validationMessages)) + return "validationMessages: array expected"; + for (var i = 0; i < message.validationMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.verify(message.validationMessages[i], long + 1); + if (error) + return "validationMessages." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a FlowValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowValidationResult} FlowValidationResult + */ + FlowValidationResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult(); + if (object.name != null) + message.name = String(object.name); + if (object.validationMessages) { + if (!Array.isArray(object.validationMessages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.validationMessages: array expected"); + message.validationMessages = []; + for (var i = 0; i < object.validationMessages.length; ++i) { + if (typeof object.validationMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.validationMessages: object expected"); + message.validationMessages[i] = $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.fromObject(object.validationMessages[i], long + 1); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowValidationResult.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FlowValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FlowValidationResult} message FlowValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validationMessages = []; + if (options.defaults) { + object.name = ""; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validationMessages && message.validationMessages.length) { + object.validationMessages = []; + for (var j = 0; j < message.validationMessages.length; ++j) + object.validationMessages[j] = $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.toObject(message.validationMessages[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this FlowValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @instance + * @returns {Object.} JSON object + */ + FlowValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowValidationResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowValidationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FlowValidationResult"; + }; + + return FlowValidationResult; + })(); + + v3beta1.ImportFlowRequest = (function() { + + /** + * Properties of an ImportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportFlowRequest + * @property {string|null} [parent] ImportFlowRequest parent + * @property {string|null} [flowUri] ImportFlowRequest flowUri + * @property {Uint8Array|null} [flowContent] ImportFlowRequest flowContent + * @property {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption|null} [importOption] ImportFlowRequest importOption + * @property {google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy|null} [flowImportStrategy] ImportFlowRequest flowImportStrategy + */ + + /** + * Constructs a new ImportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportFlowRequest. + * @implements IImportFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest=} [properties] Properties to set + */ + function ImportFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportFlowRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.parent = ""; + + /** + * ImportFlowRequest flowUri. + * @member {string|null|undefined} flowUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.flowUri = null; + + /** + * ImportFlowRequest flowContent. + * @member {Uint8Array|null|undefined} flowContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.flowContent = null; + + /** + * ImportFlowRequest importOption. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption} importOption + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.importOption = 0; + + /** + * ImportFlowRequest flowImportStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy|null|undefined} flowImportStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @instance + */ + ImportFlowRequest.prototype.flowImportStrategy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportFlowRequest flow. + * @member {"flowUri"|"flowContent"|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @instance + */ + Object.defineProperty(ImportFlowRequest.prototype, "flow", { + get: $util.oneOfGetter($oneOfFields = ["flowUri", "flowContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest} ImportFlowRequest instance + */ + ImportFlowRequest.create = function create(properties) { + return new ImportFlowRequest(properties); + }; + + /** + * Encodes the specified ImportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest} message ImportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowRequest.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.flowUri != null && Object.hasOwnProperty.call(message, "flowUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowUri); + if (message.flowContent != null && Object.hasOwnProperty.call(message, "flowContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.flowContent); + if (message.importOption != null && Object.hasOwnProperty.call(message, "importOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.importOption); + if (message.flowImportStrategy != null && Object.hasOwnProperty.call(message, "flowImportStrategy")) + $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.encode(message.flowImportStrategy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest} message ImportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest} ImportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.flowUri = reader.string(); + break; + } + case 3: { + message.flowContent = reader.bytes(); + break; + } + case 4: { + message.importOption = reader.int32(); + break; + } + case 5: { + message.flowImportStrategy = $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest} ImportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + properties.flow = 1; + if (!$util.isString(message.flowUri)) + return "flowUri: string expected"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + if (properties.flow === 1) + return "flow: multiple values"; + properties.flow = 1; + if (!(message.flowContent && typeof message.flowContent.length === "number" || $util.isString(message.flowContent))) + return "flowContent: buffer expected"; + } + if (message.importOption != null && message.hasOwnProperty("importOption")) + switch (message.importOption) { + default: + return "importOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.flowImportStrategy != null && message.hasOwnProperty("flowImportStrategy")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.verify(message.flowImportStrategy, long + 1); + if (error) + return "flowImportStrategy." + error; + } + return null; + }; + + /** + * Creates an ImportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest} ImportFlowRequest + */ + ImportFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.flowUri != null) + message.flowUri = String(object.flowUri); + if (object.flowContent != null) + if (typeof object.flowContent === "string") + $util.base64.decode(object.flowContent, message.flowContent = $util.newBuffer($util.base64.length(object.flowContent)), 0); + else if (object.flowContent.length >= 0) + message.flowContent = object.flowContent; + switch (object.importOption) { + default: + if (typeof object.importOption === "number") { + message.importOption = object.importOption; + break; + } + break; + case "IMPORT_OPTION_UNSPECIFIED": + case 0: + message.importOption = 0; + break; + case "KEEP": + case 1: + message.importOption = 1; + break; + case "FALLBACK": + case 2: + message.importOption = 2; + break; + } + if (object.flowImportStrategy != null) { + if (typeof object.flowImportStrategy !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.flowImportStrategy: object expected"); + message.flowImportStrategy = $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.fromObject(object.flowImportStrategy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest} message ImportFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.importOption = options.enums === String ? "IMPORT_OPTION_UNSPECIFIED" : 0; + object.flowImportStrategy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + object.flowUri = message.flowUri; + if (options.oneofs) + object.flow = "flowUri"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + object.flowContent = options.bytes === String ? $util.base64.encode(message.flowContent, 0, message.flowContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.flowContent) : message.flowContent; + if (options.oneofs) + object.flow = "flowContent"; + } + if (message.importOption != null && message.hasOwnProperty("importOption")) + object.importOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption[message.importOption] === undefined ? message.importOption : $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption[message.importOption] : message.importOption; + if (message.flowImportStrategy != null && message.hasOwnProperty("flowImportStrategy")) + object.flowImportStrategy = $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.toObject(message.flowImportStrategy, options); + return object; + }; + + /** + * Converts this ImportFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @instance + * @returns {Object.} JSON object + */ + ImportFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest"; + }; + + /** + * ImportOption enum. + * @name google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption + * @enum {number} + * @property {number} IMPORT_OPTION_UNSPECIFIED=0 IMPORT_OPTION_UNSPECIFIED value + * @property {number} KEEP=1 KEEP value + * @property {number} FALLBACK=2 FALLBACK value + */ + ImportFlowRequest.ImportOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEEP"] = 1; + values[valuesById[2] = "FALLBACK"] = 2; + return values; + })(); + + return ImportFlowRequest; + })(); + + v3beta1.FlowImportStrategy = (function() { + + /** + * Properties of a FlowImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFlowImportStrategy + * @property {google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null} [globalImportStrategy] FlowImportStrategy globalImportStrategy + */ + + /** + * Constructs a new FlowImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FlowImportStrategy. + * @implements IFlowImportStrategy + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy=} [properties] Properties to set + */ + function FlowImportStrategy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowImportStrategy globalImportStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportStrategy} globalImportStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @instance + */ + FlowImportStrategy.prototype.globalImportStrategy = 0; + + /** + * Creates a new FlowImportStrategy instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy} FlowImportStrategy instance + */ + FlowImportStrategy.create = function create(properties) { + return new FlowImportStrategy(properties); + }; + + /** + * Encodes the specified FlowImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy} message FlowImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowImportStrategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.globalImportStrategy != null && Object.hasOwnProperty.call(message, "globalImportStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.globalImportStrategy); + return writer; + }; + + /** + * Encodes the specified FlowImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowImportStrategy} message FlowImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowImportStrategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy} FlowImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowImportStrategy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.globalImportStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowImportStrategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy} FlowImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowImportStrategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowImportStrategy message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowImportStrategy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.globalImportStrategy != null && message.hasOwnProperty("globalImportStrategy")) + switch (message.globalImportStrategy) { + default: + return "globalImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FlowImportStrategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy} FlowImportStrategy + */ + FlowImportStrategy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy(); + switch (object.globalImportStrategy) { + default: + if (typeof object.globalImportStrategy === "number") { + message.globalImportStrategy = object.globalImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.globalImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.globalImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.globalImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.globalImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.globalImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.globalImportStrategy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FlowImportStrategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy} message FlowImportStrategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowImportStrategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.globalImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + if (message.globalImportStrategy != null && message.hasOwnProperty("globalImportStrategy")) + object.globalImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.globalImportStrategy] === undefined ? message.globalImportStrategy : $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.globalImportStrategy] : message.globalImportStrategy; + return object; + }; + + /** + * Converts this FlowImportStrategy to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @instance + * @returns {Object.} JSON object + */ + FlowImportStrategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowImportStrategy + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowImportStrategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy"; + }; + + return FlowImportStrategy; + })(); + + v3beta1.ImportFlowResponse = (function() { + + /** + * Properties of an ImportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportFlowResponse + * @property {string|null} [flow] ImportFlowResponse flow + */ + + /** + * Constructs a new ImportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportFlowResponse. + * @implements IImportFlowResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse=} [properties] Properties to set + */ + function ImportFlowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportFlowResponse flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @instance + */ + ImportFlowResponse.prototype.flow = ""; + + /** + * Creates a new ImportFlowResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse} ImportFlowResponse instance + */ + ImportFlowResponse.create = function create(properties) { + return new ImportFlowResponse(properties); + }; + + /** + * Encodes the specified ImportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse} message ImportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + return writer; + }; + + /** + * Encodes the specified ImportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse} message ImportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportFlowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse} ImportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportFlowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse} ImportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportFlowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportFlowResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportFlowResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + return null; + }; + + /** + * Creates an ImportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse} ImportFlowResponse + */ + ImportFlowResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse(); + if (object.flow != null) + message.flow = String(object.flow); + return message; + }; + + /** + * Creates a plain object from an ImportFlowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse} message ImportFlowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportFlowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.flow = ""; + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + return object; + }; + + /** + * Converts this ImportFlowResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @instance + * @returns {Object.} JSON object + */ + ImportFlowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportFlowResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportFlowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse"; + }; + + return ImportFlowResponse; + })(); + + v3beta1.ExportFlowRequest = (function() { + + /** + * Properties of an ExportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportFlowRequest + * @property {string|null} [name] ExportFlowRequest name + * @property {string|null} [flowUri] ExportFlowRequest flowUri + * @property {boolean|null} [includeReferencedFlows] ExportFlowRequest includeReferencedFlows + */ + + /** + * Constructs a new ExportFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportFlowRequest. + * @implements IExportFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest=} [properties] Properties to set + */ + function ExportFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportFlowRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @instance + */ + ExportFlowRequest.prototype.name = ""; + + /** + * ExportFlowRequest flowUri. + * @member {string} flowUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @instance + */ + ExportFlowRequest.prototype.flowUri = ""; + + /** + * ExportFlowRequest includeReferencedFlows. + * @member {boolean} includeReferencedFlows + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @instance + */ + ExportFlowRequest.prototype.includeReferencedFlows = false; + + /** + * Creates a new ExportFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest} ExportFlowRequest instance + */ + ExportFlowRequest.create = function create(properties) { + return new ExportFlowRequest(properties); + }; + + /** + * Encodes the specified ExportFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest} message ExportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowRequest.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.flowUri != null && Object.hasOwnProperty.call(message, "flowUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowUri); + if (message.includeReferencedFlows != null && Object.hasOwnProperty.call(message, "includeReferencedFlows")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includeReferencedFlows); + return writer; + }; + + /** + * Encodes the specified ExportFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest} message ExportFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest} ExportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flowUri = reader.string(); + break; + } + case 4: { + message.includeReferencedFlows = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest} ExportFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) + if (!$util.isString(message.flowUri)) + return "flowUri: string expected"; + if (message.includeReferencedFlows != null && message.hasOwnProperty("includeReferencedFlows")) + if (typeof message.includeReferencedFlows !== "boolean") + return "includeReferencedFlows: boolean expected"; + return null; + }; + + /** + * Creates an ExportFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest} ExportFlowRequest + */ + ExportFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.flowUri != null) + message.flowUri = String(object.flowUri); + if (object.includeReferencedFlows != null) + message.includeReferencedFlows = Boolean(object.includeReferencedFlows); + return message; + }; + + /** + * Creates a plain object from an ExportFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest} message ExportFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.flowUri = ""; + object.includeReferencedFlows = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) + object.flowUri = message.flowUri; + if (message.includeReferencedFlows != null && message.hasOwnProperty("includeReferencedFlows")) + object.includeReferencedFlows = message.includeReferencedFlows; + return object; + }; + + /** + * Converts this ExportFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @instance + * @returns {Object.} JSON object + */ + ExportFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest"; + }; + + return ExportFlowRequest; + })(); + + v3beta1.ExportFlowResponse = (function() { + + /** + * Properties of an ExportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportFlowResponse + * @property {string|null} [flowUri] ExportFlowResponse flowUri + * @property {Uint8Array|null} [flowContent] ExportFlowResponse flowContent + */ + + /** + * Constructs a new ExportFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportFlowResponse. + * @implements IExportFlowResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse=} [properties] Properties to set + */ + function ExportFlowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportFlowResponse flowUri. + * @member {string|null|undefined} flowUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @instance + */ + ExportFlowResponse.prototype.flowUri = null; + + /** + * ExportFlowResponse flowContent. + * @member {Uint8Array|null|undefined} flowContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @instance + */ + ExportFlowResponse.prototype.flowContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportFlowResponse flow. + * @member {"flowUri"|"flowContent"|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @instance + */ + Object.defineProperty(ExportFlowResponse.prototype, "flow", { + get: $util.oneOfGetter($oneOfFields = ["flowUri", "flowContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportFlowResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse} ExportFlowResponse instance + */ + ExportFlowResponse.create = function create(properties) { + return new ExportFlowResponse(properties); + }; + + /** + * Encodes the specified ExportFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse} message ExportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flowUri != null && Object.hasOwnProperty.call(message, "flowUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flowUri); + if (message.flowContent != null && Object.hasOwnProperty.call(message, "flowContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.flowContent); + return writer; + }; + + /** + * Encodes the specified ExportFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse} message ExportFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFlowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse} ExportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flowUri = reader.string(); + break; + } + case 2: { + message.flowContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportFlowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse} ExportFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFlowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportFlowResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportFlowResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + properties.flow = 1; + if (!$util.isString(message.flowUri)) + return "flowUri: string expected"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + if (properties.flow === 1) + return "flow: multiple values"; + properties.flow = 1; + if (!(message.flowContent && typeof message.flowContent.length === "number" || $util.isString(message.flowContent))) + return "flowContent: buffer expected"; + } + return null; + }; + + /** + * Creates an ExportFlowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse} ExportFlowResponse + */ + ExportFlowResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse(); + if (object.flowUri != null) + message.flowUri = String(object.flowUri); + if (object.flowContent != null) + if (typeof object.flowContent === "string") + $util.base64.decode(object.flowContent, message.flowContent = $util.newBuffer($util.base64.length(object.flowContent)), 0); + else if (object.flowContent.length >= 0) + message.flowContent = object.flowContent; + return message; + }; + + /** + * Creates a plain object from an ExportFlowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse} message ExportFlowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportFlowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.flowUri != null && message.hasOwnProperty("flowUri")) { + object.flowUri = message.flowUri; + if (options.oneofs) + object.flow = "flowUri"; + } + if (message.flowContent != null && message.hasOwnProperty("flowContent")) { + object.flowContent = options.bytes === String ? $util.base64.encode(message.flowContent, 0, message.flowContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.flowContent) : message.flowContent; + if (options.oneofs) + object.flow = "flowContent"; + } + return object; + }; + + /** + * Converts this ExportFlowResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @instance + * @returns {Object.} JSON object + */ + ExportFlowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportFlowResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportFlowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse"; + }; + + return ExportFlowResponse; + })(); + + /** + * ImportStrategy enum. + * @name google.cloud.dialogflow.cx.v3beta1.ImportStrategy + * @enum {number} + * @property {number} IMPORT_STRATEGY_UNSPECIFIED=0 IMPORT_STRATEGY_UNSPECIFIED value + * @property {number} IMPORT_STRATEGY_CREATE_NEW=1 IMPORT_STRATEGY_CREATE_NEW value + * @property {number} IMPORT_STRATEGY_REPLACE=2 IMPORT_STRATEGY_REPLACE value + * @property {number} IMPORT_STRATEGY_KEEP=3 IMPORT_STRATEGY_KEEP value + * @property {number} IMPORT_STRATEGY_MERGE=4 IMPORT_STRATEGY_MERGE value + * @property {number} IMPORT_STRATEGY_THROW_ERROR=5 IMPORT_STRATEGY_THROW_ERROR value + */ + v3beta1.ImportStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPORT_STRATEGY_CREATE_NEW"] = 1; + values[valuesById[2] = "IMPORT_STRATEGY_REPLACE"] = 2; + values[valuesById[3] = "IMPORT_STRATEGY_KEEP"] = 3; + values[valuesById[4] = "IMPORT_STRATEGY_MERGE"] = 4; + values[valuesById[5] = "IMPORT_STRATEGY_THROW_ERROR"] = 5; + return values; + })(); + + v3beta1.Pages = (function() { + + /** + * Constructs a new Pages service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Pages + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Pages(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Pages.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Pages; + + /** + * Creates new Pages service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Pages} RPC service. Useful where requests and/or responses are streamed. + */ + Pages.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|listPages}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @typedef ListPagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} [response] ListPagesResponse + */ + + /** + * Calls ListPages. + * @function listPages + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesRequest} request ListPagesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Pages.ListPagesCallback} callback Node-style callback called with the error, if any, and ListPagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.listPages = function listPages(request, callback) { + return this.rpcCall(listPages, $root.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse, request, callback); + }, "name", { value: "ListPages" }); + + /** + * Calls ListPages. + * @function listPages + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesRequest} request ListPagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|getPage}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @typedef GetPageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Page} [response] Page + */ + + /** + * Calls GetPage. + * @function getPage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPageRequest} request GetPageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Pages.GetPageCallback} callback Node-style callback called with the error, if any, and Page + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.getPage = function getPage(request, callback) { + return this.rpcCall(getPage, $root.google.cloud.dialogflow.cx.v3beta1.GetPageRequest, $root.google.cloud.dialogflow.cx.v3beta1.Page, request, callback); + }, "name", { value: "GetPage" }); + + /** + * Calls GetPage. + * @function getPage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPageRequest} request GetPageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|createPage}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @typedef CreatePageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Page} [response] Page + */ + + /** + * Calls CreatePage. + * @function createPage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest} request CreatePageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Pages.CreatePageCallback} callback Node-style callback called with the error, if any, and Page + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.createPage = function createPage(request, callback) { + return this.rpcCall(createPage, $root.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest, $root.google.cloud.dialogflow.cx.v3beta1.Page, request, callback); + }, "name", { value: "CreatePage" }); + + /** + * Calls CreatePage. + * @function createPage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest} request CreatePageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|updatePage}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @typedef UpdatePageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Page} [response] Page + */ + + /** + * Calls UpdatePage. + * @function updatePage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest} request UpdatePageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePageCallback} callback Node-style callback called with the error, if any, and Page + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.updatePage = function updatePage(request, callback) { + return this.rpcCall(updatePage, $root.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest, $root.google.cloud.dialogflow.cx.v3beta1.Page, request, callback); + }, "name", { value: "UpdatePage" }); + + /** + * Calls UpdatePage. + * @function updatePage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest} request UpdatePageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Pages|deletePage}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @typedef DeletePageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePage. + * @function deletePage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest} request DeletePageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Pages.DeletePageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Pages.prototype.deletePage = function deletePage(request, callback) { + return this.rpcCall(deletePage, $root.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePage" }); + + /** + * Calls DeletePage. + * @function deletePage + * @memberof google.cloud.dialogflow.cx.v3beta1.Pages + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest} request DeletePageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Pages; + })(); + + v3beta1.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPage + * @property {string|null} [name] Page name + * @property {string|null} [displayName] Page displayName + * @property {string|null} [description] Page description + * @property {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null} [entryFulfillment] Page entryFulfillment + * @property {google.cloud.dialogflow.cx.v3beta1.IForm|null} [form] Page form + * @property {Array.|null} [transitionRouteGroups] Page transitionRouteGroups + * @property {Array.|null} [transitionRoutes] Page transitionRoutes + * @property {Array.|null} [eventHandlers] Page eventHandlers + * @property {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null} [advancedSettings] Page advancedSettings + * @property {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null} [knowledgeConnectorSettings] Page knowledgeConnectorSettings + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.transitionRouteGroups = []; + this.transitionRoutes = []; + this.eventHandlers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Page name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.name = ""; + + /** + * Page displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.displayName = ""; + + /** + * Page description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.description = ""; + + /** + * Page entryFulfillment. + * @member {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null|undefined} entryFulfillment + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.entryFulfillment = null; + + /** + * Page form. + * @member {google.cloud.dialogflow.cx.v3beta1.IForm|null|undefined} form + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.form = null; + + /** + * Page transitionRouteGroups. + * @member {Array.} transitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.transitionRouteGroups = $util.emptyArray; + + /** + * Page transitionRoutes. + * @member {Array.} transitionRoutes + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.transitionRoutes = $util.emptyArray; + + /** + * Page eventHandlers. + * @member {Array.} eventHandlers + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.eventHandlers = $util.emptyArray; + + /** + * Page advancedSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.advancedSettings = null; + + /** + * Page knowledgeConnectorSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings|null|undefined} knowledgeConnectorSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + */ + Page.prototype.knowledgeConnectorSettings = null; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.form != null && Object.hasOwnProperty.call(message, "form")) + $root.google.cloud.dialogflow.cx.v3beta1.Form.encode(message.form, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.entryFulfillment != null && Object.hasOwnProperty.call(message, "entryFulfillment")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.encode(message.entryFulfillment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.transitionRoutes != null && message.transitionRoutes.length) + for (var i = 0; i < message.transitionRoutes.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.encode(message.transitionRoutes[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.eventHandlers != null && message.eventHandlers.length) + for (var i = 0; i < message.eventHandlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.encode(message.eventHandlers[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.transitionRouteGroups != null && message.transitionRouteGroups.length) + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.transitionRouteGroups[i]); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.knowledgeConnectorSettings != null && Object.hasOwnProperty.call(message, "knowledgeConnectorSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.encode(message.knowledgeConnectorSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.description); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 19: { + message.description = reader.string(); + break; + } + case 7: { + message.entryFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.form = $root.google.cloud.dialogflow.cx.v3beta1.Form.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + if (!(message.transitionRouteGroups && message.transitionRouteGroups.length)) + message.transitionRouteGroups = []; + message.transitionRouteGroups.push(reader.string()); + break; + } + case 9: { + if (!(message.transitionRoutes && message.transitionRoutes.length)) + message.transitionRoutes = []; + message.transitionRoutes.push($root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.eventHandlers && message.eventHandlers.length)) + message.eventHandlers = []; + message.eventHandlers.push($root.google.cloud.dialogflow.cx.v3beta1.EventHandler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 13: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.entryFulfillment != null && message.hasOwnProperty("entryFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify(message.entryFulfillment, long + 1); + if (error) + return "entryFulfillment." + error; + } + if (message.form != null && message.hasOwnProperty("form")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Form.verify(message.form, long + 1); + if (error) + return "form." + error; + } + if (message.transitionRouteGroups != null && message.hasOwnProperty("transitionRouteGroups")) { + if (!Array.isArray(message.transitionRouteGroups)) + return "transitionRouteGroups: array expected"; + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + if (!$util.isString(message.transitionRouteGroups[i])) + return "transitionRouteGroups: string[] expected"; + } + if (message.transitionRoutes != null && message.hasOwnProperty("transitionRoutes")) { + if (!Array.isArray(message.transitionRoutes)) + return "transitionRoutes: array expected"; + for (var i = 0; i < message.transitionRoutes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify(message.transitionRoutes[i], long + 1); + if (error) + return "transitionRoutes." + error; + } + } + if (message.eventHandlers != null && message.hasOwnProperty("eventHandlers")) { + if (!Array.isArray(message.eventHandlers)) + return "eventHandlers: array expected"; + for (var i = 0; i < message.eventHandlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.verify(message.eventHandlers[i], long + 1); + if (error) + return "eventHandlers." + error; + } + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.verify(message.knowledgeConnectorSettings, long + 1); + if (error) + return "knowledgeConnectorSettings." + error; + } + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Page} Page + */ + Page.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Page) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Page(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.entryFulfillment != null) { + if (typeof object.entryFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.entryFulfillment: object expected"); + message.entryFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.fromObject(object.entryFulfillment, long + 1); + } + if (object.form != null) { + if (typeof object.form !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.form: object expected"); + message.form = $root.google.cloud.dialogflow.cx.v3beta1.Form.fromObject(object.form, long + 1); + } + if (object.transitionRouteGroups) { + if (!Array.isArray(object.transitionRouteGroups)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.transitionRouteGroups: array expected"); + message.transitionRouteGroups = []; + for (var i = 0; i < object.transitionRouteGroups.length; ++i) + message.transitionRouteGroups[i] = String(object.transitionRouteGroups[i]); + } + if (object.transitionRoutes) { + if (!Array.isArray(object.transitionRoutes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.transitionRoutes: array expected"); + message.transitionRoutes = []; + for (var i = 0; i < object.transitionRoutes.length; ++i) { + if (typeof object.transitionRoutes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.transitionRoutes: object expected"); + message.transitionRoutes[i] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.fromObject(object.transitionRoutes[i], long + 1); + } + } + if (object.eventHandlers) { + if (!Array.isArray(object.eventHandlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.eventHandlers: array expected"); + message.eventHandlers = []; + for (var i = 0; i < object.eventHandlers.length; ++i) { + if (typeof object.eventHandlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.eventHandlers: object expected"); + message.eventHandlers[i] = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.fromObject(object.eventHandlers[i], long + 1); + } + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.knowledgeConnectorSettings != null) { + if (typeof object.knowledgeConnectorSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Page.knowledgeConnectorSettings: object expected"); + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.fromObject(object.knowledgeConnectorSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.transitionRoutes = []; + object.eventHandlers = []; + object.transitionRouteGroups = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.form = null; + object.entryFulfillment = null; + object.advancedSettings = null; + object.knowledgeConnectorSettings = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.form != null && message.hasOwnProperty("form")) + object.form = $root.google.cloud.dialogflow.cx.v3beta1.Form.toObject(message.form, options); + if (message.entryFulfillment != null && message.hasOwnProperty("entryFulfillment")) + object.entryFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.toObject(message.entryFulfillment, options); + if (message.transitionRoutes && message.transitionRoutes.length) { + object.transitionRoutes = []; + for (var j = 0; j < message.transitionRoutes.length; ++j) + object.transitionRoutes[j] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.toObject(message.transitionRoutes[j], options); + } + if (message.eventHandlers && message.eventHandlers.length) { + object.eventHandlers = []; + for (var j = 0; j < message.eventHandlers.length; ++j) + object.eventHandlers[j] = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.toObject(message.eventHandlers[j], options); + } + if (message.transitionRouteGroups && message.transitionRouteGroups.length) { + object.transitionRouteGroups = []; + for (var j = 0; j < message.transitionRouteGroups.length; ++j) + object.transitionRouteGroups[j] = message.transitionRouteGroups[j]; + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) + object.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.toObject(message.knowledgeConnectorSettings, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Page + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Page + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Page.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Page"; + }; + + return Page; + })(); + + v3beta1.Form = (function() { + + /** + * Properties of a Form. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IForm + * @property {Array.|null} [parameters] Form parameters + */ + + /** + * Constructs a new Form. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Form. + * @implements IForm + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IForm=} [properties] Properties to set + */ + function Form(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Form parameters. + * @member {Array.} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @instance + */ + Form.prototype.parameters = $util.emptyArray; + + /** + * Creates a new Form instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IForm=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Form} Form instance + */ + Form.create = function create(properties) { + return new Form(properties); + }; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.encode(message.parameters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Form message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Form(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Form message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Form.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.verify(message.parameters[i], long + 1); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a Form message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Form} Form + */ + Form.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Form) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Form(); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.parameters: object expected"); + message.parameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.fromObject(object.parameters[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form} message Form + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Form.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this Form to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @instance + * @returns {Object.} JSON object + */ + Form.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Form + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Form.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Form"; + }; + + Form.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @interface IParameter + * @property {string|null} [displayName] Parameter displayName + * @property {boolean|null} [required] Parameter required + * @property {string|null} [entityType] Parameter entityType + * @property {boolean|null} [isList] Parameter isList + * @property {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior|null} [fillBehavior] Parameter fillBehavior + * @property {google.protobuf.IValue|null} [defaultValue] Parameter defaultValue + * @property {boolean|null} [redact] Parameter redact + * @property {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null} [advancedSettings] Parameter advancedSettings + */ + + /** + * Constructs a new Parameter. + * @memberof google.cloud.dialogflow.cx.v3beta1.Form + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Form.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.displayName = ""; + + /** + * Parameter required. + * @member {boolean} required + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.required = false; + + /** + * Parameter entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.entityType = ""; + + /** + * Parameter isList. + * @member {boolean} isList + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.isList = false; + + /** + * Parameter fillBehavior. + * @member {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior|null|undefined} fillBehavior + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.fillBehavior = null; + + /** + * Parameter defaultValue. + * @member {google.protobuf.IValue|null|undefined} defaultValue + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.defaultValue = null; + + /** + * Parameter redact. + * @member {boolean} redact + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.redact = false; + + /** + * Parameter advancedSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + */ + Parameter.prototype.advancedSettings = null; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.IParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.required); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityType); + if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isList); + if (message.fillBehavior != null && Object.hasOwnProperty.call(message, "fillBehavior")) + $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.encode(message.fillBehavior, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + $root.google.protobuf.Value.encode(message.defaultValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.redact != null && Object.hasOwnProperty.call(message, "redact")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.redact); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.required = reader.bool(); + break; + } + case 3: { + message.entityType = reader.string(); + break; + } + case 4: { + message.isList = reader.bool(); + break; + } + case 7: { + message.fillBehavior = $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.defaultValue = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.redact = reader.bool(); + break; + } + case 12: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.isList != null && message.hasOwnProperty("isList")) + if (typeof message.isList !== "boolean") + return "isList: boolean expected"; + if (message.fillBehavior != null && message.hasOwnProperty("fillBehavior")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.verify(message.fillBehavior, long + 1); + if (error) + return "fillBehavior." + error; + } + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) { + var error = $root.google.protobuf.Value.verify(message.defaultValue, long + 1); + if (error) + return "defaultValue." + error; + } + if (message.redact != null && message.hasOwnProperty("redact")) + if (typeof message.redact !== "boolean") + return "redact: boolean expected"; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.required != null) + message.required = Boolean(object.required); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.isList != null) + message.isList = Boolean(object.isList); + if (object.fillBehavior != null) { + if (typeof object.fillBehavior !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.Parameter.fillBehavior: object expected"); + message.fillBehavior = $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.fromObject(object.fillBehavior, long + 1); + } + if (object.defaultValue != null) { + if (typeof object.defaultValue !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.Parameter.defaultValue: object expected"); + message.defaultValue = $root.google.protobuf.Value.fromObject(object.defaultValue, long + 1); + } + if (object.redact != null) + message.redact = Boolean(object.redact); + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.Parameter.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.required = false; + object.entityType = ""; + object.isList = false; + object.fillBehavior = null; + object.defaultValue = null; + object.redact = false; + object.advancedSettings = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.isList != null && message.hasOwnProperty("isList")) + object.isList = message.isList; + if (message.fillBehavior != null && message.hasOwnProperty("fillBehavior")) + object.fillBehavior = $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.toObject(message.fillBehavior, options); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = $root.google.protobuf.Value.toObject(message.defaultValue, options); + if (message.redact != null && message.hasOwnProperty("redact")) + object.redact = message.redact; + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.toObject(message.advancedSettings, options); + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Form.Parameter"; + }; + + Parameter.FillBehavior = (function() { + + /** + * Properties of a FillBehavior. + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @interface IFillBehavior + * @property {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null} [initialPromptFulfillment] FillBehavior initialPromptFulfillment + * @property {Array.|null} [repromptEventHandlers] FillBehavior repromptEventHandlers + */ + + /** + * Constructs a new FillBehavior. + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter + * @classdesc Represents a FillBehavior. + * @implements IFillBehavior + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior=} [properties] Properties to set + */ + function FillBehavior(properties) { + this.repromptEventHandlers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FillBehavior initialPromptFulfillment. + * @member {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null|undefined} initialPromptFulfillment + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @instance + */ + FillBehavior.prototype.initialPromptFulfillment = null; + + /** + * FillBehavior repromptEventHandlers. + * @member {Array.} repromptEventHandlers + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @instance + */ + FillBehavior.prototype.repromptEventHandlers = $util.emptyArray; + + /** + * Creates a new FillBehavior instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior} FillBehavior instance + */ + FillBehavior.create = function create(properties) { + return new FillBehavior(properties); + }; + + /** + * Encodes the specified FillBehavior message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior} message FillBehavior message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FillBehavior.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPromptFulfillment != null && Object.hasOwnProperty.call(message, "initialPromptFulfillment")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.encode(message.initialPromptFulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.repromptEventHandlers != null && message.repromptEventHandlers.length) + for (var i = 0; i < message.repromptEventHandlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.encode(message.repromptEventHandlers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FillBehavior message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.IFillBehavior} message FillBehavior message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FillBehavior.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FillBehavior message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior} FillBehavior + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FillBehavior.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.initialPromptFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.repromptEventHandlers && message.repromptEventHandlers.length)) + message.repromptEventHandlers = []; + message.repromptEventHandlers.push($root.google.cloud.dialogflow.cx.v3beta1.EventHandler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FillBehavior message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior} FillBehavior + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FillBehavior.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FillBehavior message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FillBehavior.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.initialPromptFulfillment != null && message.hasOwnProperty("initialPromptFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify(message.initialPromptFulfillment, long + 1); + if (error) + return "initialPromptFulfillment." + error; + } + if (message.repromptEventHandlers != null && message.hasOwnProperty("repromptEventHandlers")) { + if (!Array.isArray(message.repromptEventHandlers)) + return "repromptEventHandlers: array expected"; + for (var i = 0; i < message.repromptEventHandlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.verify(message.repromptEventHandlers[i], long + 1); + if (error) + return "repromptEventHandlers." + error; + } + } + return null; + }; + + /** + * Creates a FillBehavior message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior} FillBehavior + */ + FillBehavior.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior(); + if (object.initialPromptFulfillment != null) { + if (typeof object.initialPromptFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.initialPromptFulfillment: object expected"); + message.initialPromptFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.fromObject(object.initialPromptFulfillment, long + 1); + } + if (object.repromptEventHandlers) { + if (!Array.isArray(object.repromptEventHandlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.repromptEventHandlers: array expected"); + message.repromptEventHandlers = []; + for (var i = 0; i < object.repromptEventHandlers.length; ++i) { + if (typeof object.repromptEventHandlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.repromptEventHandlers: object expected"); + message.repromptEventHandlers[i] = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.fromObject(object.repromptEventHandlers[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FillBehavior message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior} message FillBehavior + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FillBehavior.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.repromptEventHandlers = []; + if (options.defaults) + object.initialPromptFulfillment = null; + if (message.initialPromptFulfillment != null && message.hasOwnProperty("initialPromptFulfillment")) + object.initialPromptFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.toObject(message.initialPromptFulfillment, options); + if (message.repromptEventHandlers && message.repromptEventHandlers.length) { + object.repromptEventHandlers = []; + for (var j = 0; j < message.repromptEventHandlers.length; ++j) + object.repromptEventHandlers[j] = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.toObject(message.repromptEventHandlers[j], options); + } + return object; + }; + + /** + * Converts this FillBehavior to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @instance + * @returns {Object.} JSON object + */ + FillBehavior.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FillBehavior + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FillBehavior.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior"; + }; + + return FillBehavior; + })(); + + return Parameter; + })(); + + return Form; + })(); + + v3beta1.EventHandler = (function() { + + /** + * Properties of an EventHandler. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IEventHandler + * @property {string|null} [name] EventHandler name + * @property {string|null} [event] EventHandler event + * @property {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null} [triggerFulfillment] EventHandler triggerFulfillment + * @property {string|null} [targetPage] EventHandler targetPage + * @property {string|null} [targetFlow] EventHandler targetFlow + * @property {string|null} [targetPlaybook] EventHandler targetPlaybook + */ + + /** + * Constructs a new EventHandler. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an EventHandler. + * @implements IEventHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IEventHandler=} [properties] Properties to set + */ + function EventHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventHandler name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + */ + EventHandler.prototype.name = ""; + + /** + * EventHandler event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + */ + EventHandler.prototype.event = ""; + + /** + * EventHandler triggerFulfillment. + * @member {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null|undefined} triggerFulfillment + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + */ + EventHandler.prototype.triggerFulfillment = null; + + /** + * EventHandler targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + */ + EventHandler.prototype.targetPage = null; + + /** + * EventHandler targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + */ + EventHandler.prototype.targetFlow = null; + + /** + * EventHandler targetPlaybook. + * @member {string|null|undefined} targetPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + */ + EventHandler.prototype.targetPlaybook = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EventHandler target. + * @member {"targetPage"|"targetFlow"|"targetPlaybook"|undefined} target + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + */ + Object.defineProperty(EventHandler.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow", "targetPlaybook"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EventHandler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEventHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.EventHandler} EventHandler instance + */ + EventHandler.create = function create(properties) { + return new EventHandler(properties); + }; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventHandler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetFlow); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.event); + if (message.triggerFulfillment != null && Object.hasOwnProperty.call(message, "triggerFulfillment")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.encode(message.triggerFulfillment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.targetPlaybook != null && Object.hasOwnProperty.call(message, "targetPlaybook")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.targetPlaybook); + return writer; + }; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.EventHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 4: { + message.event = reader.string(); + break; + } + case 5: { + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.targetPage = reader.string(); + break; + } + case 3: { + message.targetFlow = reader.string(); + break; + } + case 7: { + message.targetPlaybook = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventHandler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventHandler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify(message.triggerFulfillment, long + 1); + if (error) + return "triggerFulfillment." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.target = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + if (message.targetPlaybook != null && message.hasOwnProperty("targetPlaybook")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetPlaybook)) + return "targetPlaybook: string expected"; + } + return null; + }; + + /** + * Creates an EventHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.EventHandler} EventHandler + */ + EventHandler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.EventHandler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.EventHandler(); + if (object.name != null) + message.name = String(object.name); + if (object.event != null) + message.event = String(object.event); + if (object.triggerFulfillment != null) { + if (typeof object.triggerFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.EventHandler.triggerFulfillment: object expected"); + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.fromObject(object.triggerFulfillment, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + if (object.targetPlaybook != null) + message.targetPlaybook = String(object.targetPlaybook); + return message; + }; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EventHandler} message EventHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.event = ""; + object.triggerFulfillment = null; + object.name = ""; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.target = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.target = "targetFlow"; + } + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) + object.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.toObject(message.triggerFulfillment, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.targetPlaybook != null && message.hasOwnProperty("targetPlaybook")) { + object.targetPlaybook = message.targetPlaybook; + if (options.oneofs) + object.target = "targetPlaybook"; + } + return object; + }; + + /** + * Converts this EventHandler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @instance + * @returns {Object.} JSON object + */ + EventHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventHandler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.EventHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.EventHandler"; + }; + + return EventHandler; + })(); + + v3beta1.TransitionRoute = (function() { + + /** + * Properties of a TransitionRoute. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITransitionRoute + * @property {string|null} [name] TransitionRoute name + * @property {string|null} [description] TransitionRoute description + * @property {string|null} [intent] TransitionRoute intent + * @property {string|null} [condition] TransitionRoute condition + * @property {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null} [triggerFulfillment] TransitionRoute triggerFulfillment + * @property {string|null} [targetPage] TransitionRoute targetPage + * @property {string|null} [targetFlow] TransitionRoute targetFlow + */ + + /** + * Constructs a new TransitionRoute. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TransitionRoute. + * @implements ITransitionRoute + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute=} [properties] Properties to set + */ + function TransitionRoute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionRoute name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + TransitionRoute.prototype.name = ""; + + /** + * TransitionRoute description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + TransitionRoute.prototype.description = ""; + + /** + * TransitionRoute intent. + * @member {string} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + TransitionRoute.prototype.intent = ""; + + /** + * TransitionRoute condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + TransitionRoute.prototype.condition = ""; + + /** + * TransitionRoute triggerFulfillment. + * @member {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null|undefined} triggerFulfillment + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + TransitionRoute.prototype.triggerFulfillment = null; + + /** + * TransitionRoute targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + TransitionRoute.prototype.targetPage = null; + + /** + * TransitionRoute targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + TransitionRoute.prototype.targetFlow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransitionRoute target. + * @member {"targetPage"|"targetFlow"|undefined} target + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + */ + Object.defineProperty(TransitionRoute.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransitionRoute instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRoute} TransitionRoute instance + */ + TransitionRoute.create = function create(properties) { + return new TransitionRoute(properties); + }; + + /** + * Encodes the specified TransitionRoute message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute} message TransitionRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRoute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intent); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.condition); + if (message.triggerFulfillment != null && Object.hasOwnProperty.call(message, "triggerFulfillment")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.encode(message.triggerFulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetFlow); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified TransitionRoute message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute} message TransitionRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRoute} TransitionRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRoute.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 1: { + message.intent = reader.string(); + break; + } + case 2: { + message.condition = reader.string(); + break; + } + case 3: { + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.targetPage = reader.string(); + break; + } + case 5: { + message.targetFlow = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRoute} TransitionRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionRoute message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionRoute.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.intent != null && message.hasOwnProperty("intent")) + if (!$util.isString(message.intent)) + return "intent: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify(message.triggerFulfillment, long + 1); + if (error) + return "triggerFulfillment." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.target = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + return null; + }; + + /** + * Creates a TransitionRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRoute} TransitionRoute + */ + TransitionRoute.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.intent != null) + message.intent = String(object.intent); + if (object.condition != null) + message.condition = String(object.condition); + if (object.triggerFulfillment != null) { + if (typeof object.triggerFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRoute.triggerFulfillment: object expected"); + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.fromObject(object.triggerFulfillment, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + return message; + }; + + /** + * Creates a plain object from a TransitionRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRoute} message TransitionRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = ""; + object.condition = ""; + object.triggerFulfillment = null; + object.name = ""; + object.description = ""; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = message.intent; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) + object.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.toObject(message.triggerFulfillment, options); + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.target = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.target = "targetFlow"; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this TransitionRoute to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @instance + * @returns {Object.} JSON object + */ + TransitionRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionRoute + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionRoute"; + }; + + return TransitionRoute; + })(); + + v3beta1.ListPagesRequest = (function() { + + /** + * Properties of a ListPagesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListPagesRequest + * @property {string|null} [parent] ListPagesRequest parent + * @property {string|null} [languageCode] ListPagesRequest languageCode + * @property {number|null} [pageSize] ListPagesRequest pageSize + * @property {string|null} [pageToken] ListPagesRequest pageToken + */ + + /** + * Constructs a new ListPagesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListPagesRequest. + * @implements IListPagesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesRequest=} [properties] Properties to set + */ + function ListPagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPagesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.parent = ""; + + /** + * ListPagesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.languageCode = ""; + + /** + * ListPagesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.pageSize = 0; + + /** + * ListPagesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @instance + */ + ListPagesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesRequest} ListPagesRequest instance + */ + ListPagesRequest.create = function create(properties) { + return new ListPagesRequest(properties); + }; + + /** + * Encodes the specified ListPagesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesRequest} message ListPagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesRequest} message ListPagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesRequest} ListPagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesRequest} ListPagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPagesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPagesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: 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"; + return null; + }; + + /** + * Creates a ListPagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesRequest} ListPagesRequest + */ + ListPagesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListPagesRequest} message ListPagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListPagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPagesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListPagesRequest"; + }; + + return ListPagesRequest; + })(); + + v3beta1.ListPagesResponse = (function() { + + /** + * Properties of a ListPagesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListPagesResponse + * @property {Array.|null} [pages] ListPagesResponse pages + * @property {string|null} [nextPageToken] ListPagesResponse nextPageToken + */ + + /** + * Constructs a new ListPagesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListPagesResponse. + * @implements IListPagesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesResponse=} [properties] Properties to set + */ + function ListPagesResponse(properties) { + this.pages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPagesResponse pages. + * @member {Array.} pages + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @instance + */ + ListPagesResponse.prototype.pages = $util.emptyArray; + + /** + * ListPagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @instance + */ + ListPagesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} ListPagesResponse instance + */ + ListPagesResponse.create = function create(properties) { + return new ListPagesResponse(properties); + }; + + /** + * Encodes the specified ListPagesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesResponse} message ListPagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.pages[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 ListPagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPagesResponse} message ListPagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} ListPagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} ListPagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPagesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPagesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.pages[i], long + 1); + if (error) + return "pages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} ListPagesResponse + */ + ListPagesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.pages: object expected"); + message.pages[i] = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.pages[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} message ListPagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.pages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListPagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPagesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListPagesResponse"; + }; + + return ListPagesResponse; + })(); + + v3beta1.GetPageRequest = (function() { + + /** + * Properties of a GetPageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetPageRequest + * @property {string|null} [name] GetPageRequest name + * @property {string|null} [languageCode] GetPageRequest languageCode + */ + + /** + * Constructs a new GetPageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetPageRequest. + * @implements IGetPageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPageRequest=} [properties] Properties to set + */ + function GetPageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPageRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @instance + */ + GetPageRequest.prototype.name = ""; + + /** + * GetPageRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @instance + */ + GetPageRequest.prototype.languageCode = ""; + + /** + * Creates a new GetPageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPageRequest} GetPageRequest instance + */ + GetPageRequest.create = function create(properties) { + return new GetPageRequest(properties); + }; + + /** + * Encodes the specified GetPageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPageRequest} message GetPageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPageRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetPageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPageRequest} message GetPageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPageRequest} GetPageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPageRequest} GetPageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetPageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPageRequest} GetPageRequest + */ + GetPageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetPageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetPageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetPageRequest} message GetPageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetPageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @instance + * @returns {Object.} JSON object + */ + GetPageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetPageRequest"; + }; + + return GetPageRequest; + })(); + + v3beta1.CreatePageRequest = (function() { + + /** + * Properties of a CreatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreatePageRequest + * @property {string|null} [parent] CreatePageRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IPage|null} [page] CreatePageRequest page + * @property {string|null} [languageCode] CreatePageRequest languageCode + */ + + /** + * Constructs a new CreatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreatePageRequest. + * @implements ICreatePageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest=} [properties] Properties to set + */ + function CreatePageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePageRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @instance + */ + CreatePageRequest.prototype.parent = ""; + + /** + * CreatePageRequest page. + * @member {google.cloud.dialogflow.cx.v3beta1.IPage|null|undefined} page + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @instance + */ + CreatePageRequest.prototype.page = null; + + /** + * CreatePageRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @instance + */ + CreatePageRequest.prototype.languageCode = ""; + + /** + * Creates a new CreatePageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePageRequest} CreatePageRequest instance + */ + CreatePageRequest.create = function create(properties) { + return new CreatePageRequest(properties); + }; + + /** + * Encodes the specified CreatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest} message CreatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePageRequest.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.page != null && Object.hasOwnProperty.call(message, "page")) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.page, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest} message CreatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePageRequest} CreatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePageRequest} CreatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.page != null && message.hasOwnProperty("page")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.page, long + 1); + if (error) + return "page." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreatePageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePageRequest} CreatePageRequest + */ + CreatePageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.page: object expected"); + message.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.page, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreatePageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreatePageRequest} message CreatePageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.page = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.page != null && message.hasOwnProperty("page")) + object.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.page, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreatePageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreatePageRequest"; + }; + + return CreatePageRequest; + })(); + + v3beta1.UpdatePageRequest = (function() { + + /** + * Properties of an UpdatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdatePageRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IPage|null} [page] UpdatePageRequest page + * @property {string|null} [languageCode] UpdatePageRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePageRequest updateMask + */ + + /** + * Constructs a new UpdatePageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdatePageRequest. + * @implements IUpdatePageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest=} [properties] Properties to set + */ + function UpdatePageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePageRequest page. + * @member {google.cloud.dialogflow.cx.v3beta1.IPage|null|undefined} page + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @instance + */ + UpdatePageRequest.prototype.page = null; + + /** + * UpdatePageRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @instance + */ + UpdatePageRequest.prototype.languageCode = ""; + + /** + * UpdatePageRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @instance + */ + UpdatePageRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest} UpdatePageRequest instance + */ + UpdatePageRequest.create = function create(properties) { + return new UpdatePageRequest(properties); + }; + + /** + * Encodes the specified UpdatePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest} message UpdatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.page, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest} message UpdatePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest} UpdatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest} UpdatePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.page != null && message.hasOwnProperty("page")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.page, long + 1); + if (error) + return "page." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest} UpdatePageRequest + */ + UpdatePageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(); + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.page: object expected"); + message.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.page, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest} message UpdatePageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.page = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.page != null && message.hasOwnProperty("page")) + object.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.page, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest"; + }; + + return UpdatePageRequest; + })(); + + v3beta1.DeletePageRequest = (function() { + + /** + * Properties of a DeletePageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeletePageRequest + * @property {string|null} [name] DeletePageRequest name + * @property {boolean|null} [force] DeletePageRequest force + */ + + /** + * Constructs a new DeletePageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeletePageRequest. + * @implements IDeletePageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest=} [properties] Properties to set + */ + function DeletePageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePageRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @instance + */ + DeletePageRequest.prototype.name = ""; + + /** + * DeletePageRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @instance + */ + DeletePageRequest.prototype.force = false; + + /** + * Creates a new DeletePageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePageRequest} DeletePageRequest instance + */ + DeletePageRequest.create = function create(properties) { + return new DeletePageRequest(properties); + }; + + /** + * Encodes the specified DeletePageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest} message DeletePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePageRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeletePageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest} message DeletePageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePageRequest} DeletePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePageRequest} DeletePageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeletePageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePageRequest} DeletePageRequest + */ + DeletePageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeletePageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeletePageRequest} message DeletePageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeletePageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeletePageRequest"; + }; + + return DeletePageRequest; + })(); + + v3beta1.KnowledgeConnectorSettings = (function() { + + /** + * Properties of a KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IKnowledgeConnectorSettings + * @property {boolean|null} [enabled] KnowledgeConnectorSettings enabled + * @property {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null} [triggerFulfillment] KnowledgeConnectorSettings triggerFulfillment + * @property {string|null} [targetPage] KnowledgeConnectorSettings targetPage + * @property {string|null} [targetFlow] KnowledgeConnectorSettings targetFlow + * @property {Array.|null} [dataStoreConnections] KnowledgeConnectorSettings dataStoreConnections + */ + + /** + * Constructs a new KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a KnowledgeConnectorSettings. + * @implements IKnowledgeConnectorSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings=} [properties] Properties to set + */ + function KnowledgeConnectorSettings(properties) { + this.dataStoreConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeConnectorSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.enabled = false; + + /** + * KnowledgeConnectorSettings triggerFulfillment. + * @member {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null|undefined} triggerFulfillment + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.triggerFulfillment = null; + + /** + * KnowledgeConnectorSettings targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.targetPage = null; + + /** + * KnowledgeConnectorSettings targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.targetFlow = null; + + /** + * KnowledgeConnectorSettings dataStoreConnections. + * @member {Array.} dataStoreConnections + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.dataStoreConnections = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KnowledgeConnectorSettings target. + * @member {"targetPage"|"targetFlow"|undefined} target + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @instance + */ + Object.defineProperty(KnowledgeConnectorSettings.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings} KnowledgeConnectorSettings instance + */ + KnowledgeConnectorSettings.create = function create(properties) { + return new KnowledgeConnectorSettings(properties); + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.triggerFulfillment != null && Object.hasOwnProperty.call(message, "triggerFulfillment")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.encode(message.triggerFulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetFlow); + if (message.dataStoreConnections != null && message.dataStoreConnections.length) + for (var i = 0; i < message.dataStoreConnections.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.encode(message.dataStoreConnections[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 3: { + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.targetPage = reader.string(); + break; + } + case 5: { + message.targetFlow = reader.string(); + break; + } + case 6: { + if (!(message.dataStoreConnections && message.dataStoreConnections.length)) + message.dataStoreConnections = []; + message.dataStoreConnections.push($root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeConnectorSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeConnectorSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify(message.triggerFulfillment, long + 1); + if (error) + return "triggerFulfillment." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.target = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + if (message.dataStoreConnections != null && message.hasOwnProperty("dataStoreConnections")) { + if (!Array.isArray(message.dataStoreConnections)) + return "dataStoreConnections: array expected"; + for (var i = 0; i < message.dataStoreConnections.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.verify(message.dataStoreConnections[i], long + 1); + if (error) + return "dataStoreConnections." + error; + } + } + return null; + }; + + /** + * Creates a KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings} KnowledgeConnectorSettings + */ + KnowledgeConnectorSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.triggerFulfillment != null) { + if (typeof object.triggerFulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.triggerFulfillment: object expected"); + message.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.fromObject(object.triggerFulfillment, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + if (object.dataStoreConnections) { + if (!Array.isArray(object.dataStoreConnections)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.dataStoreConnections: array expected"); + message.dataStoreConnections = []; + for (var i = 0; i < object.dataStoreConnections.length; ++i) { + if (typeof object.dataStoreConnections[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings.dataStoreConnections: object expected"); + message.dataStoreConnections[i] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.fromObject(object.dataStoreConnections[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings} message KnowledgeConnectorSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeConnectorSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStoreConnections = []; + if (options.defaults) { + object.enabled = false; + object.triggerFulfillment = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.triggerFulfillment != null && message.hasOwnProperty("triggerFulfillment")) + object.triggerFulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.toObject(message.triggerFulfillment, options); + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.target = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.target = "targetFlow"; + } + if (message.dataStoreConnections && message.dataStoreConnections.length) { + object.dataStoreConnections = []; + for (var j = 0; j < message.dataStoreConnections.length; ++j) + object.dataStoreConnections[j] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.toObject(message.dataStoreConnections[j], options); + } + return object; + }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @instance + * @returns {Object.} JSON object + */ + KnowledgeConnectorSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KnowledgeConnectorSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.KnowledgeConnectorSettings"; + }; + + return KnowledgeConnectorSettings; + })(); + + v3beta1.DataStoreConnection = (function() { + + /** + * Properties of a DataStoreConnection. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDataStoreConnection + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreType|null} [dataStoreType] DataStoreConnection dataStoreType + * @property {string|null} [dataStore] DataStoreConnection dataStore + * @property {google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode|null} [documentProcessingMode] DataStoreConnection documentProcessingMode + */ + + /** + * Constructs a new DataStoreConnection. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DataStoreConnection. + * @implements IDataStoreConnection + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection=} [properties] Properties to set + */ + function DataStoreConnection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreConnection dataStoreType. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreType} dataStoreType + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @instance + */ + DataStoreConnection.prototype.dataStoreType = 0; + + /** + * DataStoreConnection dataStore. + * @member {string} dataStore + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @instance + */ + DataStoreConnection.prototype.dataStore = ""; + + /** + * DataStoreConnection documentProcessingMode. + * @member {google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode} documentProcessingMode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @instance + */ + DataStoreConnection.prototype.documentProcessingMode = 0; + + /** + * Creates a new DataStoreConnection instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnection} DataStoreConnection instance + */ + DataStoreConnection.create = function create(properties) { + return new DataStoreConnection(properties); + }; + + /** + * Encodes the specified DataStoreConnection message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection} message DataStoreConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStoreType != null && Object.hasOwnProperty.call(message, "dataStoreType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dataStoreType); + if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataStore); + if (message.documentProcessingMode != null && Object.hasOwnProperty.call(message, "documentProcessingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.documentProcessingMode); + return writer; + }; + + /** + * Encodes the specified DataStoreConnection message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnection} message DataStoreConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnection} DataStoreConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnection.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataStoreType = reader.int32(); + break; + } + case 2: { + message.dataStore = reader.string(); + break; + } + case 4: { + message.documentProcessingMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreConnection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnection} DataStoreConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreConnection message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreConnection.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStoreType != null && message.hasOwnProperty("dataStoreType")) + switch (message.dataStoreType) { + default: + return "dataStoreType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + if (!$util.isString(message.dataStore)) + return "dataStore: string expected"; + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + switch (message.documentProcessingMode) { + default: + return "documentProcessingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DataStoreConnection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnection} DataStoreConnection + */ + DataStoreConnection.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection(); + switch (object.dataStoreType) { + default: + if (typeof object.dataStoreType === "number") { + message.dataStoreType = object.dataStoreType; + break; + } + break; + case "DATA_STORE_TYPE_UNSPECIFIED": + case 0: + message.dataStoreType = 0; + break; + case "PUBLIC_WEB": + case 1: + message.dataStoreType = 1; + break; + case "UNSTRUCTURED": + case 2: + message.dataStoreType = 2; + break; + case "STRUCTURED": + case 3: + message.dataStoreType = 3; + break; + } + if (object.dataStore != null) + message.dataStore = String(object.dataStore); + switch (object.documentProcessingMode) { + default: + if (typeof object.documentProcessingMode === "number") { + message.documentProcessingMode = object.documentProcessingMode; + break; + } + break; + case "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": + case 0: + message.documentProcessingMode = 0; + break; + case "DOCUMENTS": + case 1: + message.documentProcessingMode = 1; + break; + case "CHUNKS": + case 2: + message.documentProcessingMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataStoreConnection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnection} message DataStoreConnection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreConnection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataStoreType = options.enums === String ? "DATA_STORE_TYPE_UNSPECIFIED" : 0; + object.dataStore = ""; + object.documentProcessingMode = options.enums === String ? "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" : 0; + } + if (message.dataStoreType != null && message.hasOwnProperty("dataStoreType")) + object.dataStoreType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DataStoreType[message.dataStoreType] === undefined ? message.dataStoreType : $root.google.cloud.dialogflow.cx.v3beta1.DataStoreType[message.dataStoreType] : message.dataStoreType; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + object.dataStore = message.dataStore; + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + object.documentProcessingMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode[message.documentProcessingMode] === undefined ? message.documentProcessingMode : $root.google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode[message.documentProcessingMode] : message.documentProcessingMode; + return object; + }; + + /** + * Converts this DataStoreConnection to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @instance + * @returns {Object.} JSON object + */ + DataStoreConnection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreConnection + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreConnection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnection"; + }; + + return DataStoreConnection; + })(); + + v3beta1.DataStoreConnectionSignals = (function() { + + /** + * Properties of a DataStoreConnectionSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDataStoreConnectionSignals + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals|null} [rewriterModelCallSignals] DataStoreConnectionSignals rewriterModelCallSignals + * @property {string|null} [rewrittenQuery] DataStoreConnectionSignals rewrittenQuery + * @property {Array.|null} [searchSnippets] DataStoreConnectionSignals searchSnippets + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null} [answerGenerationModelCallSignals] DataStoreConnectionSignals answerGenerationModelCallSignals + * @property {string|null} [answer] DataStoreConnectionSignals answer + * @property {Array.|null} [answerParts] DataStoreConnectionSignals answerParts + * @property {Array.|null} [citedSnippets] DataStoreConnectionSignals citedSnippets + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals|null} [groundingSignals] DataStoreConnectionSignals groundingSignals + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals|null} [safetySignals] DataStoreConnectionSignals safetySignals + */ + + /** + * Constructs a new DataStoreConnectionSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DataStoreConnectionSignals. + * @implements IDataStoreConnectionSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals=} [properties] Properties to set + */ + function DataStoreConnectionSignals(properties) { + this.searchSnippets = []; + this.answerParts = []; + this.citedSnippets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreConnectionSignals rewriterModelCallSignals. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals|null|undefined} rewriterModelCallSignals + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.rewriterModelCallSignals = null; + + /** + * DataStoreConnectionSignals rewrittenQuery. + * @member {string} rewrittenQuery + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.rewrittenQuery = ""; + + /** + * DataStoreConnectionSignals searchSnippets. + * @member {Array.} searchSnippets + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.searchSnippets = $util.emptyArray; + + /** + * DataStoreConnectionSignals answerGenerationModelCallSignals. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals|null|undefined} answerGenerationModelCallSignals + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.answerGenerationModelCallSignals = null; + + /** + * DataStoreConnectionSignals answer. + * @member {string} answer + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.answer = ""; + + /** + * DataStoreConnectionSignals answerParts. + * @member {Array.} answerParts + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.answerParts = $util.emptyArray; + + /** + * DataStoreConnectionSignals citedSnippets. + * @member {Array.} citedSnippets + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.citedSnippets = $util.emptyArray; + + /** + * DataStoreConnectionSignals groundingSignals. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals|null|undefined} groundingSignals + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.groundingSignals = null; + + /** + * DataStoreConnectionSignals safetySignals. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals|null|undefined} safetySignals + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + */ + DataStoreConnectionSignals.prototype.safetySignals = null; + + /** + * Creates a new DataStoreConnectionSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals} DataStoreConnectionSignals instance + */ + DataStoreConnectionSignals.create = function create(properties) { + return new DataStoreConnectionSignals(properties); + }; + + /** + * Encodes the specified DataStoreConnectionSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals} message DataStoreConnectionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnectionSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rewriterModelCallSignals != null && Object.hasOwnProperty.call(message, "rewriterModelCallSignals")) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.encode(message.rewriterModelCallSignals, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rewrittenQuery != null && Object.hasOwnProperty.call(message, "rewrittenQuery")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rewrittenQuery); + if (message.searchSnippets != null && message.searchSnippets.length) + for (var i = 0; i < message.searchSnippets.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.encode(message.searchSnippets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.answerGenerationModelCallSignals != null && Object.hasOwnProperty.call(message, "answerGenerationModelCallSignals")) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.encode(message.answerGenerationModelCallSignals, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.answer); + if (message.answerParts != null && message.answerParts.length) + for (var i = 0; i < message.answerParts.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.encode(message.answerParts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.citedSnippets != null && message.citedSnippets.length) + for (var i = 0; i < message.citedSnippets.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.encode(message.citedSnippets[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.groundingSignals != null && Object.hasOwnProperty.call(message, "groundingSignals")) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.encode(message.groundingSignals, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.safetySignals != null && Object.hasOwnProperty.call(message, "safetySignals")) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.encode(message.safetySignals, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreConnectionSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals} message DataStoreConnectionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreConnectionSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals} DataStoreConnectionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnectionSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rewriterModelCallSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.rewrittenQuery = reader.string(); + break; + } + case 3: { + if (!(message.searchSnippets && message.searchSnippets.length)) + message.searchSnippets = []; + message.searchSnippets.push($root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.answerGenerationModelCallSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.answer = reader.string(); + break; + } + case 6: { + if (!(message.answerParts && message.answerParts.length)) + message.answerParts = []; + message.answerParts.push($root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.citedSnippets && message.citedSnippets.length)) + message.citedSnippets = []; + message.citedSnippets.push($root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.groundingSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.safetySignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreConnectionSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals} DataStoreConnectionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreConnectionSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreConnectionSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreConnectionSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rewriterModelCallSignals != null && message.hasOwnProperty("rewriterModelCallSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.verify(message.rewriterModelCallSignals, long + 1); + if (error) + return "rewriterModelCallSignals." + error; + } + if (message.rewrittenQuery != null && message.hasOwnProperty("rewrittenQuery")) + if (!$util.isString(message.rewrittenQuery)) + return "rewrittenQuery: string expected"; + if (message.searchSnippets != null && message.hasOwnProperty("searchSnippets")) { + if (!Array.isArray(message.searchSnippets)) + return "searchSnippets: array expected"; + for (var i = 0; i < message.searchSnippets.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.verify(message.searchSnippets[i], long + 1); + if (error) + return "searchSnippets." + error; + } + } + if (message.answerGenerationModelCallSignals != null && message.hasOwnProperty("answerGenerationModelCallSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify(message.answerGenerationModelCallSignals, long + 1); + if (error) + return "answerGenerationModelCallSignals." + error; + } + if (message.answer != null && message.hasOwnProperty("answer")) + if (!$util.isString(message.answer)) + return "answer: string expected"; + if (message.answerParts != null && message.hasOwnProperty("answerParts")) { + if (!Array.isArray(message.answerParts)) + return "answerParts: array expected"; + for (var i = 0; i < message.answerParts.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.verify(message.answerParts[i], long + 1); + if (error) + return "answerParts." + error; + } + } + if (message.citedSnippets != null && message.hasOwnProperty("citedSnippets")) { + if (!Array.isArray(message.citedSnippets)) + return "citedSnippets: array expected"; + for (var i = 0; i < message.citedSnippets.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.verify(message.citedSnippets[i], long + 1); + if (error) + return "citedSnippets." + error; + } + } + if (message.groundingSignals != null && message.hasOwnProperty("groundingSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.verify(message.groundingSignals, long + 1); + if (error) + return "groundingSignals." + error; + } + if (message.safetySignals != null && message.hasOwnProperty("safetySignals")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.verify(message.safetySignals, long + 1); + if (error) + return "safetySignals." + error; + } + return null; + }; + + /** + * Creates a DataStoreConnectionSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals} DataStoreConnectionSignals + */ + DataStoreConnectionSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals(); + if (object.rewriterModelCallSignals != null) { + if (typeof object.rewriterModelCallSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.rewriterModelCallSignals: object expected"); + message.rewriterModelCallSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.fromObject(object.rewriterModelCallSignals, long + 1); + } + if (object.rewrittenQuery != null) + message.rewrittenQuery = String(object.rewrittenQuery); + if (object.searchSnippets) { + if (!Array.isArray(object.searchSnippets)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.searchSnippets: array expected"); + message.searchSnippets = []; + for (var i = 0; i < object.searchSnippets.length; ++i) { + if (typeof object.searchSnippets[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.searchSnippets: object expected"); + message.searchSnippets[i] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.fromObject(object.searchSnippets[i], long + 1); + } + } + if (object.answerGenerationModelCallSignals != null) { + if (typeof object.answerGenerationModelCallSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.answerGenerationModelCallSignals: object expected"); + message.answerGenerationModelCallSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.fromObject(object.answerGenerationModelCallSignals, long + 1); + } + if (object.answer != null) + message.answer = String(object.answer); + if (object.answerParts) { + if (!Array.isArray(object.answerParts)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.answerParts: array expected"); + message.answerParts = []; + for (var i = 0; i < object.answerParts.length; ++i) { + if (typeof object.answerParts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.answerParts: object expected"); + message.answerParts[i] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.fromObject(object.answerParts[i], long + 1); + } + } + if (object.citedSnippets) { + if (!Array.isArray(object.citedSnippets)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.citedSnippets: array expected"); + message.citedSnippets = []; + for (var i = 0; i < object.citedSnippets.length; ++i) { + if (typeof object.citedSnippets[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.citedSnippets: object expected"); + message.citedSnippets[i] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.fromObject(object.citedSnippets[i], long + 1); + } + } + if (object.groundingSignals != null) { + if (typeof object.groundingSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.groundingSignals: object expected"); + message.groundingSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.fromObject(object.groundingSignals, long + 1); + } + if (object.safetySignals != null) { + if (typeof object.safetySignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.safetySignals: object expected"); + message.safetySignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.fromObject(object.safetySignals, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreConnectionSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals} message DataStoreConnectionSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreConnectionSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.searchSnippets = []; + object.answerParts = []; + object.citedSnippets = []; + } + if (options.defaults) { + object.rewriterModelCallSignals = null; + object.rewrittenQuery = ""; + object.answerGenerationModelCallSignals = null; + object.answer = ""; + object.groundingSignals = null; + object.safetySignals = null; + } + if (message.rewriterModelCallSignals != null && message.hasOwnProperty("rewriterModelCallSignals")) + object.rewriterModelCallSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.toObject(message.rewriterModelCallSignals, options); + if (message.rewrittenQuery != null && message.hasOwnProperty("rewrittenQuery")) + object.rewrittenQuery = message.rewrittenQuery; + if (message.searchSnippets && message.searchSnippets.length) { + object.searchSnippets = []; + for (var j = 0; j < message.searchSnippets.length; ++j) + object.searchSnippets[j] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.toObject(message.searchSnippets[j], options); + } + if (message.answerGenerationModelCallSignals != null && message.hasOwnProperty("answerGenerationModelCallSignals")) + object.answerGenerationModelCallSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.toObject(message.answerGenerationModelCallSignals, options); + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = message.answer; + if (message.answerParts && message.answerParts.length) { + object.answerParts = []; + for (var j = 0; j < message.answerParts.length; ++j) + object.answerParts[j] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.toObject(message.answerParts[j], options); + } + if (message.citedSnippets && message.citedSnippets.length) { + object.citedSnippets = []; + for (var j = 0; j < message.citedSnippets.length; ++j) + object.citedSnippets[j] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.toObject(message.citedSnippets[j], options); + } + if (message.groundingSignals != null && message.hasOwnProperty("groundingSignals")) + object.groundingSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.toObject(message.groundingSignals, options); + if (message.safetySignals != null && message.hasOwnProperty("safetySignals")) + object.safetySignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.toObject(message.safetySignals, options); + return object; + }; + + /** + * Converts this DataStoreConnectionSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @instance + * @returns {Object.} JSON object + */ + DataStoreConnectionSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreConnectionSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreConnectionSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals"; + }; + + DataStoreConnectionSignals.RewriterModelCallSignals = (function() { + + /** + * Properties of a RewriterModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @interface IRewriterModelCallSignals + * @property {string|null} [renderedPrompt] RewriterModelCallSignals renderedPrompt + * @property {string|null} [modelOutput] RewriterModelCallSignals modelOutput + * @property {string|null} [model] RewriterModelCallSignals model + */ + + /** + * Constructs a new RewriterModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @classdesc Represents a RewriterModelCallSignals. + * @implements IRewriterModelCallSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals=} [properties] Properties to set + */ + function RewriterModelCallSignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RewriterModelCallSignals renderedPrompt. + * @member {string} renderedPrompt + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + */ + RewriterModelCallSignals.prototype.renderedPrompt = ""; + + /** + * RewriterModelCallSignals modelOutput. + * @member {string} modelOutput + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + */ + RewriterModelCallSignals.prototype.modelOutput = ""; + + /** + * RewriterModelCallSignals model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + */ + RewriterModelCallSignals.prototype.model = ""; + + /** + * Creates a new RewriterModelCallSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals instance + */ + RewriterModelCallSignals.create = function create(properties) { + return new RewriterModelCallSignals(properties); + }; + + /** + * Encodes the specified RewriterModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals} message RewriterModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterModelCallSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderedPrompt != null && Object.hasOwnProperty.call(message, "renderedPrompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedPrompt); + if (message.modelOutput != null && Object.hasOwnProperty.call(message, "modelOutput")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelOutput); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified RewriterModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IRewriterModelCallSignals} message RewriterModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterModelCallSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterModelCallSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.renderedPrompt = reader.string(); + break; + } + case 2: { + message.modelOutput = reader.string(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RewriterModelCallSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterModelCallSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RewriterModelCallSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RewriterModelCallSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + if (!$util.isString(message.renderedPrompt)) + return "renderedPrompt: string expected"; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + if (!$util.isString(message.modelOutput)) + return "modelOutput: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a RewriterModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals} RewriterModelCallSignals + */ + RewriterModelCallSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals(); + if (object.renderedPrompt != null) + message.renderedPrompt = String(object.renderedPrompt); + if (object.modelOutput != null) + message.modelOutput = String(object.modelOutput); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a RewriterModelCallSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals} message RewriterModelCallSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RewriterModelCallSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderedPrompt = ""; + object.modelOutput = ""; + object.model = ""; + } + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + object.renderedPrompt = message.renderedPrompt; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + object.modelOutput = message.modelOutput; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this RewriterModelCallSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @instance + * @returns {Object.} JSON object + */ + RewriterModelCallSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RewriterModelCallSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RewriterModelCallSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.RewriterModelCallSignals"; + }; + + return RewriterModelCallSignals; + })(); + + DataStoreConnectionSignals.SearchSnippet = (function() { + + /** + * Properties of a SearchSnippet. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @interface ISearchSnippet + * @property {string|null} [documentTitle] SearchSnippet documentTitle + * @property {string|null} [documentUri] SearchSnippet documentUri + * @property {string|null} [text] SearchSnippet text + * @property {google.protobuf.IStruct|null} [metadata] SearchSnippet metadata + */ + + /** + * Constructs a new SearchSnippet. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @classdesc Represents a SearchSnippet. + * @implements ISearchSnippet + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet=} [properties] Properties to set + */ + function SearchSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchSnippet documentTitle. + * @member {string} documentTitle + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.documentTitle = ""; + + /** + * SearchSnippet documentUri. + * @member {string} documentUri + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.documentUri = ""; + + /** + * SearchSnippet text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.text = ""; + + /** + * SearchSnippet metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @instance + */ + SearchSnippet.prototype.metadata = null; + + /** + * Creates a new SearchSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet} SearchSnippet instance + */ + SearchSnippet.create = function create(properties) { + return new SearchSnippet(properties); + }; + + /** + * Encodes the specified SearchSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet} message SearchSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSnippet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentTitle != null && Object.hasOwnProperty.call(message, "documentTitle")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentTitle); + if (message.documentUri != null && Object.hasOwnProperty.call(message, "documentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentUri); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet} message SearchSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet} SearchSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSnippet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentTitle = reader.string(); + break; + } + case 2: { + message.documentUri = reader.string(); + break; + } + case 3: { + message.text = reader.string(); + break; + } + case 5: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet} SearchSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchSnippet message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchSnippet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.documentTitle != null && message.hasOwnProperty("documentTitle")) + if (!$util.isString(message.documentTitle)) + return "documentTitle: string expected"; + if (message.documentUri != null && message.hasOwnProperty("documentUri")) + if (!$util.isString(message.documentUri)) + return "documentUri: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a SearchSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet} SearchSnippet + */ + SearchSnippet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet(); + if (object.documentTitle != null) + message.documentTitle = String(object.documentTitle); + if (object.documentUri != null) + message.documentUri = String(object.documentUri); + if (object.text != null) + message.text = String(object.text); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SearchSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet} message SearchSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentTitle = ""; + object.documentUri = ""; + object.text = ""; + object.metadata = null; + } + if (message.documentTitle != null && message.hasOwnProperty("documentTitle")) + object.documentTitle = message.documentTitle; + if (message.documentUri != null && message.hasOwnProperty("documentUri")) + object.documentUri = message.documentUri; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this SearchSnippet to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @instance + * @returns {Object.} JSON object + */ + SearchSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchSnippet + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet"; + }; + + return SearchSnippet; + })(); + + DataStoreConnectionSignals.AnswerGenerationModelCallSignals = (function() { + + /** + * Properties of an AnswerGenerationModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @interface IAnswerGenerationModelCallSignals + * @property {string|null} [renderedPrompt] AnswerGenerationModelCallSignals renderedPrompt + * @property {string|null} [modelOutput] AnswerGenerationModelCallSignals modelOutput + * @property {string|null} [model] AnswerGenerationModelCallSignals model + */ + + /** + * Constructs a new AnswerGenerationModelCallSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @classdesc Represents an AnswerGenerationModelCallSignals. + * @implements IAnswerGenerationModelCallSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals=} [properties] Properties to set + */ + function AnswerGenerationModelCallSignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerGenerationModelCallSignals renderedPrompt. + * @member {string} renderedPrompt + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + */ + AnswerGenerationModelCallSignals.prototype.renderedPrompt = ""; + + /** + * AnswerGenerationModelCallSignals modelOutput. + * @member {string} modelOutput + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + */ + AnswerGenerationModelCallSignals.prototype.modelOutput = ""; + + /** + * AnswerGenerationModelCallSignals model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + */ + AnswerGenerationModelCallSignals.prototype.model = ""; + + /** + * Creates a new AnswerGenerationModelCallSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals instance + */ + AnswerGenerationModelCallSignals.create = function create(properties) { + return new AnswerGenerationModelCallSignals(properties); + }; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals} message AnswerGenerationModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerGenerationModelCallSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderedPrompt != null && Object.hasOwnProperty.call(message, "renderedPrompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedPrompt); + if (message.modelOutput != null && Object.hasOwnProperty.call(message, "modelOutput")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelOutput); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified AnswerGenerationModelCallSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerGenerationModelCallSignals} message AnswerGenerationModelCallSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerGenerationModelCallSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerGenerationModelCallSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.renderedPrompt = reader.string(); + break; + } + case 2: { + message.modelOutput = reader.string(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerGenerationModelCallSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerGenerationModelCallSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerGenerationModelCallSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerGenerationModelCallSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + if (!$util.isString(message.renderedPrompt)) + return "renderedPrompt: string expected"; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + if (!$util.isString(message.modelOutput)) + return "modelOutput: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an AnswerGenerationModelCallSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} AnswerGenerationModelCallSignals + */ + AnswerGenerationModelCallSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals(); + if (object.renderedPrompt != null) + message.renderedPrompt = String(object.renderedPrompt); + if (object.modelOutput != null) + message.modelOutput = String(object.modelOutput); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an AnswerGenerationModelCallSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals} message AnswerGenerationModelCallSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerGenerationModelCallSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderedPrompt = ""; + object.modelOutput = ""; + object.model = ""; + } + if (message.renderedPrompt != null && message.hasOwnProperty("renderedPrompt")) + object.renderedPrompt = message.renderedPrompt; + if (message.modelOutput != null && message.hasOwnProperty("modelOutput")) + object.modelOutput = message.modelOutput; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this AnswerGenerationModelCallSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @instance + * @returns {Object.} JSON object + */ + AnswerGenerationModelCallSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerGenerationModelCallSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerGenerationModelCallSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerGenerationModelCallSignals"; + }; + + return AnswerGenerationModelCallSignals; + })(); + + DataStoreConnectionSignals.AnswerPart = (function() { + + /** + * Properties of an AnswerPart. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @interface IAnswerPart + * @property {string|null} [text] AnswerPart text + * @property {Array.|null} [supportingIndices] AnswerPart supportingIndices + */ + + /** + * Constructs a new AnswerPart. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @classdesc Represents an AnswerPart. + * @implements IAnswerPart + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart=} [properties] Properties to set + */ + function AnswerPart(properties) { + this.supportingIndices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerPart text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @instance + */ + AnswerPart.prototype.text = ""; + + /** + * AnswerPart supportingIndices. + * @member {Array.} supportingIndices + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @instance + */ + AnswerPart.prototype.supportingIndices = $util.emptyArray; + + /** + * Creates a new AnswerPart instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart} AnswerPart instance + */ + AnswerPart.create = function create(properties) { + return new AnswerPart(properties); + }; + + /** + * Encodes the specified AnswerPart message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart} message AnswerPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerPart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.supportingIndices != null && message.supportingIndices.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.supportingIndices.length; ++i) + writer.int32(message.supportingIndices[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AnswerPart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IAnswerPart} message AnswerPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerPart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerPart message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart} AnswerPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerPart.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.supportingIndices && message.supportingIndices.length)) + message.supportingIndices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportingIndices.push(reader.int32()); + } else + message.supportingIndices.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerPart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart} AnswerPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerPart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerPart message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerPart.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.supportingIndices != null && message.hasOwnProperty("supportingIndices")) { + if (!Array.isArray(message.supportingIndices)) + return "supportingIndices: array expected"; + for (var i = 0; i < message.supportingIndices.length; ++i) + if (!$util.isInteger(message.supportingIndices[i])) + return "supportingIndices: integer[] expected"; + } + return null; + }; + + /** + * Creates an AnswerPart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart} AnswerPart + */ + AnswerPart.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart(); + if (object.text != null) + message.text = String(object.text); + if (object.supportingIndices) { + if (!Array.isArray(object.supportingIndices)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart.supportingIndices: array expected"); + message.supportingIndices = []; + for (var i = 0; i < object.supportingIndices.length; ++i) + message.supportingIndices[i] = object.supportingIndices[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an AnswerPart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart} message AnswerPart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerPart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportingIndices = []; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.supportingIndices && message.supportingIndices.length) { + object.supportingIndices = []; + for (var j = 0; j < message.supportingIndices.length; ++j) + object.supportingIndices[j] = message.supportingIndices[j]; + } + return object; + }; + + /** + * Converts this AnswerPart to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @instance + * @returns {Object.} JSON object + */ + AnswerPart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerPart + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerPart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.AnswerPart"; + }; + + return AnswerPart; + })(); + + DataStoreConnectionSignals.CitedSnippet = (function() { + + /** + * Properties of a CitedSnippet. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @interface ICitedSnippet + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet|null} [searchSnippet] CitedSnippet searchSnippet + * @property {number|null} [snippetIndex] CitedSnippet snippetIndex + */ + + /** + * Constructs a new CitedSnippet. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @classdesc Represents a CitedSnippet. + * @implements ICitedSnippet + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet=} [properties] Properties to set + */ + function CitedSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CitedSnippet searchSnippet. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISearchSnippet|null|undefined} searchSnippet + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @instance + */ + CitedSnippet.prototype.searchSnippet = null; + + /** + * CitedSnippet snippetIndex. + * @member {number} snippetIndex + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @instance + */ + CitedSnippet.prototype.snippetIndex = 0; + + /** + * Creates a new CitedSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet} CitedSnippet instance + */ + CitedSnippet.create = function create(properties) { + return new CitedSnippet(properties); + }; + + /** + * Encodes the specified CitedSnippet message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet} message CitedSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedSnippet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchSnippet != null && Object.hasOwnProperty.call(message, "searchSnippet")) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.encode(message.searchSnippet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.snippetIndex != null && Object.hasOwnProperty.call(message, "snippetIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.snippetIndex); + return writer; + }; + + /** + * Encodes the specified CitedSnippet message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ICitedSnippet} message CitedSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet} CitedSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedSnippet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.searchSnippet = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.snippetIndex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CitedSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet} CitedSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CitedSnippet message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CitedSnippet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.searchSnippet != null && message.hasOwnProperty("searchSnippet")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.verify(message.searchSnippet, long + 1); + if (error) + return "searchSnippet." + error; + } + if (message.snippetIndex != null && message.hasOwnProperty("snippetIndex")) + if (!$util.isInteger(message.snippetIndex)) + return "snippetIndex: integer expected"; + return null; + }; + + /** + * Creates a CitedSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet} CitedSnippet + */ + CitedSnippet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet(); + if (object.searchSnippet != null) { + if (typeof object.searchSnippet !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet.searchSnippet: object expected"); + message.searchSnippet = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.fromObject(object.searchSnippet, long + 1); + } + if (object.snippetIndex != null) + message.snippetIndex = object.snippetIndex | 0; + return message; + }; + + /** + * Creates a plain object from a CitedSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet} message CitedSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitedSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.searchSnippet = null; + object.snippetIndex = 0; + } + if (message.searchSnippet != null && message.hasOwnProperty("searchSnippet")) + object.searchSnippet = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SearchSnippet.toObject(message.searchSnippet, options); + if (message.snippetIndex != null && message.hasOwnProperty("snippetIndex")) + object.snippetIndex = message.snippetIndex; + return object; + }; + + /** + * Converts this CitedSnippet to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @instance + * @returns {Object.} JSON object + */ + CitedSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitedSnippet + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitedSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.CitedSnippet"; + }; + + return CitedSnippet; + })(); + + DataStoreConnectionSignals.GroundingSignals = (function() { + + /** + * Properties of a GroundingSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @interface IGroundingSignals + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision|null} [decision] GroundingSignals decision + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket|null} [score] GroundingSignals score + */ + + /** + * Constructs a new GroundingSignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @classdesc Represents a GroundingSignals. + * @implements IGroundingSignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals=} [properties] Properties to set + */ + function GroundingSignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingSignals decision. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision} decision + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @instance + */ + GroundingSignals.prototype.decision = 0; + + /** + * GroundingSignals score. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket} score + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @instance + */ + GroundingSignals.prototype.score = 0; + + /** + * Creates a new GroundingSignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals} GroundingSignals instance + */ + GroundingSignals.create = function create(properties) { + return new GroundingSignals(properties); + }; + + /** + * Encodes the specified GroundingSignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals} message GroundingSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.decision != null && Object.hasOwnProperty.call(message, "decision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.decision); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.score); + return writer; + }; + + /** + * Encodes the specified GroundingSignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.IGroundingSignals} message GroundingSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals} GroundingSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingSignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.decision = reader.int32(); + break; + } + case 2: { + message.score = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals} GroundingSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingSignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingSignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.decision != null && message.hasOwnProperty("decision")) + switch (message.decision) { + default: + return "decision: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.score != null && message.hasOwnProperty("score")) + switch (message.score) { + default: + return "score: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a GroundingSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals} GroundingSignals + */ + GroundingSignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals(); + switch (object.decision) { + default: + if (typeof object.decision === "number") { + message.decision = object.decision; + break; + } + break; + case "GROUNDING_DECISION_UNSPECIFIED": + case 0: + message.decision = 0; + break; + case "ACCEPTED_BY_GROUNDING": + case 1: + message.decision = 1; + break; + case "REJECTED_BY_GROUNDING": + case 2: + message.decision = 2; + break; + } + switch (object.score) { + default: + if (typeof object.score === "number") { + message.score = object.score; + break; + } + break; + case "GROUNDING_SCORE_BUCKET_UNSPECIFIED": + case 0: + message.score = 0; + break; + case "VERY_LOW": + case 1: + message.score = 1; + break; + case "LOW": + case 3: + message.score = 3; + break; + case "MEDIUM": + case 4: + message.score = 4; + break; + case "HIGH": + case 5: + message.score = 5; + break; + case "VERY_HIGH": + case 6: + message.score = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a GroundingSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals} message GroundingSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.decision = options.enums === String ? "GROUNDING_DECISION_UNSPECIFIED" : 0; + object.score = options.enums === String ? "GROUNDING_SCORE_BUCKET_UNSPECIFIED" : 0; + } + if (message.decision != null && message.hasOwnProperty("decision")) + object.decision = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision[message.decision] === undefined ? message.decision : $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision[message.decision] : message.decision; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket[message.score] === undefined ? message.score : $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket[message.score] : message.score; + return object; + }; + + /** + * Converts this GroundingSignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @instance + * @returns {Object.} JSON object + */ + GroundingSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingSignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals"; + }; + + /** + * GroundingDecision enum. + * @name google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingDecision + * @enum {number} + * @property {number} GROUNDING_DECISION_UNSPECIFIED=0 GROUNDING_DECISION_UNSPECIFIED value + * @property {number} ACCEPTED_BY_GROUNDING=1 ACCEPTED_BY_GROUNDING value + * @property {number} REJECTED_BY_GROUNDING=2 REJECTED_BY_GROUNDING value + */ + GroundingSignals.GroundingDecision = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUNDING_DECISION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCEPTED_BY_GROUNDING"] = 1; + values[valuesById[2] = "REJECTED_BY_GROUNDING"] = 2; + return values; + })(); + + /** + * GroundingScoreBucket enum. + * @name google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket + * @enum {number} + * @property {number} GROUNDING_SCORE_BUCKET_UNSPECIFIED=0 GROUNDING_SCORE_BUCKET_UNSPECIFIED value + * @property {number} VERY_LOW=1 VERY_LOW value + * @property {number} LOW=3 LOW value + * @property {number} MEDIUM=4 MEDIUM value + * @property {number} HIGH=5 HIGH value + * @property {number} VERY_HIGH=6 VERY_HIGH value + */ + GroundingSignals.GroundingScoreBucket = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUNDING_SCORE_BUCKET_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_LOW"] = 1; + values[valuesById[3] = "LOW"] = 3; + values[valuesById[4] = "MEDIUM"] = 4; + values[valuesById[5] = "HIGH"] = 5; + values[valuesById[6] = "VERY_HIGH"] = 6; + return values; + })(); + + return GroundingSignals; + })(); + + DataStoreConnectionSignals.SafetySignals = (function() { + + /** + * Properties of a SafetySignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @interface ISafetySignals + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision|null} [decision] SafetySignals decision + * @property {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch|null} [bannedPhraseMatch] SafetySignals bannedPhraseMatch + * @property {string|null} [matchedBannedPhrase] SafetySignals matchedBannedPhrase + */ + + /** + * Constructs a new SafetySignals. + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals + * @classdesc Represents a SafetySignals. + * @implements ISafetySignals + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals=} [properties] Properties to set + */ + function SafetySignals(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySignals decision. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision} decision + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @instance + */ + SafetySignals.prototype.decision = 0; + + /** + * SafetySignals bannedPhraseMatch. + * @member {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch} bannedPhraseMatch + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @instance + */ + SafetySignals.prototype.bannedPhraseMatch = 0; + + /** + * SafetySignals matchedBannedPhrase. + * @member {string} matchedBannedPhrase + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @instance + */ + SafetySignals.prototype.matchedBannedPhrase = ""; + + /** + * Creates a new SafetySignals instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals} SafetySignals instance + */ + SafetySignals.create = function create(properties) { + return new SafetySignals(properties); + }; + + /** + * Encodes the specified SafetySignals message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals} message SafetySignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.decision != null && Object.hasOwnProperty.call(message, "decision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.decision); + if (message.bannedPhraseMatch != null && Object.hasOwnProperty.call(message, "bannedPhraseMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bannedPhraseMatch); + if (message.matchedBannedPhrase != null && Object.hasOwnProperty.call(message, "matchedBannedPhrase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.matchedBannedPhrase); + return writer; + }; + + /** + * Encodes the specified SafetySignals message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.ISafetySignals} message SafetySignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySignals message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals} SafetySignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySignals.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.decision = reader.int32(); + break; + } + case 2: { + message.bannedPhraseMatch = reader.int32(); + break; + } + case 3: { + message.matchedBannedPhrase = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals} SafetySignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySignals message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySignals.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.decision != null && message.hasOwnProperty("decision")) + switch (message.decision) { + default: + return "decision: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.bannedPhraseMatch != null && message.hasOwnProperty("bannedPhraseMatch")) + switch (message.bannedPhraseMatch) { + default: + return "bannedPhraseMatch: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.matchedBannedPhrase != null && message.hasOwnProperty("matchedBannedPhrase")) + if (!$util.isString(message.matchedBannedPhrase)) + return "matchedBannedPhrase: string expected"; + return null; + }; + + /** + * Creates a SafetySignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals} SafetySignals + */ + SafetySignals.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals(); + switch (object.decision) { + default: + if (typeof object.decision === "number") { + message.decision = object.decision; + break; + } + break; + case "SAFETY_DECISION_UNSPECIFIED": + case 0: + message.decision = 0; + break; + case "ACCEPTED_BY_SAFETY_CHECK": + case 1: + message.decision = 1; + break; + case "REJECTED_BY_SAFETY_CHECK": + case 2: + message.decision = 2; + break; + } + switch (object.bannedPhraseMatch) { + default: + if (typeof object.bannedPhraseMatch === "number") { + message.bannedPhraseMatch = object.bannedPhraseMatch; + break; + } + break; + case "BANNED_PHRASE_MATCH_UNSPECIFIED": + case 0: + message.bannedPhraseMatch = 0; + break; + case "BANNED_PHRASE_MATCH_NONE": + case 1: + message.bannedPhraseMatch = 1; + break; + case "BANNED_PHRASE_MATCH_QUERY": + case 2: + message.bannedPhraseMatch = 2; + break; + case "BANNED_PHRASE_MATCH_RESPONSE": + case 3: + message.bannedPhraseMatch = 3; + break; + } + if (object.matchedBannedPhrase != null) + message.matchedBannedPhrase = String(object.matchedBannedPhrase); + return message; + }; + + /** + * Creates a plain object from a SafetySignals message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals} message SafetySignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.decision = options.enums === String ? "SAFETY_DECISION_UNSPECIFIED" : 0; + object.bannedPhraseMatch = options.enums === String ? "BANNED_PHRASE_MATCH_UNSPECIFIED" : 0; + object.matchedBannedPhrase = ""; + } + if (message.decision != null && message.hasOwnProperty("decision")) + object.decision = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision[message.decision] === undefined ? message.decision : $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision[message.decision] : message.decision; + if (message.bannedPhraseMatch != null && message.hasOwnProperty("bannedPhraseMatch")) + object.bannedPhraseMatch = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch[message.bannedPhraseMatch] === undefined ? message.bannedPhraseMatch : $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch[message.bannedPhraseMatch] : message.bannedPhraseMatch; + if (message.matchedBannedPhrase != null && message.hasOwnProperty("matchedBannedPhrase")) + object.matchedBannedPhrase = message.matchedBannedPhrase; + return object; + }; + + /** + * Converts this SafetySignals to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @instance + * @returns {Object.} JSON object + */ + SafetySignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySignals + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals"; + }; + + /** + * SafetyDecision enum. + * @name google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.SafetyDecision + * @enum {number} + * @property {number} SAFETY_DECISION_UNSPECIFIED=0 SAFETY_DECISION_UNSPECIFIED value + * @property {number} ACCEPTED_BY_SAFETY_CHECK=1 ACCEPTED_BY_SAFETY_CHECK value + * @property {number} REJECTED_BY_SAFETY_CHECK=2 REJECTED_BY_SAFETY_CHECK value + */ + SafetySignals.SafetyDecision = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAFETY_DECISION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCEPTED_BY_SAFETY_CHECK"] = 1; + values[valuesById[2] = "REJECTED_BY_SAFETY_CHECK"] = 2; + return values; + })(); + + /** + * BannedPhraseMatch enum. + * @name google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch + * @enum {number} + * @property {number} BANNED_PHRASE_MATCH_UNSPECIFIED=0 BANNED_PHRASE_MATCH_UNSPECIFIED value + * @property {number} BANNED_PHRASE_MATCH_NONE=1 BANNED_PHRASE_MATCH_NONE value + * @property {number} BANNED_PHRASE_MATCH_QUERY=2 BANNED_PHRASE_MATCH_QUERY value + * @property {number} BANNED_PHRASE_MATCH_RESPONSE=3 BANNED_PHRASE_MATCH_RESPONSE value + */ + SafetySignals.BannedPhraseMatch = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BANNED_PHRASE_MATCH_UNSPECIFIED"] = 0; + values[valuesById[1] = "BANNED_PHRASE_MATCH_NONE"] = 1; + values[valuesById[2] = "BANNED_PHRASE_MATCH_QUERY"] = 2; + values[valuesById[3] = "BANNED_PHRASE_MATCH_RESPONSE"] = 3; + return values; + })(); + + return SafetySignals; + })(); + + return DataStoreConnectionSignals; + })(); + + /** + * DataStoreType enum. + * @name google.cloud.dialogflow.cx.v3beta1.DataStoreType + * @enum {number} + * @property {number} DATA_STORE_TYPE_UNSPECIFIED=0 DATA_STORE_TYPE_UNSPECIFIED value + * @property {number} PUBLIC_WEB=1 PUBLIC_WEB value + * @property {number} UNSTRUCTURED=2 UNSTRUCTURED value + * @property {number} STRUCTURED=3 STRUCTURED value + */ + v3beta1.DataStoreType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_STORE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PUBLIC_WEB"] = 1; + values[valuesById[2] = "UNSTRUCTURED"] = 2; + values[valuesById[3] = "STRUCTURED"] = 3; + return values; + })(); + + /** + * DocumentProcessingMode enum. + * @name google.cloud.dialogflow.cx.v3beta1.DocumentProcessingMode + * @enum {number} + * @property {number} DOCUMENT_PROCESSING_MODE_UNSPECIFIED=0 DOCUMENT_PROCESSING_MODE_UNSPECIFIED value + * @property {number} DOCUMENTS=1 DOCUMENTS value + * @property {number} CHUNKS=2 CHUNKS value + */ + v3beta1.DocumentProcessingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_PROCESSING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOCUMENTS"] = 1; + values[valuesById[2] = "CHUNKS"] = 2; + return values; + })(); + + v3beta1.Fulfillment = (function() { + + /** + * Properties of a Fulfillment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFulfillment + * @property {Array.|null} [messages] Fulfillment messages + * @property {string|null} [webhook] Fulfillment webhook + * @property {boolean|null} [returnPartialResponses] Fulfillment returnPartialResponses + * @property {string|null} [tag] Fulfillment tag + * @property {Array.|null} [setParameterActions] Fulfillment setParameterActions + * @property {Array.|null} [conditionalCases] Fulfillment conditionalCases + * @property {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null} [advancedSettings] Fulfillment advancedSettings + * @property {boolean|null} [enableGenerativeFallback] Fulfillment enableGenerativeFallback + * @property {Array.|null} [generators] Fulfillment generators + */ + + /** + * Constructs a new Fulfillment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Fulfillment. + * @implements IFulfillment + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillment=} [properties] Properties to set + */ + function Fulfillment(properties) { + this.messages = []; + this.setParameterActions = []; + this.conditionalCases = []; + this.generators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Fulfillment messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.messages = $util.emptyArray; + + /** + * Fulfillment webhook. + * @member {string} webhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.webhook = ""; + + /** + * Fulfillment returnPartialResponses. + * @member {boolean} returnPartialResponses + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.returnPartialResponses = false; + + /** + * Fulfillment tag. + * @member {string} tag + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.tag = ""; + + /** + * Fulfillment setParameterActions. + * @member {Array.} setParameterActions + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.setParameterActions = $util.emptyArray; + + /** + * Fulfillment conditionalCases. + * @member {Array.} conditionalCases + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.conditionalCases = $util.emptyArray; + + /** + * Fulfillment advancedSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.advancedSettings = null; + + /** + * Fulfillment enableGenerativeFallback. + * @member {boolean} enableGenerativeFallback + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.enableGenerativeFallback = false; + + /** + * Fulfillment generators. + * @member {Array.} generators + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + */ + Fulfillment.prototype.generators = $util.emptyArray; + + /** + * Creates a new Fulfillment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment} Fulfillment instance + */ + Fulfillment.create = function create(properties) { + return new Fulfillment(properties); + }; + + /** + * Encodes the specified Fulfillment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillment} message Fulfillment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fulfillment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.webhook != null && Object.hasOwnProperty.call(message, "webhook")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.webhook); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tag); + if (message.setParameterActions != null && message.setParameterActions.length) + for (var i = 0; i < message.setParameterActions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.encode(message.setParameterActions[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.conditionalCases != null && message.conditionalCases.length) + for (var i = 0; i < message.conditionalCases.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.encode(message.conditionalCases[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.returnPartialResponses != null && Object.hasOwnProperty.call(message, "returnPartialResponses")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.returnPartialResponses); + if (message.enableGenerativeFallback != null && Object.hasOwnProperty.call(message, "enableGenerativeFallback")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableGenerativeFallback); + if (message.generators != null && message.generators.length) + for (var i = 0; i < message.generators.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.encode(message.generators[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Fulfillment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillment} message Fulfillment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fulfillment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fulfillment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment} Fulfillment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fulfillment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.webhook = reader.string(); + break; + } + case 8: { + message.returnPartialResponses = reader.bool(); + break; + } + case 3: { + message.tag = reader.string(); + break; + } + case 4: { + if (!(message.setParameterActions && message.setParameterActions.length)) + message.setParameterActions = []; + message.setParameterActions.push($root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.conditionalCases && message.conditionalCases.length)) + message.conditionalCases = []; + message.conditionalCases.push($root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.enableGenerativeFallback = reader.bool(); + break; + } + case 13: { + if (!(message.generators && message.generators.length)) + message.generators = []; + message.generators.push($root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Fulfillment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment} Fulfillment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fulfillment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fulfillment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fulfillment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify(message.messages[i], long + 1); + if (error) + return "messages." + error; + } + } + if (message.webhook != null && message.hasOwnProperty("webhook")) + if (!$util.isString(message.webhook)) + return "webhook: string expected"; + if (message.returnPartialResponses != null && message.hasOwnProperty("returnPartialResponses")) + if (typeof message.returnPartialResponses !== "boolean") + return "returnPartialResponses: boolean expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + if (message.setParameterActions != null && message.hasOwnProperty("setParameterActions")) { + if (!Array.isArray(message.setParameterActions)) + return "setParameterActions: array expected"; + for (var i = 0; i < message.setParameterActions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.verify(message.setParameterActions[i], long + 1); + if (error) + return "setParameterActions." + error; + } + } + if (message.conditionalCases != null && message.hasOwnProperty("conditionalCases")) { + if (!Array.isArray(message.conditionalCases)) + return "conditionalCases: array expected"; + for (var i = 0; i < message.conditionalCases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.verify(message.conditionalCases[i], long + 1); + if (error) + return "conditionalCases." + error; + } + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.enableGenerativeFallback != null && message.hasOwnProperty("enableGenerativeFallback")) + if (typeof message.enableGenerativeFallback !== "boolean") + return "enableGenerativeFallback: boolean expected"; + if (message.generators != null && message.hasOwnProperty("generators")) { + if (!Array.isArray(message.generators)) + return "generators: array expected"; + for (var i = 0; i < message.generators.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.verify(message.generators[i], long + 1); + if (error) + return "generators." + error; + } + } + return null; + }; + + /** + * Creates a Fulfillment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment} Fulfillment + */ + Fulfillment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.fromObject(object.messages[i], long + 1); + } + } + if (object.webhook != null) + message.webhook = String(object.webhook); + if (object.returnPartialResponses != null) + message.returnPartialResponses = Boolean(object.returnPartialResponses); + if (object.tag != null) + message.tag = String(object.tag); + if (object.setParameterActions) { + if (!Array.isArray(object.setParameterActions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.setParameterActions: array expected"); + message.setParameterActions = []; + for (var i = 0; i < object.setParameterActions.length; ++i) { + if (typeof object.setParameterActions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.setParameterActions: object expected"); + message.setParameterActions[i] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.fromObject(object.setParameterActions[i], long + 1); + } + } + if (object.conditionalCases) { + if (!Array.isArray(object.conditionalCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.conditionalCases: array expected"); + message.conditionalCases = []; + for (var i = 0; i < object.conditionalCases.length; ++i) { + if (typeof object.conditionalCases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.conditionalCases: object expected"); + message.conditionalCases[i] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.fromObject(object.conditionalCases[i], long + 1); + } + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.enableGenerativeFallback != null) + message.enableGenerativeFallback = Boolean(object.enableGenerativeFallback); + if (object.generators) { + if (!Array.isArray(object.generators)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.generators: array expected"); + message.generators = []; + for (var i = 0; i < object.generators.length; ++i) { + if (typeof object.generators[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.generators: object expected"); + message.generators[i] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.fromObject(object.generators[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Fulfillment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment} message Fulfillment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fulfillment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.setParameterActions = []; + object.conditionalCases = []; + object.generators = []; + } + if (options.defaults) { + object.webhook = ""; + object.tag = ""; + object.advancedSettings = null; + object.returnPartialResponses = false; + object.enableGenerativeFallback = false; + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.toObject(message.messages[j], options); + } + if (message.webhook != null && message.hasOwnProperty("webhook")) + object.webhook = message.webhook; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.setParameterActions && message.setParameterActions.length) { + object.setParameterActions = []; + for (var j = 0; j < message.setParameterActions.length; ++j) + object.setParameterActions[j] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.toObject(message.setParameterActions[j], options); + } + if (message.conditionalCases && message.conditionalCases.length) { + object.conditionalCases = []; + for (var j = 0; j < message.conditionalCases.length; ++j) + object.conditionalCases[j] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.toObject(message.conditionalCases[j], options); + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.returnPartialResponses != null && message.hasOwnProperty("returnPartialResponses")) + object.returnPartialResponses = message.returnPartialResponses; + if (message.enableGenerativeFallback != null && message.hasOwnProperty("enableGenerativeFallback")) + object.enableGenerativeFallback = message.enableGenerativeFallback; + if (message.generators && message.generators.length) { + object.generators = []; + for (var j = 0; j < message.generators.length; ++j) + object.generators[j] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.toObject(message.generators[j], options); + } + return object; + }; + + /** + * Converts this Fulfillment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @instance + * @returns {Object.} JSON object + */ + Fulfillment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Fulfillment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fulfillment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Fulfillment"; + }; + + Fulfillment.SetParameterAction = (function() { + + /** + * Properties of a SetParameterAction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @interface ISetParameterAction + * @property {string|null} [parameter] SetParameterAction parameter + * @property {google.protobuf.IValue|null} [value] SetParameterAction value + */ + + /** + * Constructs a new SetParameterAction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @classdesc Represents a SetParameterAction. + * @implements ISetParameterAction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction=} [properties] Properties to set + */ + function SetParameterAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetParameterAction parameter. + * @member {string} parameter + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @instance + */ + SetParameterAction.prototype.parameter = ""; + + /** + * SetParameterAction value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @instance + */ + SetParameterAction.prototype.value = null; + + /** + * Creates a new SetParameterAction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction} SetParameterAction instance + */ + SetParameterAction.create = function create(properties) { + return new SetParameterAction(properties); + }; + + /** + * Encodes the specified SetParameterAction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction} message SetParameterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetParameterAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameter != null && Object.hasOwnProperty.call(message, "parameter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameter); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetParameterAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ISetParameterAction} message SetParameterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetParameterAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction} SetParameterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetParameterAction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parameter = reader.string(); + break; + } + case 2: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SetParameterAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction} SetParameterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetParameterAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetParameterAction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetParameterAction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameter != null && message.hasOwnProperty("parameter")) + if (!$util.isString(message.parameter)) + return "parameter: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value, long + 1); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a SetParameterAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction} SetParameterAction + */ + SetParameterAction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction(); + if (object.parameter != null) + message.parameter = String(object.parameter); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SetParameterAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction} message SetParameterAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetParameterAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parameter = ""; + object.value = null; + } + if (message.parameter != null && message.hasOwnProperty("parameter")) + object.parameter = message.parameter; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + return object; + }; + + /** + * Converts this SetParameterAction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @instance + * @returns {Object.} JSON object + */ + SetParameterAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetParameterAction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetParameterAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction"; + }; + + return SetParameterAction; + })(); + + Fulfillment.ConditionalCases = (function() { + + /** + * Properties of a ConditionalCases. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @interface IConditionalCases + * @property {Array.|null} [cases] ConditionalCases cases + */ + + /** + * Constructs a new ConditionalCases. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @classdesc Represents a ConditionalCases. + * @implements IConditionalCases + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases=} [properties] Properties to set + */ + function ConditionalCases(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionalCases cases. + * @member {Array.} cases + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @instance + */ + ConditionalCases.prototype.cases = $util.emptyArray; + + /** + * Creates a new ConditionalCases instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases} ConditionalCases instance + */ + ConditionalCases.create = function create(properties) { + return new ConditionalCases(properties); + }; + + /** + * Encodes the specified ConditionalCases message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases} message ConditionalCases message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalCases.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.encode(message.cases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionalCases message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases} message ConditionalCases message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalCases.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases} ConditionalCases + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalCases.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionalCases message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases} ConditionalCases + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalCases.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionalCases message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionalCases.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.verify(message.cases[i], long + 1); + if (error) + return "cases." + error; + } + } + return null; + }; + + /** + * Creates a ConditionalCases message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases} ConditionalCases + */ + ConditionalCases.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.cases: object expected"); + message.cases[i] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.fromObject(object.cases[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ConditionalCases message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases} message ConditionalCases + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionalCases.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.toObject(message.cases[j], options); + } + return object; + }; + + /** + * Converts this ConditionalCases to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @instance + * @returns {Object.} JSON object + */ + ConditionalCases.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionalCases + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionalCases.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases"; + }; + + ConditionalCases.Case = (function() { + + /** + * Properties of a Case. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @interface ICase + * @property {string|null} [condition] Case condition + * @property {Array.|null} [caseContent] Case caseContent + */ + + /** + * Constructs a new Case. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + * @classdesc Represents a Case. + * @implements ICase + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase=} [properties] Properties to set + */ + function Case(properties) { + this.caseContent = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Case condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @instance + */ + Case.prototype.condition = ""; + + /** + * Case caseContent. + * @member {Array.} caseContent + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @instance + */ + Case.prototype.caseContent = $util.emptyArray; + + /** + * Creates a new Case instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case} Case instance + */ + Case.create = function create(properties) { + return new Case(properties); + }; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.caseContent != null && message.caseContent.length) + for (var i = 0; i < message.caseContent.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.encode(message.caseContent[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Case message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + if (!(message.caseContent && message.caseContent.length)) + message.caseContent = []; + message.caseContent.push($root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Case message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Case.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.caseContent != null && message.hasOwnProperty("caseContent")) { + if (!Array.isArray(message.caseContent)) + return "caseContent: array expected"; + for (var i = 0; i < message.caseContent.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.verify(message.caseContent[i], long + 1); + if (error) + return "caseContent." + error; + } + } + return null; + }; + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case} Case + */ + Case.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.caseContent) { + if (!Array.isArray(object.caseContent)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.caseContent: array expected"); + message.caseContent = []; + for (var i = 0; i < object.caseContent.length; ++i) { + if (typeof object.caseContent[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.caseContent: object expected"); + message.caseContent[i] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.fromObject(object.caseContent[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case} message Case + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Case.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caseContent = []; + if (options.defaults) + object.condition = ""; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.caseContent && message.caseContent.length) { + object.caseContent = []; + for (var j = 0; j < message.caseContent.length; ++j) + object.caseContent[j] = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.toObject(message.caseContent[j], options); + } + return object; + }; + + /** + * Converts this Case to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @instance + * @returns {Object.} JSON object + */ + Case.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Case + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Case.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case"; + }; + + Case.CaseContent = (function() { + + /** + * Properties of a CaseContent. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @interface ICaseContent + * @property {google.cloud.dialogflow.cx.v3beta1.IResponseMessage|null} [message] CaseContent message + * @property {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases|null} [additionalCases] CaseContent additionalCases + */ + + /** + * Constructs a new CaseContent. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + * @classdesc Represents a CaseContent. + * @implements ICaseContent + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent=} [properties] Properties to set + */ + function CaseContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseContent message. + * @member {google.cloud.dialogflow.cx.v3beta1.IResponseMessage|null|undefined} message + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + */ + CaseContent.prototype.message = null; + + /** + * CaseContent additionalCases. + * @member {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IConditionalCases|null|undefined} additionalCases + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + */ + CaseContent.prototype.additionalCases = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CaseContent casesOrMessage. + * @member {"message"|"additionalCases"|undefined} casesOrMessage + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + */ + Object.defineProperty(CaseContent.prototype, "casesOrMessage", { + get: $util.oneOfGetter($oneOfFields = ["message", "additionalCases"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CaseContent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent instance + */ + CaseContent.create = function create(properties) { + return new CaseContent(properties); + }; + + /** + * Encodes the specified CaseContent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent} message CaseContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.additionalCases != null && Object.hasOwnProperty.call(message, "additionalCases")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.encode(message.additionalCases, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CaseContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.ICaseContent} message CaseContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseContent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.additionalCases = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CaseContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseContent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseContent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.message != null && message.hasOwnProperty("message")) { + properties.casesOrMessage = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify(message.message, long + 1); + if (error) + return "message." + error; + } + } + if (message.additionalCases != null && message.hasOwnProperty("additionalCases")) { + if (properties.casesOrMessage === 1) + return "casesOrMessage: multiple values"; + properties.casesOrMessage = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.verify(message.additionalCases, long + 1); + if (error) + return "additionalCases." + error; + } + } + return null; + }; + + /** + * Creates a CaseContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent} CaseContent + */ + CaseContent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.message: object expected"); + message.message = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.fromObject(object.message, long + 1); + } + if (object.additionalCases != null) { + if (typeof object.additionalCases !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.additionalCases: object expected"); + message.additionalCases = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.fromObject(object.additionalCases, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CaseContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent} message CaseContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.message != null && message.hasOwnProperty("message")) { + object.message = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.toObject(message.message, options); + if (options.oneofs) + object.casesOrMessage = "message"; + } + if (message.additionalCases != null && message.hasOwnProperty("additionalCases")) { + object.additionalCases = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.toObject(message.additionalCases, options); + if (options.oneofs) + object.casesOrMessage = "additionalCases"; + } + return object; + }; + + /** + * Converts this CaseContent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @instance + * @returns {Object.} JSON object + */ + CaseContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseContent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent"; + }; + + return CaseContent; + })(); + + return Case; + })(); + + return ConditionalCases; + })(); + + Fulfillment.GeneratorSettings = (function() { + + /** + * Properties of a GeneratorSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @interface IGeneratorSettings + * @property {string|null} [generator] GeneratorSettings generator + * @property {Object.|null} [inputParameters] GeneratorSettings inputParameters + * @property {string|null} [outputParameter] GeneratorSettings outputParameter + */ + + /** + * Constructs a new GeneratorSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment + * @classdesc Represents a GeneratorSettings. + * @implements IGeneratorSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings=} [properties] Properties to set + */ + function GeneratorSettings(properties) { + this.inputParameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratorSettings generator. + * @member {string} generator + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @instance + */ + GeneratorSettings.prototype.generator = ""; + + /** + * GeneratorSettings inputParameters. + * @member {Object.} inputParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @instance + */ + GeneratorSettings.prototype.inputParameters = $util.emptyObject; + + /** + * GeneratorSettings outputParameter. + * @member {string} outputParameter + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @instance + */ + GeneratorSettings.prototype.outputParameter = ""; + + /** + * Creates a new GeneratorSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings} GeneratorSettings instance + */ + GeneratorSettings.create = function create(properties) { + return new GeneratorSettings(properties); + }; + + /** + * Encodes the specified GeneratorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings} message GeneratorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratorSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generator != null && Object.hasOwnProperty.call(message, "generator")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.generator); + if (message.inputParameters != null && Object.hasOwnProperty.call(message, "inputParameters")) + for (var keys = Object.keys(message.inputParameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputParameters[keys[i]]).ldelim(); + if (message.outputParameter != null && Object.hasOwnProperty.call(message, "outputParameter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputParameter); + return writer; + }; + + /** + * Encodes the specified GeneratorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.IGeneratorSettings} message GeneratorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratorSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings} GeneratorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratorSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generator = reader.string(); + break; + } + case 2: { + if (message.inputParameters === $util.emptyObject) + message.inputParameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.inputParameters, key); + message.inputParameters[key] = value; + break; + } + case 3: { + message.outputParameter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratorSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings} GeneratorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratorSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratorSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratorSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generator != null && message.hasOwnProperty("generator")) + if (!$util.isString(message.generator)) + return "generator: string expected"; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + if (!$util.isObject(message.inputParameters)) + return "inputParameters: object expected"; + var key = Object.keys(message.inputParameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.inputParameters[key[i]])) + return "inputParameters: string{k:string} expected"; + } + if (message.outputParameter != null && message.hasOwnProperty("outputParameter")) + if (!$util.isString(message.outputParameter)) + return "outputParameter: string expected"; + return null; + }; + + /** + * Creates a GeneratorSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings} GeneratorSettings + */ + GeneratorSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings(); + if (object.generator != null) + message.generator = String(object.generator); + if (object.inputParameters) { + if (typeof object.inputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings.inputParameters: object expected"); + message.inputParameters = {}; + for (var keys = Object.keys(object.inputParameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.inputParameters, keys[i]); + message.inputParameters[keys[i]] = String(object.inputParameters[keys[i]]); + } + } + if (object.outputParameter != null) + message.outputParameter = String(object.outputParameter); + return message; + }; + + /** + * Creates a plain object from a GeneratorSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings} message GeneratorSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratorSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.inputParameters = {}; + if (options.defaults) { + object.generator = ""; + object.outputParameter = ""; + } + if (message.generator != null && message.hasOwnProperty("generator")) + object.generator = message.generator; + var keys2; + if (message.inputParameters && (keys2 = Object.keys(message.inputParameters)).length) { + object.inputParameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.inputParameters, keys2[j]); + object.inputParameters[keys2[j]] = message.inputParameters[keys2[j]]; + } + } + if (message.outputParameter != null && message.hasOwnProperty("outputParameter")) + object.outputParameter = message.outputParameter; + return object; + }; + + /** + * Converts this GeneratorSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @instance + * @returns {Object.} JSON object + */ + GeneratorSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratorSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratorSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Fulfillment.GeneratorSettings"; + }; + + return GeneratorSettings; + })(); + + return Fulfillment; + })(); + + v3beta1.ResponseMessage = (function() { + + /** + * Properties of a ResponseMessage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IResponseMessage + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText|null} [text] ResponseMessage text + * @property {google.protobuf.IStruct|null} [payload] ResponseMessage payload + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess|null} [conversationSuccess] ResponseMessage conversationSuccess + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText|null} [outputAudioText] ResponseMessage outputAudioText + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff|null} [liveAgentHandoff] ResponseMessage liveAgentHandoff + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction|null} [endInteraction] ResponseMessage endInteraction + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio|null} [playAudio] ResponseMessage playAudio + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio|null} [mixedAudio] ResponseMessage mixedAudio + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall|null} [telephonyTransferCall] ResponseMessage telephonyTransferCall + * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard|null} [knowledgeInfoCard] ResponseMessage knowledgeInfoCard + * @property {google.cloud.dialogflow.cx.v3beta1.IToolCall|null} [toolCall] ResponseMessage toolCall + * @property {string|null} [channel] ResponseMessage channel + */ + + /** + * Constructs a new ResponseMessage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ResponseMessage. + * @implements IResponseMessage + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IResponseMessage=} [properties] Properties to set + */ + function ResponseMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMessage text. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.text = null; + + /** + * ResponseMessage payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.payload = null; + + /** + * ResponseMessage conversationSuccess. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess|null|undefined} conversationSuccess + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.conversationSuccess = null; + + /** + * ResponseMessage outputAudioText. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText|null|undefined} outputAudioText + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.outputAudioText = null; + + /** + * ResponseMessage liveAgentHandoff. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff|null|undefined} liveAgentHandoff + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.liveAgentHandoff = null; + + /** + * ResponseMessage endInteraction. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction|null|undefined} endInteraction + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.endInteraction = null; + + /** + * ResponseMessage playAudio. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio|null|undefined} playAudio + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.playAudio = null; + + /** + * ResponseMessage mixedAudio. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio|null|undefined} mixedAudio + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.mixedAudio = null; + + /** + * ResponseMessage telephonyTransferCall. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall|null|undefined} telephonyTransferCall + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.telephonyTransferCall = null; + + /** + * ResponseMessage knowledgeInfoCard. + * @member {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard|null|undefined} knowledgeInfoCard + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.knowledgeInfoCard = null; + + /** + * ResponseMessage toolCall. + * @member {google.cloud.dialogflow.cx.v3beta1.IToolCall|null|undefined} toolCall + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.toolCall = null; + + /** + * ResponseMessage channel. + * @member {string} channel + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.channel = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResponseMessage message. + * @member {"text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"|"toolCall"|undefined} message + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + Object.defineProperty(ResponseMessage.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["text", "payload", "conversationSuccess", "outputAudioText", "liveAgentHandoff", "endInteraction", "playAudio", "mixedAudio", "telephonyTransferCall", "knowledgeInfoCard", "toolCall"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponseMessage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IResponseMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage} ResponseMessage instance + */ + ResponseMessage.create = function create(properties) { + return new ResponseMessage(properties); + }; + + /** + * Encodes the specified ResponseMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IResponseMessage} message ResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudioText != null && Object.hasOwnProperty.call(message, "outputAudioText")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.encode(message.outputAudioText, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.conversationSuccess != null && Object.hasOwnProperty.call(message, "conversationSuccess")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.encode(message.conversationSuccess, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.liveAgentHandoff != null && Object.hasOwnProperty.call(message, "liveAgentHandoff")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.encode(message.liveAgentHandoff, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.endInteraction != null && Object.hasOwnProperty.call(message, "endInteraction")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.encode(message.endInteraction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.playAudio != null && Object.hasOwnProperty.call(message, "playAudio")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.encode(message.playAudio, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.mixedAudio != null && Object.hasOwnProperty.call(message, "mixedAudio")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.encode(message.mixedAudio, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.telephonyTransferCall != null && Object.hasOwnProperty.call(message, "telephonyTransferCall")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.encode(message.telephonyTransferCall, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.channel); + if (message.knowledgeInfoCard != null && Object.hasOwnProperty.call(message, "knowledgeInfoCard")) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.encode(message.knowledgeInfoCard, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.encode(message.toolCall, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IResponseMessage} message ResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage} ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.conversationSuccess = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.outputAudioText = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.liveAgentHandoff = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.endInteraction = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.playAudio = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.mixedAudio = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.telephonyTransferCall = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.toolCall = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.channel = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage} ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMessage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.verify(message.text, long + 1); + if (error) + return "text." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + } + if (message.conversationSuccess != null && message.hasOwnProperty("conversationSuccess")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.verify(message.conversationSuccess, long + 1); + if (error) + return "conversationSuccess." + error; + } + } + if (message.outputAudioText != null && message.hasOwnProperty("outputAudioText")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.verify(message.outputAudioText, long + 1); + if (error) + return "outputAudioText." + error; + } + } + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.verify(message.liveAgentHandoff, long + 1); + if (error) + return "liveAgentHandoff." + error; + } + } + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify(message.endInteraction, long + 1); + if (error) + return "endInteraction." + error; + } + } + if (message.playAudio != null && message.hasOwnProperty("playAudio")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.verify(message.playAudio, long + 1); + if (error) + return "playAudio." + error; + } + } + if (message.mixedAudio != null && message.hasOwnProperty("mixedAudio")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.verify(message.mixedAudio, long + 1); + if (error) + return "mixedAudio." + error; + } + } + if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.verify(message.telephonyTransferCall, long + 1); + if (error) + return "telephonyTransferCall." + error; + } + } + if (message.knowledgeInfoCard != null && message.hasOwnProperty("knowledgeInfoCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.verify(message.knowledgeInfoCard, long + 1); + if (error) + return "knowledgeInfoCard." + error; + } + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.verify(message.toolCall, long + 1); + if (error) + return "toolCall." + error; + } + } + if (message.channel != null && message.hasOwnProperty("channel")) + if (!$util.isString(message.channel)) + return "channel: string expected"; + return null; + }; + + /** + * Creates a ResponseMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage} ResponseMessage + */ + ResponseMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.text: object expected"); + message.text = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.fromObject(object.text, long + 1); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.conversationSuccess != null) { + if (typeof object.conversationSuccess !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.conversationSuccess: object expected"); + message.conversationSuccess = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.fromObject(object.conversationSuccess, long + 1); + } + if (object.outputAudioText != null) { + if (typeof object.outputAudioText !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.outputAudioText: object expected"); + message.outputAudioText = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.fromObject(object.outputAudioText, long + 1); + } + if (object.liveAgentHandoff != null) { + if (typeof object.liveAgentHandoff !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.liveAgentHandoff: object expected"); + message.liveAgentHandoff = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.fromObject(object.liveAgentHandoff, long + 1); + } + if (object.endInteraction != null) { + if (typeof object.endInteraction !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.endInteraction: object expected"); + message.endInteraction = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.fromObject(object.endInteraction, long + 1); + } + if (object.playAudio != null) { + if (typeof object.playAudio !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.playAudio: object expected"); + message.playAudio = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.fromObject(object.playAudio, long + 1); + } + if (object.mixedAudio != null) { + if (typeof object.mixedAudio !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixedAudio: object expected"); + message.mixedAudio = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.fromObject(object.mixedAudio, long + 1); + } + if (object.telephonyTransferCall != null) { + if (typeof object.telephonyTransferCall !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.telephonyTransferCall: object expected"); + message.telephonyTransferCall = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.fromObject(object.telephonyTransferCall, long + 1); + } + if (object.knowledgeInfoCard != null) { + if (typeof object.knowledgeInfoCard !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.knowledgeInfoCard: object expected"); + message.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.fromObject(object.knowledgeInfoCard, long + 1); + } + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.toolCall: object expected"); + message.toolCall = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.fromObject(object.toolCall, long + 1); + } + if (object.channel != null) + message.channel = String(object.channel); + return message; + }; + + /** + * Creates a plain object from a ResponseMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage} message ResponseMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.channel = ""; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.toObject(message.text, options); + if (options.oneofs) + object.message = "text"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.message = "payload"; + } + if (message.outputAudioText != null && message.hasOwnProperty("outputAudioText")) { + object.outputAudioText = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.toObject(message.outputAudioText, options); + if (options.oneofs) + object.message = "outputAudioText"; + } + if (message.conversationSuccess != null && message.hasOwnProperty("conversationSuccess")) { + object.conversationSuccess = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.toObject(message.conversationSuccess, options); + if (options.oneofs) + object.message = "conversationSuccess"; + } + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) { + object.liveAgentHandoff = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.toObject(message.liveAgentHandoff, options); + if (options.oneofs) + object.message = "liveAgentHandoff"; + } + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) { + object.endInteraction = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.toObject(message.endInteraction, options); + if (options.oneofs) + object.message = "endInteraction"; + } + if (message.playAudio != null && message.hasOwnProperty("playAudio")) { + object.playAudio = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.toObject(message.playAudio, options); + if (options.oneofs) + object.message = "playAudio"; + } + if (message.mixedAudio != null && message.hasOwnProperty("mixedAudio")) { + object.mixedAudio = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.toObject(message.mixedAudio, options); + if (options.oneofs) + object.message = "mixedAudio"; + } + if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { + object.telephonyTransferCall = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.toObject(message.telephonyTransferCall, options); + if (options.oneofs) + object.message = "telephonyTransferCall"; + } + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = message.channel; + if (message.knowledgeInfoCard != null && message.hasOwnProperty("knowledgeInfoCard")) { + object.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.toObject(message.knowledgeInfoCard, options); + if (options.oneofs) + object.message = "knowledgeInfoCard"; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.message = "toolCall"; + } + return object; + }; + + /** + * Converts this ResponseMessage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + * @returns {Object.} JSON object + */ + ResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseMessage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage"; + }; + + ResponseMessage.Text = (function() { + + /** + * Properties of a Text. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IText + * @property {Array.|null} [text] Text text + * @property {boolean|null} [allowPlaybackInterruption] Text allowPlaybackInterruption + */ + + /** + * Constructs a new Text. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents a Text. + * @implements IText + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText=} [properties] Properties to set + */ + function Text(properties) { + this.text = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Text text. + * @member {Array.} text + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @instance + */ + Text.prototype.text = $util.emptyArray; + + /** + * Text allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @instance + */ + Text.prototype.allowPlaybackInterruption = false; + + /** + * Creates a new Text instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text} Text instance + */ + Text.create = function create(properties) { + return new Text(properties); + }; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Text message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); + break; + } + case 2: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Text message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Text.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text} Text + */ + Text.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); + } + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text} message Text + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Text.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.text = []; + if (options.defaults) + object.allowPlaybackInterruption = false; + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this Text to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @instance + * @returns {Object.} JSON object + */ + Text.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Text + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Text.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text"; + }; + + return Text; + })(); + + ResponseMessage.LiveAgentHandoff = (function() { + + /** + * Properties of a LiveAgentHandoff. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface ILiveAgentHandoff + * @property {google.protobuf.IStruct|null} [metadata] LiveAgentHandoff metadata + */ + + /** + * Constructs a new LiveAgentHandoff. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents a LiveAgentHandoff. + * @implements ILiveAgentHandoff + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff=} [properties] Properties to set + */ + function LiveAgentHandoff(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LiveAgentHandoff metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @instance + */ + LiveAgentHandoff.prototype.metadata = null; + + /** + * Creates a new LiveAgentHandoff instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff instance + */ + LiveAgentHandoff.create = function create(properties) { + return new LiveAgentHandoff(properties); + }; + + /** + * Encodes the specified LiveAgentHandoff message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff} message LiveAgentHandoff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveAgentHandoff.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LiveAgentHandoff message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ILiveAgentHandoff} message LiveAgentHandoff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveAgentHandoff.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveAgentHandoff.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveAgentHandoff.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LiveAgentHandoff message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LiveAgentHandoff.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a LiveAgentHandoff message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + */ + LiveAgentHandoff.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LiveAgentHandoff message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff} message LiveAgentHandoff + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LiveAgentHandoff.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this LiveAgentHandoff to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @instance + * @returns {Object.} JSON object + */ + LiveAgentHandoff.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LiveAgentHandoff + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LiveAgentHandoff.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff"; + }; + + return LiveAgentHandoff; + })(); + + ResponseMessage.ConversationSuccess = (function() { + + /** + * Properties of a ConversationSuccess. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IConversationSuccess + * @property {google.protobuf.IStruct|null} [metadata] ConversationSuccess metadata + */ + + /** + * Constructs a new ConversationSuccess. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents a ConversationSuccess. + * @implements IConversationSuccess + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess=} [properties] Properties to set + */ + function ConversationSuccess(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationSuccess metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @instance + */ + ConversationSuccess.prototype.metadata = null; + + /** + * Creates a new ConversationSuccess instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess} ConversationSuccess instance + */ + ConversationSuccess.create = function create(properties) { + return new ConversationSuccess(properties); + }; + + /** + * Encodes the specified ConversationSuccess message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess} message ConversationSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationSuccess.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConversationSuccess message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IConversationSuccess} message ConversationSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess} ConversationSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationSuccess.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationSuccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess} ConversationSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationSuccess message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationSuccess.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ConversationSuccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess} ConversationSuccess + */ + ConversationSuccess.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConversationSuccess message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess} message ConversationSuccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationSuccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ConversationSuccess to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @instance + * @returns {Object.} JSON object + */ + ConversationSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationSuccess + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess"; + }; + + return ConversationSuccess; + })(); + + ResponseMessage.OutputAudioText = (function() { + + /** + * Properties of an OutputAudioText. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IOutputAudioText + * @property {string|null} [text] OutputAudioText text + * @property {string|null} [ssml] OutputAudioText ssml + * @property {boolean|null} [allowPlaybackInterruption] OutputAudioText allowPlaybackInterruption + */ + + /** + * Constructs a new OutputAudioText. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents an OutputAudioText. + * @implements IOutputAudioText + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText=} [properties] Properties to set + */ + function OutputAudioText(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioText text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @instance + */ + OutputAudioText.prototype.text = null; + + /** + * OutputAudioText ssml. + * @member {string|null|undefined} ssml + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @instance + */ + OutputAudioText.prototype.ssml = null; + + /** + * OutputAudioText allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @instance + */ + OutputAudioText.prototype.allowPlaybackInterruption = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputAudioText source. + * @member {"text"|"ssml"|undefined} source + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @instance + */ + Object.defineProperty(OutputAudioText.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["text", "ssml"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputAudioText instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText} OutputAudioText instance + */ + OutputAudioText.create = function create(properties) { + return new OutputAudioText(properties); + }; + + /** + * Encodes the specified OutputAudioText message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText} message OutputAudioText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioText.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified OutputAudioText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IOutputAudioText} message OutputAudioText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioText.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText} OutputAudioText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioText.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.ssml = reader.string(); + break; + } + case 3: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioText message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText} OutputAudioText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioText.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioText message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioText.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.source = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.ssml != null && message.hasOwnProperty("ssml")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.ssml)) + return "ssml: string expected"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates an OutputAudioText message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText} OutputAudioText + */ + OutputAudioText.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText(); + if (object.text != null) + message.text = String(object.text); + if (object.ssml != null) + message.ssml = String(object.ssml); + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from an OutputAudioText message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText} message OutputAudioText + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioText.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.allowPlaybackInterruption = false; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.source = "text"; + } + if (message.ssml != null && message.hasOwnProperty("ssml")) { + object.ssml = message.ssml; + if (options.oneofs) + object.source = "ssml"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this OutputAudioText to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @instance + * @returns {Object.} JSON object + */ + OutputAudioText.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputAudioText + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputAudioText.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText"; + }; + + return OutputAudioText; + })(); + + ResponseMessage.EndInteraction = (function() { + + /** + * Properties of an EndInteraction. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IEndInteraction + */ + + /** + * Constructs a new EndInteraction. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents an EndInteraction. + * @implements IEndInteraction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set + */ + function EndInteraction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new EndInteraction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction instance + */ + EndInteraction.create = function create(properties) { + return new EndInteraction(properties); + }; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndInteraction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndInteraction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction + */ + EndInteraction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); + }; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} message EndInteraction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndInteraction.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EndInteraction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @instance + * @returns {Object.} JSON object + */ + EndInteraction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndInteraction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndInteraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction"; + }; + + return EndInteraction; + })(); + + ResponseMessage.PlayAudio = (function() { + + /** + * Properties of a PlayAudio. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IPlayAudio + * @property {string|null} [audioUri] PlayAudio audioUri + * @property {boolean|null} [allowPlaybackInterruption] PlayAudio allowPlaybackInterruption + */ + + /** + * Constructs a new PlayAudio. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents a PlayAudio. + * @implements IPlayAudio + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio=} [properties] Properties to set + */ + function PlayAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlayAudio audioUri. + * @member {string} audioUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @instance + */ + PlayAudio.prototype.audioUri = ""; + + /** + * PlayAudio allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @instance + */ + PlayAudio.prototype.allowPlaybackInterruption = false; + + /** + * Creates a new PlayAudio instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} PlayAudio instance + */ + PlayAudio.create = function create(properties) { + return new PlayAudio(properties); + }; + + /** + * Encodes the specified PlayAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio} message PlayAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlayAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioUri != null && Object.hasOwnProperty.call(message, "audioUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioUri); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified PlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IPlayAudio} message PlayAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlayAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlayAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} PlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlayAudio.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioUri = reader.string(); + break; + } + case 2: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlayAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} PlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlayAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlayAudio message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlayAudio.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioUri != null && message.hasOwnProperty("audioUri")) + if (!$util.isString(message.audioUri)) + return "audioUri: string expected"; + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates a PlayAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} PlayAudio + */ + PlayAudio.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(); + if (object.audioUri != null) + message.audioUri = String(object.audioUri); + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from a PlayAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} message PlayAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlayAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioUri = ""; + object.allowPlaybackInterruption = false; + } + if (message.audioUri != null && message.hasOwnProperty("audioUri")) + object.audioUri = message.audioUri; + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this PlayAudio to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @instance + * @returns {Object.} JSON object + */ + PlayAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlayAudio + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlayAudio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio"; + }; + + return PlayAudio; + })(); + + ResponseMessage.MixedAudio = (function() { + + /** + * Properties of a MixedAudio. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IMixedAudio + * @property {Array.|null} [segments] MixedAudio segments + */ + + /** + * Constructs a new MixedAudio. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents a MixedAudio. + * @implements IMixedAudio + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio=} [properties] Properties to set + */ + function MixedAudio(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MixedAudio segments. + * @member {Array.} segments + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @instance + */ + MixedAudio.prototype.segments = $util.emptyArray; + + /** + * Creates a new MixedAudio instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} MixedAudio instance + */ + MixedAudio.create = function create(properties) { + return new MixedAudio(properties); + }; + + /** + * Encodes the specified MixedAudio message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio} message MixedAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MixedAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.encode(message.segments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MixedAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio} message MixedAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MixedAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MixedAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} MixedAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MixedAudio.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MixedAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} MixedAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MixedAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MixedAudio message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MixedAudio.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.verify(message.segments[i], long + 1); + if (error) + return "segments." + error; + } + } + return null; + }; + + /** + * Creates a MixedAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} MixedAudio + */ + MixedAudio.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.segments: object expected"); + message.segments[i] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.fromObject(object.segments[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a MixedAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} message MixedAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MixedAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.toObject(message.segments[j], options); + } + return object; + }; + + /** + * Converts this MixedAudio to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @instance + * @returns {Object.} JSON object + */ + MixedAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MixedAudio + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MixedAudio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio"; + }; + + MixedAudio.Segment = (function() { + + /** + * Properties of a Segment. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @interface ISegment + * @property {Uint8Array|null} [audio] Segment audio + * @property {string|null} [uri] Segment uri + * @property {boolean|null} [allowPlaybackInterruption] Segment allowPlaybackInterruption + */ + + /** + * Constructs a new Segment. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + * @classdesc Represents a Segment. + * @implements ISegment + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment=} [properties] Properties to set + */ + function Segment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Segment audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @instance + */ + Segment.prototype.audio = null; + + /** + * Segment uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @instance + */ + Segment.prototype.uri = null; + + /** + * Segment allowPlaybackInterruption. + * @member {boolean} allowPlaybackInterruption + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @instance + */ + Segment.prototype.allowPlaybackInterruption = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Segment content. + * @member {"audio"|"uri"|undefined} content + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @instance + */ + Object.defineProperty(Segment.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["audio", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Segment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} Segment instance + */ + Segment.create = function create(properties) { + return new Segment(properties); + }; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.audio); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.allowPlaybackInterruption != null && Object.hasOwnProperty.call(message, "allowPlaybackInterruption")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowPlaybackInterruption); + return writer; + }; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audio = reader.bytes(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.allowPlaybackInterruption = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Segment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Segment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.audio != null && message.hasOwnProperty("audio")) { + properties.content = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + if (typeof message.allowPlaybackInterruption !== "boolean") + return "allowPlaybackInterruption: boolean expected"; + return null; + }; + + /** + * Creates a Segment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} Segment + */ + Segment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.uri != null) + message.uri = String(object.uri); + if (object.allowPlaybackInterruption != null) + message.allowPlaybackInterruption = Boolean(object.allowPlaybackInterruption); + return message; + }; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} message Segment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Segment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.allowPlaybackInterruption = false; + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.content = "audio"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.content = "uri"; + } + if (message.allowPlaybackInterruption != null && message.hasOwnProperty("allowPlaybackInterruption")) + object.allowPlaybackInterruption = message.allowPlaybackInterruption; + return object; + }; + + /** + * Converts this Segment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @instance + * @returns {Object.} JSON object + */ + Segment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Segment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment"; + }; + + return Segment; + })(); + + return MixedAudio; + })(); + + ResponseMessage.TelephonyTransferCall = (function() { + + /** + * Properties of a TelephonyTransferCall. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface ITelephonyTransferCall + * @property {string|null} [phoneNumber] TelephonyTransferCall phoneNumber + */ + + /** + * Constructs a new TelephonyTransferCall. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents a TelephonyTransferCall. + * @implements ITelephonyTransferCall + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall=} [properties] Properties to set + */ + function TelephonyTransferCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TelephonyTransferCall phoneNumber. + * @member {string|null|undefined} phoneNumber + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @instance + */ + TelephonyTransferCall.prototype.phoneNumber = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TelephonyTransferCall endpoint. + * @member {"phoneNumber"|undefined} endpoint + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @instance + */ + Object.defineProperty(TelephonyTransferCall.prototype, "endpoint", { + get: $util.oneOfGetter($oneOfFields = ["phoneNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TelephonyTransferCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall instance + */ + TelephonyTransferCall.create = function create(properties) { + return new TelephonyTransferCall(properties); + }; + + /** + * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyTransferCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumber); + return writer; + }; + + /** + * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyTransferCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyTransferCall.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phoneNumber = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyTransferCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TelephonyTransferCall message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TelephonyTransferCall.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + properties.endpoint = 1; + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + } + return null; + }; + + /** + * Creates a TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall} TelephonyTransferCall + */ + TelephonyTransferCall.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall(); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + return message; + }; + + /** + * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall} message TelephonyTransferCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TelephonyTransferCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + object.phoneNumber = message.phoneNumber; + if (options.oneofs) + object.endpoint = "phoneNumber"; + } + return object; + }; + + /** + * Converts this TelephonyTransferCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @instance + * @returns {Object.} JSON object + */ + TelephonyTransferCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TelephonyTransferCall + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TelephonyTransferCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TelephonyTransferCall"; + }; + + return TelephonyTransferCall; + })(); + + ResponseMessage.KnowledgeInfoCard = (function() { + + /** + * Properties of a KnowledgeInfoCard. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IKnowledgeInfoCard + */ + + /** + * Constructs a new KnowledgeInfoCard. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents a KnowledgeInfoCard. + * @implements IKnowledgeInfoCard + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard=} [properties] Properties to set + */ + function KnowledgeInfoCard(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new KnowledgeInfoCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard instance + */ + KnowledgeInfoCard.create = function create(properties) { + return new KnowledgeInfoCard(properties); + }; + + /** + * Encodes the specified KnowledgeInfoCard message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard} message KnowledgeInfoCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeInfoCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified KnowledgeInfoCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard} message KnowledgeInfoCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeInfoCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeInfoCard.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeInfoCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeInfoCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeInfoCard message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeInfoCard.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a KnowledgeInfoCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard} KnowledgeInfoCard + */ + KnowledgeInfoCard.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard(); + }; + + /** + * Creates a plain object from a KnowledgeInfoCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard} message KnowledgeInfoCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeInfoCard.toObject = function toObject() { + return {}; + }; + + /** + * Converts this KnowledgeInfoCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @instance + * @returns {Object.} JSON object + */ + KnowledgeInfoCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KnowledgeInfoCard + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KnowledgeInfoCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard"; + }; + + return KnowledgeInfoCard; + })(); + + return ResponseMessage; + })(); + + v3beta1.ToolCall = (function() { + + /** + * Properties of a ToolCall. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IToolCall + * @property {string|null} [tool] ToolCall tool + * @property {string|null} [action] ToolCall action + * @property {google.protobuf.IStruct|null} [inputParameters] ToolCall inputParameters + */ + + /** + * Constructs a new ToolCall. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ToolCall. + * @implements IToolCall + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall=} [properties] Properties to set + */ + function ToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCall tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + */ + ToolCall.prototype.tool = ""; + + /** + * ToolCall action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + */ + ToolCall.prototype.action = ""; + + /** + * ToolCall inputParameters. + * @member {google.protobuf.IStruct|null|undefined} inputParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + */ + ToolCall.prototype.inputParameters = null; + + /** + * Creates a new ToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall instance + */ + ToolCall.create = function create(properties) { + return new ToolCall(properties); + }; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.inputParameters != null && Object.hasOwnProperty.call(message, "inputParameters")) + $root.google.protobuf.Struct.encode(message.inputParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 3: { + message.inputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCall message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCall.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputParameters, long + 1); + if (error) + return "inputParameters." + error; + } + return null; + }; + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall + */ + ToolCall.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCall) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCall(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.action != null) + message.action = String(object.action); + if (object.inputParameters != null) { + if (typeof object.inputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCall.inputParameters: object expected"); + message.inputParameters = $root.google.protobuf.Struct.fromObject(object.inputParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCall} message ToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + object.inputParameters = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) + object.inputParameters = $root.google.protobuf.Struct.toObject(message.inputParameters, options); + return object; + }; + + /** + * Converts this ToolCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + * @returns {Object.} JSON object + */ + ToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCall + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCall"; + }; + + return ToolCall; + })(); + + v3beta1.ToolCallResult = (function() { + + /** + * Properties of a ToolCallResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IToolCallResult + * @property {string|null} [tool] ToolCallResult tool + * @property {string|null} [action] ToolCallResult action + * @property {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null} [error] ToolCallResult error + * @property {google.protobuf.IStruct|null} [outputParameters] ToolCallResult outputParameters + */ + + /** + * Constructs a new ToolCallResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ToolCallResult. + * @implements IToolCallResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult=} [properties] Properties to set + */ + function ToolCallResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCallResult tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.tool = ""; + + /** + * ToolCallResult action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.action = ""; + + /** + * ToolCallResult error. + * @member {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null|undefined} error + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.error = null; + + /** + * ToolCallResult outputParameters. + * @member {google.protobuf.IStruct|null|undefined} outputParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.outputParameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolCallResult result. + * @member {"error"|"outputParameters"|undefined} result + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + Object.defineProperty(ToolCallResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "outputParameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolCallResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult instance + */ + ToolCallResult.create = function create(properties) { + return new ToolCallResult(properties); + }; + + /** + * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult} message ToolCallResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputParameters != null && Object.hasOwnProperty.call(message, "outputParameters")) + $root.google.protobuf.Struct.encode(message.outputParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult} message ToolCallResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 3: { + message.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCallResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCallResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify(message.error, long + 1); + if (error) + return "error." + error; + } + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Struct.verify(message.outputParameters, long + 1); + if (error) + return "outputParameters." + error; + } + } + return null; + }; + + /** + * Creates a ToolCallResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult + */ + ToolCallResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.action != null) + message.action = String(object.action); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCallResult.error: object expected"); + message.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.fromObject(object.error, long + 1); + } + if (object.outputParameters != null) { + if (typeof object.outputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCallResult.outputParameters: object expected"); + message.outputParameters = $root.google.protobuf.Struct.fromObject(object.outputParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolCallResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} message ToolCallResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCallResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + object.outputParameters = $root.google.protobuf.Struct.toObject(message.outputParameters, options); + if (options.oneofs) + object.result = "outputParameters"; + } + return object; + }; + + /** + * Converts this ToolCallResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + * @returns {Object.} JSON object + */ + ToolCallResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCallResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCallResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCallResult"; + }; + + ToolCallResult.Error = (function() { + + /** + * Properties of an Error. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @interface IError + * @property {string|null} [message] Error message + */ + + /** + * Constructs a new Error. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError=} [properties] Properties to set + */ + function Error(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error message. + * @member {string} message + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @instance + */ + Error.prototype.message = ""; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error + */ + Error.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Error + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Error.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error"; + }; + + return Error; + })(); + + return ToolCallResult; + })(); + + v3beta1.ParameterDefinition = (function() { + + /** + * Properties of a ParameterDefinition. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IParameterDefinition + * @property {string|null} [name] ParameterDefinition name + * @property {google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType|null} [type] ParameterDefinition type + * @property {google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null} [typeSchema] ParameterDefinition typeSchema + * @property {string|null} [description] ParameterDefinition description + */ + + /** + * Constructs a new ParameterDefinition. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ParameterDefinition. + * @implements IParameterDefinition + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IParameterDefinition=} [properties] Properties to set + */ + function ParameterDefinition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterDefinition name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.name = ""; + + /** + * ParameterDefinition type. + * @member {google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType} type + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.type = 0; + + /** + * ParameterDefinition typeSchema. + * @member {google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null|undefined} typeSchema + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.typeSchema = null; + + /** + * ParameterDefinition description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.description = ""; + + /** + * Creates a new ParameterDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IParameterDefinition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ParameterDefinition} ParameterDefinition instance + */ + ParameterDefinition.create = function create(properties) { + return new ParameterDefinition(properties); + }; + + /** + * Encodes the specified ParameterDefinition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IParameterDefinition} message ParameterDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterDefinition.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.typeSchema != null && Object.hasOwnProperty.call(message, "typeSchema")) + $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.encode(message.typeSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParameterDefinition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IParameterDefinition} message ParameterDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ParameterDefinition} ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 4: { + message.typeSchema = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ParameterDefinition} ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterDefinition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.typeSchema != null && message.hasOwnProperty("typeSchema")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.verify(message.typeSchema, long + 1); + if (error) + return "typeSchema." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a ParameterDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ParameterDefinition} ParameterDefinition + */ + ParameterDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "PARAMETER_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "NUMBER": + case 2: + message.type = 2; + break; + case "BOOLEAN": + case 3: + message.type = 3; + break; + case "NULL": + case 4: + message.type = 4; + break; + case "OBJECT": + case 5: + message.type = 5; + break; + case "LIST": + case 6: + message.type = 6; + break; + } + if (object.typeSchema != null) { + if (typeof object.typeSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.typeSchema: object expected"); + message.typeSchema = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.fromObject(object.typeSchema, long + 1); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a ParameterDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ParameterDefinition} message ParameterDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterDefinition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "PARAMETER_TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.typeSchema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.typeSchema != null && message.hasOwnProperty("typeSchema")) + object.typeSchema = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.toObject(message.typeSchema, options); + return object; + }; + + /** + * Converts this ParameterDefinition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @instance + * @returns {Object.} JSON object + */ + ParameterDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterDefinition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ParameterDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ParameterDefinition"; + }; + + /** + * ParameterType enum. + * @name google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.ParameterType + * @enum {number} + * @property {number} PARAMETER_TYPE_UNSPECIFIED=0 PARAMETER_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} NUMBER=2 NUMBER value + * @property {number} BOOLEAN=3 BOOLEAN value + * @property {number} NULL=4 NULL value + * @property {number} OBJECT=5 OBJECT value + * @property {number} LIST=6 LIST value + */ + ParameterDefinition.ParameterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARAMETER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "NUMBER"] = 2; + values[valuesById[3] = "BOOLEAN"] = 3; + values[valuesById[4] = "NULL"] = 4; + values[valuesById[5] = "OBJECT"] = 5; + values[valuesById[6] = "LIST"] = 6; + return values; + })(); + + return ParameterDefinition; + })(); + + v3beta1.TypeSchema = (function() { + + /** + * Properties of a TypeSchema. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITypeSchema + * @property {google.cloud.dialogflow.cx.v3beta1.IInlineSchema|null} [inlineSchema] TypeSchema inlineSchema + * @property {google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference|null} [schemaReference] TypeSchema schemaReference + */ + + /** + * Constructs a new TypeSchema. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TypeSchema. + * @implements ITypeSchema + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITypeSchema=} [properties] Properties to set + */ + function TypeSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypeSchema inlineSchema. + * @member {google.cloud.dialogflow.cx.v3beta1.IInlineSchema|null|undefined} inlineSchema + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @instance + */ + TypeSchema.prototype.inlineSchema = null; + + /** + * TypeSchema schemaReference. + * @member {google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference|null|undefined} schemaReference + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @instance + */ + TypeSchema.prototype.schemaReference = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TypeSchema schema. + * @member {"inlineSchema"|"schemaReference"|undefined} schema + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @instance + */ + Object.defineProperty(TypeSchema.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["inlineSchema", "schemaReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TypeSchema instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITypeSchema=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema} TypeSchema instance + */ + TypeSchema.create = function create(properties) { + return new TypeSchema(properties); + }; + + /** + * Encodes the specified TypeSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITypeSchema} message TypeSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inlineSchema != null && Object.hasOwnProperty.call(message, "inlineSchema")) + $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema.encode(message.inlineSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.schemaReference != null && Object.hasOwnProperty.call(message, "schemaReference")) + $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.encode(message.schemaReference, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TypeSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITypeSchema} message TypeSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema} TypeSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inlineSchema = $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.schemaReference = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TypeSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema} TypeSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeSchema message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.inlineSchema != null && message.hasOwnProperty("inlineSchema")) { + properties.schema = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema.verify(message.inlineSchema, long + 1); + if (error) + return "inlineSchema." + error; + } + } + if (message.schemaReference != null && message.hasOwnProperty("schemaReference")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.verify(message.schemaReference, long + 1); + if (error) + return "schemaReference." + error; + } + } + return null; + }; + + /** + * Creates a TypeSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema} TypeSchema + */ + TypeSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema(); + if (object.inlineSchema != null) { + if (typeof object.inlineSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TypeSchema.inlineSchema: object expected"); + message.inlineSchema = $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema.fromObject(object.inlineSchema, long + 1); + } + if (object.schemaReference != null) { + if (typeof object.schemaReference !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TypeSchema.schemaReference: object expected"); + message.schemaReference = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.fromObject(object.schemaReference, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TypeSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TypeSchema} message TypeSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.inlineSchema != null && message.hasOwnProperty("inlineSchema")) { + object.inlineSchema = $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema.toObject(message.inlineSchema, options); + if (options.oneofs) + object.schema = "inlineSchema"; + } + if (message.schemaReference != null && message.hasOwnProperty("schemaReference")) { + object.schemaReference = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.toObject(message.schemaReference, options); + if (options.oneofs) + object.schema = "schemaReference"; + } + return object; + }; + + /** + * Converts this TypeSchema to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @instance + * @returns {Object.} JSON object + */ + TypeSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TypeSchema + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TypeSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TypeSchema"; + }; + + TypeSchema.SchemaReference = (function() { + + /** + * Properties of a SchemaReference. + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @interface ISchemaReference + * @property {string|null} [tool] SchemaReference tool + * @property {string|null} [schema] SchemaReference schema + */ + + /** + * Constructs a new SchemaReference. + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema + * @classdesc Represents a SchemaReference. + * @implements ISchemaReference + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference=} [properties] Properties to set + */ + function SchemaReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchemaReference tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @instance + */ + SchemaReference.prototype.tool = ""; + + /** + * SchemaReference schema. + * @member {string} schema + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @instance + */ + SchemaReference.prototype.schema = ""; + + /** + * Creates a new SchemaReference instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference} SchemaReference instance + */ + SchemaReference.create = function create(properties) { + return new SchemaReference(properties); + }; + + /** + * Encodes the specified SchemaReference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference} message SchemaReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schema); + return writer; + }; + + /** + * Encodes the specified SchemaReference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TypeSchema.ISchemaReference} message SchemaReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference} SchemaReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.schema = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference} SchemaReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaReference message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + return null; + }; + + /** + * Creates a SchemaReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference} SchemaReference + */ + SchemaReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.schema != null) + message.schema = String(object.schema); + return message; + }; + + /** + * Creates a plain object from a SchemaReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference} message SchemaReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.schema = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + return object; + }; + + /** + * Converts this SchemaReference to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @instance + * @returns {Object.} JSON object + */ + SchemaReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaReference + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TypeSchema.SchemaReference"; + }; + + return SchemaReference; + })(); + + return TypeSchema; + })(); + + v3beta1.InlineSchema = (function() { + + /** + * Properties of an InlineSchema. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IInlineSchema + * @property {google.cloud.dialogflow.cx.v3beta1.DataType|null} [type] InlineSchema type + * @property {google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null} [items] InlineSchema items + */ + + /** + * Constructs a new InlineSchema. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an InlineSchema. + * @implements IInlineSchema + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSchema=} [properties] Properties to set + */ + function InlineSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSchema type. + * @member {google.cloud.dialogflow.cx.v3beta1.DataType} type + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @instance + */ + InlineSchema.prototype.type = 0; + + /** + * InlineSchema items. + * @member {google.cloud.dialogflow.cx.v3beta1.ITypeSchema|null|undefined} items + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @instance + */ + InlineSchema.prototype.items = null; + + /** + * Creates a new InlineSchema instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSchema=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSchema} InlineSchema instance + */ + InlineSchema.create = function create(properties) { + return new InlineSchema(properties); + }; + + /** + * Encodes the specified InlineSchema message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSchema} message InlineSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.encode(message.items, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InlineSchema message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSchema} message InlineSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSchema} InlineSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.items = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSchema} InlineSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSchema message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + break; + } + if (message.items != null && message.hasOwnProperty("items")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.verify(message.items, long + 1); + if (error) + return "items." + error; + } + return null; + }; + + /** + * Creates an InlineSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSchema} InlineSchema + */ + InlineSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.InlineSchema(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "NUMBER": + case 2: + message.type = 2; + break; + case "BOOLEAN": + case 3: + message.type = 3; + break; + case "ARRAY": + case 6: + message.type = 6; + break; + } + if (object.items != null) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.InlineSchema.items: object expected"); + message.items = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.fromObject(object.items, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an InlineSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.InlineSchema} message InlineSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.items = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DataType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3beta1.DataType[message.type] : message.type; + if (message.items != null && message.hasOwnProperty("items")) + object.items = $root.google.cloud.dialogflow.cx.v3beta1.TypeSchema.toObject(message.items, options); + return object; + }; + + /** + * Converts this InlineSchema to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @instance + * @returns {Object.} JSON object + */ + InlineSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSchema + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.InlineSchema"; + }; + + return InlineSchema; + })(); + + /** + * DataType enum. + * @name google.cloud.dialogflow.cx.v3beta1.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} NUMBER=2 NUMBER value + * @property {number} BOOLEAN=3 BOOLEAN value + * @property {number} ARRAY=6 ARRAY value + */ + v3beta1.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "NUMBER"] = 2; + values[valuesById[3] = "BOOLEAN"] = 3; + values[valuesById[6] = "ARRAY"] = 6; + return values; + })(); + + v3beta1.ValidationMessage = (function() { + + /** + * Properties of a ValidationMessage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IValidationMessage + * @property {google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType|null} [resourceType] ValidationMessage resourceType + * @property {Array.|null} [resources] ValidationMessage resources + * @property {Array.|null} [resourceNames] ValidationMessage resourceNames + * @property {google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity|null} [severity] ValidationMessage severity + * @property {string|null} [detail] ValidationMessage detail + */ + + /** + * Constructs a new ValidationMessage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ValidationMessage. + * @implements IValidationMessage + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IValidationMessage=} [properties] Properties to set + */ + function ValidationMessage(properties) { + this.resources = []; + this.resourceNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidationMessage resourceType. + * @member {google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType} resourceType + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @instance + */ + ValidationMessage.prototype.resourceType = 0; + + /** + * ValidationMessage resources. + * @member {Array.} resources + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @instance + */ + ValidationMessage.prototype.resources = $util.emptyArray; + + /** + * ValidationMessage resourceNames. + * @member {Array.} resourceNames + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @instance + */ + ValidationMessage.prototype.resourceNames = $util.emptyArray; + + /** + * ValidationMessage severity. + * @member {google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity} severity + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @instance + */ + ValidationMessage.prototype.severity = 0; + + /** + * ValidationMessage detail. + * @member {string} detail + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @instance + */ + ValidationMessage.prototype.detail = ""; + + /** + * Creates a new ValidationMessage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidationMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidationMessage} ValidationMessage instance + */ + ValidationMessage.create = function create(properties) { + return new ValidationMessage(properties); + }; + + /** + * Encodes the specified ValidationMessage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidationMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidationMessage} message ValidationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.resourceType); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resources[i]); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.severity); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.detail); + if (message.resourceNames != null && message.resourceNames.length) + for (var i = 0; i < message.resourceNames.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ResourceName.encode(message.resourceNames[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidationMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ValidationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IValidationMessage} message ValidationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidationMessage} ValidationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resourceType = reader.int32(); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 6: { + if (!(message.resourceNames && message.resourceNames.length)) + message.resourceNames = []; + message.resourceNames.push($root.google.cloud.dialogflow.cx.v3beta1.ResourceName.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.severity = reader.int32(); + break; + } + case 4: { + message.detail = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ValidationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidationMessage} ValidationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidationMessage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidationMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + case 8: + case 9: + case 10: + case 11: + case 3: + case 12: + case 4: + case 5: + case 6: + case 13: + case 7: + case 14: + break; + } + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.resourceNames != null && message.hasOwnProperty("resourceNames")) { + if (!Array.isArray(message.resourceNames)) + return "resourceNames: array expected"; + for (var i = 0; i < message.resourceNames.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResourceName.verify(message.resourceNames[i], long + 1); + if (error) + return "resourceNames." + error; + } + } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a ValidationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ValidationMessage} ValidationMessage + */ + ValidationMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage(); + switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "AGENT": + case 1: + message.resourceType = 1; + break; + case "INTENT": + case 2: + message.resourceType = 2; + break; + case "INTENT_TRAINING_PHRASE": + case 8: + message.resourceType = 8; + break; + case "INTENT_PARAMETER": + case 9: + message.resourceType = 9; + break; + case "INTENTS": + case 10: + message.resourceType = 10; + break; + case "INTENT_TRAINING_PHRASES": + case 11: + message.resourceType = 11; + break; + case "ENTITY_TYPE": + case 3: + message.resourceType = 3; + break; + case "ENTITY_TYPES": + case 12: + message.resourceType = 12; + break; + case "WEBHOOK": + case 4: + message.resourceType = 4; + break; + case "FLOW": + case 5: + message.resourceType = 5; + break; + case "PAGE": + case 6: + message.resourceType = 6; + break; + case "PAGES": + case 13: + message.resourceType = 13; + break; + case "TRANSITION_ROUTE_GROUP": + case 7: + message.resourceType = 7; + break; + case "AGENT_TRANSITION_ROUTE_GROUP": + case 14: + message.resourceType = 14; + break; + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ValidationMessage.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.resourceNames) { + if (!Array.isArray(object.resourceNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ValidationMessage.resourceNames: array expected"); + message.resourceNames = []; + for (var i = 0; i < object.resourceNames.length; ++i) { + if (typeof object.resourceNames[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ValidationMessage.resourceNames: object expected"); + message.resourceNames[i] = $root.google.cloud.dialogflow.cx.v3beta1.ResourceName.fromObject(object.resourceNames[i], long + 1); + } + } + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "INFO": + case 1: + message.severity = 1; + break; + case "WARNING": + case 2: + message.severity = 2; + break; + case "ERROR": + case 3: + message.severity = 3; + break; + } + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a ValidationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ValidationMessage} message ValidationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.resourceNames = []; + } + if (options.defaults) { + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.detail = ""; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType[message.resourceType] : message.resourceType; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity[message.severity] : message.severity; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + if (message.resourceNames && message.resourceNames.length) { + object.resourceNames = []; + for (var j = 0; j < message.resourceNames.length; ++j) + object.resourceNames[j] = $root.google.cloud.dialogflow.cx.v3beta1.ResourceName.toObject(message.resourceNames[j], options); + } + return object; + }; + + /** + * Converts this ValidationMessage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @instance + * @returns {Object.} JSON object + */ + ValidationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidationMessage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ValidationMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ValidationMessage"; + }; + + /** + * ResourceType enum. + * @name google.cloud.dialogflow.cx.v3beta1.ValidationMessage.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} AGENT=1 AGENT value + * @property {number} INTENT=2 INTENT value + * @property {number} INTENT_TRAINING_PHRASE=8 INTENT_TRAINING_PHRASE value + * @property {number} INTENT_PARAMETER=9 INTENT_PARAMETER value + * @property {number} INTENTS=10 INTENTS value + * @property {number} INTENT_TRAINING_PHRASES=11 INTENT_TRAINING_PHRASES value + * @property {number} ENTITY_TYPE=3 ENTITY_TYPE value + * @property {number} ENTITY_TYPES=12 ENTITY_TYPES value + * @property {number} WEBHOOK=4 WEBHOOK value + * @property {number} FLOW=5 FLOW value + * @property {number} PAGE=6 PAGE value + * @property {number} PAGES=13 PAGES value + * @property {number} TRANSITION_ROUTE_GROUP=7 TRANSITION_ROUTE_GROUP value + * @property {number} AGENT_TRANSITION_ROUTE_GROUP=14 AGENT_TRANSITION_ROUTE_GROUP value + */ + ValidationMessage.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGENT"] = 1; + values[valuesById[2] = "INTENT"] = 2; + values[valuesById[8] = "INTENT_TRAINING_PHRASE"] = 8; + values[valuesById[9] = "INTENT_PARAMETER"] = 9; + values[valuesById[10] = "INTENTS"] = 10; + values[valuesById[11] = "INTENT_TRAINING_PHRASES"] = 11; + values[valuesById[3] = "ENTITY_TYPE"] = 3; + values[valuesById[12] = "ENTITY_TYPES"] = 12; + values[valuesById[4] = "WEBHOOK"] = 4; + values[valuesById[5] = "FLOW"] = 5; + values[valuesById[6] = "PAGE"] = 6; + values[valuesById[13] = "PAGES"] = 13; + values[valuesById[7] = "TRANSITION_ROUTE_GROUP"] = 7; + values[valuesById[14] = "AGENT_TRANSITION_ROUTE_GROUP"] = 14; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.dialogflow.cx.v3beta1.ValidationMessage.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} INFO=1 INFO value + * @property {number} WARNING=2 WARNING value + * @property {number} ERROR=3 ERROR value + */ + ValidationMessage.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFO"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return ValidationMessage; + })(); + + v3beta1.ResourceName = (function() { + + /** + * Properties of a ResourceName. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IResourceName + * @property {string|null} [name] ResourceName name + * @property {string|null} [displayName] ResourceName displayName + */ + + /** + * Constructs a new ResourceName. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ResourceName. + * @implements IResourceName + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IResourceName=} [properties] Properties to set + */ + function ResourceName(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceName name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @instance + */ + ResourceName.prototype.name = ""; + + /** + * ResourceName displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @instance + */ + ResourceName.prototype.displayName = ""; + + /** + * Creates a new ResourceName instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IResourceName=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResourceName} ResourceName instance + */ + ResourceName.create = function create(properties) { + return new ResourceName(properties); + }; + + /** + * Encodes the specified ResourceName message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResourceName.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IResourceName} message ResourceName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceName.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ResourceName message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResourceName.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IResourceName} message ResourceName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceName.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceName message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResourceName} ResourceName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceName.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResourceName(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceName message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResourceName} ResourceName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceName.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceName message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceName.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ResourceName message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResourceName} ResourceName + */ + ResourceName.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResourceName) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ResourceName(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ResourceName message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResourceName} message ResourceName + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceName.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ResourceName to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @instance + * @returns {Object.} JSON object + */ + ResourceName.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceName + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ResourceName + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ResourceName"; + }; + + return ResourceName; + })(); + + v3beta1.GenerativeSettings = (function() { + + /** + * Properties of a GenerativeSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGenerativeSettings + * @property {string|null} [name] GenerativeSettings name + * @property {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings|null} [fallbackSettings] GenerativeSettings fallbackSettings + * @property {google.cloud.dialogflow.cx.v3beta1.ISafetySettings|null} [generativeSafetySettings] GenerativeSettings generativeSafetySettings + * @property {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings|null} [knowledgeConnectorSettings] GenerativeSettings knowledgeConnectorSettings + * @property {string|null} [languageCode] GenerativeSettings languageCode + * @property {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null} [llmModelSettings] GenerativeSettings llmModelSettings + */ + + /** + * Constructs a new GenerativeSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GenerativeSettings. + * @implements IGenerativeSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings=} [properties] Properties to set + */ + function GenerativeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerativeSettings name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.name = ""; + + /** + * GenerativeSettings fallbackSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings|null|undefined} fallbackSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.fallbackSettings = null; + + /** + * GenerativeSettings generativeSafetySettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ISafetySettings|null|undefined} generativeSafetySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.generativeSafetySettings = null; + + /** + * GenerativeSettings knowledgeConnectorSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings|null|undefined} knowledgeConnectorSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.knowledgeConnectorSettings = null; + + /** + * GenerativeSettings languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.languageCode = ""; + + /** + * GenerativeSettings llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @instance + */ + GenerativeSettings.prototype.llmModelSettings = null; + + /** + * Creates a new GenerativeSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} GenerativeSettings instance + */ + GenerativeSettings.create = function create(properties) { + return new GenerativeSettings(properties); + }; + + /** + * Encodes the specified GenerativeSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings} message GenerativeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fallbackSettings != null && Object.hasOwnProperty.call(message, "fallbackSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.encode(message.fallbackSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.generativeSafetySettings != null && Object.hasOwnProperty.call(message, "generativeSafetySettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.encode(message.generativeSafetySettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + if (message.knowledgeConnectorSettings != null && Object.hasOwnProperty.call(message, "knowledgeConnectorSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.encode(message.knowledgeConnectorSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerativeSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings} message GenerativeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} GenerativeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.name = reader.string(); + break; + } + case 1: { + message.fallbackSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.generativeSafetySettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.languageCode = reader.string(); + break; + } + case 8: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenerativeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} GenerativeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerativeSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerativeSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fallbackSettings != null && message.hasOwnProperty("fallbackSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.verify(message.fallbackSettings, long + 1); + if (error) + return "fallbackSettings." + error; + } + if (message.generativeSafetySettings != null && message.hasOwnProperty("generativeSafetySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.verify(message.generativeSafetySettings, long + 1); + if (error) + return "generativeSafetySettings." + error; + } + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.verify(message.knowledgeConnectorSettings, long + 1); + if (error) + return "knowledgeConnectorSettings." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + return null; + }; + + /** + * Creates a GenerativeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} GenerativeSettings + */ + GenerativeSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.fallbackSettings != null) { + if (typeof object.fallbackSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.fallbackSettings: object expected"); + message.fallbackSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.fromObject(object.fallbackSettings, long + 1); + } + if (object.generativeSafetySettings != null) { + if (typeof object.generativeSafetySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.generativeSafetySettings: object expected"); + message.generativeSafetySettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.fromObject(object.generativeSafetySettings, long + 1); + } + if (object.knowledgeConnectorSettings != null) { + if (typeof object.knowledgeConnectorSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.knowledgeConnectorSettings: object expected"); + message.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.fromObject(object.knowledgeConnectorSettings, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GenerativeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} message GenerativeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerativeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fallbackSettings = null; + object.generativeSafetySettings = null; + object.languageCode = ""; + object.name = ""; + object.knowledgeConnectorSettings = null; + object.llmModelSettings = null; + } + if (message.fallbackSettings != null && message.hasOwnProperty("fallbackSettings")) + object.fallbackSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.toObject(message.fallbackSettings, options); + if (message.generativeSafetySettings != null && message.hasOwnProperty("generativeSafetySettings")) + object.generativeSafetySettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.toObject(message.generativeSafetySettings, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.knowledgeConnectorSettings != null && message.hasOwnProperty("knowledgeConnectorSettings")) + object.knowledgeConnectorSettings = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.toObject(message.knowledgeConnectorSettings, options); + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.toObject(message.llmModelSettings, options); + return object; + }; + + /** + * Converts this GenerativeSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @instance + * @returns {Object.} JSON object + */ + GenerativeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerativeSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerativeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GenerativeSettings"; + }; + + GenerativeSettings.FallbackSettings = (function() { + + /** + * Properties of a FallbackSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @interface IFallbackSettings + * @property {string|null} [selectedPrompt] FallbackSettings selectedPrompt + * @property {Array.|null} [promptTemplates] FallbackSettings promptTemplates + */ + + /** + * Constructs a new FallbackSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @classdesc Represents a FallbackSettings. + * @implements IFallbackSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings=} [properties] Properties to set + */ + function FallbackSettings(properties) { + this.promptTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FallbackSettings selectedPrompt. + * @member {string} selectedPrompt + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @instance + */ + FallbackSettings.prototype.selectedPrompt = ""; + + /** + * FallbackSettings promptTemplates. + * @member {Array.} promptTemplates + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @instance + */ + FallbackSettings.prototype.promptTemplates = $util.emptyArray; + + /** + * Creates a new FallbackSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings} FallbackSettings instance + */ + FallbackSettings.create = function create(properties) { + return new FallbackSettings(properties); + }; + + /** + * Encodes the specified FallbackSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings} message FallbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedPrompt != null && Object.hasOwnProperty.call(message, "selectedPrompt")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.selectedPrompt); + if (message.promptTemplates != null && message.promptTemplates.length) + for (var i = 0; i < message.promptTemplates.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.encode(message.promptTemplates[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FallbackSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IFallbackSettings} message FallbackSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings} FallbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.selectedPrompt = reader.string(); + break; + } + case 4: { + if (!(message.promptTemplates && message.promptTemplates.length)) + message.promptTemplates = []; + message.promptTemplates.push($root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FallbackSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings} FallbackSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FallbackSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FallbackSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.selectedPrompt != null && message.hasOwnProperty("selectedPrompt")) + if (!$util.isString(message.selectedPrompt)) + return "selectedPrompt: string expected"; + if (message.promptTemplates != null && message.hasOwnProperty("promptTemplates")) { + if (!Array.isArray(message.promptTemplates)) + return "promptTemplates: array expected"; + for (var i = 0; i < message.promptTemplates.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.verify(message.promptTemplates[i], long + 1); + if (error) + return "promptTemplates." + error; + } + } + return null; + }; + + /** + * Creates a FallbackSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings} FallbackSettings + */ + FallbackSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings(); + if (object.selectedPrompt != null) + message.selectedPrompt = String(object.selectedPrompt); + if (object.promptTemplates) { + if (!Array.isArray(object.promptTemplates)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.promptTemplates: array expected"); + message.promptTemplates = []; + for (var i = 0; i < object.promptTemplates.length; ++i) { + if (typeof object.promptTemplates[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.promptTemplates: object expected"); + message.promptTemplates[i] = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.fromObject(object.promptTemplates[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FallbackSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings} message FallbackSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FallbackSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.promptTemplates = []; + if (options.defaults) + object.selectedPrompt = ""; + if (message.selectedPrompt != null && message.hasOwnProperty("selectedPrompt")) + object.selectedPrompt = message.selectedPrompt; + if (message.promptTemplates && message.promptTemplates.length) { + object.promptTemplates = []; + for (var j = 0; j < message.promptTemplates.length; ++j) + object.promptTemplates[j] = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.toObject(message.promptTemplates[j], options); + } + return object; + }; + + /** + * Converts this FallbackSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @instance + * @returns {Object.} JSON object + */ + FallbackSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FallbackSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FallbackSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings"; + }; + + FallbackSettings.PromptTemplate = (function() { + + /** + * Properties of a PromptTemplate. + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @interface IPromptTemplate + * @property {string|null} [displayName] PromptTemplate displayName + * @property {string|null} [promptText] PromptTemplate promptText + * @property {boolean|null} [frozen] PromptTemplate frozen + */ + + /** + * Constructs a new PromptTemplate. + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings + * @classdesc Represents a PromptTemplate. + * @implements IPromptTemplate + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate=} [properties] Properties to set + */ + function PromptTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptTemplate displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + */ + PromptTemplate.prototype.displayName = ""; + + /** + * PromptTemplate promptText. + * @member {string} promptText + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + */ + PromptTemplate.prototype.promptText = ""; + + /** + * PromptTemplate frozen. + * @member {boolean} frozen + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + */ + PromptTemplate.prototype.frozen = false; + + /** + * Creates a new PromptTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate instance + */ + PromptTemplate.create = function create(properties) { + return new PromptTemplate(properties); + }; + + /** + * Encodes the specified PromptTemplate message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate} message PromptTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.promptText != null && Object.hasOwnProperty.call(message, "promptText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.promptText); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified PromptTemplate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.IPromptTemplate} message PromptTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptTemplate.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.promptText = reader.string(); + break; + } + case 3: { + message.frozen = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PromptTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptTemplate message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptTemplate.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.promptText != null && message.hasOwnProperty("promptText")) + if (!$util.isString(message.promptText)) + return "promptText: string expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a PromptTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate} PromptTemplate + */ + PromptTemplate.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.promptText != null) + message.promptText = String(object.promptText); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a PromptTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate} message PromptTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.promptText = ""; + object.frozen = false; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.promptText != null && message.hasOwnProperty("promptText")) + object.promptText = message.promptText; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this PromptTemplate to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @instance + * @returns {Object.} JSON object + */ + PromptTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptTemplate + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.FallbackSettings.PromptTemplate"; + }; + + return PromptTemplate; + })(); + + return FallbackSettings; + })(); + + GenerativeSettings.KnowledgeConnectorSettings = (function() { + + /** + * Properties of a KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @interface IKnowledgeConnectorSettings + * @property {string|null} [business] KnowledgeConnectorSettings business + * @property {string|null} [agent] KnowledgeConnectorSettings agent + * @property {string|null} [agentIdentity] KnowledgeConnectorSettings agentIdentity + * @property {string|null} [businessDescription] KnowledgeConnectorSettings businessDescription + * @property {string|null} [agentScope] KnowledgeConnectorSettings agentScope + * @property {boolean|null} [disableDataStoreFallback] KnowledgeConnectorSettings disableDataStoreFallback + */ + + /** + * Constructs a new KnowledgeConnectorSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings + * @classdesc Represents a KnowledgeConnectorSettings. + * @implements IKnowledgeConnectorSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings=} [properties] Properties to set + */ + function KnowledgeConnectorSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeConnectorSettings business. + * @member {string} business + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.business = ""; + + /** + * KnowledgeConnectorSettings agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.agent = ""; + + /** + * KnowledgeConnectorSettings agentIdentity. + * @member {string} agentIdentity + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.agentIdentity = ""; + + /** + * KnowledgeConnectorSettings businessDescription. + * @member {string} businessDescription + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.businessDescription = ""; + + /** + * KnowledgeConnectorSettings agentScope. + * @member {string} agentScope + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.agentScope = ""; + + /** + * KnowledgeConnectorSettings disableDataStoreFallback. + * @member {boolean} disableDataStoreFallback + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @instance + */ + KnowledgeConnectorSettings.prototype.disableDataStoreFallback = false; + + /** + * Creates a new KnowledgeConnectorSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings instance + */ + KnowledgeConnectorSettings.create = function create(properties) { + return new KnowledgeConnectorSettings(properties); + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.business != null && Object.hasOwnProperty.call(message, "business")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.business); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agent); + if (message.agentIdentity != null && Object.hasOwnProperty.call(message, "agentIdentity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentIdentity); + if (message.businessDescription != null && Object.hasOwnProperty.call(message, "businessDescription")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.businessDescription); + if (message.agentScope != null && Object.hasOwnProperty.call(message, "agentScope")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.agentScope); + if (message.disableDataStoreFallback != null && Object.hasOwnProperty.call(message, "disableDataStoreFallback")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.disableDataStoreFallback); + return writer; + }; + + /** + * Encodes the specified KnowledgeConnectorSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.IKnowledgeConnectorSettings} message KnowledgeConnectorSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeConnectorSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.business = reader.string(); + break; + } + case 2: { + message.agent = reader.string(); + break; + } + case 3: { + message.agentIdentity = reader.string(); + break; + } + case 4: { + message.businessDescription = reader.string(); + break; + } + case 5: { + message.agentScope = reader.string(); + break; + } + case 8: { + message.disableDataStoreFallback = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeConnectorSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeConnectorSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeConnectorSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeConnectorSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.business != null && message.hasOwnProperty("business")) + if (!$util.isString(message.business)) + return "business: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.agentIdentity != null && message.hasOwnProperty("agentIdentity")) + if (!$util.isString(message.agentIdentity)) + return "agentIdentity: string expected"; + if (message.businessDescription != null && message.hasOwnProperty("businessDescription")) + if (!$util.isString(message.businessDescription)) + return "businessDescription: string expected"; + if (message.agentScope != null && message.hasOwnProperty("agentScope")) + if (!$util.isString(message.agentScope)) + return "agentScope: string expected"; + if (message.disableDataStoreFallback != null && message.hasOwnProperty("disableDataStoreFallback")) + if (typeof message.disableDataStoreFallback !== "boolean") + return "disableDataStoreFallback: boolean expected"; + return null; + }; + + /** + * Creates a KnowledgeConnectorSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings} KnowledgeConnectorSettings + */ + KnowledgeConnectorSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings(); + if (object.business != null) + message.business = String(object.business); + if (object.agent != null) + message.agent = String(object.agent); + if (object.agentIdentity != null) + message.agentIdentity = String(object.agentIdentity); + if (object.businessDescription != null) + message.businessDescription = String(object.businessDescription); + if (object.agentScope != null) + message.agentScope = String(object.agentScope); + if (object.disableDataStoreFallback != null) + message.disableDataStoreFallback = Boolean(object.disableDataStoreFallback); + return message; + }; + + /** + * Creates a plain object from a KnowledgeConnectorSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings} message KnowledgeConnectorSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeConnectorSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.business = ""; + object.agent = ""; + object.agentIdentity = ""; + object.businessDescription = ""; + object.agentScope = ""; + object.disableDataStoreFallback = false; + } + if (message.business != null && message.hasOwnProperty("business")) + object.business = message.business; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + if (message.agentIdentity != null && message.hasOwnProperty("agentIdentity")) + object.agentIdentity = message.agentIdentity; + if (message.businessDescription != null && message.hasOwnProperty("businessDescription")) + object.businessDescription = message.businessDescription; + if (message.agentScope != null && message.hasOwnProperty("agentScope")) + object.agentScope = message.agentScope; + if (message.disableDataStoreFallback != null && message.hasOwnProperty("disableDataStoreFallback")) + object.disableDataStoreFallback = message.disableDataStoreFallback; + return object; + }; + + /** + * Converts this KnowledgeConnectorSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @instance + * @returns {Object.} JSON object + */ + KnowledgeConnectorSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KnowledgeConnectorSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KnowledgeConnectorSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GenerativeSettings.KnowledgeConnectorSettings"; + }; + + return KnowledgeConnectorSettings; + })(); + + return GenerativeSettings; + })(); + + v3beta1.LlmModelSettings = (function() { + + /** + * Properties of a LlmModelSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ILlmModelSettings + * @property {string|null} [model] LlmModelSettings model + * @property {string|null} [promptText] LlmModelSettings promptText + * @property {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters|null} [parameters] LlmModelSettings parameters + */ + + /** + * Constructs a new LlmModelSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a LlmModelSettings. + * @implements ILlmModelSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings=} [properties] Properties to set + */ + function LlmModelSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmModelSettings model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @instance + */ + LlmModelSettings.prototype.model = ""; + + /** + * LlmModelSettings promptText. + * @member {string} promptText + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @instance + */ + LlmModelSettings.prototype.promptText = ""; + + /** + * LlmModelSettings parameters. + * @member {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters|null|undefined} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @instance + */ + LlmModelSettings.prototype.parameters = null; + + /** + * Creates a new LlmModelSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings} LlmModelSettings instance + */ + LlmModelSettings.create = function create(properties) { + return new LlmModelSettings(properties); + }; + + /** + * Encodes the specified LlmModelSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings} message LlmModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmModelSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.promptText != null && Object.hasOwnProperty.call(message, "promptText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.promptText); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LlmModelSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings} message LlmModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmModelSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings} LlmModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmModelSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.promptText = reader.string(); + break; + } + case 4: { + message.parameters = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LlmModelSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings} LlmModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmModelSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmModelSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmModelSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.promptText != null && message.hasOwnProperty("promptText")) + if (!$util.isString(message.promptText)) + return "promptText: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.verify(message.parameters, long + 1); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates a LlmModelSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings} LlmModelSettings + */ + LlmModelSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings(); + if (object.model != null) + message.model = String(object.model); + if (object.promptText != null) + message.promptText = String(object.promptText); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.parameters: object expected"); + message.parameters = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.fromObject(object.parameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LlmModelSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings} message LlmModelSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmModelSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.promptText = ""; + object.parameters = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.promptText != null && message.hasOwnProperty("promptText")) + object.promptText = message.promptText; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this LlmModelSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @instance + * @returns {Object.} JSON object + */ + LlmModelSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmModelSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmModelSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LlmModelSettings"; + }; + + LlmModelSettings.Parameters = (function() { + + /** + * Properties of a Parameters. + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @interface IParameters + * @property {number|null} [temperature] Parameters temperature + * @property {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit|null} [inputTokenLimit] Parameters inputTokenLimit + * @property {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit|null} [outputTokenLimit] Parameters outputTokenLimit + */ + + /** + * Constructs a new Parameters. + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings + * @classdesc Represents a Parameters. + * @implements IParameters + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters=} [properties] Properties to set + */ + function Parameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameters temperature. + * @member {number|null|undefined} temperature + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @instance + */ + Parameters.prototype.temperature = null; + + /** + * Parameters inputTokenLimit. + * @member {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit|null|undefined} inputTokenLimit + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @instance + */ + Parameters.prototype.inputTokenLimit = null; + + /** + * Parameters outputTokenLimit. + * @member {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit|null|undefined} outputTokenLimit + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @instance + */ + Parameters.prototype.outputTokenLimit = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_inputTokenLimit", { + get: $util.oneOfGetter($oneOfFields = ["inputTokenLimit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Parameters.prototype, "_outputTokenLimit", { + get: $util.oneOfGetter($oneOfFields = ["outputTokenLimit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Parameters instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters} Parameters instance + */ + Parameters.create = function create(properties) { + return new Parameters(properties); + }; + + /** + * Encodes the specified Parameters message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters} message Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.temperature); + if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inputTokenLimit); + if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.outputTokenLimit); + return writer; + }; + + /** + * Encodes the specified Parameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.IParameters} message Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters} Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameters.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.temperature = reader.float(); + break; + } + case 2: { + message.inputTokenLimit = reader.int32(); + break; + } + case 3: { + message.outputTokenLimit = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Parameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters} Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameters message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameters.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit")) { + properties._inputTokenLimit = 1; + switch (message.inputTokenLimit) { + default: + return "inputTokenLimit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit")) { + properties._outputTokenLimit = 1; + switch (message.outputTokenLimit) { + default: + return "outputTokenLimit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a Parameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters} Parameters + */ + Parameters.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters(); + if (object.temperature != null) + message.temperature = Number(object.temperature); + switch (object.inputTokenLimit) { + default: + if (typeof object.inputTokenLimit === "number") { + message.inputTokenLimit = object.inputTokenLimit; + break; + } + break; + case "INPUT_TOKEN_LIMIT_UNSPECIFIED": + case 0: + message.inputTokenLimit = 0; + break; + case "INPUT_TOKEN_LIMIT_SHORT": + case 1: + message.inputTokenLimit = 1; + break; + case "INPUT_TOKEN_LIMIT_MEDIUM": + case 2: + message.inputTokenLimit = 2; + break; + case "INPUT_TOKEN_LIMIT_LONG": + case 3: + message.inputTokenLimit = 3; + break; + } + switch (object.outputTokenLimit) { + default: + if (typeof object.outputTokenLimit === "number") { + message.outputTokenLimit = object.outputTokenLimit; + break; + } + break; + case "OUTPUT_TOKEN_LIMIT_UNSPECIFIED": + case 0: + message.outputTokenLimit = 0; + break; + case "OUTPUT_TOKEN_LIMIT_SHORT": + case 1: + message.outputTokenLimit = 1; + break; + case "OUTPUT_TOKEN_LIMIT_MEDIUM": + case 2: + message.outputTokenLimit = 2; + break; + case "OUTPUT_TOKEN_LIMIT_LONG": + case 3: + message.outputTokenLimit = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Parameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters} message Parameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit")) { + object.inputTokenLimit = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit[message.inputTokenLimit] === undefined ? message.inputTokenLimit : $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit[message.inputTokenLimit] : message.inputTokenLimit; + if (options.oneofs) + object._inputTokenLimit = "inputTokenLimit"; + } + if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit")) { + object.outputTokenLimit = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit[message.outputTokenLimit] === undefined ? message.outputTokenLimit : $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit[message.outputTokenLimit] : message.outputTokenLimit; + if (options.oneofs) + object._outputTokenLimit = "outputTokenLimit"; + } + return object; + }; + + /** + * Converts this Parameters to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @instance + * @returns {Object.} JSON object + */ + Parameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameters + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters"; + }; + + /** + * InputTokenLimit enum. + * @name google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.InputTokenLimit + * @enum {number} + * @property {number} INPUT_TOKEN_LIMIT_UNSPECIFIED=0 INPUT_TOKEN_LIMIT_UNSPECIFIED value + * @property {number} INPUT_TOKEN_LIMIT_SHORT=1 INPUT_TOKEN_LIMIT_SHORT value + * @property {number} INPUT_TOKEN_LIMIT_MEDIUM=2 INPUT_TOKEN_LIMIT_MEDIUM value + * @property {number} INPUT_TOKEN_LIMIT_LONG=3 INPUT_TOKEN_LIMIT_LONG value + */ + Parameters.InputTokenLimit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INPUT_TOKEN_LIMIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "INPUT_TOKEN_LIMIT_SHORT"] = 1; + values[valuesById[2] = "INPUT_TOKEN_LIMIT_MEDIUM"] = 2; + values[valuesById[3] = "INPUT_TOKEN_LIMIT_LONG"] = 3; + return values; + })(); + + /** + * OutputTokenLimit enum. + * @name google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.Parameters.OutputTokenLimit + * @enum {number} + * @property {number} OUTPUT_TOKEN_LIMIT_UNSPECIFIED=0 OUTPUT_TOKEN_LIMIT_UNSPECIFIED value + * @property {number} OUTPUT_TOKEN_LIMIT_SHORT=1 OUTPUT_TOKEN_LIMIT_SHORT value + * @property {number} OUTPUT_TOKEN_LIMIT_MEDIUM=2 OUTPUT_TOKEN_LIMIT_MEDIUM value + * @property {number} OUTPUT_TOKEN_LIMIT_LONG=3 OUTPUT_TOKEN_LIMIT_LONG value + */ + Parameters.OutputTokenLimit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_TOKEN_LIMIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTPUT_TOKEN_LIMIT_SHORT"] = 1; + values[valuesById[2] = "OUTPUT_TOKEN_LIMIT_MEDIUM"] = 2; + values[valuesById[3] = "OUTPUT_TOKEN_LIMIT_LONG"] = 3; + return values; + })(); + + return Parameters; + })(); + + return LlmModelSettings; + })(); + + v3beta1.SafetySettings = (function() { + + /** + * Properties of a SafetySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISafetySettings + * @property {google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy|null} [defaultBannedPhraseMatchStrategy] SafetySettings defaultBannedPhraseMatchStrategy + * @property {Array.|null} [bannedPhrases] SafetySettings bannedPhrases + * @property {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null} [raiSettings] SafetySettings raiSettings + * @property {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null} [defaultRaiSettings] SafetySettings defaultRaiSettings + * @property {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings|null} [promptSecuritySettings] SafetySettings promptSecuritySettings + */ + + /** + * Constructs a new SafetySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SafetySettings. + * @implements ISafetySettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISafetySettings=} [properties] Properties to set + */ + function SafetySettings(properties) { + this.bannedPhrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySettings defaultBannedPhraseMatchStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy} defaultBannedPhraseMatchStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @instance + */ + SafetySettings.prototype.defaultBannedPhraseMatchStrategy = 0; + + /** + * SafetySettings bannedPhrases. + * @member {Array.} bannedPhrases + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @instance + */ + SafetySettings.prototype.bannedPhrases = $util.emptyArray; + + /** + * SafetySettings raiSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null|undefined} raiSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @instance + */ + SafetySettings.prototype.raiSettings = null; + + /** + * SafetySettings defaultRaiSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings|null|undefined} defaultRaiSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @instance + */ + SafetySettings.prototype.defaultRaiSettings = null; + + /** + * SafetySettings promptSecuritySettings. + * @member {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings|null|undefined} promptSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @instance + */ + SafetySettings.prototype.promptSecuritySettings = null; + + /** + * Creates a new SafetySettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISafetySettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings} SafetySettings instance + */ + SafetySettings.create = function create(properties) { + return new SafetySettings(properties); + }; + + /** + * Encodes the specified SafetySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISafetySettings} message SafetySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bannedPhrases != null && message.bannedPhrases.length) + for (var i = 0; i < message.bannedPhrases.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.encode(message.bannedPhrases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.raiSettings != null && Object.hasOwnProperty.call(message, "raiSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.encode(message.raiSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.defaultRaiSettings != null && Object.hasOwnProperty.call(message, "defaultRaiSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.encode(message.defaultRaiSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaultBannedPhraseMatchStrategy != null && Object.hasOwnProperty.call(message, "defaultBannedPhraseMatchStrategy")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.defaultBannedPhraseMatchStrategy); + if (message.promptSecuritySettings != null && Object.hasOwnProperty.call(message, "promptSecuritySettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.encode(message.promptSecuritySettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SafetySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISafetySettings} message SafetySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings} SafetySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.defaultBannedPhraseMatchStrategy = reader.int32(); + break; + } + case 1: { + if (!(message.bannedPhrases && message.bannedPhrases.length)) + message.bannedPhrases = []; + message.bannedPhrases.push($root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.raiSettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.defaultRaiSettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.promptSecuritySettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings} SafetySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.defaultBannedPhraseMatchStrategy != null && message.hasOwnProperty("defaultBannedPhraseMatchStrategy")) + switch (message.defaultBannedPhraseMatchStrategy) { + default: + return "defaultBannedPhraseMatchStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.bannedPhrases != null && message.hasOwnProperty("bannedPhrases")) { + if (!Array.isArray(message.bannedPhrases)) + return "bannedPhrases: array expected"; + for (var i = 0; i < message.bannedPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.verify(message.bannedPhrases[i], long + 1); + if (error) + return "bannedPhrases." + error; + } + } + if (message.raiSettings != null && message.hasOwnProperty("raiSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.verify(message.raiSettings, long + 1); + if (error) + return "raiSettings." + error; + } + if (message.defaultRaiSettings != null && message.hasOwnProperty("defaultRaiSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.verify(message.defaultRaiSettings, long + 1); + if (error) + return "defaultRaiSettings." + error; + } + if (message.promptSecuritySettings != null && message.hasOwnProperty("promptSecuritySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.verify(message.promptSecuritySettings, long + 1); + if (error) + return "promptSecuritySettings." + error; + } + return null; + }; + + /** + * Creates a SafetySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings} SafetySettings + */ + SafetySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings(); + switch (object.defaultBannedPhraseMatchStrategy) { + default: + if (typeof object.defaultBannedPhraseMatchStrategy === "number") { + message.defaultBannedPhraseMatchStrategy = object.defaultBannedPhraseMatchStrategy; + break; + } + break; + case "PHRASE_MATCH_STRATEGY_UNSPECIFIED": + case 0: + message.defaultBannedPhraseMatchStrategy = 0; + break; + case "PARTIAL_MATCH": + case 1: + message.defaultBannedPhraseMatchStrategy = 1; + break; + case "WORD_MATCH": + case 2: + message.defaultBannedPhraseMatchStrategy = 2; + break; + } + if (object.bannedPhrases) { + if (!Array.isArray(object.bannedPhrases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SafetySettings.bannedPhrases: array expected"); + message.bannedPhrases = []; + for (var i = 0; i < object.bannedPhrases.length; ++i) { + if (typeof object.bannedPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SafetySettings.bannedPhrases: object expected"); + message.bannedPhrases[i] = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.fromObject(object.bannedPhrases[i], long + 1); + } + } + if (object.raiSettings != null) { + if (typeof object.raiSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SafetySettings.raiSettings: object expected"); + message.raiSettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.fromObject(object.raiSettings, long + 1); + } + if (object.defaultRaiSettings != null) { + if (typeof object.defaultRaiSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SafetySettings.defaultRaiSettings: object expected"); + message.defaultRaiSettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.fromObject(object.defaultRaiSettings, long + 1); + } + if (object.promptSecuritySettings != null) { + if (typeof object.promptSecuritySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SafetySettings.promptSecuritySettings: object expected"); + message.promptSecuritySettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.fromObject(object.promptSecuritySettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SafetySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings} message SafetySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bannedPhrases = []; + if (options.defaults) { + object.raiSettings = null; + object.defaultRaiSettings = null; + object.defaultBannedPhraseMatchStrategy = options.enums === String ? "PHRASE_MATCH_STRATEGY_UNSPECIFIED" : 0; + object.promptSecuritySettings = null; + } + if (message.bannedPhrases && message.bannedPhrases.length) { + object.bannedPhrases = []; + for (var j = 0; j < message.bannedPhrases.length; ++j) + object.bannedPhrases[j] = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.toObject(message.bannedPhrases[j], options); + } + if (message.raiSettings != null && message.hasOwnProperty("raiSettings")) + object.raiSettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.toObject(message.raiSettings, options); + if (message.defaultRaiSettings != null && message.hasOwnProperty("defaultRaiSettings")) + object.defaultRaiSettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.toObject(message.defaultRaiSettings, options); + if (message.defaultBannedPhraseMatchStrategy != null && message.hasOwnProperty("defaultBannedPhraseMatchStrategy")) + object.defaultBannedPhraseMatchStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy[message.defaultBannedPhraseMatchStrategy] === undefined ? message.defaultBannedPhraseMatchStrategy : $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy[message.defaultBannedPhraseMatchStrategy] : message.defaultBannedPhraseMatchStrategy; + if (message.promptSecuritySettings != null && message.hasOwnProperty("promptSecuritySettings")) + object.promptSecuritySettings = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.toObject(message.promptSecuritySettings, options); + return object; + }; + + /** + * Converts this SafetySettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @instance + * @returns {Object.} JSON object + */ + SafetySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SafetySettings"; + }; + + SafetySettings.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @interface IPhrase + * @property {string|null} [text] Phrase text + * @property {string|null} [languageCode] Phrase languageCode + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @instance + */ + Phrase.prototype.text = ""; + + /** + * Phrase languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @instance + */ + Phrase.prototype.languageCode = ""; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase(); + if (object.text != null) + message.text = String(object.text); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.languageCode = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SafetySettings.Phrase"; + }; + + return Phrase; + })(); + + /** + * PhraseMatchStrategy enum. + * @name google.cloud.dialogflow.cx.v3beta1.SafetySettings.PhraseMatchStrategy + * @enum {number} + * @property {number} PHRASE_MATCH_STRATEGY_UNSPECIFIED=0 PHRASE_MATCH_STRATEGY_UNSPECIFIED value + * @property {number} PARTIAL_MATCH=1 PARTIAL_MATCH value + * @property {number} WORD_MATCH=2 WORD_MATCH value + */ + SafetySettings.PhraseMatchStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PHRASE_MATCH_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARTIAL_MATCH"] = 1; + values[valuesById[2] = "WORD_MATCH"] = 2; + return values; + })(); + + SafetySettings.RaiSettings = (function() { + + /** + * Properties of a RaiSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @interface IRaiSettings + * @property {Array.|null} [categoryFilters] RaiSettings categoryFilters + */ + + /** + * Constructs a new RaiSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @classdesc Represents a RaiSettings. + * @implements IRaiSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings=} [properties] Properties to set + */ + function RaiSettings(properties) { + this.categoryFilters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RaiSettings categoryFilters. + * @member {Array.} categoryFilters + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @instance + */ + RaiSettings.prototype.categoryFilters = $util.emptyArray; + + /** + * Creates a new RaiSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings} RaiSettings instance + */ + RaiSettings.create = function create(properties) { + return new RaiSettings(properties); + }; + + /** + * Encodes the specified RaiSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings} message RaiSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RaiSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.categoryFilters != null && message.categoryFilters.length) + for (var i = 0; i < message.categoryFilters.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.encode(message.categoryFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RaiSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IRaiSettings} message RaiSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RaiSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RaiSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings} RaiSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RaiSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.categoryFilters && message.categoryFilters.length)) + message.categoryFilters = []; + message.categoryFilters.push($root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RaiSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings} RaiSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RaiSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RaiSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RaiSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.categoryFilters != null && message.hasOwnProperty("categoryFilters")) { + if (!Array.isArray(message.categoryFilters)) + return "categoryFilters: array expected"; + for (var i = 0; i < message.categoryFilters.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.verify(message.categoryFilters[i], long + 1); + if (error) + return "categoryFilters." + error; + } + } + return null; + }; + + /** + * Creates a RaiSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings} RaiSettings + */ + RaiSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings(); + if (object.categoryFilters) { + if (!Array.isArray(object.categoryFilters)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.categoryFilters: array expected"); + message.categoryFilters = []; + for (var i = 0; i < object.categoryFilters.length; ++i) { + if (typeof object.categoryFilters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.categoryFilters: object expected"); + message.categoryFilters[i] = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.fromObject(object.categoryFilters[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a RaiSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings} message RaiSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RaiSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.categoryFilters = []; + if (message.categoryFilters && message.categoryFilters.length) { + object.categoryFilters = []; + for (var j = 0; j < message.categoryFilters.length; ++j) + object.categoryFilters[j] = $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.toObject(message.categoryFilters[j], options); + } + return object; + }; + + /** + * Converts this RaiSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @instance + * @returns {Object.} JSON object + */ + RaiSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RaiSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RaiSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings"; + }; + + /** + * SafetyFilterLevel enum. + * @name google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel + * @enum {number} + * @property {number} SAFETY_FILTER_LEVEL_UNSPECIFIED=0 SAFETY_FILTER_LEVEL_UNSPECIFIED value + * @property {number} BLOCK_NONE=1 BLOCK_NONE value + * @property {number} BLOCK_FEW=2 BLOCK_FEW value + * @property {number} BLOCK_SOME=3 BLOCK_SOME value + * @property {number} BLOCK_MOST=4 BLOCK_MOST value + */ + RaiSettings.SafetyFilterLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAFETY_FILTER_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK_NONE"] = 1; + values[valuesById[2] = "BLOCK_FEW"] = 2; + values[valuesById[3] = "BLOCK_SOME"] = 3; + values[valuesById[4] = "BLOCK_MOST"] = 4; + return values; + })(); + + /** + * SafetyCategory enum. + * @name google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory + * @enum {number} + * @property {number} SAFETY_CATEGORY_UNSPECIFIED=0 SAFETY_CATEGORY_UNSPECIFIED value + * @property {number} DANGEROUS_CONTENT=1 DANGEROUS_CONTENT value + * @property {number} HATE_SPEECH=2 HATE_SPEECH value + * @property {number} HARASSMENT=3 HARASSMENT value + * @property {number} SEXUALLY_EXPLICIT_CONTENT=4 SEXUALLY_EXPLICIT_CONTENT value + */ + RaiSettings.SafetyCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SAFETY_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DANGEROUS_CONTENT"] = 1; + values[valuesById[2] = "HATE_SPEECH"] = 2; + values[valuesById[3] = "HARASSMENT"] = 3; + values[valuesById[4] = "SEXUALLY_EXPLICIT_CONTENT"] = 4; + return values; + })(); + + RaiSettings.CategoryFilter = (function() { + + /** + * Properties of a CategoryFilter. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @interface ICategoryFilter + * @property {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory|null} [category] CategoryFilter category + * @property {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel|null} [filterLevel] CategoryFilter filterLevel + */ + + /** + * Constructs a new CategoryFilter. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings + * @classdesc Represents a CategoryFilter. + * @implements ICategoryFilter + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter=} [properties] Properties to set + */ + function CategoryFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoryFilter category. + * @member {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory} category + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @instance + */ + CategoryFilter.prototype.category = 0; + + /** + * CategoryFilter filterLevel. + * @member {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel} filterLevel + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @instance + */ + CategoryFilter.prototype.filterLevel = 0; + + /** + * Creates a new CategoryFilter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter instance + */ + CategoryFilter.create = function create(properties) { + return new CategoryFilter(properties); + }; + + /** + * Encodes the specified CategoryFilter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter} message CategoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.filterLevel != null && Object.hasOwnProperty.call(message, "filterLevel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.filterLevel); + return writer; + }; + + /** + * Encodes the specified CategoryFilter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.ICategoryFilter} message CategoryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryFilter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.category = reader.int32(); + break; + } + case 2: { + message.filterLevel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CategoryFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoryFilter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoryFilter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.filterLevel != null && message.hasOwnProperty("filterLevel")) + switch (message.filterLevel) { + default: + return "filterLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a CategoryFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter} CategoryFilter + */ + CategoryFilter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "SAFETY_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "DANGEROUS_CONTENT": + case 1: + message.category = 1; + break; + case "HATE_SPEECH": + case 2: + message.category = 2; + break; + case "HARASSMENT": + case 3: + message.category = 3; + break; + case "SEXUALLY_EXPLICIT_CONTENT": + case 4: + message.category = 4; + break; + } + switch (object.filterLevel) { + default: + if (typeof object.filterLevel === "number") { + message.filterLevel = object.filterLevel; + break; + } + break; + case "SAFETY_FILTER_LEVEL_UNSPECIFIED": + case 0: + message.filterLevel = 0; + break; + case "BLOCK_NONE": + case 1: + message.filterLevel = 1; + break; + case "BLOCK_FEW": + case 2: + message.filterLevel = 2; + break; + case "BLOCK_SOME": + case 3: + message.filterLevel = 3; + break; + case "BLOCK_MOST": + case 4: + message.filterLevel = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a CategoryFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter} message CategoryFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoryFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "SAFETY_CATEGORY_UNSPECIFIED" : 0; + object.filterLevel = options.enums === String ? "SAFETY_FILTER_LEVEL_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory[message.category] === undefined ? message.category : $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyCategory[message.category] : message.category; + if (message.filterLevel != null && message.hasOwnProperty("filterLevel")) + object.filterLevel = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel[message.filterLevel] === undefined ? message.filterLevel : $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.SafetyFilterLevel[message.filterLevel] : message.filterLevel; + return object; + }; + + /** + * Converts this CategoryFilter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @instance + * @returns {Object.} JSON object + */ + CategoryFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoryFilter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoryFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SafetySettings.RaiSettings.CategoryFilter"; + }; + + return CategoryFilter; + })(); + + return RaiSettings; + })(); + + SafetySettings.PromptSecuritySettings = (function() { + + /** + * Properties of a PromptSecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @interface IPromptSecuritySettings + * @property {boolean|null} [enablePromptSecurity] PromptSecuritySettings enablePromptSecurity + */ + + /** + * Constructs a new PromptSecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings + * @classdesc Represents a PromptSecuritySettings. + * @implements IPromptSecuritySettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings=} [properties] Properties to set + */ + function PromptSecuritySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptSecuritySettings enablePromptSecurity. + * @member {boolean} enablePromptSecurity + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @instance + */ + PromptSecuritySettings.prototype.enablePromptSecurity = false; + + /** + * Creates a new PromptSecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings} PromptSecuritySettings instance + */ + PromptSecuritySettings.create = function create(properties) { + return new PromptSecuritySettings(properties); + }; + + /** + * Encodes the specified PromptSecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings} message PromptSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptSecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePromptSecurity != null && Object.hasOwnProperty.call(message, "enablePromptSecurity")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePromptSecurity); + return writer; + }; + + /** + * Encodes the specified PromptSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.IPromptSecuritySettings} message PromptSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptSecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings} PromptSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptSecuritySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enablePromptSecurity = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PromptSecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings} PromptSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptSecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptSecuritySettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptSecuritySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enablePromptSecurity != null && message.hasOwnProperty("enablePromptSecurity")) + if (typeof message.enablePromptSecurity !== "boolean") + return "enablePromptSecurity: boolean expected"; + return null; + }; + + /** + * Creates a PromptSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings} PromptSecuritySettings + */ + PromptSecuritySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings(); + if (object.enablePromptSecurity != null) + message.enablePromptSecurity = Boolean(object.enablePromptSecurity); + return message; + }; + + /** + * Creates a plain object from a PromptSecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings} message PromptSecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptSecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enablePromptSecurity = false; + if (message.enablePromptSecurity != null && message.hasOwnProperty("enablePromptSecurity")) + object.enablePromptSecurity = message.enablePromptSecurity; + return object; + }; + + /** + * Converts this PromptSecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @instance + * @returns {Object.} JSON object + */ + PromptSecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptSecuritySettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptSecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SafetySettings.PromptSecuritySettings"; + }; + + return PromptSecuritySettings; + })(); + + return SafetySettings; + })(); + + v3beta1.Changelogs = (function() { + + /** + * Constructs a new Changelogs service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Changelogs + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Changelogs(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Changelogs.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Changelogs; + + /** + * Creates new Changelogs service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelogs + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Changelogs} RPC service. Useful where requests and/or responses are streamed. + */ + Changelogs.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Changelogs|listChangelogs}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelogs + * @typedef ListChangelogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse} [response] ListChangelogsResponse + */ + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Changelogs.ListChangelogsCallback} callback Node-style callback called with the error, if any, and ListChangelogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Changelogs.prototype.listChangelogs = function listChangelogs(request, callback) { + return this.rpcCall(listChangelogs, $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse, request, callback); + }, "name", { value: "ListChangelogs" }); + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Changelogs|getChangelog}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelogs + * @typedef GetChangelogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Changelog} [response] Changelog + */ + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Changelogs.GetChangelogCallback} callback Node-style callback called with the error, if any, and Changelog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Changelogs.prototype.getChangelog = function getChangelog(request, callback) { + return this.rpcCall(getChangelog, $root.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest, $root.google.cloud.dialogflow.cx.v3beta1.Changelog, request, callback); + }, "name", { value: "GetChangelog" }); + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelogs + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Changelogs; + })(); + + v3beta1.ListChangelogsRequest = (function() { + + /** + * Properties of a ListChangelogsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListChangelogsRequest + * @property {string|null} [parent] ListChangelogsRequest parent + * @property {string|null} [filter] ListChangelogsRequest filter + * @property {number|null} [pageSize] ListChangelogsRequest pageSize + * @property {string|null} [pageToken] ListChangelogsRequest pageToken + */ + + /** + * Constructs a new ListChangelogsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListChangelogsRequest. + * @implements IListChangelogsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest=} [properties] Properties to set + */ + function ListChangelogsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.parent = ""; + + /** + * ListChangelogsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.filter = ""; + + /** + * ListChangelogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageSize = 0; + + /** + * ListChangelogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest} ListChangelogsRequest instance + */ + ListChangelogsRequest.create = function create(properties) { + return new ListChangelogsRequest(properties); + }; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.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"; + return null; + }; + + /** + * Creates a ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest} ListChangelogsRequest + */ + ListChangelogsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest} message ListChangelogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListChangelogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest"; + }; + + return ListChangelogsRequest; + })(); + + v3beta1.ListChangelogsResponse = (function() { + + /** + * Properties of a ListChangelogsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListChangelogsResponse + * @property {Array.|null} [changelogs] ListChangelogsResponse changelogs + * @property {string|null} [nextPageToken] ListChangelogsResponse nextPageToken + */ + + /** + * Constructs a new ListChangelogsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListChangelogsResponse. + * @implements IListChangelogsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse=} [properties] Properties to set + */ + function ListChangelogsResponse(properties) { + this.changelogs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsResponse changelogs. + * @member {Array.} changelogs + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.changelogs = $util.emptyArray; + + /** + * ListChangelogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse} ListChangelogsResponse instance + */ + ListChangelogsResponse.create = function create(properties) { + return new ListChangelogsResponse(properties); + }; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.changelogs != null && message.changelogs.length) + for (var i = 0; i < message.changelogs.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Changelog.encode(message.changelogs[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 ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.changelogs && message.changelogs.length)) + message.changelogs = []; + message.changelogs.push($root.google.cloud.dialogflow.cx.v3beta1.Changelog.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.changelogs != null && message.hasOwnProperty("changelogs")) { + if (!Array.isArray(message.changelogs)) + return "changelogs: array expected"; + for (var i = 0; i < message.changelogs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Changelog.verify(message.changelogs[i], long + 1); + if (error) + return "changelogs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse} ListChangelogsResponse + */ + ListChangelogsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse(); + if (object.changelogs) { + if (!Array.isArray(object.changelogs)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse.changelogs: array expected"); + message.changelogs = []; + for (var i = 0; i < object.changelogs.length; ++i) { + if (typeof object.changelogs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse.changelogs: object expected"); + message.changelogs[i] = $root.google.cloud.dialogflow.cx.v3beta1.Changelog.fromObject(object.changelogs[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse} message ListChangelogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.changelogs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.changelogs && message.changelogs.length) { + object.changelogs = []; + for (var j = 0; j < message.changelogs.length; ++j) + object.changelogs[j] = $root.google.cloud.dialogflow.cx.v3beta1.Changelog.toObject(message.changelogs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListChangelogsResponse"; + }; + + return ListChangelogsResponse; + })(); + + v3beta1.GetChangelogRequest = (function() { + + /** + * Properties of a GetChangelogRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetChangelogRequest + * @property {string|null} [name] GetChangelogRequest name + */ + + /** + * Constructs a new GetChangelogRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetChangelogRequest. + * @implements IGetChangelogRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest=} [properties] Properties to set + */ + function GetChangelogRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChangelogRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @instance + */ + GetChangelogRequest.prototype.name = ""; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest} GetChangelogRequest instance + */ + GetChangelogRequest.create = function create(properties) { + return new GetChangelogRequest(properties); + }; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.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 GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChangelogRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChangelogRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest} GetChangelogRequest + */ + GetChangelogRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest} message GetChangelogRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChangelogRequest.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 GetChangelogRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @instance + * @returns {Object.} JSON object + */ + GetChangelogRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChangelogRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChangelogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest"; + }; + + return GetChangelogRequest; + })(); + + v3beta1.Changelog = (function() { + + /** + * Properties of a Changelog. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IChangelog + * @property {string|null} [name] Changelog name + * @property {string|null} [userEmail] Changelog userEmail + * @property {string|null} [displayName] Changelog displayName + * @property {string|null} [action] Changelog action + * @property {string|null} [type] Changelog type + * @property {string|null} [resource] Changelog resource + * @property {google.protobuf.ITimestamp|null} [createTime] Changelog createTime + * @property {string|null} [languageCode] Changelog languageCode + */ + + /** + * Constructs a new Changelog. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Changelog. + * @implements IChangelog + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IChangelog=} [properties] Properties to set + */ + function Changelog(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Changelog name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.name = ""; + + /** + * Changelog userEmail. + * @member {string} userEmail + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.userEmail = ""; + + /** + * Changelog displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.displayName = ""; + + /** + * Changelog action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.action = ""; + + /** + * Changelog type. + * @member {string} type + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.type = ""; + + /** + * Changelog resource. + * @member {string} resource + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.resource = ""; + + /** + * Changelog createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.createTime = null; + + /** + * Changelog languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + */ + Changelog.prototype.languageCode = ""; + + /** + * Creates a new Changelog instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IChangelog=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Changelog} Changelog instance + */ + Changelog.create = function create(properties) { + return new Changelog(properties); + }; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Changelog.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.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.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userEmail); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.type); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.action); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Changelog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Changelog(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userEmail = reader.string(); + break; + } + case 7: { + message.displayName = reader.string(); + break; + } + case 11: { + message.action = reader.string(); + break; + } + case 8: { + message.type = reader.string(); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Changelog message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Changelog.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + if (!$util.isString(message.userEmail)) + return "userEmail: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Changelog} Changelog + */ + Changelog.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Changelog) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Changelog(); + if (object.name != null) + message.name = String(object.name); + if (object.userEmail != null) + message.userEmail = String(object.userEmail); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.action != null) + message.action = String(object.action); + if (object.type != null) + message.type = String(object.type); + if (object.resource != null) + message.resource = String(object.resource); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Changelog.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Changelog} message Changelog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Changelog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.userEmail = ""; + object.resource = ""; + object.createTime = null; + object.displayName = ""; + object.type = ""; + object.action = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + object.userEmail = message.userEmail; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Changelog to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @instance + * @returns {Object.} JSON object + */ + Changelog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Changelog + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Changelog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Changelog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Changelog"; + }; + + return Changelog; + })(); + + v3beta1.CodeBlock = (function() { + + /** + * Properties of a CodeBlock. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICodeBlock + * @property {string|null} [code] CodeBlock code + */ + + /** + * Constructs a new CodeBlock. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CodeBlock. + * @implements ICodeBlock + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICodeBlock=} [properties] Properties to set + */ + function CodeBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeBlock code. + * @member {string} code + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @instance + */ + CodeBlock.prototype.code = ""; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICodeBlock=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CodeBlock} CodeBlock instance + */ + CodeBlock.create = function create(properties) { + return new CodeBlock(properties); + }; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CodeBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); + return writer; + }; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CodeBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeBlock message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeBlock.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; + return null; + }; + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CodeBlock} CodeBlock + */ + CodeBlock.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock(); + if (object.code != null) + message.code = String(object.code); + return message; + }; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CodeBlock} message CodeBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.code = ""; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + return object; + }; + + /** + * Converts this CodeBlock to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @instance + * @returns {Object.} JSON object + */ + CodeBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeBlock + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CodeBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CodeBlock"; + }; + + return CodeBlock; + })(); + + v3beta1.ConversationHistory = (function() { + + /** + * Constructs a new ConversationHistory service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ConversationHistory + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ConversationHistory(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ConversationHistory.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ConversationHistory; + + /** + * Creates new ConversationHistory service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ConversationHistory} RPC service. Useful where requests and/or responses are streamed. + */ + ConversationHistory.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.ConversationHistory|listConversations}. + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @typedef ListConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse} [response] ListConversationsResponse + */ + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest} request ListConversationsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationHistory.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConversationHistory.prototype.listConversations = function listConversations(request, callback) { + return this.rpcCall(listConversations, $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse, request, callback); + }, "name", { value: "ListConversations" }); + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest} request ListConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.ConversationHistory|getConversation}. + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @typedef GetConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation} [response] Conversation + */ + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest} request GetConversationRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationHistory.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConversationHistory.prototype.getConversation = function getConversation(request, callback) { + return this.rpcCall(getConversation, $root.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest, $root.google.cloud.dialogflow.cx.v3beta1.Conversation, request, callback); + }, "name", { value: "GetConversation" }); + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest} request GetConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.ConversationHistory|deleteConversation}. + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @typedef DeleteConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationHistory.DeleteConversationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConversationHistory.prototype.deleteConversation = function deleteConversation(request, callback) { + return this.rpcCall(deleteConversation, $root.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteConversation" }); + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationHistory + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ConversationHistory; + })(); + + v3beta1.GetConversationRequest = (function() { + + /** + * Properties of a GetConversationRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetConversationRequest + * @property {string|null} [name] GetConversationRequest name + */ + + /** + * Constructs a new GetConversationRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetConversationRequest. + * @implements IGetConversationRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest=} [properties] Properties to set + */ + function GetConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConversationRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.name = ""; + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetConversationRequest} GetConversationRequest instance + */ + GetConversationRequest.create = function create(properties) { + return new GetConversationRequest(properties); + }; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.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 GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConversationRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConversationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetConversationRequest} GetConversationRequest + */ + GetConversationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetConversationRequest} message GetConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConversationRequest.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 GetConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @instance + * @returns {Object.} JSON object + */ + GetConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConversationRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetConversationRequest"; + }; + + return GetConversationRequest; + })(); + + v3beta1.DeleteConversationRequest = (function() { + + /** + * Properties of a DeleteConversationRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteConversationRequest + * @property {string|null} [name] DeleteConversationRequest name + */ + + /** + * Constructs a new DeleteConversationRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteConversationRequest. + * @implements IDeleteConversationRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest=} [properties] Properties to set + */ + function DeleteConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteConversationRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @instance + */ + DeleteConversationRequest.prototype.name = ""; + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest} DeleteConversationRequest instance + */ + DeleteConversationRequest.create = function create(properties) { + return new DeleteConversationRequest(properties); + }; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.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 DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConversationRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConversationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest} DeleteConversationRequest + */ + DeleteConversationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest} message DeleteConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConversationRequest.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 DeleteConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteConversationRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest"; + }; + + return DeleteConversationRequest; + })(); + + v3beta1.ListConversationsRequest = (function() { + + /** + * Properties of a ListConversationsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListConversationsRequest + * @property {string|null} [parent] ListConversationsRequest parent + * @property {string|null} [filter] ListConversationsRequest filter + * @property {number|null} [pageSize] ListConversationsRequest pageSize + * @property {string|null} [pageToken] ListConversationsRequest pageToken + */ + + /** + * Constructs a new ListConversationsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListConversationsRequest. + * @implements IListConversationsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest=} [properties] Properties to set + */ + function ListConversationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.parent = ""; + + /** + * ListConversationsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.filter = ""; + + /** + * ListConversationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageSize = 0; + + /** + * ListConversationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest} ListConversationsRequest instance + */ + ListConversationsRequest.create = function create(properties) { + return new ListConversationsRequest(properties); + }; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.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"; + return null; + }; + + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest} ListConversationsRequest + */ + ListConversationsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest} message ListConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest"; + }; + + return ListConversationsRequest; + })(); + + v3beta1.ListConversationsResponse = (function() { + + /** + * Properties of a ListConversationsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListConversationsResponse + * @property {Array.|null} [conversations] ListConversationsResponse conversations + * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken + */ + + /** + * Constructs a new ListConversationsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListConversationsResponse. + * @implements IListConversationsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse=} [properties] Properties to set + */ + function ListConversationsResponse(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsResponse conversations. + * @member {Array.} conversations + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.conversations = $util.emptyArray; + + /** + * ListConversationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse} ListConversationsResponse instance + */ + ListConversationsResponse.create = function create(properties) { + return new ListConversationsResponse(properties); + }; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Conversation.encode(message.conversations[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 ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push($root.google.cloud.dialogflow.cx.v3beta1.Conversation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.verify(message.conversations[i], long + 1); + if (error) + return "conversations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse} ListConversationsResponse + */ + ListConversationsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) { + if (typeof object.conversations[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse.conversations: object expected"); + message.conversations[i] = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.fromObject(object.conversations[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse} message ListConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.toObject(message.conversations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListConversationsResponse"; + }; + + return ListConversationsResponse; + })(); + + v3beta1.Conversation = (function() { + + /** + * Properties of a Conversation. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IConversation + * @property {string|null} [name] Conversation name + * @property {google.cloud.dialogflow.cx.v3beta1.Conversation.Type|null} [type] Conversation type + * @property {string|null} [languageCode] Conversation languageCode + * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime + * @property {google.protobuf.IDuration|null} [duration] Conversation duration + * @property {google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics|null} [metrics] Conversation metrics + * @property {Array.|null} [intents] Conversation intents + * @property {Array.|null} [flows] Conversation flows + * @property {Array.|null} [pages] Conversation pages + * @property {Array.|null} [interactions] Conversation interactions + * @property {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null} [environment] Conversation environment + * @property {Object.|null} [flowVersions] Conversation flowVersions + */ + + /** + * Constructs a new Conversation. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Conversation. + * @implements IConversation + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IConversation=} [properties] Properties to set + */ + function Conversation(properties) { + this.intents = []; + this.flows = []; + this.pages = []; + this.interactions = []; + this.flowVersions = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Conversation name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.name = ""; + + /** + * Conversation type. + * @member {google.cloud.dialogflow.cx.v3beta1.Conversation.Type} type + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.type = 0; + + /** + * Conversation languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.languageCode = ""; + + /** + * Conversation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.startTime = null; + + /** + * Conversation duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.duration = null; + + /** + * Conversation metrics. + * @member {google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics|null|undefined} metrics + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.metrics = null; + + /** + * Conversation intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.intents = $util.emptyArray; + + /** + * Conversation flows. + * @member {Array.} flows + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.flows = $util.emptyArray; + + /** + * Conversation pages. + * @member {Array.} pages + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.pages = $util.emptyArray; + + /** + * Conversation interactions. + * @member {Array.} interactions + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.interactions = $util.emptyArray; + + /** + * Conversation environment. + * @member {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.environment = null; + + /** + * Conversation flowVersions. + * @member {Object.} flowVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + */ + Conversation.prototype.flowVersions = $util.emptyObject; + + /** + * Creates a new Conversation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IConversation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation} Conversation instance + */ + Conversation.create = function create(properties) { + return new Conversation(properties); + }; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.encode(message.metrics, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.encode(message.intents[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.flows != null && message.flows.length) + for (var i = 0; i < message.flows.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Flow.encode(message.flows[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.pages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.interactions != null && message.interactions.length) + for (var i = 0; i < message.interactions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.encode(message.interactions[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.encode(message.environment, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.flowVersions != null && Object.hasOwnProperty.call(message, "flowVersions")) + for (var keys = Object.keys(message.flowVersions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.flowVersions[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.metrics = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.cx.v3beta1.Intent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + if (!(message.flows && message.flows.length)) + message.flows = []; + message.flows.push($root.google.cloud.dialogflow.cx.v3beta1.Flow.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 9: { + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.interactions && message.interactions.length)) + message.interactions = []; + message.interactions.push($root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 11: { + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + if (message.flowVersions === $util.emptyObject) + message.flowVersions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.flowVersions, key); + message.flowVersions[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Conversation message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Conversation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration, long + 1); + if (error) + return "duration." + error; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.verify(message.metrics, long + 1); + if (error) + return "metrics." + error; + } + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.verify(message.intents[i], long + 1); + if (error) + return "intents." + error; + } + } + if (message.flows != null && message.hasOwnProperty("flows")) { + if (!Array.isArray(message.flows)) + return "flows: array expected"; + for (var i = 0; i < message.flows.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Flow.verify(message.flows[i], long + 1); + if (error) + return "flows." + error; + } + } + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.pages[i], long + 1); + if (error) + return "pages." + error; + } + } + if (message.interactions != null && message.hasOwnProperty("interactions")) { + if (!Array.isArray(message.interactions)) + return "interactions: array expected"; + for (var i = 0; i < message.interactions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.verify(message.interactions[i], long + 1); + if (error) + return "interactions." + error; + } + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.verify(message.environment, long + 1); + if (error) + return "environment." + error; + } + if (message.flowVersions != null && message.hasOwnProperty("flowVersions")) { + if (!$util.isObject(message.flowVersions)) + return "flowVersions: object expected"; + var key = Object.keys(message.flowVersions); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.flowVersions[key[i]]) && !(message.flowVersions[key[i]] && $util.isInteger(message.flowVersions[key[i]].low) && $util.isInteger(message.flowVersions[key[i]].high))) + return "flowVersions: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation} Conversation + */ + Conversation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Conversation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "AUDIO": + case 1: + message.type = 1; + break; + case "TEXT": + case 2: + message.type = 2; + break; + case "UNDETERMINED": + case 3: + message.type = 3; + break; + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration, long + 1); + } + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.metrics: object expected"); + message.metrics = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.fromObject(object.metrics, long + 1); + } + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.fromObject(object.intents[i], long + 1); + } + } + if (object.flows) { + if (!Array.isArray(object.flows)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.flows: array expected"); + message.flows = []; + for (var i = 0; i < object.flows.length; ++i) { + if (typeof object.flows[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.flows: object expected"); + message.flows[i] = $root.google.cloud.dialogflow.cx.v3beta1.Flow.fromObject(object.flows[i], long + 1); + } + } + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.pages: object expected"); + message.pages[i] = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.pages[i], long + 1); + } + } + if (object.interactions) { + if (!Array.isArray(object.interactions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.interactions: array expected"); + message.interactions = []; + for (var i = 0; i < object.interactions.length; ++i) { + if (typeof object.interactions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.interactions: object expected"); + message.interactions[i] = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.fromObject(object.interactions[i], long + 1); + } + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.environment: object expected"); + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.fromObject(object.environment, long + 1); + } + if (object.flowVersions) { + if (typeof object.flowVersions !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.flowVersions: object expected"); + message.flowVersions = {}; + for (var keys = Object.keys(object.flowVersions), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.flowVersions, keys[i]); + if ($util.Long) + (message.flowVersions[keys[i]] = $util.Long.fromValue(object.flowVersions[keys[i]])).unsigned = false; + else if (typeof object.flowVersions[keys[i]] === "string") + message.flowVersions[keys[i]] = parseInt(object.flowVersions[keys[i]], 10); + else if (typeof object.flowVersions[keys[i]] === "number") + message.flowVersions[keys[i]] = object.flowVersions[keys[i]]; + else if (typeof object.flowVersions[keys[i]] === "object") + message.flowVersions[keys[i]] = new $util.LongBits(object.flowVersions[keys[i]].low >>> 0, object.flowVersions[keys[i]].high >>> 0).toNumber(); + } + } + return message; + }; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation} message Conversation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Conversation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.intents = []; + object.flows = []; + object.pages = []; + object.interactions = []; + } + if (options.objects || options.defaults) + object.flowVersions = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.languageCode = ""; + object.startTime = null; + object.duration = null; + object.metrics = null; + object.environment = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Type[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Type[message.type] : message.type; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.toObject(message.metrics, options); + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.toObject(message.intents[j], options); + } + if (message.flows && message.flows.length) { + object.flows = []; + for (var j = 0; j < message.flows.length; ++j) + object.flows[j] = $root.google.cloud.dialogflow.cx.v3beta1.Flow.toObject(message.flows[j], options); + } + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.pages[j], options); + } + if (message.interactions && message.interactions.length) { + object.interactions = []; + for (var j = 0; j < message.interactions.length; ++j) + object.interactions[j] = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.toObject(message.interactions[j], options); + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.toObject(message.environment, options); + var keys2; + if (message.flowVersions && (keys2 = Object.keys(message.flowVersions)).length) { + object.flowVersions = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.flowVersions, keys2[j]); + if (typeof message.flowVersions[keys2[j]] === "number") + object.flowVersions[keys2[j]] = options.longs === String ? String(message.flowVersions[keys2[j]]) : message.flowVersions[keys2[j]]; + else + object.flowVersions[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.flowVersions[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.flowVersions[keys2[j]].low >>> 0, message.flowVersions[keys2[j]].high >>> 0).toNumber() : message.flowVersions[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this Conversation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @instance + * @returns {Object.} JSON object + */ + Conversation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Conversation + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Conversation"; + }; + + /** + * Type enum. + * @name google.cloud.dialogflow.cx.v3beta1.Conversation.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} AUDIO=1 AUDIO value + * @property {number} TEXT=2 TEXT value + * @property {number} UNDETERMINED=3 UNDETERMINED value + */ + Conversation.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO"] = 1; + values[valuesById[2] = "TEXT"] = 2; + values[valuesById[3] = "UNDETERMINED"] = 3; + return values; + })(); + + Conversation.Metrics = (function() { + + /** + * Properties of a Metrics. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @interface IMetrics + * @property {number|null} [interactionCount] Metrics interactionCount + * @property {google.protobuf.IDuration|null} [inputAudioDuration] Metrics inputAudioDuration + * @property {google.protobuf.IDuration|null} [outputAudioDuration] Metrics outputAudioDuration + * @property {google.protobuf.IDuration|null} [maxWebhookLatency] Metrics maxWebhookLatency + * @property {boolean|null} [hasEndInteraction] Metrics hasEndInteraction + * @property {boolean|null} [hasLiveAgentHandoff] Metrics hasLiveAgentHandoff + * @property {number|null} [averageMatchConfidence] Metrics averageMatchConfidence + * @property {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount|null} [queryInputCount] Metrics queryInputCount + * @property {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount|null} [matchTypeCount] Metrics matchTypeCount + */ + + /** + * Constructs a new Metrics. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @classdesc Represents a Metrics. + * @implements IMetrics + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics=} [properties] Properties to set + */ + function Metrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metrics interactionCount. + * @member {number} interactionCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.interactionCount = 0; + + /** + * Metrics inputAudioDuration. + * @member {google.protobuf.IDuration|null|undefined} inputAudioDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.inputAudioDuration = null; + + /** + * Metrics outputAudioDuration. + * @member {google.protobuf.IDuration|null|undefined} outputAudioDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.outputAudioDuration = null; + + /** + * Metrics maxWebhookLatency. + * @member {google.protobuf.IDuration|null|undefined} maxWebhookLatency + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.maxWebhookLatency = null; + + /** + * Metrics hasEndInteraction. + * @member {boolean} hasEndInteraction + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.hasEndInteraction = false; + + /** + * Metrics hasLiveAgentHandoff. + * @member {boolean} hasLiveAgentHandoff + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.hasLiveAgentHandoff = false; + + /** + * Metrics averageMatchConfidence. + * @member {number} averageMatchConfidence + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.averageMatchConfidence = 0; + + /** + * Metrics queryInputCount. + * @member {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount|null|undefined} queryInputCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.queryInputCount = null; + + /** + * Metrics matchTypeCount. + * @member {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount|null|undefined} matchTypeCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + */ + Metrics.prototype.matchTypeCount = null; + + /** + * Creates a new Metrics instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics} Metrics instance + */ + Metrics.create = function create(properties) { + return new Metrics(properties); + }; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interactionCount != null && Object.hasOwnProperty.call(message, "interactionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionCount); + if (message.inputAudioDuration != null && Object.hasOwnProperty.call(message, "inputAudioDuration")) + $root.google.protobuf.Duration.encode(message.inputAudioDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudioDuration != null && Object.hasOwnProperty.call(message, "outputAudioDuration")) + $root.google.protobuf.Duration.encode(message.outputAudioDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxWebhookLatency != null && Object.hasOwnProperty.call(message, "maxWebhookLatency")) + $root.google.protobuf.Duration.encode(message.maxWebhookLatency, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hasEndInteraction != null && Object.hasOwnProperty.call(message, "hasEndInteraction")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.hasEndInteraction); + if (message.hasLiveAgentHandoff != null && Object.hasOwnProperty.call(message, "hasLiveAgentHandoff")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.hasLiveAgentHandoff); + if (message.averageMatchConfidence != null && Object.hasOwnProperty.call(message, "averageMatchConfidence")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.averageMatchConfidence); + if (message.queryInputCount != null && Object.hasOwnProperty.call(message, "queryInputCount")) + $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.encode(message.queryInputCount, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.matchTypeCount != null && Object.hasOwnProperty.call(message, "matchTypeCount")) + $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.encode(message.matchTypeCount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interactionCount = reader.int32(); + break; + } + case 2: { + message.inputAudioDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.outputAudioDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.maxWebhookLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.hasEndInteraction = reader.bool(); + break; + } + case 6: { + message.hasLiveAgentHandoff = reader.bool(); + break; + } + case 7: { + message.averageMatchConfidence = reader.float(); + break; + } + case 8: { + message.queryInputCount = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.matchTypeCount = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metrics message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.interactionCount != null && message.hasOwnProperty("interactionCount")) + if (!$util.isInteger(message.interactionCount)) + return "interactionCount: integer expected"; + if (message.inputAudioDuration != null && message.hasOwnProperty("inputAudioDuration")) { + var error = $root.google.protobuf.Duration.verify(message.inputAudioDuration, long + 1); + if (error) + return "inputAudioDuration." + error; + } + if (message.outputAudioDuration != null && message.hasOwnProperty("outputAudioDuration")) { + var error = $root.google.protobuf.Duration.verify(message.outputAudioDuration, long + 1); + if (error) + return "outputAudioDuration." + error; + } + if (message.maxWebhookLatency != null && message.hasOwnProperty("maxWebhookLatency")) { + var error = $root.google.protobuf.Duration.verify(message.maxWebhookLatency, long + 1); + if (error) + return "maxWebhookLatency." + error; + } + if (message.hasEndInteraction != null && message.hasOwnProperty("hasEndInteraction")) + if (typeof message.hasEndInteraction !== "boolean") + return "hasEndInteraction: boolean expected"; + if (message.hasLiveAgentHandoff != null && message.hasOwnProperty("hasLiveAgentHandoff")) + if (typeof message.hasLiveAgentHandoff !== "boolean") + return "hasLiveAgentHandoff: boolean expected"; + if (message.averageMatchConfidence != null && message.hasOwnProperty("averageMatchConfidence")) + if (typeof message.averageMatchConfidence !== "number") + return "averageMatchConfidence: number expected"; + if (message.queryInputCount != null && message.hasOwnProperty("queryInputCount")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.verify(message.queryInputCount, long + 1); + if (error) + return "queryInputCount." + error; + } + if (message.matchTypeCount != null && message.hasOwnProperty("matchTypeCount")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.verify(message.matchTypeCount, long + 1); + if (error) + return "matchTypeCount." + error; + } + return null; + }; + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics} Metrics + */ + Metrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics(); + if (object.interactionCount != null) + message.interactionCount = object.interactionCount | 0; + if (object.inputAudioDuration != null) { + if (typeof object.inputAudioDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.inputAudioDuration: object expected"); + message.inputAudioDuration = $root.google.protobuf.Duration.fromObject(object.inputAudioDuration, long + 1); + } + if (object.outputAudioDuration != null) { + if (typeof object.outputAudioDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.outputAudioDuration: object expected"); + message.outputAudioDuration = $root.google.protobuf.Duration.fromObject(object.outputAudioDuration, long + 1); + } + if (object.maxWebhookLatency != null) { + if (typeof object.maxWebhookLatency !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.maxWebhookLatency: object expected"); + message.maxWebhookLatency = $root.google.protobuf.Duration.fromObject(object.maxWebhookLatency, long + 1); + } + if (object.hasEndInteraction != null) + message.hasEndInteraction = Boolean(object.hasEndInteraction); + if (object.hasLiveAgentHandoff != null) + message.hasLiveAgentHandoff = Boolean(object.hasLiveAgentHandoff); + if (object.averageMatchConfidence != null) + message.averageMatchConfidence = Number(object.averageMatchConfidence); + if (object.queryInputCount != null) { + if (typeof object.queryInputCount !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.queryInputCount: object expected"); + message.queryInputCount = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.fromObject(object.queryInputCount, long + 1); + } + if (object.matchTypeCount != null) { + if (typeof object.matchTypeCount !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.matchTypeCount: object expected"); + message.matchTypeCount = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.fromObject(object.matchTypeCount, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics} message Metrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interactionCount = 0; + object.inputAudioDuration = null; + object.outputAudioDuration = null; + object.maxWebhookLatency = null; + object.hasEndInteraction = false; + object.hasLiveAgentHandoff = false; + object.averageMatchConfidence = 0; + object.queryInputCount = null; + object.matchTypeCount = null; + } + if (message.interactionCount != null && message.hasOwnProperty("interactionCount")) + object.interactionCount = message.interactionCount; + if (message.inputAudioDuration != null && message.hasOwnProperty("inputAudioDuration")) + object.inputAudioDuration = $root.google.protobuf.Duration.toObject(message.inputAudioDuration, options); + if (message.outputAudioDuration != null && message.hasOwnProperty("outputAudioDuration")) + object.outputAudioDuration = $root.google.protobuf.Duration.toObject(message.outputAudioDuration, options); + if (message.maxWebhookLatency != null && message.hasOwnProperty("maxWebhookLatency")) + object.maxWebhookLatency = $root.google.protobuf.Duration.toObject(message.maxWebhookLatency, options); + if (message.hasEndInteraction != null && message.hasOwnProperty("hasEndInteraction")) + object.hasEndInteraction = message.hasEndInteraction; + if (message.hasLiveAgentHandoff != null && message.hasOwnProperty("hasLiveAgentHandoff")) + object.hasLiveAgentHandoff = message.hasLiveAgentHandoff; + if (message.averageMatchConfidence != null && message.hasOwnProperty("averageMatchConfidence")) + object.averageMatchConfidence = options.json && !isFinite(message.averageMatchConfidence) ? String(message.averageMatchConfidence) : message.averageMatchConfidence; + if (message.queryInputCount != null && message.hasOwnProperty("queryInputCount")) + object.queryInputCount = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.toObject(message.queryInputCount, options); + if (message.matchTypeCount != null && message.hasOwnProperty("matchTypeCount")) + object.matchTypeCount = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.toObject(message.matchTypeCount, options); + return object; + }; + + /** + * Converts this Metrics to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @instance + * @returns {Object.} JSON object + */ + Metrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metrics + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics"; + }; + + Metrics.QueryInputCount = (function() { + + /** + * Properties of a QueryInputCount. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @interface IQueryInputCount + * @property {number|null} [textCount] QueryInputCount textCount + * @property {number|null} [intentCount] QueryInputCount intentCount + * @property {number|null} [audioCount] QueryInputCount audioCount + * @property {number|null} [eventCount] QueryInputCount eventCount + * @property {number|null} [dtmfCount] QueryInputCount dtmfCount + */ + + /** + * Constructs a new QueryInputCount. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @classdesc Represents a QueryInputCount. + * @implements IQueryInputCount + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount=} [properties] Properties to set + */ + function QueryInputCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInputCount textCount. + * @member {number} textCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @instance + */ + QueryInputCount.prototype.textCount = 0; + + /** + * QueryInputCount intentCount. + * @member {number} intentCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @instance + */ + QueryInputCount.prototype.intentCount = 0; + + /** + * QueryInputCount audioCount. + * @member {number} audioCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @instance + */ + QueryInputCount.prototype.audioCount = 0; + + /** + * QueryInputCount eventCount. + * @member {number} eventCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @instance + */ + QueryInputCount.prototype.eventCount = 0; + + /** + * QueryInputCount dtmfCount. + * @member {number} dtmfCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @instance + */ + QueryInputCount.prototype.dtmfCount = 0; + + /** + * Creates a new QueryInputCount instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount} QueryInputCount instance + */ + QueryInputCount.create = function create(properties) { + return new QueryInputCount(properties); + }; + + /** + * Encodes the specified QueryInputCount message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount} message QueryInputCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInputCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textCount != null && Object.hasOwnProperty.call(message, "textCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.textCount); + if (message.intentCount != null && Object.hasOwnProperty.call(message, "intentCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intentCount); + if (message.audioCount != null && Object.hasOwnProperty.call(message, "audioCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.audioCount); + if (message.eventCount != null && Object.hasOwnProperty.call(message, "eventCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.eventCount); + if (message.dtmfCount != null && Object.hasOwnProperty.call(message, "dtmfCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.dtmfCount); + return writer; + }; + + /** + * Encodes the specified QueryInputCount message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IQueryInputCount} message QueryInputCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInputCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInputCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount} QueryInputCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInputCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textCount = reader.int32(); + break; + } + case 2: { + message.intentCount = reader.int32(); + break; + } + case 3: { + message.audioCount = reader.int32(); + break; + } + case 4: { + message.eventCount = reader.int32(); + break; + } + case 5: { + message.dtmfCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInputCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount} QueryInputCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInputCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInputCount message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInputCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.textCount != null && message.hasOwnProperty("textCount")) + if (!$util.isInteger(message.textCount)) + return "textCount: integer expected"; + if (message.intentCount != null && message.hasOwnProperty("intentCount")) + if (!$util.isInteger(message.intentCount)) + return "intentCount: integer expected"; + if (message.audioCount != null && message.hasOwnProperty("audioCount")) + if (!$util.isInteger(message.audioCount)) + return "audioCount: integer expected"; + if (message.eventCount != null && message.hasOwnProperty("eventCount")) + if (!$util.isInteger(message.eventCount)) + return "eventCount: integer expected"; + if (message.dtmfCount != null && message.hasOwnProperty("dtmfCount")) + if (!$util.isInteger(message.dtmfCount)) + return "dtmfCount: integer expected"; + return null; + }; + + /** + * Creates a QueryInputCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount} QueryInputCount + */ + QueryInputCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount(); + if (object.textCount != null) + message.textCount = object.textCount | 0; + if (object.intentCount != null) + message.intentCount = object.intentCount | 0; + if (object.audioCount != null) + message.audioCount = object.audioCount | 0; + if (object.eventCount != null) + message.eventCount = object.eventCount | 0; + if (object.dtmfCount != null) + message.dtmfCount = object.dtmfCount | 0; + return message; + }; + + /** + * Creates a plain object from a QueryInputCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount} message QueryInputCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInputCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textCount = 0; + object.intentCount = 0; + object.audioCount = 0; + object.eventCount = 0; + object.dtmfCount = 0; + } + if (message.textCount != null && message.hasOwnProperty("textCount")) + object.textCount = message.textCount; + if (message.intentCount != null && message.hasOwnProperty("intentCount")) + object.intentCount = message.intentCount; + if (message.audioCount != null && message.hasOwnProperty("audioCount")) + object.audioCount = message.audioCount; + if (message.eventCount != null && message.hasOwnProperty("eventCount")) + object.eventCount = message.eventCount; + if (message.dtmfCount != null && message.hasOwnProperty("dtmfCount")) + object.dtmfCount = message.dtmfCount; + return object; + }; + + /** + * Converts this QueryInputCount to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @instance + * @returns {Object.} JSON object + */ + QueryInputCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryInputCount + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInputCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.QueryInputCount"; + }; + + return QueryInputCount; + })(); + + Metrics.MatchTypeCount = (function() { + + /** + * Properties of a MatchTypeCount. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @interface IMatchTypeCount + * @property {number|null} [unspecifiedCount] MatchTypeCount unspecifiedCount + * @property {number|null} [intentCount] MatchTypeCount intentCount + * @property {number|null} [directIntentCount] MatchTypeCount directIntentCount + * @property {number|null} [parameterFillingCount] MatchTypeCount parameterFillingCount + * @property {number|null} [noMatchCount] MatchTypeCount noMatchCount + * @property {number|null} [noInputCount] MatchTypeCount noInputCount + * @property {number|null} [eventCount] MatchTypeCount eventCount + */ + + /** + * Constructs a new MatchTypeCount. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics + * @classdesc Represents a MatchTypeCount. + * @implements IMatchTypeCount + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount=} [properties] Properties to set + */ + function MatchTypeCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchTypeCount unspecifiedCount. + * @member {number} unspecifiedCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + */ + MatchTypeCount.prototype.unspecifiedCount = 0; + + /** + * MatchTypeCount intentCount. + * @member {number} intentCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + */ + MatchTypeCount.prototype.intentCount = 0; + + /** + * MatchTypeCount directIntentCount. + * @member {number} directIntentCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + */ + MatchTypeCount.prototype.directIntentCount = 0; + + /** + * MatchTypeCount parameterFillingCount. + * @member {number} parameterFillingCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + */ + MatchTypeCount.prototype.parameterFillingCount = 0; + + /** + * MatchTypeCount noMatchCount. + * @member {number} noMatchCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + */ + MatchTypeCount.prototype.noMatchCount = 0; + + /** + * MatchTypeCount noInputCount. + * @member {number} noInputCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + */ + MatchTypeCount.prototype.noInputCount = 0; + + /** + * MatchTypeCount eventCount. + * @member {number} eventCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + */ + MatchTypeCount.prototype.eventCount = 0; + + /** + * Creates a new MatchTypeCount instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount} MatchTypeCount instance + */ + MatchTypeCount.create = function create(properties) { + return new MatchTypeCount(properties); + }; + + /** + * Encodes the specified MatchTypeCount message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount} message MatchTypeCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchTypeCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unspecifiedCount != null && Object.hasOwnProperty.call(message, "unspecifiedCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.unspecifiedCount); + if (message.intentCount != null && Object.hasOwnProperty.call(message, "intentCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intentCount); + if (message.directIntentCount != null && Object.hasOwnProperty.call(message, "directIntentCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.directIntentCount); + if (message.parameterFillingCount != null && Object.hasOwnProperty.call(message, "parameterFillingCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.parameterFillingCount); + if (message.noMatchCount != null && Object.hasOwnProperty.call(message, "noMatchCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.noMatchCount); + if (message.noInputCount != null && Object.hasOwnProperty.call(message, "noInputCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.noInputCount); + if (message.eventCount != null && Object.hasOwnProperty.call(message, "eventCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.eventCount); + return writer; + }; + + /** + * Encodes the specified MatchTypeCount message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.IMatchTypeCount} message MatchTypeCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchTypeCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchTypeCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount} MatchTypeCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchTypeCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.unspecifiedCount = reader.int32(); + break; + } + case 2: { + message.intentCount = reader.int32(); + break; + } + case 3: { + message.directIntentCount = reader.int32(); + break; + } + case 4: { + message.parameterFillingCount = reader.int32(); + break; + } + case 5: { + message.noMatchCount = reader.int32(); + break; + } + case 6: { + message.noInputCount = reader.int32(); + break; + } + case 7: { + message.eventCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MatchTypeCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount} MatchTypeCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchTypeCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchTypeCount message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchTypeCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.unspecifiedCount != null && message.hasOwnProperty("unspecifiedCount")) + if (!$util.isInteger(message.unspecifiedCount)) + return "unspecifiedCount: integer expected"; + if (message.intentCount != null && message.hasOwnProperty("intentCount")) + if (!$util.isInteger(message.intentCount)) + return "intentCount: integer expected"; + if (message.directIntentCount != null && message.hasOwnProperty("directIntentCount")) + if (!$util.isInteger(message.directIntentCount)) + return "directIntentCount: integer expected"; + if (message.parameterFillingCount != null && message.hasOwnProperty("parameterFillingCount")) + if (!$util.isInteger(message.parameterFillingCount)) + return "parameterFillingCount: integer expected"; + if (message.noMatchCount != null && message.hasOwnProperty("noMatchCount")) + if (!$util.isInteger(message.noMatchCount)) + return "noMatchCount: integer expected"; + if (message.noInputCount != null && message.hasOwnProperty("noInputCount")) + if (!$util.isInteger(message.noInputCount)) + return "noInputCount: integer expected"; + if (message.eventCount != null && message.hasOwnProperty("eventCount")) + if (!$util.isInteger(message.eventCount)) + return "eventCount: integer expected"; + return null; + }; + + /** + * Creates a MatchTypeCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount} MatchTypeCount + */ + MatchTypeCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount(); + if (object.unspecifiedCount != null) + message.unspecifiedCount = object.unspecifiedCount | 0; + if (object.intentCount != null) + message.intentCount = object.intentCount | 0; + if (object.directIntentCount != null) + message.directIntentCount = object.directIntentCount | 0; + if (object.parameterFillingCount != null) + message.parameterFillingCount = object.parameterFillingCount | 0; + if (object.noMatchCount != null) + message.noMatchCount = object.noMatchCount | 0; + if (object.noInputCount != null) + message.noInputCount = object.noInputCount | 0; + if (object.eventCount != null) + message.eventCount = object.eventCount | 0; + return message; + }; + + /** + * Creates a plain object from a MatchTypeCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount} message MatchTypeCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchTypeCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unspecifiedCount = 0; + object.intentCount = 0; + object.directIntentCount = 0; + object.parameterFillingCount = 0; + object.noMatchCount = 0; + object.noInputCount = 0; + object.eventCount = 0; + } + if (message.unspecifiedCount != null && message.hasOwnProperty("unspecifiedCount")) + object.unspecifiedCount = message.unspecifiedCount; + if (message.intentCount != null && message.hasOwnProperty("intentCount")) + object.intentCount = message.intentCount; + if (message.directIntentCount != null && message.hasOwnProperty("directIntentCount")) + object.directIntentCount = message.directIntentCount; + if (message.parameterFillingCount != null && message.hasOwnProperty("parameterFillingCount")) + object.parameterFillingCount = message.parameterFillingCount; + if (message.noMatchCount != null && message.hasOwnProperty("noMatchCount")) + object.noMatchCount = message.noMatchCount; + if (message.noInputCount != null && message.hasOwnProperty("noInputCount")) + object.noInputCount = message.noInputCount; + if (message.eventCount != null && message.hasOwnProperty("eventCount")) + object.eventCount = message.eventCount; + return object; + }; + + /** + * Converts this MatchTypeCount to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @instance + * @returns {Object.} JSON object + */ + MatchTypeCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchTypeCount + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchTypeCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Conversation.Metrics.MatchTypeCount"; + }; + + return MatchTypeCount; + })(); + + return Metrics; + })(); + + Conversation.Interaction = (function() { + + /** + * Properties of an Interaction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @interface IInteraction + * @property {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest|null} [request] Interaction request + * @property {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null} [response] Interaction response + * @property {Array.|null} [partialResponses] Interaction partialResponses + * @property {string|null} [requestUtterances] Interaction requestUtterances + * @property {string|null} [responseUtterances] Interaction responseUtterances + * @property {google.protobuf.ITimestamp|null} [createTime] Interaction createTime + * @property {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null} [answerFeedback] Interaction answerFeedback + * @property {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition|null} [missingTransition] Interaction missingTransition + * @property {Array.|null} [stepMetrics] Interaction stepMetrics + */ + + /** + * Constructs a new Interaction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation + * @classdesc Represents an Interaction. + * @implements IInteraction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction=} [properties] Properties to set + */ + function Interaction(properties) { + this.partialResponses = []; + this.stepMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interaction request. + * @member {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest|null|undefined} request + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.request = null; + + /** + * Interaction response. + * @member {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null|undefined} response + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.response = null; + + /** + * Interaction partialResponses. + * @member {Array.} partialResponses + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.partialResponses = $util.emptyArray; + + /** + * Interaction requestUtterances. + * @member {string} requestUtterances + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.requestUtterances = ""; + + /** + * Interaction responseUtterances. + * @member {string} responseUtterances + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.responseUtterances = ""; + + /** + * Interaction createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.createTime = null; + + /** + * Interaction answerFeedback. + * @member {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null|undefined} answerFeedback + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.answerFeedback = null; + + /** + * Interaction missingTransition. + * @member {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition|null|undefined} missingTransition + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.missingTransition = null; + + /** + * Interaction stepMetrics. + * @member {Array.} stepMetrics + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + */ + Interaction.prototype.stepMetrics = $util.emptyArray; + + /** + * Creates a new Interaction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction} Interaction instance + */ + Interaction.create = function create(properties) { + return new Interaction(properties); + }; + + /** + * Encodes the specified Interaction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction} message Interaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interaction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partialResponses != null && message.partialResponses.length) + for (var i = 0; i < message.partialResponses.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.encode(message.partialResponses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestUtterances != null && Object.hasOwnProperty.call(message, "requestUtterances")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestUtterances); + if (message.responseUtterances != null && Object.hasOwnProperty.call(message, "responseUtterances")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.responseUtterances); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.answerFeedback != null && Object.hasOwnProperty.call(message, "answerFeedback")) + $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.encode(message.answerFeedback, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.missingTransition != null && Object.hasOwnProperty.call(message, "missingTransition")) + $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.encode(message.missingTransition, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.stepMetrics != null && message.stepMetrics.length) + for (var i = 0; i < message.stepMetrics.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.encode(message.stepMetrics[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Interaction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.IInteraction} message Interaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interaction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interaction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction} Interaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interaction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.request = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.response = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.partialResponses && message.partialResponses.length)) + message.partialResponses = []; + message.partialResponses.push($root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.requestUtterances = reader.string(); + break; + } + case 5: { + message.responseUtterances = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.answerFeedback = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.missingTransition = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.stepMetrics && message.stepMetrics.length)) + message.stepMetrics = []; + message.stepMetrics.push($root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Interaction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction} Interaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interaction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interaction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interaction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.verify(message.request, long + 1); + if (error) + return "request." + error; + } + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.verify(message.response, long + 1); + if (error) + return "response." + error; + } + if (message.partialResponses != null && message.hasOwnProperty("partialResponses")) { + if (!Array.isArray(message.partialResponses)) + return "partialResponses: array expected"; + for (var i = 0; i < message.partialResponses.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.verify(message.partialResponses[i], long + 1); + if (error) + return "partialResponses." + error; + } + } + if (message.requestUtterances != null && message.hasOwnProperty("requestUtterances")) + if (!$util.isString(message.requestUtterances)) + return "requestUtterances: string expected"; + if (message.responseUtterances != null && message.hasOwnProperty("responseUtterances")) + if (!$util.isString(message.responseUtterances)) + return "responseUtterances: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.verify(message.answerFeedback, long + 1); + if (error) + return "answerFeedback." + error; + } + if (message.missingTransition != null && message.hasOwnProperty("missingTransition")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.verify(message.missingTransition, long + 1); + if (error) + return "missingTransition." + error; + } + if (message.stepMetrics != null && message.hasOwnProperty("stepMetrics")) { + if (!Array.isArray(message.stepMetrics)) + return "stepMetrics: array expected"; + for (var i = 0; i < message.stepMetrics.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.verify(message.stepMetrics[i], long + 1); + if (error) + return "stepMetrics." + error; + } + } + return null; + }; + + /** + * Creates an Interaction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction} Interaction + */ + Interaction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction(); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.request: object expected"); + message.request = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.fromObject(object.request, long + 1); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.response: object expected"); + message.response = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.fromObject(object.response, long + 1); + } + if (object.partialResponses) { + if (!Array.isArray(object.partialResponses)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.partialResponses: array expected"); + message.partialResponses = []; + for (var i = 0; i < object.partialResponses.length; ++i) { + if (typeof object.partialResponses[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.partialResponses: object expected"); + message.partialResponses[i] = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.fromObject(object.partialResponses[i], long + 1); + } + } + if (object.requestUtterances != null) + message.requestUtterances = String(object.requestUtterances); + if (object.responseUtterances != null) + message.responseUtterances = String(object.responseUtterances); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.answerFeedback != null) { + if (typeof object.answerFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.answerFeedback: object expected"); + message.answerFeedback = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.fromObject(object.answerFeedback, long + 1); + } + if (object.missingTransition != null) { + if (typeof object.missingTransition !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.missingTransition: object expected"); + message.missingTransition = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.fromObject(object.missingTransition, long + 1); + } + if (object.stepMetrics) { + if (!Array.isArray(object.stepMetrics)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.stepMetrics: array expected"); + message.stepMetrics = []; + for (var i = 0; i < object.stepMetrics.length; ++i) { + if (typeof object.stepMetrics[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.stepMetrics: object expected"); + message.stepMetrics[i] = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.fromObject(object.stepMetrics[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an Interaction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction} message Interaction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interaction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.partialResponses = []; + object.stepMetrics = []; + } + if (options.defaults) { + object.request = null; + object.response = null; + object.requestUtterances = ""; + object.responseUtterances = ""; + object.createTime = null; + object.answerFeedback = null; + object.missingTransition = null; + } + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.toObject(message.request, options); + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.toObject(message.response, options); + if (message.partialResponses && message.partialResponses.length) { + object.partialResponses = []; + for (var j = 0; j < message.partialResponses.length; ++j) + object.partialResponses[j] = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.toObject(message.partialResponses[j], options); + } + if (message.requestUtterances != null && message.hasOwnProperty("requestUtterances")) + object.requestUtterances = message.requestUtterances; + if (message.responseUtterances != null && message.hasOwnProperty("responseUtterances")) + object.responseUtterances = message.responseUtterances; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) + object.answerFeedback = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.toObject(message.answerFeedback, options); + if (message.missingTransition != null && message.hasOwnProperty("missingTransition")) + object.missingTransition = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.toObject(message.missingTransition, options); + if (message.stepMetrics && message.stepMetrics.length) { + object.stepMetrics = []; + for (var j = 0; j < message.stepMetrics.length; ++j) + object.stepMetrics[j] = $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.toObject(message.stepMetrics[j], options); + } + return object; + }; + + /** + * Converts this Interaction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @instance + * @returns {Object.} JSON object + */ + Interaction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interaction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction"; + }; + + Interaction.MissingTransition = (function() { + + /** + * Properties of a MissingTransition. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @interface IMissingTransition + * @property {string|null} [intentDisplayName] MissingTransition intentDisplayName + * @property {number|null} [score] MissingTransition score + */ + + /** + * Constructs a new MissingTransition. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @classdesc Represents a MissingTransition. + * @implements IMissingTransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition=} [properties] Properties to set + */ + function MissingTransition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MissingTransition intentDisplayName. + * @member {string} intentDisplayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @instance + */ + MissingTransition.prototype.intentDisplayName = ""; + + /** + * MissingTransition score. + * @member {number} score + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @instance + */ + MissingTransition.prototype.score = 0; + + /** + * Creates a new MissingTransition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition} MissingTransition instance + */ + MissingTransition.create = function create(properties) { + return new MissingTransition(properties); + }; + + /** + * Encodes the specified MissingTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition} message MissingTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissingTransition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentDisplayName != null && Object.hasOwnProperty.call(message, "intentDisplayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intentDisplayName); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified MissingTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IMissingTransition} message MissingTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissingTransition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MissingTransition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition} MissingTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissingTransition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intentDisplayName = reader.string(); + break; + } + case 2: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MissingTransition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition} MissingTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissingTransition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MissingTransition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MissingTransition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intentDisplayName != null && message.hasOwnProperty("intentDisplayName")) + if (!$util.isString(message.intentDisplayName)) + return "intentDisplayName: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a MissingTransition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition} MissingTransition + */ + MissingTransition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition(); + if (object.intentDisplayName != null) + message.intentDisplayName = String(object.intentDisplayName); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a MissingTransition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition} message MissingTransition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MissingTransition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intentDisplayName = ""; + object.score = 0; + } + if (message.intentDisplayName != null && message.hasOwnProperty("intentDisplayName")) + object.intentDisplayName = message.intentDisplayName; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this MissingTransition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @instance + * @returns {Object.} JSON object + */ + MissingTransition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MissingTransition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MissingTransition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.MissingTransition"; + }; + + return MissingTransition; + })(); + + Interaction.StepMetrics = (function() { + + /** + * Properties of a StepMetrics. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @interface IStepMetrics + * @property {string|null} [name] StepMetrics name + * @property {google.protobuf.IDuration|null} [latency] StepMetrics latency + */ + + /** + * Constructs a new StepMetrics. + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction + * @classdesc Represents a StepMetrics. + * @implements IStepMetrics + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics=} [properties] Properties to set + */ + function StepMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StepMetrics name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @instance + */ + StepMetrics.prototype.name = ""; + + /** + * StepMetrics latency. + * @member {google.protobuf.IDuration|null|undefined} latency + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @instance + */ + StepMetrics.prototype.latency = null; + + /** + * Creates a new StepMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics} StepMetrics instance + */ + StepMetrics.create = function create(properties) { + return new StepMetrics(properties); + }; + + /** + * Encodes the specified StepMetrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics} message StepMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StepMetrics.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.latency != null && Object.hasOwnProperty.call(message, "latency")) + $root.google.protobuf.Duration.encode(message.latency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StepMetrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.IStepMetrics} message StepMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StepMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StepMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics} StepMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StepMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.latency = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StepMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics} StepMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StepMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StepMetrics message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StepMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.latency != null && message.hasOwnProperty("latency")) { + var error = $root.google.protobuf.Duration.verify(message.latency, long + 1); + if (error) + return "latency." + error; + } + return null; + }; + + /** + * Creates a StepMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics} StepMetrics + */ + StepMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics(); + if (object.name != null) + message.name = String(object.name); + if (object.latency != null) { + if (typeof object.latency !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics.latency: object expected"); + message.latency = $root.google.protobuf.Duration.fromObject(object.latency, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StepMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics} message StepMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StepMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.latency = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.latency != null && message.hasOwnProperty("latency")) + object.latency = $root.google.protobuf.Duration.toObject(message.latency, options); + return object; + }; + + /** + * Converts this StepMetrics to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @instance + * @returns {Object.} JSON object + */ + StepMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StepMetrics + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StepMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Conversation.Interaction.StepMetrics"; + }; + + return StepMetrics; + })(); + + return Interaction; + })(); + + return Conversation; + })(); + + v3beta1.Environments = (function() { + + /** + * Constructs a new Environments service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Environments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Environments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; + + /** + * Creates new Environments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Environments} RPC service. Useful where requests and/or responses are streamed. + */ + Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|listEnvironments}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef ListEnvironmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + */ + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { + return this.rpcCall(listEnvironments, $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse, request, callback); + }, "name", { value: "ListEnvironments" }); + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|getEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef GetEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Environment} [response] Environment + */ + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.getEnvironment = function getEnvironment(request, callback) { + return this.rpcCall(getEnvironment, $root.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Environment, request, callback); + }, "name", { value: "GetEnvironment" }); + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|createEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef CreateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.createEnvironment = function createEnvironment(request, callback) { + return this.rpcCall(createEnvironment, $root.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEnvironment" }); + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|updateEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef UpdateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.updateEnvironment = function updateEnvironment(request, callback) { + return this.rpcCall(updateEnvironment, $root.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEnvironment" }); + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|deleteEnvironment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef DeleteEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.deleteEnvironment = function deleteEnvironment(request, callback) { + return this.rpcCall(deleteEnvironment, $root.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEnvironment" }); + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|lookupEnvironmentHistory}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef LookupEnvironmentHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} [response] LookupEnvironmentHistoryResponse + */ + + /** + * Calls LookupEnvironmentHistory. + * @function lookupEnvironmentHistory + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest} request LookupEnvironmentHistoryRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistoryCallback} callback Node-style callback called with the error, if any, and LookupEnvironmentHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.lookupEnvironmentHistory = function lookupEnvironmentHistory(request, callback) { + return this.rpcCall(lookupEnvironmentHistory, $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest, $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse, request, callback); + }, "name", { value: "LookupEnvironmentHistory" }); + + /** + * Calls LookupEnvironmentHistory. + * @function lookupEnvironmentHistory + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest} request LookupEnvironmentHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|runContinuousTest}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef RunContinuousTestCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunContinuousTest. + * @function runContinuousTest + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest} request RunContinuousTestRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTestCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.runContinuousTest = function runContinuousTest(request, callback) { + return this.rpcCall(runContinuousTest, $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunContinuousTest" }); + + /** + * Calls RunContinuousTest. + * @function runContinuousTest + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest} request RunContinuousTestRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|listContinuousTestResults}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef ListContinuousTestResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse} [response] ListContinuousTestResultsResponse + */ + + /** + * Calls ListContinuousTestResults. + * @function listContinuousTestResults + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest} request ListContinuousTestResultsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.ListContinuousTestResultsCallback} callback Node-style callback called with the error, if any, and ListContinuousTestResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listContinuousTestResults = function listContinuousTestResults(request, callback) { + return this.rpcCall(listContinuousTestResults, $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse, request, callback); + }, "name", { value: "ListContinuousTestResults" }); + + /** + * Calls ListContinuousTestResults. + * @function listContinuousTestResults + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest} request ListContinuousTestResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Environments|deployFlow}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @typedef DeployFlowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployFlow. + * @function deployFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest} request DeployFlowRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Environments.DeployFlowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.deployFlow = function deployFlow(request, callback) { + return this.rpcCall(deployFlow, $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployFlow" }); + + /** + * Calls DeployFlow. + * @function deployFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest} request DeployFlowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Environments; + })(); + + v3beta1.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {string|null} [displayName] Environment displayName + * @property {string|null} [description] Environment description + * @property {Array.|null} [versionConfigs] Environment versionConfigs + * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + * @property {google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig|null} [testCasesConfig] Environment testCasesConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig|null} [webhookConfig] Environment webhookConfig + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.versionConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + */ + Environment.prototype.name = ""; + + /** + * Environment displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + */ + Environment.prototype.displayName = ""; + + /** + * Environment description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + */ + Environment.prototype.description = ""; + + /** + * Environment versionConfigs. + * @member {Array.} versionConfigs + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + */ + Environment.prototype.versionConfigs = $util.emptyArray; + + /** + * Environment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + */ + Environment.prototype.updateTime = null; + + /** + * Environment testCasesConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig|null|undefined} testCasesConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + */ + Environment.prototype.testCasesConfig = null; + + /** + * Environment webhookConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig|null|undefined} webhookConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + */ + Environment.prototype.webhookConfig = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.versionConfigs != null && message.versionConfigs.length) + for (var i = 0; i < message.versionConfigs.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.encode(message.versionConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.testCasesConfig != null && Object.hasOwnProperty.call(message, "testCasesConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.encode(message.testCasesConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.webhookConfig != null && Object.hasOwnProperty.call(message, "webhookConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.encode(message.webhookConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.versionConfigs && message.versionConfigs.length)) + message.versionConfigs = []; + message.versionConfigs.push($root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.testCasesConfig = $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.webhookConfig = $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.versionConfigs != null && message.hasOwnProperty("versionConfigs")) { + if (!Array.isArray(message.versionConfigs)) + return "versionConfigs: array expected"; + for (var i = 0; i < message.versionConfigs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.verify(message.versionConfigs[i], long + 1); + if (error) + return "versionConfigs." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.testCasesConfig != null && message.hasOwnProperty("testCasesConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.verify(message.testCasesConfig, long + 1); + if (error) + return "testCasesConfig." + error; + } + if (message.webhookConfig != null && message.hasOwnProperty("webhookConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.verify(message.webhookConfig, long + 1); + if (error) + return "webhookConfig." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment} Environment + */ + Environment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Environment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.versionConfigs) { + if (!Array.isArray(object.versionConfigs)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.versionConfigs: array expected"); + message.versionConfigs = []; + for (var i = 0; i < object.versionConfigs.length; ++i) { + if (typeof object.versionConfigs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.versionConfigs: object expected"); + message.versionConfigs[i] = $root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.fromObject(object.versionConfigs[i], long + 1); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.testCasesConfig != null) { + if (typeof object.testCasesConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.testCasesConfig: object expected"); + message.testCasesConfig = $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.fromObject(object.testCasesConfig, long + 1); + } + if (object.webhookConfig != null) { + if (typeof object.webhookConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.webhookConfig: object expected"); + message.webhookConfig = $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.fromObject(object.webhookConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionConfigs = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.updateTime = null; + object.testCasesConfig = null; + object.webhookConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.versionConfigs && message.versionConfigs.length) { + object.versionConfigs = []; + for (var j = 0; j < message.versionConfigs.length; ++j) + object.versionConfigs[j] = $root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.toObject(message.versionConfigs[j], options); + } + if (message.testCasesConfig != null && message.hasOwnProperty("testCasesConfig")) + object.testCasesConfig = $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.toObject(message.testCasesConfig, options); + if (message.webhookConfig != null && message.hasOwnProperty("webhookConfig")) + object.webhookConfig = $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.toObject(message.webhookConfig, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Environment"; + }; + + Environment.VersionConfig = (function() { + + /** + * Properties of a VersionConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @interface IVersionConfig + * @property {string|null} [version] VersionConfig version + */ + + /** + * Constructs a new VersionConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @classdesc Represents a VersionConfig. + * @implements IVersionConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig=} [properties] Properties to set + */ + function VersionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionConfig version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @instance + */ + VersionConfig.prototype.version = ""; + + /** + * Creates a new VersionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig} VersionConfig instance + */ + VersionConfig.create = function create(properties) { + return new VersionConfig(properties); + }; + + /** + * Encodes the specified VersionConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig} message VersionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + return writer; + }; + + /** + * Encodes the specified VersionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IVersionConfig} message VersionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig} VersionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VersionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig} VersionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a VersionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig} VersionConfig + */ + VersionConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig(); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a VersionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig} message VersionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.version = ""; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this VersionConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @instance + * @returns {Object.} JSON object + */ + VersionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig"; + }; + + return VersionConfig; + })(); + + Environment.TestCasesConfig = (function() { + + /** + * Properties of a TestCasesConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @interface ITestCasesConfig + * @property {Array.|null} [testCases] TestCasesConfig testCases + * @property {boolean|null} [enableContinuousRun] TestCasesConfig enableContinuousRun + * @property {boolean|null} [enablePredeploymentRun] TestCasesConfig enablePredeploymentRun + */ + + /** + * Constructs a new TestCasesConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @classdesc Represents a TestCasesConfig. + * @implements ITestCasesConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig=} [properties] Properties to set + */ + function TestCasesConfig(properties) { + this.testCases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCasesConfig testCases. + * @member {Array.} testCases + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @instance + */ + TestCasesConfig.prototype.testCases = $util.emptyArray; + + /** + * TestCasesConfig enableContinuousRun. + * @member {boolean} enableContinuousRun + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @instance + */ + TestCasesConfig.prototype.enableContinuousRun = false; + + /** + * TestCasesConfig enablePredeploymentRun. + * @member {boolean} enablePredeploymentRun + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @instance + */ + TestCasesConfig.prototype.enablePredeploymentRun = false; + + /** + * Creates a new TestCasesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig} TestCasesConfig instance + */ + TestCasesConfig.create = function create(properties) { + return new TestCasesConfig(properties); + }; + + /** + * Encodes the specified TestCasesConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig} message TestCasesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCasesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCases != null && message.testCases.length) + for (var i = 0; i < message.testCases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.testCases[i]); + if (message.enableContinuousRun != null && Object.hasOwnProperty.call(message, "enableContinuousRun")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableContinuousRun); + if (message.enablePredeploymentRun != null && Object.hasOwnProperty.call(message, "enablePredeploymentRun")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enablePredeploymentRun); + return writer; + }; + + /** + * Encodes the specified TestCasesConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.ITestCasesConfig} message TestCasesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCasesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig} TestCasesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCasesConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testCases && message.testCases.length)) + message.testCases = []; + message.testCases.push(reader.string()); + break; + } + case 2: { + message.enableContinuousRun = reader.bool(); + break; + } + case 3: { + message.enablePredeploymentRun = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCasesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig} TestCasesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCasesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCasesConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCasesConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCases != null && message.hasOwnProperty("testCases")) { + if (!Array.isArray(message.testCases)) + return "testCases: array expected"; + for (var i = 0; i < message.testCases.length; ++i) + if (!$util.isString(message.testCases[i])) + return "testCases: string[] expected"; + } + if (message.enableContinuousRun != null && message.hasOwnProperty("enableContinuousRun")) + if (typeof message.enableContinuousRun !== "boolean") + return "enableContinuousRun: boolean expected"; + if (message.enablePredeploymentRun != null && message.hasOwnProperty("enablePredeploymentRun")) + if (typeof message.enablePredeploymentRun !== "boolean") + return "enablePredeploymentRun: boolean expected"; + return null; + }; + + /** + * Creates a TestCasesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig} TestCasesConfig + */ + TestCasesConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig(); + if (object.testCases) { + if (!Array.isArray(object.testCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig.testCases: array expected"); + message.testCases = []; + for (var i = 0; i < object.testCases.length; ++i) + message.testCases[i] = String(object.testCases[i]); + } + if (object.enableContinuousRun != null) + message.enableContinuousRun = Boolean(object.enableContinuousRun); + if (object.enablePredeploymentRun != null) + message.enablePredeploymentRun = Boolean(object.enablePredeploymentRun); + return message; + }; + + /** + * Creates a plain object from a TestCasesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig} message TestCasesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCasesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCases = []; + if (options.defaults) { + object.enableContinuousRun = false; + object.enablePredeploymentRun = false; + } + if (message.testCases && message.testCases.length) { + object.testCases = []; + for (var j = 0; j < message.testCases.length; ++j) + object.testCases[j] = message.testCases[j]; + } + if (message.enableContinuousRun != null && message.hasOwnProperty("enableContinuousRun")) + object.enableContinuousRun = message.enableContinuousRun; + if (message.enablePredeploymentRun != null && message.hasOwnProperty("enablePredeploymentRun")) + object.enablePredeploymentRun = message.enablePredeploymentRun; + return object; + }; + + /** + * Converts this TestCasesConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @instance + * @returns {Object.} JSON object + */ + TestCasesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCasesConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCasesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Environment.TestCasesConfig"; + }; + + return TestCasesConfig; + })(); + + Environment.WebhookConfig = (function() { + + /** + * Properties of a WebhookConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @interface IWebhookConfig + * @property {Array.|null} [webhookOverrides] WebhookConfig webhookOverrides + */ + + /** + * Constructs a new WebhookConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment + * @classdesc Represents a WebhookConfig. + * @implements IWebhookConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig=} [properties] Properties to set + */ + function WebhookConfig(properties) { + this.webhookOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookConfig webhookOverrides. + * @member {Array.} webhookOverrides + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @instance + */ + WebhookConfig.prototype.webhookOverrides = $util.emptyArray; + + /** + * Creates a new WebhookConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig} WebhookConfig instance + */ + WebhookConfig.create = function create(properties) { + return new WebhookConfig(properties); + }; + + /** + * Encodes the specified WebhookConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig} message WebhookConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhookOverrides != null && message.webhookOverrides.length) + for (var i = 0; i < message.webhookOverrides.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.encode(message.webhookOverrides[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebhookConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.IWebhookConfig} message WebhookConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig} WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.webhookOverrides && message.webhookOverrides.length)) + message.webhookOverrides = []; + message.webhookOverrides.push($root.google.cloud.dialogflow.cx.v3beta1.Webhook.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig} WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.webhookOverrides != null && message.hasOwnProperty("webhookOverrides")) { + if (!Array.isArray(message.webhookOverrides)) + return "webhookOverrides: array expected"; + for (var i = 0; i < message.webhookOverrides.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.verify(message.webhookOverrides[i], long + 1); + if (error) + return "webhookOverrides." + error; + } + } + return null; + }; + + /** + * Creates a WebhookConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig} WebhookConfig + */ + WebhookConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig(); + if (object.webhookOverrides) { + if (!Array.isArray(object.webhookOverrides)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.webhookOverrides: array expected"); + message.webhookOverrides = []; + for (var i = 0; i < object.webhookOverrides.length; ++i) { + if (typeof object.webhookOverrides[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig.webhookOverrides: object expected"); + message.webhookOverrides[i] = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.fromObject(object.webhookOverrides[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a WebhookConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig} message WebhookConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.webhookOverrides = []; + if (message.webhookOverrides && message.webhookOverrides.length) { + object.webhookOverrides = []; + for (var j = 0; j < message.webhookOverrides.length; ++j) + object.webhookOverrides[j] = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.toObject(message.webhookOverrides[j], options); + } + return object; + }; + + /** + * Converts this WebhookConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @instance + * @returns {Object.} JSON object + */ + WebhookConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Environment.WebhookConfig"; + }; + + return WebhookConfig; + })(); + + return Environment; + })(); + + v3beta1.ListEnvironmentsRequest = (function() { + + /** + * Properties of a ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListEnvironmentsRequest + * @property {string|null} [parent] ListEnvironmentsRequest parent + * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize + * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken + */ + + /** + * Constructs a new ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListEnvironmentsRequest. + * @implements IListEnvironmentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest=} [properties] Properties to set + */ + function ListEnvironmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.parent = ""; + + /** + * ListEnvironmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageSize = 0; + + /** + * ListEnvironmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest} ListEnvironmentsRequest instance + */ + ListEnvironmentsRequest.create = function create(properties) { + return new ListEnvironmentsRequest(properties); + }; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + */ + ListEnvironmentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest} message ListEnvironmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEnvironmentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEnvironmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest"; + }; + + return ListEnvironmentsRequest; + })(); + + v3beta1.ListEnvironmentsResponse = (function() { + + /** + * Properties of a ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListEnvironmentsResponse + * @property {Array.|null} [environments] ListEnvironmentsResponse environments + * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + */ + + /** + * Constructs a new ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListEnvironmentsResponse. + * @implements IListEnvironmentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse=} [properties] Properties to set + */ + function ListEnvironmentsResponse(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsResponse environments. + * @member {Array.} environments + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + + /** + * ListEnvironmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} ListEnvironmentsResponse instance + */ + ListEnvironmentsResponse.create = function create(properties) { + return new ListEnvironmentsResponse(properties); + }; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.encode(message.environments[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 ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.dialogflow.cx.v3beta1.Environment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.verify(message.environments[i], long + 1); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + */ + ListEnvironmentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.dialogflow.cx.v3beta1.Environment.fromObject(object.environments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.dialogflow.cx.v3beta1.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEnvironmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse"; + }; + + return ListEnvironmentsResponse; + })(); + + v3beta1.GetEnvironmentRequest = (function() { + + /** + * Properties of a GetEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetEnvironmentRequest + * @property {string|null} [name] GetEnvironmentRequest name + */ + + /** + * Constructs a new GetEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetEnvironmentRequest. + * @implements IGetEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest=} [properties] Properties to set + */ + function GetEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @instance + */ + GetEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest} GetEnvironmentRequest instance + */ + GetEnvironmentRequest.create = function create(properties) { + return new GetEnvironmentRequest(properties); + }; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.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 GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest} GetEnvironmentRequest + */ + GetEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest} message GetEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEnvironmentRequest.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 GetEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest"; + }; + + return GetEnvironmentRequest; + })(); + + v3beta1.CreateEnvironmentRequest = (function() { + + /** + * Properties of a CreateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateEnvironmentRequest + * @property {string|null} [parent] CreateEnvironmentRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null} [environment] CreateEnvironmentRequest environment + */ + + /** + * Constructs a new CreateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateEnvironmentRequest. + * @implements ICreateEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest=} [properties] Properties to set + */ + function CreateEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEnvironmentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.parent = ""; + + /** + * CreateEnvironmentRequest environment. + * @member {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.environment = null; + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest} CreateEnvironmentRequest instance + */ + CreateEnvironmentRequest.create = function create(properties) { + return new CreateEnvironmentRequest(properties); + }; + + /** + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.encode(message.environment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.verify(message.environment, long + 1); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + */ + CreateEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.fromObject(object.environment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest} message CreateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.environment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.toObject(message.environment, options); + return object; + }; + + /** + * Converts this CreateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest"; + }; + + return CreateEnvironmentRequest; + })(); + + v3beta1.UpdateEnvironmentRequest = (function() { + + /** + * Properties of an UpdateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateEnvironmentRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null} [environment] UpdateEnvironmentRequest environment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnvironmentRequest updateMask + */ + + /** + * Constructs a new UpdateEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateEnvironmentRequest. + * @implements IUpdateEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest=} [properties] Properties to set + */ + function UpdateEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEnvironmentRequest environment. + * @member {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.environment = null; + + /** + * UpdateEnvironmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest instance + */ + UpdateEnvironmentRequest.create = function create(properties) { + return new UpdateEnvironmentRequest(properties); + }; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.encode(message.environment, 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 UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.verify(message.environment, long + 1); + if (error) + return "environment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + */ + UpdateEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.fromObject(object.environment, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest} message UpdateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = null; + object.updateMask = null; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.toObject(message.environment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest"; + }; + + return UpdateEnvironmentRequest; + })(); + + v3beta1.DeleteEnvironmentRequest = (function() { + + /** + * Properties of a DeleteEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteEnvironmentRequest + * @property {string|null} [name] DeleteEnvironmentRequest name + */ + + /** + * Constructs a new DeleteEnvironmentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteEnvironmentRequest. + * @implements IDeleteEnvironmentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest=} [properties] Properties to set + */ + function DeleteEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @instance + */ + DeleteEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest instance + */ + DeleteEnvironmentRequest.create = function create(properties) { + return new DeleteEnvironmentRequest(properties); + }; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEnvironmentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + */ + DeleteEnvironmentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest} message DeleteEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest"; + }; + + return DeleteEnvironmentRequest; + })(); + + v3beta1.LookupEnvironmentHistoryRequest = (function() { + + /** + * Properties of a LookupEnvironmentHistoryRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ILookupEnvironmentHistoryRequest + * @property {string|null} [name] LookupEnvironmentHistoryRequest name + * @property {number|null} [pageSize] LookupEnvironmentHistoryRequest pageSize + * @property {string|null} [pageToken] LookupEnvironmentHistoryRequest pageToken + */ + + /** + * Constructs a new LookupEnvironmentHistoryRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a LookupEnvironmentHistoryRequest. + * @implements ILookupEnvironmentHistoryRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest=} [properties] Properties to set + */ + function LookupEnvironmentHistoryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LookupEnvironmentHistoryRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @instance + */ + LookupEnvironmentHistoryRequest.prototype.name = ""; + + /** + * LookupEnvironmentHistoryRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @instance + */ + LookupEnvironmentHistoryRequest.prototype.pageSize = 0; + + /** + * LookupEnvironmentHistoryRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @instance + */ + LookupEnvironmentHistoryRequest.prototype.pageToken = ""; + + /** + * Creates a new LookupEnvironmentHistoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest instance + */ + LookupEnvironmentHistoryRequest.create = function create(properties) { + return new LookupEnvironmentHistoryRequest(properties); + }; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest} message LookupEnvironmentHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryRequest.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.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); + return writer; + }; + + /** + * Encodes the specified LookupEnvironmentHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest} message LookupEnvironmentHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LookupEnvironmentHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupEnvironmentHistoryRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupEnvironmentHistoryRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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"; + return null; + }; + + /** + * Creates a LookupEnvironmentHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest} LookupEnvironmentHistoryRequest + */ + LookupEnvironmentHistoryRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a LookupEnvironmentHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest} message LookupEnvironmentHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupEnvironmentHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this LookupEnvironmentHistoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + LookupEnvironmentHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupEnvironmentHistoryRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupEnvironmentHistoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest"; + }; + + return LookupEnvironmentHistoryRequest; + })(); + + v3beta1.LookupEnvironmentHistoryResponse = (function() { + + /** + * Properties of a LookupEnvironmentHistoryResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ILookupEnvironmentHistoryResponse + * @property {Array.|null} [environments] LookupEnvironmentHistoryResponse environments + * @property {string|null} [nextPageToken] LookupEnvironmentHistoryResponse nextPageToken + */ + + /** + * Constructs a new LookupEnvironmentHistoryResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a LookupEnvironmentHistoryResponse. + * @implements ILookupEnvironmentHistoryResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse=} [properties] Properties to set + */ + function LookupEnvironmentHistoryResponse(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LookupEnvironmentHistoryResponse environments. + * @member {Array.} environments + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @instance + */ + LookupEnvironmentHistoryResponse.prototype.environments = $util.emptyArray; + + /** + * LookupEnvironmentHistoryResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @instance + */ + LookupEnvironmentHistoryResponse.prototype.nextPageToken = ""; + + /** + * Creates a new LookupEnvironmentHistoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse instance + */ + LookupEnvironmentHistoryResponse.create = function create(properties) { + return new LookupEnvironmentHistoryResponse(properties); + }; + + /** + * Encodes the specified LookupEnvironmentHistoryResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse} message LookupEnvironmentHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.encode(message.environments[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 LookupEnvironmentHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse} message LookupEnvironmentHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupEnvironmentHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.dialogflow.cx.v3beta1.Environment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LookupEnvironmentHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupEnvironmentHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupEnvironmentHistoryResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupEnvironmentHistoryResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.verify(message.environments[i], long + 1); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a LookupEnvironmentHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} LookupEnvironmentHistoryResponse + */ + LookupEnvironmentHistoryResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.dialogflow.cx.v3beta1.Environment.fromObject(object.environments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a LookupEnvironmentHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} message LookupEnvironmentHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupEnvironmentHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.dialogflow.cx.v3beta1.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this LookupEnvironmentHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + LookupEnvironmentHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupEnvironmentHistoryResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupEnvironmentHistoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse"; + }; + + return LookupEnvironmentHistoryResponse; + })(); + + v3beta1.ContinuousTestResult = (function() { + + /** + * Properties of a ContinuousTestResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IContinuousTestResult + * @property {string|null} [name] ContinuousTestResult name + * @property {google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult|null} [result] ContinuousTestResult result + * @property {Array.|null} [testCaseResults] ContinuousTestResult testCaseResults + * @property {google.protobuf.ITimestamp|null} [runTime] ContinuousTestResult runTime + */ + + /** + * Constructs a new ContinuousTestResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ContinuousTestResult. + * @implements IContinuousTestResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult=} [properties] Properties to set + */ + function ContinuousTestResult(properties) { + this.testCaseResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousTestResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.name = ""; + + /** + * ContinuousTestResult result. + * @member {google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult} result + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.result = 0; + + /** + * ContinuousTestResult testCaseResults. + * @member {Array.} testCaseResults + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.testCaseResults = $util.emptyArray; + + /** + * ContinuousTestResult runTime. + * @member {google.protobuf.ITimestamp|null|undefined} runTime + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.runTime = null; + + /** + * Creates a new ContinuousTestResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult} ContinuousTestResult instance + */ + ContinuousTestResult.create = function create(properties) { + return new ContinuousTestResult(properties); + }; + + /** + * Encodes the specified ContinuousTestResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult} message ContinuousTestResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousTestResult.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.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.result); + if (message.testCaseResults != null && message.testCaseResults.length) + for (var i = 0; i < message.testCaseResults.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.testCaseResults[i]); + if (message.runTime != null && Object.hasOwnProperty.call(message, "runTime")) + $root.google.protobuf.Timestamp.encode(message.runTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousTestResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult} message ContinuousTestResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousTestResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult} ContinuousTestResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousTestResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.result = reader.int32(); + break; + } + case 3: { + if (!(message.testCaseResults && message.testCaseResults.length)) + message.testCaseResults = []; + message.testCaseResults.push(reader.string()); + break; + } + case 4: { + message.runTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult} ContinuousTestResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousTestResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousTestResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousTestResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.testCaseResults != null && message.hasOwnProperty("testCaseResults")) { + if (!Array.isArray(message.testCaseResults)) + return "testCaseResults: array expected"; + for (var i = 0; i < message.testCaseResults.length; ++i) + if (!$util.isString(message.testCaseResults[i])) + return "testCaseResults: string[] expected"; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.runTime, long + 1); + if (error) + return "runTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousTestResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult} ContinuousTestResult + */ + ContinuousTestResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(); + if (object.name != null) + message.name = String(object.name); + switch (object.result) { + default: + if (typeof object.result === "number") { + message.result = object.result; + break; + } + break; + case "AGGREGATED_TEST_RESULT_UNSPECIFIED": + case 0: + message.result = 0; + break; + case "PASSED": + case 1: + message.result = 1; + break; + case "FAILED": + case 2: + message.result = 2; + break; + } + if (object.testCaseResults) { + if (!Array.isArray(object.testCaseResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.testCaseResults: array expected"); + message.testCaseResults = []; + for (var i = 0; i < object.testCaseResults.length; ++i) + message.testCaseResults[i] = String(object.testCaseResults[i]); + } + if (object.runTime != null) { + if (typeof object.runTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.runTime: object expected"); + message.runTime = $root.google.protobuf.Timestamp.fromObject(object.runTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousTestResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult} message ContinuousTestResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousTestResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCaseResults = []; + if (options.defaults) { + object.name = ""; + object.result = options.enums === String ? "AGGREGATED_TEST_RESULT_UNSPECIFIED" : 0; + object.runTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult[message.result] === undefined ? message.result : $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult[message.result] : message.result; + if (message.testCaseResults && message.testCaseResults.length) { + object.testCaseResults = []; + for (var j = 0; j < message.testCaseResults.length; ++j) + object.testCaseResults[j] = message.testCaseResults[j]; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) + object.runTime = $root.google.protobuf.Timestamp.toObject(message.runTime, options); + return object; + }; + + /** + * Converts this ContinuousTestResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @instance + * @returns {Object.} JSON object + */ + ContinuousTestResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousTestResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousTestResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult"; + }; + + /** + * AggregatedTestResult enum. + * @name google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.AggregatedTestResult + * @enum {number} + * @property {number} AGGREGATED_TEST_RESULT_UNSPECIFIED=0 AGGREGATED_TEST_RESULT_UNSPECIFIED value + * @property {number} PASSED=1 PASSED value + * @property {number} FAILED=2 FAILED value + */ + ContinuousTestResult.AggregatedTestResult = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGGREGATED_TEST_RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PASSED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + return ContinuousTestResult; + })(); + + v3beta1.RunContinuousTestRequest = (function() { + + /** + * Properties of a RunContinuousTestRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRunContinuousTestRequest + * @property {string|null} [environment] RunContinuousTestRequest environment + */ + + /** + * Constructs a new RunContinuousTestRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RunContinuousTestRequest. + * @implements IRunContinuousTestRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest=} [properties] Properties to set + */ + function RunContinuousTestRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunContinuousTestRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @instance + */ + RunContinuousTestRequest.prototype.environment = ""; + + /** + * Creates a new RunContinuousTestRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest} RunContinuousTestRequest instance + */ + RunContinuousTestRequest.create = function create(properties) { + return new RunContinuousTestRequest(properties); + }; + + /** + * Encodes the specified RunContinuousTestRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest} message RunContinuousTestRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest} message RunContinuousTestRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest} RunContinuousTestRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest} RunContinuousTestRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + return null; + }; + + /** + * Creates a RunContinuousTestRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest} RunContinuousTestRequest + */ + RunContinuousTestRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest(); + if (object.environment != null) + message.environment = String(object.environment); + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest} message RunContinuousTestRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.environment = ""; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + return object; + }; + + /** + * Converts this RunContinuousTestRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunContinuousTestRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunContinuousTestRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest"; + }; + + return RunContinuousTestRequest; + })(); + + v3beta1.RunContinuousTestResponse = (function() { + + /** + * Properties of a RunContinuousTestResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRunContinuousTestResponse + * @property {google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult|null} [continuousTestResult] RunContinuousTestResponse continuousTestResult + */ + + /** + * Constructs a new RunContinuousTestResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RunContinuousTestResponse. + * @implements IRunContinuousTestResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse=} [properties] Properties to set + */ + function RunContinuousTestResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunContinuousTestResponse continuousTestResult. + * @member {google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult|null|undefined} continuousTestResult + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @instance + */ + RunContinuousTestResponse.prototype.continuousTestResult = null; + + /** + * Creates a new RunContinuousTestResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse} RunContinuousTestResponse instance + */ + RunContinuousTestResponse.create = function create(properties) { + return new RunContinuousTestResponse(properties); + }; + + /** + * Encodes the specified RunContinuousTestResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse} message RunContinuousTestResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuousTestResult != null && Object.hasOwnProperty.call(message, "continuousTestResult")) + $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.encode(message.continuousTestResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse} message RunContinuousTestResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse} RunContinuousTestResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.continuousTestResult = $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse} RunContinuousTestResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.continuousTestResult != null && message.hasOwnProperty("continuousTestResult")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.verify(message.continuousTestResult, long + 1); + if (error) + return "continuousTestResult." + error; + } + return null; + }; + + /** + * Creates a RunContinuousTestResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse} RunContinuousTestResponse + */ + RunContinuousTestResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse(); + if (object.continuousTestResult != null) { + if (typeof object.continuousTestResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse.continuousTestResult: object expected"); + message.continuousTestResult = $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.fromObject(object.continuousTestResult, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse} message RunContinuousTestResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.continuousTestResult = null; + if (message.continuousTestResult != null && message.hasOwnProperty("continuousTestResult")) + object.continuousTestResult = $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.toObject(message.continuousTestResult, options); + return object; + }; + + /** + * Converts this RunContinuousTestResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunContinuousTestResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunContinuousTestResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse"; + }; + + return RunContinuousTestResponse; + })(); + + v3beta1.RunContinuousTestMetadata = (function() { + + /** + * Properties of a RunContinuousTestMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRunContinuousTestMetadata + * @property {Array.|null} [errors] RunContinuousTestMetadata errors + */ + + /** + * Constructs a new RunContinuousTestMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RunContinuousTestMetadata. + * @implements IRunContinuousTestMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata=} [properties] Properties to set + */ + function RunContinuousTestMetadata(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunContinuousTestMetadata errors. + * @member {Array.} errors + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @instance + */ + RunContinuousTestMetadata.prototype.errors = $util.emptyArray; + + /** + * Creates a new RunContinuousTestMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata} RunContinuousTestMetadata instance + */ + RunContinuousTestMetadata.create = function create(properties) { + return new RunContinuousTestMetadata(properties); + }; + + /** + * Encodes the specified RunContinuousTestMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata} message RunContinuousTestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata} message RunContinuousTestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata} RunContinuousTestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.dialogflow.cx.v3beta1.TestError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata} RunContinuousTestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestError.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a RunContinuousTestMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata} RunContinuousTestMetadata + */ + RunContinuousTestMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata.errors: object expected"); + message.errors[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestError.fromObject(object.errors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata} message RunContinuousTestMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this RunContinuousTestMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunContinuousTestMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunContinuousTestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata"; + }; + + return RunContinuousTestMetadata; + })(); + + v3beta1.ListContinuousTestResultsRequest = (function() { + + /** + * Properties of a ListContinuousTestResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListContinuousTestResultsRequest + * @property {string|null} [parent] ListContinuousTestResultsRequest parent + * @property {number|null} [pageSize] ListContinuousTestResultsRequest pageSize + * @property {string|null} [pageToken] ListContinuousTestResultsRequest pageToken + */ + + /** + * Constructs a new ListContinuousTestResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListContinuousTestResultsRequest. + * @implements IListContinuousTestResultsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest=} [properties] Properties to set + */ + function ListContinuousTestResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContinuousTestResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.parent = ""; + + /** + * ListContinuousTestResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.pageSize = 0; + + /** + * ListContinuousTestResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListContinuousTestResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest instance + */ + ListContinuousTestResultsRequest.create = function create(properties) { + return new ListContinuousTestResultsRequest(properties); + }; + + /** + * Encodes the specified ListContinuousTestResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest} message ListContinuousTestResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListContinuousTestResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest} message ListContinuousTestResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContinuousTestResultsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContinuousTestResultsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListContinuousTestResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + */ + ListContinuousTestResultsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListContinuousTestResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest} message ListContinuousTestResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContinuousTestResultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListContinuousTestResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListContinuousTestResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListContinuousTestResultsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContinuousTestResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest"; + }; + + return ListContinuousTestResultsRequest; + })(); + + v3beta1.ListContinuousTestResultsResponse = (function() { + + /** + * Properties of a ListContinuousTestResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListContinuousTestResultsResponse + * @property {Array.|null} [continuousTestResults] ListContinuousTestResultsResponse continuousTestResults + * @property {string|null} [nextPageToken] ListContinuousTestResultsResponse nextPageToken + */ + + /** + * Constructs a new ListContinuousTestResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListContinuousTestResultsResponse. + * @implements IListContinuousTestResultsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse=} [properties] Properties to set + */ + function ListContinuousTestResultsResponse(properties) { + this.continuousTestResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContinuousTestResultsResponse continuousTestResults. + * @member {Array.} continuousTestResults + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @instance + */ + ListContinuousTestResultsResponse.prototype.continuousTestResults = $util.emptyArray; + + /** + * ListContinuousTestResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @instance + */ + ListContinuousTestResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListContinuousTestResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse instance + */ + ListContinuousTestResultsResponse.create = function create(properties) { + return new ListContinuousTestResultsResponse(properties); + }; + + /** + * Encodes the specified ListContinuousTestResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse} message ListContinuousTestResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuousTestResults != null && message.continuousTestResults.length) + for (var i = 0; i < message.continuousTestResults.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.encode(message.continuousTestResults[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 ListContinuousTestResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse} message ListContinuousTestResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.continuousTestResults && message.continuousTestResults.length)) + message.continuousTestResults = []; + message.continuousTestResults.push($root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContinuousTestResultsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContinuousTestResultsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.continuousTestResults != null && message.hasOwnProperty("continuousTestResults")) { + if (!Array.isArray(message.continuousTestResults)) + return "continuousTestResults: array expected"; + for (var i = 0; i < message.continuousTestResults.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.verify(message.continuousTestResults[i], long + 1); + if (error) + return "continuousTestResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListContinuousTestResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + */ + ListContinuousTestResultsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse(); + if (object.continuousTestResults) { + if (!Array.isArray(object.continuousTestResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse.continuousTestResults: array expected"); + message.continuousTestResults = []; + for (var i = 0; i < object.continuousTestResults.length; ++i) { + if (typeof object.continuousTestResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse.continuousTestResults: object expected"); + message.continuousTestResults[i] = $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.fromObject(object.continuousTestResults[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListContinuousTestResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse} message ListContinuousTestResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContinuousTestResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.continuousTestResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.continuousTestResults && message.continuousTestResults.length) { + object.continuousTestResults = []; + for (var j = 0; j < message.continuousTestResults.length; ++j) + object.continuousTestResults[j] = $root.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult.toObject(message.continuousTestResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListContinuousTestResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListContinuousTestResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListContinuousTestResultsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContinuousTestResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsResponse"; + }; + + return ListContinuousTestResultsResponse; + })(); + + v3beta1.DeployFlowRequest = (function() { + + /** + * Properties of a DeployFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeployFlowRequest + * @property {string|null} [environment] DeployFlowRequest environment + * @property {string|null} [flowVersion] DeployFlowRequest flowVersion + */ + + /** + * Constructs a new DeployFlowRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeployFlowRequest. + * @implements IDeployFlowRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest=} [properties] Properties to set + */ + function DeployFlowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployFlowRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @instance + */ + DeployFlowRequest.prototype.environment = ""; + + /** + * DeployFlowRequest flowVersion. + * @member {string} flowVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @instance + */ + DeployFlowRequest.prototype.flowVersion = ""; + + /** + * Creates a new DeployFlowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest} DeployFlowRequest instance + */ + DeployFlowRequest.create = function create(properties) { + return new DeployFlowRequest(properties); + }; + + /** + * Encodes the specified DeployFlowRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest} message DeployFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.flowVersion != null && Object.hasOwnProperty.call(message, "flowVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowVersion); + return writer; + }; + + /** + * Encodes the specified DeployFlowRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest} message DeployFlowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest} DeployFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.flowVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployFlowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest} DeployFlowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployFlowRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployFlowRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + if (!$util.isString(message.flowVersion)) + return "flowVersion: string expected"; + return null; + }; + + /** + * Creates a DeployFlowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest} DeployFlowRequest + */ + DeployFlowRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.flowVersion != null) + message.flowVersion = String(object.flowVersion); + return message; + }; + + /** + * Creates a plain object from a DeployFlowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest} message DeployFlowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployFlowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.flowVersion = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + object.flowVersion = message.flowVersion; + return object; + }; + + /** + * Converts this DeployFlowRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @instance + * @returns {Object.} JSON object + */ + DeployFlowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployFlowRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployFlowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest"; + }; + + return DeployFlowRequest; + })(); + + v3beta1.DeployFlowResponse = (function() { + + /** + * Properties of a DeployFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeployFlowResponse + * @property {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null} [environment] DeployFlowResponse environment + * @property {string|null} [deployment] DeployFlowResponse deployment + */ + + /** + * Constructs a new DeployFlowResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeployFlowResponse. + * @implements IDeployFlowResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse=} [properties] Properties to set + */ + function DeployFlowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployFlowResponse environment. + * @member {google.cloud.dialogflow.cx.v3beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @instance + */ + DeployFlowResponse.prototype.environment = null; + + /** + * DeployFlowResponse deployment. + * @member {string} deployment + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @instance + */ + DeployFlowResponse.prototype.deployment = ""; + + /** + * Creates a new DeployFlowResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse} DeployFlowResponse instance + */ + DeployFlowResponse.create = function create(properties) { + return new DeployFlowResponse(properties); + }; + + /** + * Encodes the specified DeployFlowResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse} message DeployFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dialogflow.cx.v3beta1.Environment.encode(message.environment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); + return writer; + }; + + /** + * Encodes the specified DeployFlowResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse} message DeployFlowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse} DeployFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.deployment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployFlowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse} DeployFlowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployFlowResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployFlowResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Environment.verify(message.environment, long + 1); + if (error) + return "environment." + error; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + return null; + }; + + /** + * Creates a DeployFlowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse} DeployFlowResponse + */ + DeployFlowResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse(); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse.environment: object expected"); + message.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.fromObject(object.environment, long + 1); + } + if (object.deployment != null) + message.deployment = String(object.deployment); + return message; + }; + + /** + * Creates a plain object from a DeployFlowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse} message DeployFlowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployFlowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = null; + object.deployment = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dialogflow.cx.v3beta1.Environment.toObject(message.environment, options); + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + return object; + }; + + /** + * Converts this DeployFlowResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @instance + * @returns {Object.} JSON object + */ + DeployFlowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployFlowResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployFlowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse"; + }; + + return DeployFlowResponse; + })(); + + v3beta1.DeployFlowMetadata = (function() { + + /** + * Properties of a DeployFlowMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeployFlowMetadata + * @property {Array.|null} [testErrors] DeployFlowMetadata testErrors + */ + + /** + * Constructs a new DeployFlowMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeployFlowMetadata. + * @implements IDeployFlowMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata=} [properties] Properties to set + */ + function DeployFlowMetadata(properties) { + this.testErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployFlowMetadata testErrors. + * @member {Array.} testErrors + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @instance + */ + DeployFlowMetadata.prototype.testErrors = $util.emptyArray; + + /** + * Creates a new DeployFlowMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata} DeployFlowMetadata instance + */ + DeployFlowMetadata.create = function create(properties) { + return new DeployFlowMetadata(properties); + }; + + /** + * Encodes the specified DeployFlowMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata} message DeployFlowMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testErrors != null && message.testErrors.length) + for (var i = 0; i < message.testErrors.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestError.encode(message.testErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployFlowMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata} message DeployFlowMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployFlowMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata} DeployFlowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testErrors && message.testErrors.length)) + message.testErrors = []; + message.testErrors.push($root.google.cloud.dialogflow.cx.v3beta1.TestError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployFlowMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata} DeployFlowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployFlowMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployFlowMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployFlowMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testErrors != null && message.hasOwnProperty("testErrors")) { + if (!Array.isArray(message.testErrors)) + return "testErrors: array expected"; + for (var i = 0; i < message.testErrors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestError.verify(message.testErrors[i], long + 1); + if (error) + return "testErrors." + error; + } + } + return null; + }; + + /** + * Creates a DeployFlowMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata} DeployFlowMetadata + */ + DeployFlowMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata(); + if (object.testErrors) { + if (!Array.isArray(object.testErrors)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata.testErrors: array expected"); + message.testErrors = []; + for (var i = 0; i < object.testErrors.length; ++i) { + if (typeof object.testErrors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata.testErrors: object expected"); + message.testErrors[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestError.fromObject(object.testErrors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a DeployFlowMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata} message DeployFlowMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployFlowMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testErrors = []; + if (message.testErrors && message.testErrors.length) { + object.testErrors = []; + for (var j = 0; j < message.testErrors.length; ++j) + object.testErrors[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestError.toObject(message.testErrors[j], options); + } + return object; + }; + + /** + * Converts this DeployFlowMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployFlowMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployFlowMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployFlowMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata"; + }; + + return DeployFlowMetadata; + })(); + + v3beta1.TestCases = (function() { + + /** + * Constructs a new TestCases service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TestCases + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TestCases(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TestCases.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TestCases; + + /** + * Creates new TestCases service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TestCases} RPC service. Useful where requests and/or responses are streamed. + */ + TestCases.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|listTestCases}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef ListTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse} [response] ListTestCasesResponse + */ + + /** + * Calls ListTestCases. + * @function listTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest} request ListTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCasesCallback} callback Node-style callback called with the error, if any, and ListTestCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.listTestCases = function listTestCases(request, callback) { + return this.rpcCall(listTestCases, $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse, request, callback); + }, "name", { value: "ListTestCases" }); + + /** + * Calls ListTestCases. + * @function listTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest} request ListTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|batchDeleteTestCases}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef BatchDeleteTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls BatchDeleteTestCases. + * @function batchDeleteTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest} request BatchDeleteTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.BatchDeleteTestCasesCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.batchDeleteTestCases = function batchDeleteTestCases(request, callback) { + return this.rpcCall(batchDeleteTestCases, $root.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "BatchDeleteTestCases" }); + + /** + * Calls BatchDeleteTestCases. + * @function batchDeleteTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest} request BatchDeleteTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|getTestCase}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef GetTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.TestCase} [response] TestCase + */ + + /** + * Calls GetTestCase. + * @function getTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest} request GetTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCaseCallback} callback Node-style callback called with the error, if any, and TestCase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.getTestCase = function getTestCase(request, callback) { + return this.rpcCall(getTestCase, $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest, $root.google.cloud.dialogflow.cx.v3beta1.TestCase, request, callback); + }, "name", { value: "GetTestCase" }); + + /** + * Calls GetTestCase. + * @function getTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest} request GetTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|createTestCase}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef CreateTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.TestCase} [response] TestCase + */ + + /** + * Calls CreateTestCase. + * @function createTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest} request CreateTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCaseCallback} callback Node-style callback called with the error, if any, and TestCase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.createTestCase = function createTestCase(request, callback) { + return this.rpcCall(createTestCase, $root.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest, $root.google.cloud.dialogflow.cx.v3beta1.TestCase, request, callback); + }, "name", { value: "CreateTestCase" }); + + /** + * Calls CreateTestCase. + * @function createTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest} request CreateTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|updateTestCase}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef UpdateTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.TestCase} [response] TestCase + */ + + /** + * Calls UpdateTestCase. + * @function updateTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest} request UpdateTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.UpdateTestCaseCallback} callback Node-style callback called with the error, if any, and TestCase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.updateTestCase = function updateTestCase(request, callback) { + return this.rpcCall(updateTestCase, $root.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest, $root.google.cloud.dialogflow.cx.v3beta1.TestCase, request, callback); + }, "name", { value: "UpdateTestCase" }); + + /** + * Calls UpdateTestCase. + * @function updateTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest} request UpdateTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|runTestCase}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef RunTestCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunTestCase. + * @function runTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest} request RunTestCaseRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.RunTestCaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.runTestCase = function runTestCase(request, callback) { + return this.rpcCall(runTestCase, $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunTestCase" }); + + /** + * Calls RunTestCase. + * @function runTestCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest} request RunTestCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|batchRunTestCases}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef BatchRunTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchRunTestCases. + * @function batchRunTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest} request BatchRunTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCasesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.batchRunTestCases = function batchRunTestCases(request, callback) { + return this.rpcCall(batchRunTestCases, $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchRunTestCases" }); + + /** + * Calls BatchRunTestCases. + * @function batchRunTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest} request BatchRunTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|calculateCoverage}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef CalculateCoverageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse} [response] CalculateCoverageResponse + */ + + /** + * Calls CalculateCoverage. + * @function calculateCoverage + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest} request CalculateCoverageRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.CalculateCoverageCallback} callback Node-style callback called with the error, if any, and CalculateCoverageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.calculateCoverage = function calculateCoverage(request, callback) { + return this.rpcCall(calculateCoverage, $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest, $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse, request, callback); + }, "name", { value: "CalculateCoverage" }); + + /** + * Calls CalculateCoverage. + * @function calculateCoverage + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest} request CalculateCoverageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|importTestCases}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef ImportTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportTestCases. + * @function importTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest} request ImportTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCasesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.importTestCases = function importTestCases(request, callback) { + return this.rpcCall(importTestCases, $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportTestCases" }); + + /** + * Calls ImportTestCases. + * @function importTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest} request ImportTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|exportTestCases}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef ExportTestCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportTestCases. + * @function exportTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest} request ExportTestCasesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.ExportTestCasesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.exportTestCases = function exportTestCases(request, callback) { + return this.rpcCall(exportTestCases, $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportTestCases" }); + + /** + * Calls ExportTestCases. + * @function exportTestCases + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest} request ExportTestCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|listTestCaseResults}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef ListTestCaseResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse} [response] ListTestCaseResultsResponse + */ + + /** + * Calls ListTestCaseResults. + * @function listTestCaseResults + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest} request ListTestCaseResultsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCaseResultsCallback} callback Node-style callback called with the error, if any, and ListTestCaseResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.listTestCaseResults = function listTestCaseResults(request, callback) { + return this.rpcCall(listTestCaseResults, $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse, request, callback); + }, "name", { value: "ListTestCaseResults" }); + + /** + * Calls ListTestCaseResults. + * @function listTestCaseResults + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest} request ListTestCaseResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TestCases|getTestCaseResult}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @typedef GetTestCaseResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.TestCaseResult} [response] TestCaseResult + */ + + /** + * Calls GetTestCaseResult. + * @function getTestCaseResult + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest} request GetTestCaseResultRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCaseResultCallback} callback Node-style callback called with the error, if any, and TestCaseResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TestCases.prototype.getTestCaseResult = function getTestCaseResult(request, callback) { + return this.rpcCall(getTestCaseResult, $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest, $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult, request, callback); + }, "name", { value: "GetTestCaseResult" }); + + /** + * Calls GetTestCaseResult. + * @function getTestCaseResult + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCases + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest} request GetTestCaseResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TestCases; + })(); + + v3beta1.TestCase = (function() { + + /** + * Properties of a TestCase. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITestCase + * @property {string|null} [name] TestCase name + * @property {Array.|null} [tags] TestCase tags + * @property {string|null} [displayName] TestCase displayName + * @property {string|null} [notes] TestCase notes + * @property {google.cloud.dialogflow.cx.v3beta1.ITestConfig|null} [testConfig] TestCase testConfig + * @property {Array.|null} [testCaseConversationTurns] TestCase testCaseConversationTurns + * @property {google.protobuf.ITimestamp|null} [creationTime] TestCase creationTime + * @property {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null} [lastTestResult] TestCase lastTestResult + */ + + /** + * Constructs a new TestCase. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TestCase. + * @implements ITestCase + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCase=} [properties] Properties to set + */ + function TestCase(properties) { + this.tags = []; + this.testCaseConversationTurns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCase name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.name = ""; + + /** + * TestCase tags. + * @member {Array.} tags + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.tags = $util.emptyArray; + + /** + * TestCase displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.displayName = ""; + + /** + * TestCase notes. + * @member {string} notes + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.notes = ""; + + /** + * TestCase testConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.ITestConfig|null|undefined} testConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.testConfig = null; + + /** + * TestCase testCaseConversationTurns. + * @member {Array.} testCaseConversationTurns + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.testCaseConversationTurns = $util.emptyArray; + + /** + * TestCase creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.creationTime = null; + + /** + * TestCase lastTestResult. + * @member {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null|undefined} lastTestResult + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + */ + TestCase.prototype.lastTestResult = null; + + /** + * Creates a new TestCase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCase} TestCase instance + */ + TestCase.create = function create(properties) { + return new TestCase(properties); + }; + + /** + * Encodes the specified TestCase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCase} message TestCase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCase.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.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tags[i]); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.notes != null && Object.hasOwnProperty.call(message, "notes")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.notes); + if (message.testCaseConversationTurns != null && message.testCaseConversationTurns.length) + for (var i = 0; i < message.testCaseConversationTurns.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.encode(message.testCaseConversationTurns[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.lastTestResult != null && Object.hasOwnProperty.call(message, "lastTestResult")) + $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.encode(message.lastTestResult, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.testConfig != null && Object.hasOwnProperty.call(message, "testConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.TestConfig.encode(message.testConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestCase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCase} message TestCase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCase} TestCase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TestCase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.notes = reader.string(); + break; + } + case 13: { + message.testConfig = $root.google.cloud.dialogflow.cx.v3beta1.TestConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.testCaseConversationTurns && message.testCaseConversationTurns.length)) + message.testCaseConversationTurns = []; + message.testCaseConversationTurns.push($root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.lastTestResult = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCase} TestCase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.notes != null && message.hasOwnProperty("notes")) + if (!$util.isString(message.notes)) + return "notes: string expected"; + if (message.testConfig != null && message.hasOwnProperty("testConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestConfig.verify(message.testConfig, long + 1); + if (error) + return "testConfig." + error; + } + if (message.testCaseConversationTurns != null && message.hasOwnProperty("testCaseConversationTurns")) { + if (!Array.isArray(message.testCaseConversationTurns)) + return "testCaseConversationTurns: array expected"; + for (var i = 0; i < message.testCaseConversationTurns.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.verify(message.testCaseConversationTurns[i], long + 1); + if (error) + return "testCaseConversationTurns." + error; + } + } + if (message.creationTime != null && message.hasOwnProperty("creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime, long + 1); + if (error) + return "creationTime." + error; + } + if (message.lastTestResult != null && message.hasOwnProperty("lastTestResult")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify(message.lastTestResult, long + 1); + if (error) + return "lastTestResult." + error; + } + return null; + }; + + /** + * Creates a TestCase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCase} TestCase + */ + TestCase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TestCase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TestCase(); + if (object.name != null) + message.name = String(object.name); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCase.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.notes != null) + message.notes = String(object.notes); + if (object.testConfig != null) { + if (typeof object.testConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCase.testConfig: object expected"); + message.testConfig = $root.google.cloud.dialogflow.cx.v3beta1.TestConfig.fromObject(object.testConfig, long + 1); + } + if (object.testCaseConversationTurns) { + if (!Array.isArray(object.testCaseConversationTurns)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCase.testCaseConversationTurns: array expected"); + message.testCaseConversationTurns = []; + for (var i = 0; i < object.testCaseConversationTurns.length; ++i) { + if (typeof object.testCaseConversationTurns[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCase.testCaseConversationTurns: object expected"); + message.testCaseConversationTurns[i] = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.fromObject(object.testCaseConversationTurns[i], long + 1); + } + } + if (object.creationTime != null) { + if (typeof object.creationTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCase.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime, long + 1); + } + if (object.lastTestResult != null) { + if (typeof object.lastTestResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCase.lastTestResult: object expected"); + message.lastTestResult = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.fromObject(object.lastTestResult, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestCase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TestCase} message TestCase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tags = []; + object.testCaseConversationTurns = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.notes = ""; + object.creationTime = null; + object.lastTestResult = null; + object.testConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.notes != null && message.hasOwnProperty("notes")) + object.notes = message.notes; + if (message.testCaseConversationTurns && message.testCaseConversationTurns.length) { + object.testCaseConversationTurns = []; + for (var j = 0; j < message.testCaseConversationTurns.length; ++j) + object.testCaseConversationTurns[j] = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.toObject(message.testCaseConversationTurns[j], options); + } + if (message.creationTime != null && message.hasOwnProperty("creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); + if (message.lastTestResult != null && message.hasOwnProperty("lastTestResult")) + object.lastTestResult = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.toObject(message.lastTestResult, options); + if (message.testConfig != null && message.hasOwnProperty("testConfig")) + object.testConfig = $root.google.cloud.dialogflow.cx.v3beta1.TestConfig.toObject(message.testConfig, options); + return object; + }; + + /** + * Converts this TestCase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @instance + * @returns {Object.} JSON object + */ + TestCase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TestCase"; + }; + + return TestCase; + })(); + + v3beta1.TestCaseResult = (function() { + + /** + * Properties of a TestCaseResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITestCaseResult + * @property {string|null} [name] TestCaseResult name + * @property {string|null} [environment] TestCaseResult environment + * @property {Array.|null} [conversationTurns] TestCaseResult conversationTurns + * @property {google.cloud.dialogflow.cx.v3beta1.TestResult|null} [testResult] TestCaseResult testResult + * @property {google.protobuf.ITimestamp|null} [testTime] TestCaseResult testTime + */ + + /** + * Constructs a new TestCaseResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TestCaseResult. + * @implements ITestCaseResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult=} [properties] Properties to set + */ + function TestCaseResult(properties) { + this.conversationTurns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCaseResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @instance + */ + TestCaseResult.prototype.name = ""; + + /** + * TestCaseResult environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @instance + */ + TestCaseResult.prototype.environment = ""; + + /** + * TestCaseResult conversationTurns. + * @member {Array.} conversationTurns + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @instance + */ + TestCaseResult.prototype.conversationTurns = $util.emptyArray; + + /** + * TestCaseResult testResult. + * @member {google.cloud.dialogflow.cx.v3beta1.TestResult} testResult + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @instance + */ + TestCaseResult.prototype.testResult = 0; + + /** + * TestCaseResult testTime. + * @member {google.protobuf.ITimestamp|null|undefined} testTime + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @instance + */ + TestCaseResult.prototype.testTime = null; + + /** + * Creates a new TestCaseResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseResult} TestCaseResult instance + */ + TestCaseResult.create = function create(properties) { + return new TestCaseResult(properties); + }; + + /** + * Encodes the specified TestCaseResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult} message TestCaseResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseResult.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + if (message.conversationTurns != null && message.conversationTurns.length) + for (var i = 0; i < message.conversationTurns.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.encode(message.conversationTurns[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.testResult != null && Object.hasOwnProperty.call(message, "testResult")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.testResult); + if (message.testTime != null && Object.hasOwnProperty.call(message, "testTime")) + $root.google.protobuf.Timestamp.encode(message.testTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestCaseResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult} message TestCaseResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseResult} TestCaseResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.environment = reader.string(); + break; + } + case 3: { + if (!(message.conversationTurns && message.conversationTurns.length)) + message.conversationTurns = []; + message.conversationTurns.push($root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.testResult = reader.int32(); + break; + } + case 5: { + message.testTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCaseResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseResult} TestCaseResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCaseResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCaseResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.conversationTurns != null && message.hasOwnProperty("conversationTurns")) { + if (!Array.isArray(message.conversationTurns)) + return "conversationTurns: array expected"; + for (var i = 0; i < message.conversationTurns.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.verify(message.conversationTurns[i], long + 1); + if (error) + return "conversationTurns." + error; + } + } + if (message.testResult != null && message.hasOwnProperty("testResult")) + switch (message.testResult) { + default: + return "testResult: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.testTime != null && message.hasOwnProperty("testTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.testTime, long + 1); + if (error) + return "testTime." + error; + } + return null; + }; + + /** + * Creates a TestCaseResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseResult} TestCaseResult + */ + TestCaseResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(); + if (object.name != null) + message.name = String(object.name); + if (object.environment != null) + message.environment = String(object.environment); + if (object.conversationTurns) { + if (!Array.isArray(object.conversationTurns)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCaseResult.conversationTurns: array expected"); + message.conversationTurns = []; + for (var i = 0; i < object.conversationTurns.length; ++i) { + if (typeof object.conversationTurns[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCaseResult.conversationTurns: object expected"); + message.conversationTurns[i] = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.fromObject(object.conversationTurns[i], long + 1); + } + } + switch (object.testResult) { + default: + if (typeof object.testResult === "number") { + message.testResult = object.testResult; + break; + } + break; + case "TEST_RESULT_UNSPECIFIED": + case 0: + message.testResult = 0; + break; + case "PASSED": + case 1: + message.testResult = 1; + break; + case "FAILED": + case 2: + message.testResult = 2; + break; + } + if (object.testTime != null) { + if (typeof object.testTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCaseResult.testTime: object expected"); + message.testTime = $root.google.protobuf.Timestamp.fromObject(object.testTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestCaseResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TestCaseResult} message TestCaseResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCaseResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversationTurns = []; + if (options.defaults) { + object.name = ""; + object.environment = ""; + object.testResult = options.enums === String ? "TEST_RESULT_UNSPECIFIED" : 0; + object.testTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.conversationTurns && message.conversationTurns.length) { + object.conversationTurns = []; + for (var j = 0; j < message.conversationTurns.length; ++j) + object.conversationTurns[j] = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.toObject(message.conversationTurns[j], options); + } + if (message.testResult != null && message.hasOwnProperty("testResult")) + object.testResult = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.TestResult[message.testResult] === undefined ? message.testResult : $root.google.cloud.dialogflow.cx.v3beta1.TestResult[message.testResult] : message.testResult; + if (message.testTime != null && message.hasOwnProperty("testTime")) + object.testTime = $root.google.protobuf.Timestamp.toObject(message.testTime, options); + return object; + }; + + /** + * Converts this TestCaseResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @instance + * @returns {Object.} JSON object + */ + TestCaseResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCaseResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCaseResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TestCaseResult"; + }; + + return TestCaseResult; + })(); + + v3beta1.TestConfig = (function() { + + /** + * Properties of a TestConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITestConfig + * @property {Array.|null} [trackingParameters] TestConfig trackingParameters + * @property {string|null} [flow] TestConfig flow + * @property {string|null} [page] TestConfig page + */ + + /** + * Constructs a new TestConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TestConfig. + * @implements ITestConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITestConfig=} [properties] Properties to set + */ + function TestConfig(properties) { + this.trackingParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestConfig trackingParameters. + * @member {Array.} trackingParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @instance + */ + TestConfig.prototype.trackingParameters = $util.emptyArray; + + /** + * TestConfig flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @instance + */ + TestConfig.prototype.flow = ""; + + /** + * TestConfig page. + * @member {string} page + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @instance + */ + TestConfig.prototype.page = ""; + + /** + * Creates a new TestConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TestConfig} TestConfig instance + */ + TestConfig.create = function create(properties) { + return new TestConfig(properties); + }; + + /** + * Encodes the specified TestConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestConfig} message TestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackingParameters != null && message.trackingParameters.length) + for (var i = 0; i < message.trackingParameters.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackingParameters[i]); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flow); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.page); + return writer; + }; + + /** + * Encodes the specified TestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestConfig} message TestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TestConfig} TestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TestConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.trackingParameters && message.trackingParameters.length)) + message.trackingParameters = []; + message.trackingParameters.push(reader.string()); + break; + } + case 2: { + message.flow = reader.string(); + break; + } + case 3: { + message.page = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TestConfig} TestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackingParameters != null && message.hasOwnProperty("trackingParameters")) { + if (!Array.isArray(message.trackingParameters)) + return "trackingParameters: array expected"; + for (var i = 0; i < message.trackingParameters.length; ++i) + if (!$util.isString(message.trackingParameters[i])) + return "trackingParameters: string[] expected"; + } + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.page != null && message.hasOwnProperty("page")) + if (!$util.isString(message.page)) + return "page: string expected"; + return null; + }; + + /** + * Creates a TestConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TestConfig} TestConfig + */ + TestConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TestConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TestConfig(); + if (object.trackingParameters) { + if (!Array.isArray(object.trackingParameters)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestConfig.trackingParameters: array expected"); + message.trackingParameters = []; + for (var i = 0; i < object.trackingParameters.length; ++i) + message.trackingParameters[i] = String(object.trackingParameters[i]); + } + if (object.flow != null) + message.flow = String(object.flow); + if (object.page != null) + message.page = String(object.page); + return message; + }; + + /** + * Creates a plain object from a TestConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TestConfig} message TestConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.trackingParameters = []; + if (options.defaults) { + object.flow = ""; + object.page = ""; + } + if (message.trackingParameters && message.trackingParameters.length) { + object.trackingParameters = []; + for (var j = 0; j < message.trackingParameters.length; ++j) + object.trackingParameters[j] = message.trackingParameters[j]; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.page != null && message.hasOwnProperty("page")) + object.page = message.page; + return object; + }; + + /** + * Converts this TestConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @instance + * @returns {Object.} JSON object + */ + TestConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TestConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TestConfig"; + }; + + return TestConfig; + })(); + + v3beta1.ConversationTurn = (function() { + + /** + * Properties of a ConversationTurn. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IConversationTurn + * @property {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput|null} [userInput] ConversationTurn userInput + * @property {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput|null} [virtualAgentOutput] ConversationTurn virtualAgentOutput + */ + + /** + * Constructs a new ConversationTurn. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ConversationTurn. + * @implements IConversationTurn + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IConversationTurn=} [properties] Properties to set + */ + function ConversationTurn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationTurn userInput. + * @member {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput|null|undefined} userInput + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @instance + */ + ConversationTurn.prototype.userInput = null; + + /** + * ConversationTurn virtualAgentOutput. + * @member {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput|null|undefined} virtualAgentOutput + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @instance + */ + ConversationTurn.prototype.virtualAgentOutput = null; + + /** + * Creates a new ConversationTurn instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IConversationTurn=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn} ConversationTurn instance + */ + ConversationTurn.create = function create(properties) { + return new ConversationTurn(properties); + }; + + /** + * Encodes the specified ConversationTurn message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IConversationTurn} message ConversationTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationTurn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userInput != null && Object.hasOwnProperty.call(message, "userInput")) + $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.encode(message.userInput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.virtualAgentOutput != null && Object.hasOwnProperty.call(message, "virtualAgentOutput")) + $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.encode(message.virtualAgentOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConversationTurn message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IConversationTurn} message ConversationTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationTurn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn} ConversationTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationTurn.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userInput = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.virtualAgentOutput = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationTurn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn} ConversationTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationTurn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationTurn message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationTurn.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.userInput != null && message.hasOwnProperty("userInput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.verify(message.userInput, long + 1); + if (error) + return "userInput." + error; + } + if (message.virtualAgentOutput != null && message.hasOwnProperty("virtualAgentOutput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.verify(message.virtualAgentOutput, long + 1); + if (error) + return "virtualAgentOutput." + error; + } + return null; + }; + + /** + * Creates a ConversationTurn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn} ConversationTurn + */ + ConversationTurn.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn(); + if (object.userInput != null) { + if (typeof object.userInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.userInput: object expected"); + message.userInput = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.fromObject(object.userInput, long + 1); + } + if (object.virtualAgentOutput != null) { + if (typeof object.virtualAgentOutput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.virtualAgentOutput: object expected"); + message.virtualAgentOutput = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.fromObject(object.virtualAgentOutput, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConversationTurn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn} message ConversationTurn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationTurn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userInput = null; + object.virtualAgentOutput = null; + } + if (message.userInput != null && message.hasOwnProperty("userInput")) + object.userInput = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.toObject(message.userInput, options); + if (message.virtualAgentOutput != null && message.hasOwnProperty("virtualAgentOutput")) + object.virtualAgentOutput = $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.toObject(message.virtualAgentOutput, options); + return object; + }; + + /** + * Converts this ConversationTurn to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @instance + * @returns {Object.} JSON object + */ + ConversationTurn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationTurn + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ConversationTurn"; + }; + + ConversationTurn.UserInput = (function() { + + /** + * Properties of a UserInput. + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @interface IUserInput + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null} [input] UserInput input + * @property {google.protobuf.IStruct|null} [injectedParameters] UserInput injectedParameters + * @property {boolean|null} [isWebhookEnabled] UserInput isWebhookEnabled + * @property {boolean|null} [enableSentimentAnalysis] UserInput enableSentimentAnalysis + */ + + /** + * Constructs a new UserInput. + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @classdesc Represents a UserInput. + * @implements IUserInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput=} [properties] Properties to set + */ + function UserInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserInput input. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null|undefined} input + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.input = null; + + /** + * UserInput injectedParameters. + * @member {google.protobuf.IStruct|null|undefined} injectedParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.injectedParameters = null; + + /** + * UserInput isWebhookEnabled. + * @member {boolean} isWebhookEnabled + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.isWebhookEnabled = false; + + /** + * UserInput enableSentimentAnalysis. + * @member {boolean} enableSentimentAnalysis + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @instance + */ + UserInput.prototype.enableSentimentAnalysis = false; + + /** + * Creates a new UserInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput} UserInput instance + */ + UserInput.create = function create(properties) { + return new UserInput(properties); + }; + + /** + * Encodes the specified UserInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput} message UserInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.injectedParameters != null && Object.hasOwnProperty.call(message, "injectedParameters")) + $root.google.protobuf.Struct.encode(message.injectedParameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.isWebhookEnabled != null && Object.hasOwnProperty.call(message, "isWebhookEnabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isWebhookEnabled); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.encode(message.input, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.enableSentimentAnalysis != null && Object.hasOwnProperty.call(message, "enableSentimentAnalysis")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableSentimentAnalysis); + return writer; + }; + + /** + * Encodes the specified UserInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IUserInput} message UserInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput} UserInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.input = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.injectedParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.isWebhookEnabled = reader.bool(); + break; + } + case 7: { + message.enableSentimentAnalysis = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UserInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput} UserInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.verify(message.input, long + 1); + if (error) + return "input." + error; + } + if (message.injectedParameters != null && message.hasOwnProperty("injectedParameters")) { + var error = $root.google.protobuf.Struct.verify(message.injectedParameters, long + 1); + if (error) + return "injectedParameters." + error; + } + if (message.isWebhookEnabled != null && message.hasOwnProperty("isWebhookEnabled")) + if (typeof message.isWebhookEnabled !== "boolean") + return "isWebhookEnabled: boolean expected"; + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + if (typeof message.enableSentimentAnalysis !== "boolean") + return "enableSentimentAnalysis: boolean expected"; + return null; + }; + + /** + * Creates a UserInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput} UserInput + */ + UserInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput(); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.input: object expected"); + message.input = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.fromObject(object.input, long + 1); + } + if (object.injectedParameters != null) { + if (typeof object.injectedParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput.injectedParameters: object expected"); + message.injectedParameters = $root.google.protobuf.Struct.fromObject(object.injectedParameters, long + 1); + } + if (object.isWebhookEnabled != null) + message.isWebhookEnabled = Boolean(object.isWebhookEnabled); + if (object.enableSentimentAnalysis != null) + message.enableSentimentAnalysis = Boolean(object.enableSentimentAnalysis); + return message; + }; + + /** + * Creates a plain object from a UserInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput} message UserInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.injectedParameters = null; + object.isWebhookEnabled = false; + object.input = null; + object.enableSentimentAnalysis = false; + } + if (message.injectedParameters != null && message.hasOwnProperty("injectedParameters")) + object.injectedParameters = $root.google.protobuf.Struct.toObject(message.injectedParameters, options); + if (message.isWebhookEnabled != null && message.hasOwnProperty("isWebhookEnabled")) + object.isWebhookEnabled = message.isWebhookEnabled; + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.toObject(message.input, options); + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + object.enableSentimentAnalysis = message.enableSentimentAnalysis; + return object; + }; + + /** + * Converts this UserInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @instance + * @returns {Object.} JSON object + */ + UserInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ConversationTurn.UserInput"; + }; + + return UserInput; + })(); + + ConversationTurn.VirtualAgentOutput = (function() { + + /** + * Properties of a VirtualAgentOutput. + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @interface IVirtualAgentOutput + * @property {google.protobuf.IStruct|null} [sessionParameters] VirtualAgentOutput sessionParameters + * @property {Array.|null} [differences] VirtualAgentOutput differences + * @property {google.protobuf.IStruct|null} [diagnosticInfo] VirtualAgentOutput diagnosticInfo + * @property {google.cloud.dialogflow.cx.v3beta1.IIntent|null} [triggeredIntent] VirtualAgentOutput triggeredIntent + * @property {google.cloud.dialogflow.cx.v3beta1.IPage|null} [currentPage] VirtualAgentOutput currentPage + * @property {Array.|null} [textResponses] VirtualAgentOutput textResponses + * @property {google.rpc.IStatus|null} [status] VirtualAgentOutput status + */ + + /** + * Constructs a new VirtualAgentOutput. + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn + * @classdesc Represents a VirtualAgentOutput. + * @implements IVirtualAgentOutput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput=} [properties] Properties to set + */ + function VirtualAgentOutput(properties) { + this.differences = []; + this.textResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VirtualAgentOutput sessionParameters. + * @member {google.protobuf.IStruct|null|undefined} sessionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.sessionParameters = null; + + /** + * VirtualAgentOutput differences. + * @member {Array.} differences + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.differences = $util.emptyArray; + + /** + * VirtualAgentOutput diagnosticInfo. + * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.diagnosticInfo = null; + + /** + * VirtualAgentOutput triggeredIntent. + * @member {google.cloud.dialogflow.cx.v3beta1.IIntent|null|undefined} triggeredIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.triggeredIntent = null; + + /** + * VirtualAgentOutput currentPage. + * @member {google.cloud.dialogflow.cx.v3beta1.IPage|null|undefined} currentPage + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.currentPage = null; + + /** + * VirtualAgentOutput textResponses. + * @member {Array.} textResponses + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.textResponses = $util.emptyArray; + + /** + * VirtualAgentOutput status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + */ + VirtualAgentOutput.prototype.status = null; + + /** + * Creates a new VirtualAgentOutput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput instance + */ + VirtualAgentOutput.create = function create(properties) { + return new VirtualAgentOutput(properties); + }; + + /** + * Encodes the specified VirtualAgentOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput} message VirtualAgentOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualAgentOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionParameters != null && Object.hasOwnProperty.call(message, "sessionParameters")) + $root.google.protobuf.Struct.encode(message.sessionParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.differences != null && message.differences.length) + for (var i = 0; i < message.differences.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference.encode(message.differences[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.triggeredIntent != null && Object.hasOwnProperty.call(message, "triggeredIntent")) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.encode(message.triggeredIntent, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.currentPage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.textResponses != null && message.textResponses.length) + for (var i = 0; i < message.textResponses.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.encode(message.textResponses[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VirtualAgentOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.IVirtualAgentOutput} message VirtualAgentOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualAgentOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualAgentOutput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.sessionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.differences && message.differences.length)) + message.differences = []; + message.differences.push($root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.triggeredIntent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.textResponses && message.textResponses.length)) + message.textResponses = []; + message.textResponses.push($root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VirtualAgentOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualAgentOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VirtualAgentOutput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VirtualAgentOutput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sessionParameters != null && message.hasOwnProperty("sessionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.sessionParameters, long + 1); + if (error) + return "sessionParameters." + error; + } + if (message.differences != null && message.hasOwnProperty("differences")) { + if (!Array.isArray(message.differences)) + return "differences: array expected"; + for (var i = 0; i < message.differences.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference.verify(message.differences[i], long + 1); + if (error) + return "differences." + error; + } + } + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo, long + 1); + if (error) + return "diagnosticInfo." + error; + } + if (message.triggeredIntent != null && message.hasOwnProperty("triggeredIntent")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.verify(message.triggeredIntent, long + 1); + if (error) + return "triggeredIntent." + error; + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.currentPage, long + 1); + if (error) + return "currentPage." + error; + } + if (message.textResponses != null && message.hasOwnProperty("textResponses")) { + if (!Array.isArray(message.textResponses)) + return "textResponses: array expected"; + for (var i = 0; i < message.textResponses.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.verify(message.textResponses[i], long + 1); + if (error) + return "textResponses." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a VirtualAgentOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput} VirtualAgentOutput + */ + VirtualAgentOutput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput(); + if (object.sessionParameters != null) { + if (typeof object.sessionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.sessionParameters: object expected"); + message.sessionParameters = $root.google.protobuf.Struct.fromObject(object.sessionParameters, long + 1); + } + if (object.differences) { + if (!Array.isArray(object.differences)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.differences: array expected"); + message.differences = []; + for (var i = 0; i < object.differences.length; ++i) { + if (typeof object.differences[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.differences: object expected"); + message.differences[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference.fromObject(object.differences[i], long + 1); + } + } + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo, long + 1); + } + if (object.triggeredIntent != null) { + if (typeof object.triggeredIntent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.triggeredIntent: object expected"); + message.triggeredIntent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.fromObject(object.triggeredIntent, long + 1); + } + if (object.currentPage != null) { + if (typeof object.currentPage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.currentPage: object expected"); + message.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.currentPage, long + 1); + } + if (object.textResponses) { + if (!Array.isArray(object.textResponses)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.textResponses: array expected"); + message.textResponses = []; + for (var i = 0; i < object.textResponses.length; ++i) { + if (typeof object.textResponses[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.textResponses: object expected"); + message.textResponses[i] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.fromObject(object.textResponses[i], long + 1); + } + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a VirtualAgentOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput} message VirtualAgentOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VirtualAgentOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.differences = []; + object.textResponses = []; + } + if (options.defaults) { + object.sessionParameters = null; + object.diagnosticInfo = null; + object.triggeredIntent = null; + object.currentPage = null; + object.status = null; + } + if (message.sessionParameters != null && message.hasOwnProperty("sessionParameters")) + object.sessionParameters = $root.google.protobuf.Struct.toObject(message.sessionParameters, options); + if (message.differences && message.differences.length) { + object.differences = []; + for (var j = 0; j < message.differences.length; ++j) + object.differences[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference.toObject(message.differences[j], options); + } + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); + if (message.triggeredIntent != null && message.hasOwnProperty("triggeredIntent")) + object.triggeredIntent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.toObject(message.triggeredIntent, options); + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.currentPage, options); + if (message.textResponses && message.textResponses.length) { + object.textResponses = []; + for (var j = 0; j < message.textResponses.length; ++j) + object.textResponses[j] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.toObject(message.textResponses[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this VirtualAgentOutput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @instance + * @returns {Object.} JSON object + */ + VirtualAgentOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VirtualAgentOutput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VirtualAgentOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ConversationTurn.VirtualAgentOutput"; + }; + + return VirtualAgentOutput; + })(); + + return ConversationTurn; + })(); + + v3beta1.TestRunDifference = (function() { + + /** + * Properties of a TestRunDifference. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITestRunDifference + * @property {google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType|null} [type] TestRunDifference type + * @property {string|null} [description] TestRunDifference description + */ + + /** + * Constructs a new TestRunDifference. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TestRunDifference. + * @implements ITestRunDifference + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITestRunDifference=} [properties] Properties to set + */ + function TestRunDifference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestRunDifference type. + * @member {google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType} type + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @instance + */ + TestRunDifference.prototype.type = 0; + + /** + * TestRunDifference description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @instance + */ + TestRunDifference.prototype.description = ""; + + /** + * Creates a new TestRunDifference instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestRunDifference=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TestRunDifference} TestRunDifference instance + */ + TestRunDifference.create = function create(properties) { + return new TestRunDifference(properties); + }; + + /** + * Encodes the specified TestRunDifference message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestRunDifference.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestRunDifference} message TestRunDifference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestRunDifference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified TestRunDifference message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestRunDifference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestRunDifference} message TestRunDifference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestRunDifference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TestRunDifference} TestRunDifference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestRunDifference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestRunDifference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TestRunDifference} TestRunDifference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestRunDifference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestRunDifference message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestRunDifference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a TestRunDifference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TestRunDifference} TestRunDifference + */ + TestRunDifference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DIFF_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INTENT": + case 1: + message.type = 1; + break; + case "PAGE": + case 2: + message.type = 2; + break; + case "PARAMETERS": + case 3: + message.type = 3; + break; + case "UTTERANCE": + case 4: + message.type = 4; + break; + case "FLOW": + case 5: + message.type = 5; + break; + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a TestRunDifference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TestRunDifference} message TestRunDifference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestRunDifference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "DIFF_TYPE_UNSPECIFIED" : 0; + object.description = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this TestRunDifference to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @instance + * @returns {Object.} JSON object + */ + TestRunDifference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestRunDifference + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TestRunDifference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestRunDifference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TestRunDifference"; + }; + + /** + * DiffType enum. + * @name google.cloud.dialogflow.cx.v3beta1.TestRunDifference.DiffType + * @enum {number} + * @property {number} DIFF_TYPE_UNSPECIFIED=0 DIFF_TYPE_UNSPECIFIED value + * @property {number} INTENT=1 INTENT value + * @property {number} PAGE=2 PAGE value + * @property {number} PARAMETERS=3 PARAMETERS value + * @property {number} UTTERANCE=4 UTTERANCE value + * @property {number} FLOW=5 FLOW value + */ + TestRunDifference.DiffType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIFF_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT"] = 1; + values[valuesById[2] = "PAGE"] = 2; + values[valuesById[3] = "PARAMETERS"] = 3; + values[valuesById[4] = "UTTERANCE"] = 4; + values[valuesById[5] = "FLOW"] = 5; + return values; + })(); + + return TestRunDifference; + })(); + + v3beta1.TransitionCoverage = (function() { + + /** + * Properties of a TransitionCoverage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITransitionCoverage + * @property {Array.|null} [transitions] TransitionCoverage transitions + * @property {number|null} [coverageScore] TransitionCoverage coverageScore + */ + + /** + * Constructs a new TransitionCoverage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TransitionCoverage. + * @implements ITransitionCoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage=} [properties] Properties to set + */ + function TransitionCoverage(properties) { + this.transitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionCoverage transitions. + * @member {Array.} transitions + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @instance + */ + TransitionCoverage.prototype.transitions = $util.emptyArray; + + /** + * TransitionCoverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @instance + */ + TransitionCoverage.prototype.coverageScore = 0; + + /** + * Creates a new TransitionCoverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage} TransitionCoverage instance + */ + TransitionCoverage.create = function create(properties) { + return new TransitionCoverage(properties); + }; + + /** + * Encodes the specified TransitionCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage} message TransitionCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionCoverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitions != null && message.transitions.length) + for (var i = 0; i < message.transitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.encode(message.transitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified TransitionCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage} message TransitionCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionCoverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage} TransitionCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionCoverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.transitions && message.transitions.length)) + message.transitions = []; + message.transitions.push($root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionCoverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage} TransitionCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionCoverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionCoverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionCoverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitions != null && message.hasOwnProperty("transitions")) { + if (!Array.isArray(message.transitions)) + return "transitions: array expected"; + for (var i = 0; i < message.transitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.verify(message.transitions[i], long + 1); + if (error) + return "transitions." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates a TransitionCoverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage} TransitionCoverage + */ + TransitionCoverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage(); + if (object.transitions) { + if (!Array.isArray(object.transitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.transitions: array expected"); + message.transitions = []; + for (var i = 0; i < object.transitions.length; ++i) { + if (typeof object.transitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.transitions: object expected"); + message.transitions[i] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.fromObject(object.transitions[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from a TransitionCoverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage} message TransitionCoverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionCoverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitions = []; + if (options.defaults) + object.coverageScore = 0; + if (message.transitions && message.transitions.length) { + object.transitions = []; + for (var j = 0; j < message.transitions.length; ++j) + object.transitions[j] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.toObject(message.transitions[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this TransitionCoverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @instance + * @returns {Object.} JSON object + */ + TransitionCoverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionCoverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionCoverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionCoverage"; + }; + + TransitionCoverage.TransitionNode = (function() { + + /** + * Properties of a TransitionNode. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @interface ITransitionNode + * @property {google.cloud.dialogflow.cx.v3beta1.IPage|null} [page] TransitionNode page + * @property {google.cloud.dialogflow.cx.v3beta1.IFlow|null} [flow] TransitionNode flow + */ + + /** + * Constructs a new TransitionNode. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @classdesc Represents a TransitionNode. + * @implements ITransitionNode + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode=} [properties] Properties to set + */ + function TransitionNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionNode page. + * @member {google.cloud.dialogflow.cx.v3beta1.IPage|null|undefined} page + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @instance + */ + TransitionNode.prototype.page = null; + + /** + * TransitionNode flow. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlow|null|undefined} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @instance + */ + TransitionNode.prototype.flow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransitionNode kind. + * @member {"page"|"flow"|undefined} kind + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @instance + */ + Object.defineProperty(TransitionNode.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["page", "flow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransitionNode instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode} TransitionNode instance + */ + TransitionNode.create = function create(properties) { + return new TransitionNode(properties); + }; + + /** + * Encodes the specified TransitionNode message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode} message TransitionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.page, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + $root.google.cloud.dialogflow.cx.v3beta1.Flow.encode(message.flow, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitionNode message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode} message TransitionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode} TransitionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionNode.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode} TransitionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionNode message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionNode.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.page != null && message.hasOwnProperty("page")) { + properties.kind = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.page, long + 1); + if (error) + return "page." + error; + } + } + if (message.flow != null && message.hasOwnProperty("flow")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Flow.verify(message.flow, long + 1); + if (error) + return "flow." + error; + } + } + return null; + }; + + /** + * Creates a TransitionNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode} TransitionNode + */ + TransitionNode.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode(); + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.page: object expected"); + message.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.page, long + 1); + } + if (object.flow != null) { + if (typeof object.flow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.flow: object expected"); + message.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.fromObject(object.flow, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TransitionNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode} message TransitionNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.page != null && message.hasOwnProperty("page")) { + object.page = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.page, options); + if (options.oneofs) + object.kind = "page"; + } + if (message.flow != null && message.hasOwnProperty("flow")) { + object.flow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.toObject(message.flow, options); + if (options.oneofs) + object.kind = "flow"; + } + return object; + }; + + /** + * Converts this TransitionNode to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @instance + * @returns {Object.} JSON object + */ + TransitionNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionNode + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode"; + }; + + return TransitionNode; + })(); + + TransitionCoverage.Transition = (function() { + + /** + * Properties of a Transition. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @interface ITransition + * @property {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null} [source] Transition source + * @property {number|null} [index] Transition index + * @property {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null} [target] Transition target + * @property {boolean|null} [covered] Transition covered + * @property {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null} [transitionRoute] Transition transitionRoute + * @property {google.cloud.dialogflow.cx.v3beta1.IEventHandler|null} [eventHandler] Transition eventHandler + */ + + /** + * Constructs a new Transition. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage + * @classdesc Represents a Transition. + * @implements ITransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition=} [properties] Properties to set + */ + function Transition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Transition source. + * @member {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null|undefined} source + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.source = null; + + /** + * Transition index. + * @member {number} index + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.index = 0; + + /** + * Transition target. + * @member {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransitionNode|null|undefined} target + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.target = null; + + /** + * Transition covered. + * @member {boolean} covered + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.covered = false; + + /** + * Transition transitionRoute. + * @member {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null|undefined} transitionRoute + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.transitionRoute = null; + + /** + * Transition eventHandler. + * @member {google.cloud.dialogflow.cx.v3beta1.IEventHandler|null|undefined} eventHandler + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + */ + Transition.prototype.eventHandler = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Transition detail. + * @member {"transitionRoute"|"eventHandler"|undefined} detail + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + */ + Object.defineProperty(Transition.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["transitionRoute", "eventHandler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Transition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition} Transition instance + */ + Transition.create = function create(properties) { + return new Transition(properties); + }; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.encode(message.target, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.covered != null && Object.hasOwnProperty.call(message, "covered")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.covered); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.index); + if (message.transitionRoute != null && Object.hasOwnProperty.call(message, "transitionRoute")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.encode(message.transitionRoute, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.eventHandler != null && Object.hasOwnProperty.call(message, "eventHandler")) + $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.encode(message.eventHandler, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.index = reader.int32(); + break; + } + case 2: { + message.target = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.covered = reader.bool(); + break; + } + case 5: { + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.eventHandler = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Transition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Transition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.verify(message.source, long + 1); + if (error) + return "source." + error; + } + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.verify(message.target, long + 1); + if (error) + return "target." + error; + } + if (message.covered != null && message.hasOwnProperty("covered")) + if (typeof message.covered !== "boolean") + return "covered: boolean expected"; + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) { + properties.detail = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify(message.transitionRoute, long + 1); + if (error) + return "transitionRoute." + error; + } + } + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.verify(message.eventHandler, long + 1); + if (error) + return "eventHandler." + error; + } + } + return null; + }; + + /** + * Creates a Transition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition} Transition + */ + Transition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.source: object expected"); + message.source = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.fromObject(object.source, long + 1); + } + if (object.index != null) + message.index = object.index | 0; + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.target: object expected"); + message.target = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.fromObject(object.target, long + 1); + } + if (object.covered != null) + message.covered = Boolean(object.covered); + if (object.transitionRoute != null) { + if (typeof object.transitionRoute !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.transitionRoute: object expected"); + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.fromObject(object.transitionRoute, long + 1); + } + if (object.eventHandler != null) { + if (typeof object.eventHandler !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition.eventHandler: object expected"); + message.eventHandler = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.fromObject(object.eventHandler, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition} message Transition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Transition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.target = null; + object.covered = false; + object.index = 0; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.toObject(message.source, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.TransitionNode.toObject(message.target, options); + if (message.covered != null && message.hasOwnProperty("covered")) + object.covered = message.covered; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) { + object.transitionRoute = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.toObject(message.transitionRoute, options); + if (options.oneofs) + object.detail = "transitionRoute"; + } + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + object.eventHandler = $root.google.cloud.dialogflow.cx.v3beta1.EventHandler.toObject(message.eventHandler, options); + if (options.oneofs) + object.detail = "eventHandler"; + } + return object; + }; + + /** + * Converts this Transition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @instance + * @returns {Object.} JSON object + */ + Transition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Transition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.Transition"; + }; + + return Transition; + })(); + + return TransitionCoverage; + })(); + + v3beta1.TransitionRouteGroupCoverage = (function() { + + /** + * Properties of a TransitionRouteGroupCoverage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITransitionRouteGroupCoverage + * @property {Array.|null} [coverages] TransitionRouteGroupCoverage coverages + * @property {number|null} [coverageScore] TransitionRouteGroupCoverage coverageScore + */ + + /** + * Constructs a new TransitionRouteGroupCoverage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TransitionRouteGroupCoverage. + * @implements ITransitionRouteGroupCoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage=} [properties] Properties to set + */ + function TransitionRouteGroupCoverage(properties) { + this.coverages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionRouteGroupCoverage coverages. + * @member {Array.} coverages + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @instance + */ + TransitionRouteGroupCoverage.prototype.coverages = $util.emptyArray; + + /** + * TransitionRouteGroupCoverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @instance + */ + TransitionRouteGroupCoverage.prototype.coverageScore = 0; + + /** + * Creates a new TransitionRouteGroupCoverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage instance + */ + TransitionRouteGroupCoverage.create = function create(properties) { + return new TransitionRouteGroupCoverage(properties); + }; + + /** + * Encodes the specified TransitionRouteGroupCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage} message TransitionRouteGroupCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroupCoverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coverages != null && message.coverages.length) + for (var i = 0; i < message.coverages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.encode(message.coverages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified TransitionRouteGroupCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage} message TransitionRouteGroupCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroupCoverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroupCoverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.coverages && message.coverages.length)) + message.coverages = []; + message.coverages.push($root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionRouteGroupCoverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroupCoverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionRouteGroupCoverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionRouteGroupCoverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.coverages != null && message.hasOwnProperty("coverages")) { + if (!Array.isArray(message.coverages)) + return "coverages: array expected"; + for (var i = 0; i < message.coverages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.verify(message.coverages[i], long + 1); + if (error) + return "coverages." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates a TransitionRouteGroupCoverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage} TransitionRouteGroupCoverage + */ + TransitionRouteGroupCoverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage(); + if (object.coverages) { + if (!Array.isArray(object.coverages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.coverages: array expected"); + message.coverages = []; + for (var i = 0; i < object.coverages.length; ++i) { + if (typeof object.coverages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.coverages: object expected"); + message.coverages[i] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.fromObject(object.coverages[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from a TransitionRouteGroupCoverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage} message TransitionRouteGroupCoverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionRouteGroupCoverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coverages = []; + if (options.defaults) + object.coverageScore = 0; + if (message.coverages && message.coverages.length) { + object.coverages = []; + for (var j = 0; j < message.coverages.length; ++j) + object.coverages[j] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.toObject(message.coverages[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this TransitionRouteGroupCoverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @instance + * @returns {Object.} JSON object + */ + TransitionRouteGroupCoverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionRouteGroupCoverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionRouteGroupCoverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage"; + }; + + TransitionRouteGroupCoverage.Coverage = (function() { + + /** + * Properties of a Coverage. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @interface ICoverage + * @property {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null} [routeGroup] Coverage routeGroup + * @property {Array.|null} [transitions] Coverage transitions + * @property {number|null} [coverageScore] Coverage coverageScore + */ + + /** + * Constructs a new Coverage. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage + * @classdesc Represents a Coverage. + * @implements ICoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage=} [properties] Properties to set + */ + function Coverage(properties) { + this.transitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Coverage routeGroup. + * @member {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null|undefined} routeGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @instance + */ + Coverage.prototype.routeGroup = null; + + /** + * Coverage transitions. + * @member {Array.} transitions + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @instance + */ + Coverage.prototype.transitions = $util.emptyArray; + + /** + * Coverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @instance + */ + Coverage.prototype.coverageScore = 0; + + /** + * Creates a new Coverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage} Coverage instance + */ + Coverage.create = function create(properties) { + return new Coverage(properties); + }; + + /** + * Encodes the specified Coverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage} message Coverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routeGroup != null && Object.hasOwnProperty.call(message, "routeGroup")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.encode(message.routeGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transitions != null && message.transitions.length) + for (var i = 0; i < message.transitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.encode(message.transitions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified Coverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.ICoverage} message Coverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage} Coverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.routeGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.transitions && message.transitions.length)) + message.transitions = []; + message.transitions.push($root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Coverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage} Coverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.routeGroup != null && message.hasOwnProperty("routeGroup")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify(message.routeGroup, long + 1); + if (error) + return "routeGroup." + error; + } + if (message.transitions != null && message.hasOwnProperty("transitions")) { + if (!Array.isArray(message.transitions)) + return "transitions: array expected"; + for (var i = 0; i < message.transitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.verify(message.transitions[i], long + 1); + if (error) + return "transitions." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates a Coverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage} Coverage + */ + Coverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage(); + if (object.routeGroup != null) { + if (typeof object.routeGroup !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.routeGroup: object expected"); + message.routeGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.fromObject(object.routeGroup, long + 1); + } + if (object.transitions) { + if (!Array.isArray(object.transitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.transitions: array expected"); + message.transitions = []; + for (var i = 0; i < object.transitions.length; ++i) { + if (typeof object.transitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.transitions: object expected"); + message.transitions[i] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.fromObject(object.transitions[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from a Coverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage} message Coverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitions = []; + if (options.defaults) { + object.routeGroup = null; + object.coverageScore = 0; + } + if (message.routeGroup != null && message.hasOwnProperty("routeGroup")) + object.routeGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.toObject(message.routeGroup, options); + if (message.transitions && message.transitions.length) { + object.transitions = []; + for (var j = 0; j < message.transitions.length; ++j) + object.transitions[j] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.toObject(message.transitions[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this Coverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @instance + * @returns {Object.} JSON object + */ + Coverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Coverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Coverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage"; + }; + + Coverage.Transition = (function() { + + /** + * Properties of a Transition. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @interface ITransition + * @property {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null} [transitionRoute] Transition transitionRoute + * @property {boolean|null} [covered] Transition covered + */ + + /** + * Constructs a new Transition. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage + * @classdesc Represents a Transition. + * @implements ITransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition=} [properties] Properties to set + */ + function Transition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Transition transitionRoute. + * @member {google.cloud.dialogflow.cx.v3beta1.ITransitionRoute|null|undefined} transitionRoute + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @instance + */ + Transition.prototype.transitionRoute = null; + + /** + * Transition covered. + * @member {boolean} covered + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @instance + */ + Transition.prototype.covered = false; + + /** + * Creates a new Transition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition} Transition instance + */ + Transition.create = function create(properties) { + return new Transition(properties); + }; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitionRoute != null && Object.hasOwnProperty.call(message, "transitionRoute")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.encode(message.transitionRoute, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.covered != null && Object.hasOwnProperty.call(message, "covered")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.covered); + return writer; + }; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.covered = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Transition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Transition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify(message.transitionRoute, long + 1); + if (error) + return "transitionRoute." + error; + } + if (message.covered != null && message.hasOwnProperty("covered")) + if (typeof message.covered !== "boolean") + return "covered: boolean expected"; + return null; + }; + + /** + * Creates a Transition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition} Transition + */ + Transition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition(); + if (object.transitionRoute != null) { + if (typeof object.transitionRoute !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition.transitionRoute: object expected"); + message.transitionRoute = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.fromObject(object.transitionRoute, long + 1); + } + if (object.covered != null) + message.covered = Boolean(object.covered); + return message; + }; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition} message Transition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Transition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transitionRoute = null; + object.covered = false; + } + if (message.transitionRoute != null && message.hasOwnProperty("transitionRoute")) + object.transitionRoute = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.toObject(message.transitionRoute, options); + if (message.covered != null && message.hasOwnProperty("covered")) + object.covered = message.covered; + return object; + }; + + /** + * Converts this Transition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @instance + * @returns {Object.} JSON object + */ + Transition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Transition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.Coverage.Transition"; + }; + + return Transition; + })(); + + return Coverage; + })(); + + return TransitionRouteGroupCoverage; + })(); + + v3beta1.IntentCoverage = (function() { + + /** + * Properties of an IntentCoverage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IIntentCoverage + * @property {Array.|null} [intents] IntentCoverage intents + * @property {number|null} [coverageScore] IntentCoverage coverageScore + */ + + /** + * Constructs a new IntentCoverage. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an IntentCoverage. + * @implements IIntentCoverage + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentCoverage=} [properties] Properties to set + */ + function IntentCoverage(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentCoverage intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @instance + */ + IntentCoverage.prototype.intents = $util.emptyArray; + + /** + * IntentCoverage coverageScore. + * @member {number} coverageScore + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @instance + */ + IntentCoverage.prototype.coverageScore = 0; + + /** + * Creates a new IntentCoverage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentCoverage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage} IntentCoverage instance + */ + IntentCoverage.create = function create(properties) { + return new IntentCoverage(properties); + }; + + /** + * Encodes the specified IntentCoverage message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentCoverage} message IntentCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentCoverage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coverageScore != null && Object.hasOwnProperty.call(message, "coverageScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.coverageScore); + return writer; + }; + + /** + * Encodes the specified IntentCoverage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentCoverage} message IntentCoverage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentCoverage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage} IntentCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentCoverage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.coverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentCoverage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage} IntentCoverage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentCoverage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentCoverage message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentCoverage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.verify(message.intents[i], long + 1); + if (error) + return "intents." + error; + } + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + if (typeof message.coverageScore !== "number") + return "coverageScore: number expected"; + return null; + }; + + /** + * Creates an IntentCoverage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage} IntentCoverage + */ + IntentCoverage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.IntentCoverage.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.IntentCoverage.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.fromObject(object.intents[i], long + 1); + } + } + if (object.coverageScore != null) + message.coverageScore = Number(object.coverageScore); + return message; + }; + + /** + * Creates a plain object from an IntentCoverage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IntentCoverage} message IntentCoverage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentCoverage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.coverageScore = 0; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.toObject(message.intents[j], options); + } + if (message.coverageScore != null && message.hasOwnProperty("coverageScore")) + object.coverageScore = options.json && !isFinite(message.coverageScore) ? String(message.coverageScore) : message.coverageScore; + return object; + }; + + /** + * Converts this IntentCoverage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @instance + * @returns {Object.} JSON object + */ + IntentCoverage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentCoverage + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentCoverage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.IntentCoverage"; + }; + + IntentCoverage.Intent = (function() { + + /** + * Properties of an Intent. + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @interface IIntent + * @property {string|null} [intent] Intent intent + * @property {boolean|null} [covered] Intent covered + */ + + /** + * Constructs a new Intent. + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage + * @classdesc Represents an Intent. + * @implements IIntent + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent=} [properties] Properties to set + */ + function Intent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Intent intent. + * @member {string} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @instance + */ + Intent.prototype.intent = ""; + + /** + * Intent covered. + * @member {boolean} covered + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @instance + */ + Intent.prototype.covered = false; + + /** + * Creates a new Intent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent} Intent instance + */ + Intent.create = function create(properties) { + return new Intent(properties); + }; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intent); + if (message.covered != null && Object.hasOwnProperty.call(message, "covered")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.covered); + return writer; + }; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = reader.string(); + break; + } + case 2: { + message.covered = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Intent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Intent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) + if (!$util.isString(message.intent)) + return "intent: string expected"; + if (message.covered != null && message.hasOwnProperty("covered")) + if (typeof message.covered !== "boolean") + return "covered: boolean expected"; + return null; + }; + + /** + * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent} Intent + */ + Intent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent(); + if (object.intent != null) + message.intent = String(object.intent); + if (object.covered != null) + message.covered = Boolean(object.covered); + return message; + }; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent} message Intent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Intent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = ""; + object.covered = false; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = message.intent; + if (message.covered != null && message.hasOwnProperty("covered")) + object.covered = message.covered; + return object; + }; + + /** + * Converts this Intent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @instance + * @returns {Object.} JSON object + */ + Intent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Intent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Intent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.IntentCoverage.Intent"; + }; + + return Intent; + })(); + + return IntentCoverage; + })(); + + v3beta1.CalculateCoverageRequest = (function() { + + /** + * Properties of a CalculateCoverageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICalculateCoverageRequest + * @property {string|null} [agent] CalculateCoverageRequest agent + * @property {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType|null} [type] CalculateCoverageRequest type + */ + + /** + * Constructs a new CalculateCoverageRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CalculateCoverageRequest. + * @implements ICalculateCoverageRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest=} [properties] Properties to set + */ + function CalculateCoverageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CalculateCoverageRequest agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @instance + */ + CalculateCoverageRequest.prototype.agent = ""; + + /** + * CalculateCoverageRequest type. + * @member {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType} type + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @instance + */ + CalculateCoverageRequest.prototype.type = 0; + + /** + * Creates a new CalculateCoverageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest} CalculateCoverageRequest instance + */ + CalculateCoverageRequest.create = function create(properties) { + return new CalculateCoverageRequest(properties); + }; + + /** + * Encodes the specified CalculateCoverageRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest} message CalculateCoverageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agent); + return writer; + }; + + /** + * Encodes the specified CalculateCoverageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest} message CalculateCoverageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest} CalculateCoverageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.agent = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CalculateCoverageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest} CalculateCoverageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CalculateCoverageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CalculateCoverageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a CalculateCoverageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest} CalculateCoverageRequest + */ + CalculateCoverageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest(); + if (object.agent != null) + message.agent = String(object.agent); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COVERAGE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INTENT": + case 1: + message.type = 1; + break; + case "PAGE_TRANSITION": + case 2: + message.type = 2; + break; + case "TRANSITION_ROUTE_GROUP": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a CalculateCoverageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest} message CalculateCoverageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CalculateCoverageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "COVERAGE_TYPE_UNSPECIFIED" : 0; + object.agent = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType[message.type] : message.type; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; + + /** + * Converts this CalculateCoverageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @instance + * @returns {Object.} JSON object + */ + CalculateCoverageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CalculateCoverageRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CalculateCoverageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest"; + }; + + /** + * CoverageType enum. + * @name google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType + * @enum {number} + * @property {number} COVERAGE_TYPE_UNSPECIFIED=0 COVERAGE_TYPE_UNSPECIFIED value + * @property {number} INTENT=1 INTENT value + * @property {number} PAGE_TRANSITION=2 PAGE_TRANSITION value + * @property {number} TRANSITION_ROUTE_GROUP=3 TRANSITION_ROUTE_GROUP value + */ + CalculateCoverageRequest.CoverageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COVERAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT"] = 1; + values[valuesById[2] = "PAGE_TRANSITION"] = 2; + values[valuesById[3] = "TRANSITION_ROUTE_GROUP"] = 3; + return values; + })(); + + return CalculateCoverageRequest; + })(); + + v3beta1.CalculateCoverageResponse = (function() { + + /** + * Properties of a CalculateCoverageResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICalculateCoverageResponse + * @property {string|null} [agent] CalculateCoverageResponse agent + * @property {google.cloud.dialogflow.cx.v3beta1.IIntentCoverage|null} [intentCoverage] CalculateCoverageResponse intentCoverage + * @property {google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage|null} [transitionCoverage] CalculateCoverageResponse transitionCoverage + * @property {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage|null} [routeGroupCoverage] CalculateCoverageResponse routeGroupCoverage + */ + + /** + * Constructs a new CalculateCoverageResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CalculateCoverageResponse. + * @implements ICalculateCoverageResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse=} [properties] Properties to set + */ + function CalculateCoverageResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CalculateCoverageResponse agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.agent = ""; + + /** + * CalculateCoverageResponse intentCoverage. + * @member {google.cloud.dialogflow.cx.v3beta1.IIntentCoverage|null|undefined} intentCoverage + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.intentCoverage = null; + + /** + * CalculateCoverageResponse transitionCoverage. + * @member {google.cloud.dialogflow.cx.v3beta1.ITransitionCoverage|null|undefined} transitionCoverage + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.transitionCoverage = null; + + /** + * CalculateCoverageResponse routeGroupCoverage. + * @member {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroupCoverage|null|undefined} routeGroupCoverage + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @instance + */ + CalculateCoverageResponse.prototype.routeGroupCoverage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CalculateCoverageResponse coverageType. + * @member {"intentCoverage"|"transitionCoverage"|"routeGroupCoverage"|undefined} coverageType + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @instance + */ + Object.defineProperty(CalculateCoverageResponse.prototype, "coverageType", { + get: $util.oneOfGetter($oneOfFields = ["intentCoverage", "transitionCoverage", "routeGroupCoverage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CalculateCoverageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse} CalculateCoverageResponse instance + */ + CalculateCoverageResponse.create = function create(properties) { + return new CalculateCoverageResponse(properties); + }; + + /** + * Encodes the specified CalculateCoverageResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse} message CalculateCoverageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentCoverage != null && Object.hasOwnProperty.call(message, "intentCoverage")) + $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.encode(message.intentCoverage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transitionCoverage != null && Object.hasOwnProperty.call(message, "transitionCoverage")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.encode(message.transitionCoverage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.agent); + if (message.routeGroupCoverage != null && Object.hasOwnProperty.call(message, "routeGroupCoverage")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.encode(message.routeGroupCoverage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CalculateCoverageResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse} message CalculateCoverageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CalculateCoverageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse} CalculateCoverageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.agent = reader.string(); + break; + } + case 2: { + message.intentCoverage = $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.transitionCoverage = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.routeGroupCoverage = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CalculateCoverageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse} CalculateCoverageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CalculateCoverageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CalculateCoverageResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CalculateCoverageResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.intentCoverage != null && message.hasOwnProperty("intentCoverage")) { + properties.coverageType = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.verify(message.intentCoverage, long + 1); + if (error) + return "intentCoverage." + error; + } + } + if (message.transitionCoverage != null && message.hasOwnProperty("transitionCoverage")) { + if (properties.coverageType === 1) + return "coverageType: multiple values"; + properties.coverageType = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.verify(message.transitionCoverage, long + 1); + if (error) + return "transitionCoverage." + error; + } + } + if (message.routeGroupCoverage != null && message.hasOwnProperty("routeGroupCoverage")) { + if (properties.coverageType === 1) + return "coverageType: multiple values"; + properties.coverageType = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.verify(message.routeGroupCoverage, long + 1); + if (error) + return "routeGroupCoverage." + error; + } + } + return null; + }; + + /** + * Creates a CalculateCoverageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse} CalculateCoverageResponse + */ + CalculateCoverageResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse(); + if (object.agent != null) + message.agent = String(object.agent); + if (object.intentCoverage != null) { + if (typeof object.intentCoverage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse.intentCoverage: object expected"); + message.intentCoverage = $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.fromObject(object.intentCoverage, long + 1); + } + if (object.transitionCoverage != null) { + if (typeof object.transitionCoverage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse.transitionCoverage: object expected"); + message.transitionCoverage = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.fromObject(object.transitionCoverage, long + 1); + } + if (object.routeGroupCoverage != null) { + if (typeof object.routeGroupCoverage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse.routeGroupCoverage: object expected"); + message.routeGroupCoverage = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.fromObject(object.routeGroupCoverage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CalculateCoverageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse} message CalculateCoverageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CalculateCoverageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agent = ""; + if (message.intentCoverage != null && message.hasOwnProperty("intentCoverage")) { + object.intentCoverage = $root.google.cloud.dialogflow.cx.v3beta1.IntentCoverage.toObject(message.intentCoverage, options); + if (options.oneofs) + object.coverageType = "intentCoverage"; + } + if (message.transitionCoverage != null && message.hasOwnProperty("transitionCoverage")) { + object.transitionCoverage = $root.google.cloud.dialogflow.cx.v3beta1.TransitionCoverage.toObject(message.transitionCoverage, options); + if (options.oneofs) + object.coverageType = "transitionCoverage"; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + if (message.routeGroupCoverage != null && message.hasOwnProperty("routeGroupCoverage")) { + object.routeGroupCoverage = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupCoverage.toObject(message.routeGroupCoverage, options); + if (options.oneofs) + object.coverageType = "routeGroupCoverage"; + } + return object; + }; + + /** + * Converts this CalculateCoverageResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @instance + * @returns {Object.} JSON object + */ + CalculateCoverageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CalculateCoverageResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CalculateCoverageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse"; + }; + + return CalculateCoverageResponse; + })(); + + v3beta1.ListTestCasesRequest = (function() { + + /** + * Properties of a ListTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListTestCasesRequest + * @property {string|null} [parent] ListTestCasesRequest parent + * @property {number|null} [pageSize] ListTestCasesRequest pageSize + * @property {string|null} [pageToken] ListTestCasesRequest pageToken + * @property {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView|null} [view] ListTestCasesRequest view + */ + + /** + * Constructs a new ListTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListTestCasesRequest. + * @implements IListTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest=} [properties] Properties to set + */ + function ListTestCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.parent = ""; + + /** + * ListTestCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.pageSize = 0; + + /** + * ListTestCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.pageToken = ""; + + /** + * ListTestCasesRequest view. + * @member {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView} view + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @instance + */ + ListTestCasesRequest.prototype.view = 0; + + /** + * Creates a new ListTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest} ListTestCasesRequest instance + */ + ListTestCasesRequest.create = function create(properties) { + return new ListTestCasesRequest(properties); + }; + + /** + * Encodes the specified ListTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest} message ListTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest} message ListTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest} ListTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest} ListTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest} ListTestCasesRequest + */ + ListTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "TEST_CASE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest} message ListTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "TEST_CASE_VIEW_UNSPECIFIED" : 0; + } + 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.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView[message.view] === undefined ? message.view : $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest"; + }; + + /** + * TestCaseView enum. + * @name google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView + * @enum {number} + * @property {number} TEST_CASE_VIEW_UNSPECIFIED=0 TEST_CASE_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + ListTestCasesRequest.TestCaseView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEST_CASE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return ListTestCasesRequest; + })(); + + v3beta1.ListTestCasesResponse = (function() { + + /** + * Properties of a ListTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListTestCasesResponse + * @property {Array.|null} [testCases] ListTestCasesResponse testCases + * @property {string|null} [nextPageToken] ListTestCasesResponse nextPageToken + */ + + /** + * Constructs a new ListTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListTestCasesResponse. + * @implements IListTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse=} [properties] Properties to set + */ + function ListTestCasesResponse(properties) { + this.testCases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCasesResponse testCases. + * @member {Array.} testCases + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @instance + */ + ListTestCasesResponse.prototype.testCases = $util.emptyArray; + + /** + * ListTestCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @instance + */ + ListTestCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse} ListTestCasesResponse instance + */ + ListTestCasesResponse.create = function create(properties) { + return new ListTestCasesResponse(properties); + }; + + /** + * Encodes the specified ListTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse} message ListTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCases != null && message.testCases.length) + for (var i = 0; i < message.testCases.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestCase.encode(message.testCases[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 ListTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse} message ListTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse} ListTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testCases && message.testCases.length)) + message.testCases = []; + message.testCases.push($root.google.cloud.dialogflow.cx.v3beta1.TestCase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse} ListTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCases != null && message.hasOwnProperty("testCases")) { + if (!Array.isArray(message.testCases)) + return "testCases: array expected"; + for (var i = 0; i < message.testCases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.verify(message.testCases[i], long + 1); + if (error) + return "testCases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse} ListTestCasesResponse + */ + ListTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse(); + if (object.testCases) { + if (!Array.isArray(object.testCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse.testCases: array expected"); + message.testCases = []; + for (var i = 0; i < object.testCases.length; ++i) { + if (typeof object.testCases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse.testCases: object expected"); + message.testCases[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.fromObject(object.testCases[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse} message ListTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.testCases && message.testCases.length) { + object.testCases = []; + for (var j = 0; j < message.testCases.length; ++j) + object.testCases[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.toObject(message.testCases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListTestCasesResponse"; + }; + + return ListTestCasesResponse; + })(); + + v3beta1.BatchDeleteTestCasesRequest = (function() { + + /** + * Properties of a BatchDeleteTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBatchDeleteTestCasesRequest + * @property {string|null} [parent] BatchDeleteTestCasesRequest parent + * @property {Array.|null} [names] BatchDeleteTestCasesRequest names + */ + + /** + * Constructs a new BatchDeleteTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BatchDeleteTestCasesRequest. + * @implements IBatchDeleteTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest=} [properties] Properties to set + */ + function BatchDeleteTestCasesRequest(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @instance + */ + BatchDeleteTestCasesRequest.prototype.parent = ""; + + /** + * BatchDeleteTestCasesRequest names. + * @member {Array.} names + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @instance + */ + BatchDeleteTestCasesRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchDeleteTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest instance + */ + BatchDeleteTestCasesRequest.create = function create(properties) { + return new BatchDeleteTestCasesRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest} message BatchDeleteTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteTestCasesRequest.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.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest} message BatchDeleteTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest} BatchDeleteTestCasesRequest + */ + BatchDeleteTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest} message BatchDeleteTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest"; + }; + + return BatchDeleteTestCasesRequest; + })(); + + v3beta1.CreateTestCaseRequest = (function() { + + /** + * Properties of a CreateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateTestCaseRequest + * @property {string|null} [parent] CreateTestCaseRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.ITestCase|null} [testCase] CreateTestCaseRequest testCase + */ + + /** + * Constructs a new CreateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateTestCaseRequest. + * @implements ICreateTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest=} [properties] Properties to set + */ + function CreateTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTestCaseRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @instance + */ + CreateTestCaseRequest.prototype.parent = ""; + + /** + * CreateTestCaseRequest testCase. + * @member {google.cloud.dialogflow.cx.v3beta1.ITestCase|null|undefined} testCase + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @instance + */ + CreateTestCaseRequest.prototype.testCase = null; + + /** + * Creates a new CreateTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest} CreateTestCaseRequest instance + */ + CreateTestCaseRequest.create = function create(properties) { + return new CreateTestCaseRequest(properties); + }; + + /** + * Encodes the specified CreateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest} message CreateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTestCaseRequest.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.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + $root.google.cloud.dialogflow.cx.v3beta1.TestCase.encode(message.testCase, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest} message CreateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest} CreateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest} CreateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.testCase != null && message.hasOwnProperty("testCase")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.verify(message.testCase, long + 1); + if (error) + return "testCase." + error; + } + return null; + }; + + /** + * Creates a CreateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest} CreateTestCaseRequest + */ + CreateTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.testCase != null) { + if (typeof object.testCase !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest.testCase: object expected"); + message.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.fromObject(object.testCase, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest} message CreateTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTestCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.testCase = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.toObject(message.testCase, options); + return object; + }; + + /** + * Converts this CreateTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest"; + }; + + return CreateTestCaseRequest; + })(); + + v3beta1.UpdateTestCaseRequest = (function() { + + /** + * Properties of an UpdateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateTestCaseRequest + * @property {google.cloud.dialogflow.cx.v3beta1.ITestCase|null} [testCase] UpdateTestCaseRequest testCase + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTestCaseRequest updateMask + */ + + /** + * Constructs a new UpdateTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateTestCaseRequest. + * @implements IUpdateTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest=} [properties] Properties to set + */ + function UpdateTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTestCaseRequest testCase. + * @member {google.cloud.dialogflow.cx.v3beta1.ITestCase|null|undefined} testCase + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @instance + */ + UpdateTestCaseRequest.prototype.testCase = null; + + /** + * UpdateTestCaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @instance + */ + UpdateTestCaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest} UpdateTestCaseRequest instance + */ + UpdateTestCaseRequest.create = function create(properties) { + return new UpdateTestCaseRequest(properties); + }; + + /** + * Encodes the specified UpdateTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest} message UpdateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTestCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + $root.google.cloud.dialogflow.cx.v3beta1.TestCase.encode(message.testCase, 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 UpdateTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest} message UpdateTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest} UpdateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest} UpdateTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCase != null && message.hasOwnProperty("testCase")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.verify(message.testCase, long + 1); + if (error) + return "testCase." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest} UpdateTestCaseRequest + */ + UpdateTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest(); + if (object.testCase != null) { + if (typeof object.testCase !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest.testCase: object expected"); + message.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.fromObject(object.testCase, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest} message UpdateTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTestCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testCase = null; + object.updateMask = null; + } + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.toObject(message.testCase, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest"; + }; + + return UpdateTestCaseRequest; + })(); + + v3beta1.GetTestCaseRequest = (function() { + + /** + * Properties of a GetTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetTestCaseRequest + * @property {string|null} [name] GetTestCaseRequest name + */ + + /** + * Constructs a new GetTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetTestCaseRequest. + * @implements IGetTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest=} [properties] Properties to set + */ + function GetTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTestCaseRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @instance + */ + GetTestCaseRequest.prototype.name = ""; + + /** + * Creates a new GetTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest} GetTestCaseRequest instance + */ + GetTestCaseRequest.create = function create(properties) { + return new GetTestCaseRequest(properties); + }; + + /** + * Encodes the specified GetTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest} message GetTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseRequest.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 GetTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest} message GetTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest} GetTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest} GetTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest} GetTestCaseRequest + */ + GetTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest} message GetTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTestCaseRequest.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 GetTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest"; + }; + + return GetTestCaseRequest; + })(); + + v3beta1.RunTestCaseRequest = (function() { + + /** + * Properties of a RunTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRunTestCaseRequest + * @property {string|null} [name] RunTestCaseRequest name + * @property {string|null} [environment] RunTestCaseRequest environment + */ + + /** + * Constructs a new RunTestCaseRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RunTestCaseRequest. + * @implements IRunTestCaseRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest=} [properties] Properties to set + */ + function RunTestCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunTestCaseRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @instance + */ + RunTestCaseRequest.prototype.name = ""; + + /** + * RunTestCaseRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @instance + */ + RunTestCaseRequest.prototype.environment = ""; + + /** + * Creates a new RunTestCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest} RunTestCaseRequest instance + */ + RunTestCaseRequest.create = function create(properties) { + return new RunTestCaseRequest(properties); + }; + + /** + * Encodes the specified RunTestCaseRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest} message RunTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + return writer; + }; + + /** + * Encodes the specified RunTestCaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest} message RunTestCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest} RunTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.environment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunTestCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest} RunTestCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunTestCaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunTestCaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + return null; + }; + + /** + * Creates a RunTestCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest} RunTestCaseRequest + */ + RunTestCaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.environment != null) + message.environment = String(object.environment); + return message; + }; + + /** + * Creates a plain object from a RunTestCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest} message RunTestCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunTestCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.environment = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + return object; + }; + + /** + * Converts this RunTestCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @instance + * @returns {Object.} JSON object + */ + RunTestCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunTestCaseRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunTestCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest"; + }; + + return RunTestCaseRequest; + })(); + + v3beta1.RunTestCaseResponse = (function() { + + /** + * Properties of a RunTestCaseResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRunTestCaseResponse + * @property {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null} [result] RunTestCaseResponse result + */ + + /** + * Constructs a new RunTestCaseResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RunTestCaseResponse. + * @implements IRunTestCaseResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse=} [properties] Properties to set + */ + function RunTestCaseResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunTestCaseResponse result. + * @member {google.cloud.dialogflow.cx.v3beta1.ITestCaseResult|null|undefined} result + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @instance + */ + RunTestCaseResponse.prototype.result = null; + + /** + * Creates a new RunTestCaseResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse} RunTestCaseResponse instance + */ + RunTestCaseResponse.create = function create(properties) { + return new RunTestCaseResponse(properties); + }; + + /** + * Encodes the specified RunTestCaseResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse} message RunTestCaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.encode(message.result, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunTestCaseResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse} message RunTestCaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse} RunTestCaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.result = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunTestCaseResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse} RunTestCaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunTestCaseResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunTestCaseResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify(message.result, long + 1); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a RunTestCaseResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse} RunTestCaseResponse + */ + RunTestCaseResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse.result: object expected"); + message.result = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.fromObject(object.result, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RunTestCaseResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse} message RunTestCaseResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunTestCaseResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.result = null; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.toObject(message.result, options); + return object; + }; + + /** + * Converts this RunTestCaseResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @instance + * @returns {Object.} JSON object + */ + RunTestCaseResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunTestCaseResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunTestCaseResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse"; + }; + + return RunTestCaseResponse; + })(); + + v3beta1.RunTestCaseMetadata = (function() { + + /** + * Properties of a RunTestCaseMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRunTestCaseMetadata + */ + + /** + * Constructs a new RunTestCaseMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RunTestCaseMetadata. + * @implements IRunTestCaseMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata=} [properties] Properties to set + */ + function RunTestCaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RunTestCaseMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata} RunTestCaseMetadata instance + */ + RunTestCaseMetadata.create = function create(properties) { + return new RunTestCaseMetadata(properties); + }; + + /** + * Encodes the specified RunTestCaseMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata} message RunTestCaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RunTestCaseMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata} message RunTestCaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTestCaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata} RunTestCaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RunTestCaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata} RunTestCaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTestCaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunTestCaseMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunTestCaseMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a RunTestCaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata} RunTestCaseMetadata + */ + RunTestCaseMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata(); + }; + + /** + * Creates a plain object from a RunTestCaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata} message RunTestCaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunTestCaseMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RunTestCaseMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @instance + * @returns {Object.} JSON object + */ + RunTestCaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunTestCaseMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunTestCaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata"; + }; + + return RunTestCaseMetadata; + })(); + + v3beta1.BatchRunTestCasesRequest = (function() { + + /** + * Properties of a BatchRunTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBatchRunTestCasesRequest + * @property {string|null} [parent] BatchRunTestCasesRequest parent + * @property {string|null} [environment] BatchRunTestCasesRequest environment + * @property {Array.|null} [testCases] BatchRunTestCasesRequest testCases + */ + + /** + * Constructs a new BatchRunTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BatchRunTestCasesRequest. + * @implements IBatchRunTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest=} [properties] Properties to set + */ + function BatchRunTestCasesRequest(properties) { + this.testCases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRunTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @instance + */ + BatchRunTestCasesRequest.prototype.parent = ""; + + /** + * BatchRunTestCasesRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @instance + */ + BatchRunTestCasesRequest.prototype.environment = ""; + + /** + * BatchRunTestCasesRequest testCases. + * @member {Array.} testCases + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @instance + */ + BatchRunTestCasesRequest.prototype.testCases = $util.emptyArray; + + /** + * Creates a new BatchRunTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest} BatchRunTestCasesRequest instance + */ + BatchRunTestCasesRequest.create = function create(properties) { + return new BatchRunTestCasesRequest(properties); + }; + + /** + * Encodes the specified BatchRunTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest} message BatchRunTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + if (message.testCases != null && message.testCases.length) + for (var i = 0; i < message.testCases.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.testCases[i]); + return writer; + }; + + /** + * Encodes the specified BatchRunTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest} message BatchRunTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest} BatchRunTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.environment = reader.string(); + break; + } + case 3: { + if (!(message.testCases && message.testCases.length)) + message.testCases = []; + message.testCases.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest} BatchRunTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.testCases != null && message.hasOwnProperty("testCases")) { + if (!Array.isArray(message.testCases)) + return "testCases: array expected"; + for (var i = 0; i < message.testCases.length; ++i) + if (!$util.isString(message.testCases[i])) + return "testCases: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchRunTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest} BatchRunTestCasesRequest + */ + BatchRunTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.environment != null) + message.environment = String(object.environment); + if (object.testCases) { + if (!Array.isArray(object.testCases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest.testCases: array expected"); + message.testCases = []; + for (var i = 0; i < object.testCases.length; ++i) + message.testCases[i] = String(object.testCases[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchRunTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest} message BatchRunTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCases = []; + if (options.defaults) { + object.parent = ""; + object.environment = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.testCases && message.testCases.length) { + object.testCases = []; + for (var j = 0; j < message.testCases.length; ++j) + object.testCases[j] = message.testCases[j]; + } + return object; + }; + + /** + * Converts this BatchRunTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchRunTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest"; + }; + + return BatchRunTestCasesRequest; + })(); + + v3beta1.BatchRunTestCasesResponse = (function() { + + /** + * Properties of a BatchRunTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBatchRunTestCasesResponse + * @property {Array.|null} [results] BatchRunTestCasesResponse results + */ + + /** + * Constructs a new BatchRunTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BatchRunTestCasesResponse. + * @implements IBatchRunTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse=} [properties] Properties to set + */ + function BatchRunTestCasesResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRunTestCasesResponse results. + * @member {Array.} results + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @instance + */ + BatchRunTestCasesResponse.prototype.results = $util.emptyArray; + + /** + * Creates a new BatchRunTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse} BatchRunTestCasesResponse instance + */ + BatchRunTestCasesResponse.create = function create(properties) { + return new BatchRunTestCasesResponse(properties); + }; + + /** + * Encodes the specified BatchRunTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse} message BatchRunTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRunTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse} message BatchRunTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse} BatchRunTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse} BatchRunTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify(message.results[i], long + 1); + if (error) + return "results." + error; + } + } + return null; + }; + + /** + * Creates a BatchRunTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse} BatchRunTestCasesResponse + */ + BatchRunTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse.results: object expected"); + message.results[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.fromObject(object.results[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchRunTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse} message BatchRunTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.toObject(message.results[j], options); + } + return object; + }; + + /** + * Converts this BatchRunTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchRunTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse"; + }; + + return BatchRunTestCasesResponse; + })(); + + v3beta1.BatchRunTestCasesMetadata = (function() { + + /** + * Properties of a BatchRunTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBatchRunTestCasesMetadata + * @property {Array.|null} [errors] BatchRunTestCasesMetadata errors + */ + + /** + * Constructs a new BatchRunTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BatchRunTestCasesMetadata. + * @implements IBatchRunTestCasesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata=} [properties] Properties to set + */ + function BatchRunTestCasesMetadata(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRunTestCasesMetadata errors. + * @member {Array.} errors + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @instance + */ + BatchRunTestCasesMetadata.prototype.errors = $util.emptyArray; + + /** + * Creates a new BatchRunTestCasesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata instance + */ + BatchRunTestCasesMetadata.create = function create(properties) { + return new BatchRunTestCasesMetadata(properties); + }; + + /** + * Encodes the specified BatchRunTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata} message BatchRunTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRunTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata} message BatchRunTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunTestCasesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.dialogflow.cx.v3beta1.TestError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunTestCasesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunTestCasesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunTestCasesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunTestCasesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestError.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a BatchRunTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata} BatchRunTestCasesMetadata + */ + BatchRunTestCasesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata.errors: object expected"); + message.errors[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestError.fromObject(object.errors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchRunTestCasesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata} message BatchRunTestCasesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunTestCasesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this BatchRunTestCasesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchRunTestCasesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunTestCasesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunTestCasesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata"; + }; + + return BatchRunTestCasesMetadata; + })(); + + v3beta1.TestError = (function() { + + /** + * Properties of a TestError. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITestError + * @property {string|null} [testCase] TestError testCase + * @property {google.rpc.IStatus|null} [status] TestError status + * @property {google.protobuf.ITimestamp|null} [testTime] TestError testTime + */ + + /** + * Constructs a new TestError. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TestError. + * @implements ITestError + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITestError=} [properties] Properties to set + */ + function TestError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestError testCase. + * @member {string} testCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @instance + */ + TestError.prototype.testCase = ""; + + /** + * TestError status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @instance + */ + TestError.prototype.status = null; + + /** + * TestError testTime. + * @member {google.protobuf.ITimestamp|null|undefined} testTime + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @instance + */ + TestError.prototype.testTime = null; + + /** + * Creates a new TestError instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TestError} TestError instance + */ + TestError.create = function create(properties) { + return new TestError(properties); + }; + + /** + * Encodes the specified TestError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestError.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestError} message TestError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.testCase); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.testTime != null && Object.hasOwnProperty.call(message, "testTime")) + $root.google.protobuf.Timestamp.encode(message.testTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestError} message TestError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TestError} TestError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestError.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TestError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.testCase = reader.string(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.testTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TestError} TestError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestError message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestError.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCase != null && message.hasOwnProperty("testCase")) + if (!$util.isString(message.testCase)) + return "testCase: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + if (message.testTime != null && message.hasOwnProperty("testTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.testTime, long + 1); + if (error) + return "testTime." + error; + } + return null; + }; + + /** + * Creates a TestError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TestError} TestError + */ + TestError.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TestError) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TestError(); + if (object.testCase != null) + message.testCase = String(object.testCase); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestError.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); + } + if (object.testTime != null) { + if (typeof object.testTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestError.testTime: object expected"); + message.testTime = $root.google.protobuf.Timestamp.fromObject(object.testTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TestError} message TestError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testCase = ""; + object.status = null; + object.testTime = null; + } + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = message.testCase; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.testTime != null && message.hasOwnProperty("testTime")) + object.testTime = $root.google.protobuf.Timestamp.toObject(message.testTime, options); + return object; + }; + + /** + * Converts this TestError to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @instance + * @returns {Object.} JSON object + */ + TestError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestError + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TestError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TestError"; + }; + + return TestError; + })(); + + v3beta1.ImportTestCasesRequest = (function() { + + /** + * Properties of an ImportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportTestCasesRequest + * @property {string|null} [parent] ImportTestCasesRequest parent + * @property {string|null} [gcsUri] ImportTestCasesRequest gcsUri + * @property {Uint8Array|null} [content] ImportTestCasesRequest content + */ + + /** + * Constructs a new ImportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportTestCasesRequest. + * @implements IImportTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest=} [properties] Properties to set + */ + function ImportTestCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @instance + */ + ImportTestCasesRequest.prototype.parent = ""; + + /** + * ImportTestCasesRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @instance + */ + ImportTestCasesRequest.prototype.gcsUri = null; + + /** + * ImportTestCasesRequest content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @instance + */ + ImportTestCasesRequest.prototype.content = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportTestCasesRequest source. + * @member {"gcsUri"|"content"|undefined} source + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @instance + */ + Object.defineProperty(ImportTestCasesRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri", "content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest} ImportTestCasesRequest instance + */ + ImportTestCasesRequest.create = function create(properties) { + return new ImportTestCasesRequest(properties); + }; + + /** + * Encodes the specified ImportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest} message ImportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesRequest.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.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified ImportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest} message ImportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest} ImportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest} ImportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.source = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + return null; + }; + + /** + * Creates an ImportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest} ImportTestCasesRequest + */ + ImportTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an ImportTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest} message ImportTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.source = "gcsUri"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.source = "content"; + } + return object; + }; + + /** + * Converts this ImportTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest"; + }; + + return ImportTestCasesRequest; + })(); + + v3beta1.ImportTestCasesResponse = (function() { + + /** + * Properties of an ImportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportTestCasesResponse + * @property {Array.|null} [names] ImportTestCasesResponse names + */ + + /** + * Constructs a new ImportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportTestCasesResponse. + * @implements IImportTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse=} [properties] Properties to set + */ + function ImportTestCasesResponse(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTestCasesResponse names. + * @member {Array.} names + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @instance + */ + ImportTestCasesResponse.prototype.names = $util.emptyArray; + + /** + * Creates a new ImportTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse} ImportTestCasesResponse instance + */ + ImportTestCasesResponse.create = function create(properties) { + return new ImportTestCasesResponse(properties); + }; + + /** + * Encodes the specified ImportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse} message ImportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified ImportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse} message ImportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse} ImportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse} ImportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates an ImportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse} ImportTestCasesResponse + */ + ImportTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse(); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from an ImportTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse} message ImportTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this ImportTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ImportTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse"; + }; + + return ImportTestCasesResponse; + })(); + + v3beta1.ImportTestCasesMetadata = (function() { + + /** + * Properties of an ImportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportTestCasesMetadata + * @property {Array.|null} [errors] ImportTestCasesMetadata errors + */ + + /** + * Constructs a new ImportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportTestCasesMetadata. + * @implements IImportTestCasesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata=} [properties] Properties to set + */ + function ImportTestCasesMetadata(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTestCasesMetadata errors. + * @member {Array.} errors + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @instance + */ + ImportTestCasesMetadata.prototype.errors = $util.emptyArray; + + /** + * Creates a new ImportTestCasesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata} ImportTestCasesMetadata instance + */ + ImportTestCasesMetadata.create = function create(properties) { + return new ImportTestCasesMetadata(properties); + }; + + /** + * Encodes the specified ImportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata} message ImportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestCaseError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata} message ImportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTestCasesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata} ImportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.dialogflow.cx.v3beta1.TestCaseError.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata} ImportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTestCasesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTestCasesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTestCasesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseError.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates an ImportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata} ImportTestCasesMetadata + */ + ImportTestCasesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata.errors: object expected"); + message.errors[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseError.fromObject(object.errors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportTestCasesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata} message ImportTestCasesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTestCasesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this ImportTestCasesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportTestCasesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportTestCasesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportTestCasesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata"; + }; + + return ImportTestCasesMetadata; + })(); + + v3beta1.TestCaseError = (function() { + + /** + * Properties of a TestCaseError. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITestCaseError + * @property {google.cloud.dialogflow.cx.v3beta1.ITestCase|null} [testCase] TestCaseError testCase + * @property {google.rpc.IStatus|null} [status] TestCaseError status + */ + + /** + * Constructs a new TestCaseError. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TestCaseError. + * @implements ITestCaseError + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseError=} [properties] Properties to set + */ + function TestCaseError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestCaseError testCase. + * @member {google.cloud.dialogflow.cx.v3beta1.ITestCase|null|undefined} testCase + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @instance + */ + TestCaseError.prototype.testCase = null; + + /** + * TestCaseError status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @instance + */ + TestCaseError.prototype.status = null; + + /** + * Creates a new TestCaseError instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseError} TestCaseError instance + */ + TestCaseError.create = function create(properties) { + return new TestCaseError(properties); + }; + + /** + * Encodes the specified TestCaseError message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseError.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseError} message TestCaseError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + $root.google.cloud.dialogflow.cx.v3beta1.TestCase.encode(message.testCase, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestCaseError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TestCaseError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITestCaseError} message TestCaseError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestCaseError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestCaseError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseError} TestCaseError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseError.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TestCaseError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TestCaseError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseError} TestCaseError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestCaseError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestCaseError message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestCaseError.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCase != null && message.hasOwnProperty("testCase")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.verify(message.testCase, long + 1); + if (error) + return "testCase." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a TestCaseError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TestCaseError} TestCaseError + */ + TestCaseError.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TestCaseError) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TestCaseError(); + if (object.testCase != null) { + if (typeof object.testCase !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCaseError.testCase: object expected"); + message.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.fromObject(object.testCase, long + 1); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TestCaseError.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TestCaseError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TestCaseError} message TestCaseError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestCaseError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testCase = null; + object.status = null; + } + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = $root.google.cloud.dialogflow.cx.v3beta1.TestCase.toObject(message.testCase, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this TestCaseError to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @instance + * @returns {Object.} JSON object + */ + TestCaseError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestCaseError + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TestCaseError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestCaseError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TestCaseError"; + }; + + return TestCaseError; + })(); + + v3beta1.ExportTestCasesRequest = (function() { + + /** + * Properties of an ExportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportTestCasesRequest + * @property {string|null} [parent] ExportTestCasesRequest parent + * @property {string|null} [gcsUri] ExportTestCasesRequest gcsUri + * @property {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat|null} [dataFormat] ExportTestCasesRequest dataFormat + * @property {string|null} [filter] ExportTestCasesRequest filter + */ + + /** + * Constructs a new ExportTestCasesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportTestCasesRequest. + * @implements IExportTestCasesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest=} [properties] Properties to set + */ + function ExportTestCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportTestCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.parent = ""; + + /** + * ExportTestCasesRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.gcsUri = null; + + /** + * ExportTestCasesRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.dataFormat = 0; + + /** + * ExportTestCasesRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @instance + */ + ExportTestCasesRequest.prototype.filter = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportTestCasesRequest destination. + * @member {"gcsUri"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @instance + */ + Object.defineProperty(ExportTestCasesRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportTestCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest} ExportTestCasesRequest instance + */ + ExportTestCasesRequest.create = function create(properties) { + return new ExportTestCasesRequest(properties); + }; + + /** + * Encodes the specified ExportTestCasesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest} message ExportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesRequest.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.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ExportTestCasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest} message ExportTestCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest} ExportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.dataFormat = reader.int32(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTestCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest} ExportTestCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTestCasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTestCasesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.destination = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates an ExportTestCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest} ExportTestCasesRequest + */ + ExportTestCasesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON": + case 2: + message.dataFormat = 2; + break; + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from an ExportTestCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest} message ExportTestCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTestCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.destination = "gcsUri"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat[message.dataFormat] : message.dataFormat; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ExportTestCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportTestCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportTestCasesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTestCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON=2 JSON value + */ + ExportTestCasesRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); + + return ExportTestCasesRequest; + })(); + + v3beta1.ExportTestCasesResponse = (function() { + + /** + * Properties of an ExportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportTestCasesResponse + * @property {string|null} [gcsUri] ExportTestCasesResponse gcsUri + * @property {Uint8Array|null} [content] ExportTestCasesResponse content + */ + + /** + * Constructs a new ExportTestCasesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportTestCasesResponse. + * @implements IExportTestCasesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse=} [properties] Properties to set + */ + function ExportTestCasesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportTestCasesResponse gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @instance + */ + ExportTestCasesResponse.prototype.gcsUri = null; + + /** + * ExportTestCasesResponse content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @instance + */ + ExportTestCasesResponse.prototype.content = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportTestCasesResponse destination. + * @member {"gcsUri"|"content"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @instance + */ + Object.defineProperty(ExportTestCasesResponse.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri", "content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportTestCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse} ExportTestCasesResponse instance + */ + ExportTestCasesResponse.create = function create(properties) { + return new ExportTestCasesResponse(properties); + }; + + /** + * Encodes the specified ExportTestCasesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse} message ExportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified ExportTestCasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse} message ExportTestCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse} ExportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + case 2: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTestCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse} ExportTestCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTestCasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTestCasesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.destination = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + return null; + }; + + /** + * Creates an ExportTestCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse} ExportTestCasesResponse + */ + ExportTestCasesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an ExportTestCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse} message ExportTestCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTestCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.destination = "gcsUri"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.destination = "content"; + } + return object; + }; + + /** + * Converts this ExportTestCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ExportTestCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportTestCasesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTestCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse"; + }; + + return ExportTestCasesResponse; + })(); + + v3beta1.ExportTestCasesMetadata = (function() { + + /** + * Properties of an ExportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportTestCasesMetadata + */ + + /** + * Constructs a new ExportTestCasesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportTestCasesMetadata. + * @implements IExportTestCasesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata=} [properties] Properties to set + */ + function ExportTestCasesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportTestCasesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata} ExportTestCasesMetadata instance + */ + ExportTestCasesMetadata.create = function create(properties) { + return new ExportTestCasesMetadata(properties); + }; + + /** + * Encodes the specified ExportTestCasesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata} message ExportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportTestCasesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata} message ExportTestCasesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTestCasesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata} ExportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTestCasesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata} ExportTestCasesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTestCasesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTestCasesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTestCasesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportTestCasesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata} ExportTestCasesMetadata + */ + ExportTestCasesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata(); + }; + + /** + * Creates a plain object from an ExportTestCasesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata} message ExportTestCasesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTestCasesMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportTestCasesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportTestCasesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportTestCasesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTestCasesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata"; + }; + + return ExportTestCasesMetadata; + })(); + + v3beta1.ListTestCaseResultsRequest = (function() { + + /** + * Properties of a ListTestCaseResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListTestCaseResultsRequest + * @property {string|null} [parent] ListTestCaseResultsRequest parent + * @property {number|null} [pageSize] ListTestCaseResultsRequest pageSize + * @property {string|null} [pageToken] ListTestCaseResultsRequest pageToken + * @property {string|null} [filter] ListTestCaseResultsRequest filter + */ + + /** + * Constructs a new ListTestCaseResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListTestCaseResultsRequest. + * @implements IListTestCaseResultsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest=} [properties] Properties to set + */ + function ListTestCaseResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCaseResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.parent = ""; + + /** + * ListTestCaseResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.pageSize = 0; + + /** + * ListTestCaseResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.pageToken = ""; + + /** + * ListTestCaseResultsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @instance + */ + ListTestCaseResultsRequest.prototype.filter = ""; + + /** + * Creates a new ListTestCaseResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest} ListTestCaseResultsRequest instance + */ + ListTestCaseResultsRequest.create = function create(properties) { + return new ListTestCaseResultsRequest(properties); + }; + + /** + * Encodes the specified ListTestCaseResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest} message ListTestCaseResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsRequest.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 ListTestCaseResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest} message ListTestCaseResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest} ListTestCaseResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCaseResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest} ListTestCaseResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCaseResultsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCaseResultsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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 ListTestCaseResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest} ListTestCaseResultsRequest + */ + ListTestCaseResultsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(); + 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 ListTestCaseResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest} message ListTestCaseResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCaseResultsRequest.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 ListTestCaseResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTestCaseResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCaseResultsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCaseResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest"; + }; + + return ListTestCaseResultsRequest; + })(); + + v3beta1.ListTestCaseResultsResponse = (function() { + + /** + * Properties of a ListTestCaseResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListTestCaseResultsResponse + * @property {Array.|null} [testCaseResults] ListTestCaseResultsResponse testCaseResults + * @property {string|null} [nextPageToken] ListTestCaseResultsResponse nextPageToken + */ + + /** + * Constructs a new ListTestCaseResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListTestCaseResultsResponse. + * @implements IListTestCaseResultsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse=} [properties] Properties to set + */ + function ListTestCaseResultsResponse(properties) { + this.testCaseResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTestCaseResultsResponse testCaseResults. + * @member {Array.} testCaseResults + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @instance + */ + ListTestCaseResultsResponse.prototype.testCaseResults = $util.emptyArray; + + /** + * ListTestCaseResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @instance + */ + ListTestCaseResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTestCaseResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse} ListTestCaseResultsResponse instance + */ + ListTestCaseResultsResponse.create = function create(properties) { + return new ListTestCaseResultsResponse(properties); + }; + + /** + * Encodes the specified ListTestCaseResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse} message ListTestCaseResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testCaseResults != null && message.testCaseResults.length) + for (var i = 0; i < message.testCaseResults.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.encode(message.testCaseResults[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 ListTestCaseResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse} message ListTestCaseResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTestCaseResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse} ListTestCaseResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.testCaseResults && message.testCaseResults.length)) + message.testCaseResults = []; + message.testCaseResults.push($root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTestCaseResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse} ListTestCaseResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTestCaseResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTestCaseResultsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTestCaseResultsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.testCaseResults != null && message.hasOwnProperty("testCaseResults")) { + if (!Array.isArray(message.testCaseResults)) + return "testCaseResults: array expected"; + for (var i = 0; i < message.testCaseResults.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.verify(message.testCaseResults[i], long + 1); + if (error) + return "testCaseResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTestCaseResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse} ListTestCaseResultsResponse + */ + ListTestCaseResultsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse(); + if (object.testCaseResults) { + if (!Array.isArray(object.testCaseResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse.testCaseResults: array expected"); + message.testCaseResults = []; + for (var i = 0; i < object.testCaseResults.length; ++i) { + if (typeof object.testCaseResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse.testCaseResults: object expected"); + message.testCaseResults[i] = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.fromObject(object.testCaseResults[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTestCaseResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse} message ListTestCaseResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTestCaseResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCaseResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.testCaseResults && message.testCaseResults.length) { + object.testCaseResults = []; + for (var j = 0; j < message.testCaseResults.length; ++j) + object.testCaseResults[j] = $root.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.toObject(message.testCaseResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTestCaseResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTestCaseResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTestCaseResultsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTestCaseResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsResponse"; + }; + + return ListTestCaseResultsResponse; + })(); + + v3beta1.GetTestCaseResultRequest = (function() { + + /** + * Properties of a GetTestCaseResultRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetTestCaseResultRequest + * @property {string|null} [name] GetTestCaseResultRequest name + */ + + /** + * Constructs a new GetTestCaseResultRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetTestCaseResultRequest. + * @implements IGetTestCaseResultRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest=} [properties] Properties to set + */ + function GetTestCaseResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTestCaseResultRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @instance + */ + GetTestCaseResultRequest.prototype.name = ""; + + /** + * Creates a new GetTestCaseResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest} GetTestCaseResultRequest instance + */ + GetTestCaseResultRequest.create = function create(properties) { + return new GetTestCaseResultRequest(properties); + }; + + /** + * Encodes the specified GetTestCaseResultRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest} message GetTestCaseResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseResultRequest.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 GetTestCaseResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest} message GetTestCaseResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTestCaseResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest} GetTestCaseResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseResultRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetTestCaseResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest} GetTestCaseResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTestCaseResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTestCaseResultRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTestCaseResultRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTestCaseResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest} GetTestCaseResultRequest + */ + GetTestCaseResultRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTestCaseResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest} message GetTestCaseResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTestCaseResultRequest.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 GetTestCaseResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetTestCaseResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTestCaseResultRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTestCaseResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest"; + }; + + return GetTestCaseResultRequest; + })(); + + /** + * TestResult enum. + * @name google.cloud.dialogflow.cx.v3beta1.TestResult + * @enum {number} + * @property {number} TEST_RESULT_UNSPECIFIED=0 TEST_RESULT_UNSPECIFIED value + * @property {number} PASSED=1 PASSED value + * @property {number} FAILED=2 FAILED value + */ + v3beta1.TestResult = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEST_RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PASSED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + v3beta1.Intents = (function() { + + /** + * Constructs a new Intents service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Intents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Intents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Intents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Intents; + + /** + * Creates new Intents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Intents} RPC service. Useful where requests and/or responses are streamed. + */ + Intents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|listIntents}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @typedef ListIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} [response] ListIntentsResponse + */ + + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest} request ListIntentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Intents.ListIntentsCallback} callback Node-style callback called with the error, if any, and ListIntentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.listIntents = function listIntents(request, callback) { + return this.rpcCall(listIntents, $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse, request, callback); + }, "name", { value: "ListIntents" }); + + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest} request ListIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|getIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @typedef GetIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Intent} [response] Intent + */ + + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest} request GetIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Intents.GetIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.getIntent = function getIntent(request, callback) { + return this.rpcCall(getIntent, $root.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Intent, request, callback); + }, "name", { value: "GetIntent" }); + + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest} request GetIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|createIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @typedef CreateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Intent} [response] Intent + */ + + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.createIntent = function createIntent(request, callback) { + return this.rpcCall(createIntent, $root.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Intent, request, callback); + }, "name", { value: "CreateIntent" }); + + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|updateIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @typedef UpdateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Intent} [response] Intent + */ + + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.updateIntent = function updateIntent(request, callback) { + return this.rpcCall(updateIntent, $root.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Intent, request, callback); + }, "name", { value: "UpdateIntent" }); + + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|deleteIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @typedef DeleteIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.deleteIntent = function deleteIntent(request, callback) { + return this.rpcCall(deleteIntent, $root.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteIntent" }); + + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|importIntents}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @typedef ImportIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportIntents. + * @function importIntents + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest} request ImportIntentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Intents.ImportIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.importIntents = function importIntents(request, callback) { + return this.rpcCall(importIntents, $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportIntents" }); + + /** + * Calls ImportIntents. + * @function importIntents + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest} request ImportIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Intents|exportIntents}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @typedef ExportIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportIntents. + * @function exportIntents + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest} request ExportIntentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Intents.ExportIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.exportIntents = function exportIntents(request, callback) { + return this.rpcCall(exportIntents, $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportIntents" }); + + /** + * Calls ExportIntents. + * @function exportIntents + * @memberof google.cloud.dialogflow.cx.v3beta1.Intents + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest} request ExportIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Intents; + })(); + + v3beta1.Intent = (function() { + + /** + * Properties of an Intent. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IIntent + * @property {string|null} [name] Intent name + * @property {string|null} [displayName] Intent displayName + * @property {Array.|null} [trainingPhrases] Intent trainingPhrases + * @property {Array.|null} [parameters] Intent parameters + * @property {number|null} [priority] Intent priority + * @property {boolean|null} [isFallback] Intent isFallback + * @property {Object.|null} [labels] Intent labels + * @property {string|null} [description] Intent description + * @property {string|null} [dtmfPattern] Intent dtmfPattern + */ + + /** + * Constructs a new Intent. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Intent. + * @implements IIntent + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IIntent=} [properties] Properties to set + */ + function Intent(properties) { + this.trainingPhrases = []; + this.parameters = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Intent name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.name = ""; + + /** + * Intent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.displayName = ""; + + /** + * Intent trainingPhrases. + * @member {Array.} trainingPhrases + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.trainingPhrases = $util.emptyArray; + + /** + * Intent parameters. + * @member {Array.} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.parameters = $util.emptyArray; + + /** + * Intent priority. + * @member {number} priority + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.priority = 0; + + /** + * Intent isFallback. + * @member {boolean} isFallback + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.isFallback = false; + + /** + * Intent labels. + * @member {Object.} labels + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.labels = $util.emptyObject; + + /** + * Intent description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.description = ""; + + /** + * Intent dtmfPattern. + * @member {string} dtmfPattern + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + */ + Intent.prototype.dtmfPattern = ""; + + /** + * Creates a new Intent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent} Intent instance + */ + Intent.create = function create(properties) { + return new Intent(properties); + }; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.trainingPhrases != null && message.trainingPhrases.length) + for (var i = 0; i < message.trainingPhrases.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.encode(message.trainingPhrases[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.encode(message.parameters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.priority); + if (message.isFallback != null && Object.hasOwnProperty.call(message, "isFallback")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isFallback); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.dtmfPattern != null && Object.hasOwnProperty.call(message, "dtmfPattern")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.dtmfPattern); + return writer; + }; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.trainingPhrases && message.trainingPhrases.length)) + message.trainingPhrases = []; + message.trainingPhrases.push($root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.priority = reader.int32(); + break; + } + case 6: { + message.isFallback = reader.bool(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 16: { + message.dtmfPattern = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Intent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Intent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.trainingPhrases != null && message.hasOwnProperty("trainingPhrases")) { + if (!Array.isArray(message.trainingPhrases)) + return "trainingPhrases: array expected"; + for (var i = 0; i < message.trainingPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.verify(message.trainingPhrases[i], long + 1); + if (error) + return "trainingPhrases." + error; + } + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.verify(message.parameters[i], long + 1); + if (error) + return "parameters." + error; + } + } + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + if (typeof message.isFallback !== "boolean") + return "isFallback: boolean expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dtmfPattern != null && message.hasOwnProperty("dtmfPattern")) + if (!$util.isString(message.dtmfPattern)) + return "dtmfPattern: string expected"; + return null; + }; + + /** + * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent} Intent + */ + Intent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Intent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.trainingPhrases) { + if (!Array.isArray(object.trainingPhrases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Intent.trainingPhrases: array expected"); + message.trainingPhrases = []; + for (var i = 0; i < object.trainingPhrases.length; ++i) { + if (typeof object.trainingPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Intent.trainingPhrases: object expected"); + message.trainingPhrases[i] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.fromObject(object.trainingPhrases[i], long + 1); + } + } + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Intent.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Intent.parameters: object expected"); + message.parameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.fromObject(object.parameters[i], long + 1); + } + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.isFallback != null) + message.isFallback = Boolean(object.isFallback); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Intent.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.dtmfPattern != null) + message.dtmfPattern = String(object.dtmfPattern); + return message; + }; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent} message Intent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Intent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.trainingPhrases = []; + object.parameters = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.priority = 0; + object.isFallback = false; + object.description = ""; + object.dtmfPattern = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.trainingPhrases && message.trainingPhrases.length) { + object.trainingPhrases = []; + for (var j = 0; j < message.trainingPhrases.length; ++j) + object.trainingPhrases[j] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.toObject(message.trainingPhrases[j], options); + } + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.toObject(message.parameters[j], options); + } + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = message.priority; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + object.isFallback = message.isFallback; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dtmfPattern != null && message.hasOwnProperty("dtmfPattern")) + object.dtmfPattern = message.dtmfPattern; + return object; + }; + + /** + * Converts this Intent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @instance + * @returns {Object.} JSON object + */ + Intent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Intent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Intent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Intent"; + }; + + Intent.TrainingPhrase = (function() { + + /** + * Properties of a TrainingPhrase. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @interface ITrainingPhrase + * @property {string|null} [id] TrainingPhrase id + * @property {Array.|null} [parts] TrainingPhrase parts + * @property {number|null} [repeatCount] TrainingPhrase repeatCount + */ + + /** + * Constructs a new TrainingPhrase. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @classdesc Represents a TrainingPhrase. + * @implements ITrainingPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase=} [properties] Properties to set + */ + function TrainingPhrase(properties) { + this.parts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainingPhrase id. + * @member {string} id + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.id = ""; + + /** + * TrainingPhrase parts. + * @member {Array.} parts + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.parts = $util.emptyArray; + + /** + * TrainingPhrase repeatCount. + * @member {number} repeatCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.repeatCount = 0; + + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase} TrainingPhrase instance + */ + TrainingPhrase.create = function create(properties) { + return new TrainingPhrase(properties); + }; + + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.encode(message.parts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.repeatCount != null && Object.hasOwnProperty.call(message, "repeatCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatCount); + return writer; + }; + + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.repeatCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainingPhrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainingPhrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.verify(message.parts[i], long + 1); + if (error) + return "parts." + error; + } + } + if (message.repeatCount != null && message.hasOwnProperty("repeatCount")) + if (!$util.isInteger(message.repeatCount)) + return "repeatCount: integer expected"; + return null; + }; + + /** + * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase} TrainingPhrase + */ + TrainingPhrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase(); + if (object.id != null) + message.id = String(object.id); + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.parts: object expected"); + message.parts[i] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.fromObject(object.parts[i], long + 1); + } + } + if (object.repeatCount != null) + message.repeatCount = object.repeatCount | 0; + return message; + }; + + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase} message TrainingPhrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainingPhrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) { + object.id = ""; + object.repeatCount = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.toObject(message.parts[j], options); + } + if (message.repeatCount != null && message.hasOwnProperty("repeatCount")) + object.repeatCount = message.repeatCount; + return object; + }; + + /** + * Converts this TrainingPhrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @instance + * @returns {Object.} JSON object + */ + TrainingPhrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainingPhrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainingPhrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase"; + }; + + TrainingPhrase.Part = (function() { + + /** + * Properties of a Part. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @interface IPart + * @property {string|null} [text] Part text + * @property {string|null} [parameterId] Part parameterId + */ + + /** + * Constructs a new Part. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.text = ""; + + /** + * Part parameterId. + * @member {string} parameterId + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.parameterId = ""; + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.parameterId != null && Object.hasOwnProperty.call(message, "parameterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parameterId); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.parameterId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.parameterId != null && message.hasOwnProperty("parameterId")) + if (!$util.isString(message.parameterId)) + return "parameterId: string expected"; + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part} Part + */ + Part.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part(); + if (object.text != null) + message.text = String(object.text); + if (object.parameterId != null) + message.parameterId = String(object.parameterId); + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.parameterId = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.parameterId != null && message.hasOwnProperty("parameterId")) + object.parameterId = message.parameterId; + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Part + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part"; + }; + + return Part; + })(); + + return TrainingPhrase; + })(); + + Intent.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @interface IParameter + * @property {string|null} [id] Parameter id + * @property {string|null} [entityType] Parameter entityType + * @property {boolean|null} [isList] Parameter isList + * @property {boolean|null} [redact] Parameter redact + */ + + /** + * Constructs a new Parameter. + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter id. + * @member {string} id + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.id = ""; + + /** + * Parameter entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.entityType = ""; + + /** + * Parameter isList. + * @member {boolean} isList + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.isList = false; + + /** + * Parameter redact. + * @member {boolean} redact + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.redact = false; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.IParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isList); + if (message.redact != null && Object.hasOwnProperty.call(message, "redact")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.redact); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.entityType = reader.string(); + break; + } + case 3: { + message.isList = reader.bool(); + break; + } + case 4: { + message.redact = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.isList != null && message.hasOwnProperty("isList")) + if (typeof message.isList !== "boolean") + return "isList: boolean expected"; + if (message.redact != null && message.hasOwnProperty("redact")) + if (typeof message.redact !== "boolean") + return "redact: boolean expected"; + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Intent.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter(); + if (object.id != null) + message.id = String(object.id); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.isList != null) + message.isList = Boolean(object.isList); + if (object.redact != null) + message.redact = Boolean(object.redact); + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Intent.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.entityType = ""; + object.isList = false; + object.redact = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.isList != null && message.hasOwnProperty("isList")) + object.isList = message.isList; + if (message.redact != null && message.hasOwnProperty("redact")) + object.redact = message.redact; + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Intent.Parameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Intent.Parameter"; + }; + + return Parameter; + })(); + + return Intent; + })(); + + v3beta1.ListIntentsRequest = (function() { + + /** + * Properties of a ListIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListIntentsRequest + * @property {string|null} [parent] ListIntentsRequest parent + * @property {string|null} [languageCode] ListIntentsRequest languageCode + * @property {google.cloud.dialogflow.cx.v3beta1.IntentView|null} [intentView] ListIntentsRequest intentView + * @property {number|null} [pageSize] ListIntentsRequest pageSize + * @property {string|null} [pageToken] ListIntentsRequest pageToken + */ + + /** + * Constructs a new ListIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListIntentsRequest. + * @implements IListIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest=} [properties] Properties to set + */ + function ListIntentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.parent = ""; + + /** + * ListIntentsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.languageCode = ""; + + /** + * ListIntentsRequest intentView. + * @member {google.cloud.dialogflow.cx.v3beta1.IntentView} intentView + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.intentView = 0; + + /** + * ListIntentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageSize = 0; + + /** + * ListIntentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest} ListIntentsRequest instance + */ + ListIntentsRequest.create = function create(properties) { + return new ListIntentsRequest(properties); + }; + + /** + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.intentView); + return writer; + }; + + /** + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest} ListIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 5: { + message.intentView = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest} ListIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIntentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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"; + return null; + }; + + /** + * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest} ListIntentsRequest + */ + ListIntentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + default: + if (typeof object.intentView === "number") { + message.intentView = object.intentView; + break; + } + break; + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_PARTIAL": + case 1: + message.intentView = 1; + break; + case "INTENT_VIEW_FULL": + case 2: + message.intentView = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest} message ListIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.IntentView[message.intentView] === undefined ? message.intentView : $root.google.cloud.dialogflow.cx.v3beta1.IntentView[message.intentView] : message.intentView; + return object; + }; + + /** + * Converts this ListIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListIntentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListIntentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest"; + }; + + return ListIntentsRequest; + })(); + + v3beta1.ListIntentsResponse = (function() { + + /** + * Properties of a ListIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListIntentsResponse + * @property {Array.|null} [intents] ListIntentsResponse intents + * @property {string|null} [nextPageToken] ListIntentsResponse nextPageToken + */ + + /** + * Constructs a new ListIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListIntentsResponse. + * @implements IListIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse=} [properties] Properties to set + */ + function ListIntentsResponse(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @instance + */ + ListIntentsResponse.prototype.intents = $util.emptyArray; + + /** + * ListIntentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @instance + */ + ListIntentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} ListIntentsResponse instance + */ + ListIntentsResponse.create = function create(properties) { + return new ListIntentsResponse(properties); + }; + + /** + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.encode(message.intents[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 ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} ListIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.cx.v3beta1.Intent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} ListIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIntentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.verify(message.intents[i], long + 1); + if (error) + return "intents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} ListIntentsResponse + */ + ListIntentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.fromObject(object.intents[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} message ListIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.cx.v3beta1.Intent.toObject(message.intents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListIntentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListIntentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse"; + }; + + return ListIntentsResponse; + })(); + + v3beta1.GetIntentRequest = (function() { + + /** + * Properties of a GetIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetIntentRequest + * @property {string|null} [name] GetIntentRequest name + * @property {string|null} [languageCode] GetIntentRequest languageCode + */ + + /** + * Constructs a new GetIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetIntentRequest. + * @implements IGetIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest=} [properties] Properties to set + */ + function GetIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @instance + */ + GetIntentRequest.prototype.name = ""; + + /** + * GetIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @instance + */ + GetIntentRequest.prototype.languageCode = ""; + + /** + * Creates a new GetIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetIntentRequest} GetIntentRequest instance + */ + GetIntentRequest.create = function create(properties) { + return new GetIntentRequest(properties); + }; + + /** + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIntentRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetIntentRequest} GetIntentRequest + */ + GetIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetIntentRequest} message GetIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @instance + * @returns {Object.} JSON object + */ + GetIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetIntentRequest"; + }; + + return GetIntentRequest; + })(); + + v3beta1.CreateIntentRequest = (function() { + + /** + * Properties of a CreateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateIntentRequest + * @property {string|null} [parent] CreateIntentRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IIntent|null} [intent] CreateIntentRequest intent + * @property {string|null} [languageCode] CreateIntentRequest languageCode + */ + + /** + * Constructs a new CreateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateIntentRequest. + * @implements ICreateIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest=} [properties] Properties to set + */ + function CreateIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateIntentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.parent = ""; + + /** + * CreateIntentRequest intent. + * @member {google.cloud.dialogflow.cx.v3beta1.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.intent = null; + + /** + * CreateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest} CreateIntentRequest instance + */ + CreateIntentRequest.create = function create(properties) { + return new CreateIntentRequest(properties); + }; + + /** + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIntentRequest.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.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.encode(message.intent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest} CreateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest} CreateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest} CreateIntentRequest + */ + CreateIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.fromObject(object.intent, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest} message CreateIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.intent = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest"; + }; + + return CreateIntentRequest; + })(); + + v3beta1.UpdateIntentRequest = (function() { + + /** + * Properties of an UpdateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateIntentRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IIntent|null} [intent] UpdateIntentRequest intent + * @property {string|null} [languageCode] UpdateIntentRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateIntentRequest updateMask + */ + + /** + * Constructs a new UpdateIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateIntentRequest. + * @implements IUpdateIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest=} [properties] Properties to set + */ + function UpdateIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateIntentRequest intent. + * @member {google.cloud.dialogflow.cx.v3beta1.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.intent = null; + + /** + * UpdateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.languageCode = ""; + + /** + * UpdateIntentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest} UpdateIntentRequest instance + */ + UpdateIntentRequest.create = function create(properties) { + return new UpdateIntentRequest(properties); + }; + + /** + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest} UpdateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest} UpdateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest} UpdateIntentRequest + */ + UpdateIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.fromObject(object.intent, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest} message UpdateIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest"; + }; + + return UpdateIntentRequest; + })(); + + v3beta1.DeleteIntentRequest = (function() { + + /** + * Properties of a DeleteIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteIntentRequest + * @property {string|null} [name] DeleteIntentRequest name + */ + + /** + * Constructs a new DeleteIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteIntentRequest. + * @implements IDeleteIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest=} [properties] Properties to set + */ + function DeleteIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @instance + */ + DeleteIntentRequest.prototype.name = ""; + + /** + * Creates a new DeleteIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest} DeleteIntentRequest instance + */ + DeleteIntentRequest.create = function create(properties) { + return new DeleteIntentRequest(properties); + }; + + /** + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIntentRequest.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 DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest} DeleteIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest} DeleteIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest} DeleteIntentRequest + */ + DeleteIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest} message DeleteIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteIntentRequest.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 DeleteIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest"; + }; + + return DeleteIntentRequest; + })(); + + /** + * IntentView enum. + * @name google.cloud.dialogflow.cx.v3beta1.IntentView + * @enum {number} + * @property {number} INTENT_VIEW_UNSPECIFIED=0 INTENT_VIEW_UNSPECIFIED value + * @property {number} INTENT_VIEW_PARTIAL=1 INTENT_VIEW_PARTIAL value + * @property {number} INTENT_VIEW_FULL=2 INTENT_VIEW_FULL value + */ + v3beta1.IntentView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTENT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT_VIEW_PARTIAL"] = 1; + values[valuesById[2] = "INTENT_VIEW_FULL"] = 2; + return values; + })(); + + v3beta1.ImportIntentsRequest = (function() { + + /** + * Properties of an ImportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportIntentsRequest + * @property {string|null} [parent] ImportIntentsRequest parent + * @property {string|null} [intentsUri] ImportIntentsRequest intentsUri + * @property {google.cloud.dialogflow.cx.v3beta1.IInlineSource|null} [intentsContent] ImportIntentsRequest intentsContent + * @property {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption|null} [mergeOption] ImportIntentsRequest mergeOption + */ + + /** + * Constructs a new ImportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportIntentsRequest. + * @implements IImportIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest=} [properties] Properties to set + */ + function ImportIntentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.parent = ""; + + /** + * ImportIntentsRequest intentsUri. + * @member {string|null|undefined} intentsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.intentsUri = null; + + /** + * ImportIntentsRequest intentsContent. + * @member {google.cloud.dialogflow.cx.v3beta1.IInlineSource|null|undefined} intentsContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.intentsContent = null; + + /** + * ImportIntentsRequest mergeOption. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption} mergeOption + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @instance + */ + ImportIntentsRequest.prototype.mergeOption = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportIntentsRequest intents. + * @member {"intentsUri"|"intentsContent"|undefined} intents + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @instance + */ + Object.defineProperty(ImportIntentsRequest.prototype, "intents", { + get: $util.oneOfGetter($oneOfFields = ["intentsUri", "intentsContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest} ImportIntentsRequest instance + */ + ImportIntentsRequest.create = function create(properties) { + return new ImportIntentsRequest(properties); + }; + + /** + * Encodes the specified ImportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest} message ImportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsRequest.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.intentsUri != null && Object.hasOwnProperty.call(message, "intentsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intentsUri); + if (message.intentsContent != null && Object.hasOwnProperty.call(message, "intentsContent")) + $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.encode(message.intentsContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mergeOption != null && Object.hasOwnProperty.call(message, "mergeOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mergeOption); + return writer; + }; + + /** + * Encodes the specified ImportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest} message ImportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest} ImportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.intentsUri = reader.string(); + break; + } + case 3: { + message.intentsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.mergeOption = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest} ImportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportIntentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + properties.intents = 1; + if (!$util.isString(message.intentsUri)) + return "intentsUri: string expected"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + if (properties.intents === 1) + return "intents: multiple values"; + properties.intents = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.verify(message.intentsContent, long + 1); + if (error) + return "intentsContent." + error; + } + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + switch (message.mergeOption) { + default: + return "mergeOption: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates an ImportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest} ImportIntentsRequest + */ + ImportIntentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intentsUri != null) + message.intentsUri = String(object.intentsUri); + if (object.intentsContent != null) { + if (typeof object.intentsContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.intentsContent: object expected"); + message.intentsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.fromObject(object.intentsContent, long + 1); + } + switch (object.mergeOption) { + default: + if (typeof object.mergeOption === "number") { + message.mergeOption = object.mergeOption; + break; + } + break; + case "MERGE_OPTION_UNSPECIFIED": + case 0: + message.mergeOption = 0; + break; + case "REJECT": + case 1: + message.mergeOption = 1; + break; + case "REPLACE": + case 2: + message.mergeOption = 2; + break; + case "MERGE": + case 3: + message.mergeOption = 3; + break; + case "RENAME": + case 4: + message.mergeOption = 4; + break; + case "REPORT_CONFLICT": + case 5: + message.mergeOption = 5; + break; + case "KEEP": + case 6: + message.mergeOption = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest} message ImportIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mergeOption = options.enums === String ? "MERGE_OPTION_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + object.intentsUri = message.intentsUri; + if (options.oneofs) + object.intents = "intentsUri"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + object.intentsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.toObject(message.intentsContent, options); + if (options.oneofs) + object.intents = "intentsContent"; + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + object.mergeOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption[message.mergeOption] === undefined ? message.mergeOption : $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption[message.mergeOption] : message.mergeOption; + return object; + }; + + /** + * Converts this ImportIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportIntentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportIntentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest"; + }; + + /** + * MergeOption enum. + * @name google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption + * @enum {number} + * @property {number} MERGE_OPTION_UNSPECIFIED=0 MERGE_OPTION_UNSPECIFIED value + * @property {number} REJECT=1 REJECT value + * @property {number} REPLACE=2 REPLACE value + * @property {number} MERGE=3 MERGE value + * @property {number} RENAME=4 RENAME value + * @property {number} REPORT_CONFLICT=5 REPORT_CONFLICT value + * @property {number} KEEP=6 KEEP value + */ + ImportIntentsRequest.MergeOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MERGE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "REJECT"] = 1; + values[valuesById[2] = "REPLACE"] = 2; + values[valuesById[3] = "MERGE"] = 3; + values[valuesById[4] = "RENAME"] = 4; + values[valuesById[5] = "REPORT_CONFLICT"] = 5; + values[valuesById[6] = "KEEP"] = 6; + return values; + })(); + + return ImportIntentsRequest; + })(); + + v3beta1.ImportIntentsResponse = (function() { + + /** + * Properties of an ImportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportIntentsResponse + * @property {Array.|null} [intents] ImportIntentsResponse intents + * @property {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources|null} [conflictingResources] ImportIntentsResponse conflictingResources + */ + + /** + * Constructs a new ImportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportIntentsResponse. + * @implements IImportIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse=} [properties] Properties to set + */ + function ImportIntentsResponse(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @instance + */ + ImportIntentsResponse.prototype.intents = $util.emptyArray; + + /** + * ImportIntentsResponse conflictingResources. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources|null|undefined} conflictingResources + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @instance + */ + ImportIntentsResponse.prototype.conflictingResources = null; + + /** + * Creates a new ImportIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse} ImportIntentsResponse instance + */ + ImportIntentsResponse.create = function create(properties) { + return new ImportIntentsResponse(properties); + }; + + /** + * Encodes the specified ImportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse} message ImportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intents[i]); + if (message.conflictingResources != null && Object.hasOwnProperty.call(message, "conflictingResources")) + $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.encode(message.conflictingResources, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse} message ImportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse} ImportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push(reader.string()); + break; + } + case 2: { + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse} ImportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportIntentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) + if (!$util.isString(message.intents[i])) + return "intents: string[] expected"; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.verify(message.conflictingResources, long + 1); + if (error) + return "conflictingResources." + error; + } + return null; + }; + + /** + * Creates an ImportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse} ImportIntentsResponse + */ + ImportIntentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) + message.intents[i] = String(object.intents[i]); + } + if (object.conflictingResources != null) { + if (typeof object.conflictingResources !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.conflictingResources: object expected"); + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.fromObject(object.conflictingResources, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse} message ImportIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.conflictingResources = null; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = message.intents[j]; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) + object.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.toObject(message.conflictingResources, options); + return object; + }; + + /** + * Converts this ImportIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportIntentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportIntentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse"; + }; + + ImportIntentsResponse.ConflictingResources = (function() { + + /** + * Properties of a ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @interface IConflictingResources + * @property {Array.|null} [intentDisplayNames] ConflictingResources intentDisplayNames + * @property {Array.|null} [entityDisplayNames] ConflictingResources entityDisplayNames + */ + + /** + * Constructs a new ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse + * @classdesc Represents a ConflictingResources. + * @implements IConflictingResources + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources=} [properties] Properties to set + */ + function ConflictingResources(properties) { + this.intentDisplayNames = []; + this.entityDisplayNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConflictingResources intentDisplayNames. + * @member {Array.} intentDisplayNames + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.intentDisplayNames = $util.emptyArray; + + /** + * ConflictingResources entityDisplayNames. + * @member {Array.} entityDisplayNames + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.entityDisplayNames = $util.emptyArray; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources} ConflictingResources instance + */ + ConflictingResources.create = function create(properties) { + return new ConflictingResources(properties); + }; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentDisplayNames != null && message.intentDisplayNames.length) + for (var i = 0; i < message.intentDisplayNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intentDisplayNames[i]); + if (message.entityDisplayNames != null && message.entityDisplayNames.length) + for (var i = 0; i < message.entityDisplayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityDisplayNames[i]); + return writer; + }; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intentDisplayNames && message.intentDisplayNames.length)) + message.intentDisplayNames = []; + message.intentDisplayNames.push(reader.string()); + break; + } + case 2: { + if (!(message.entityDisplayNames && message.entityDisplayNames.length)) + message.entityDisplayNames = []; + message.entityDisplayNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConflictingResources message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConflictingResources.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intentDisplayNames != null && message.hasOwnProperty("intentDisplayNames")) { + if (!Array.isArray(message.intentDisplayNames)) + return "intentDisplayNames: array expected"; + for (var i = 0; i < message.intentDisplayNames.length; ++i) + if (!$util.isString(message.intentDisplayNames[i])) + return "intentDisplayNames: string[] expected"; + } + if (message.entityDisplayNames != null && message.hasOwnProperty("entityDisplayNames")) { + if (!Array.isArray(message.entityDisplayNames)) + return "entityDisplayNames: array expected"; + for (var i = 0; i < message.entityDisplayNames.length; ++i) + if (!$util.isString(message.entityDisplayNames[i])) + return "entityDisplayNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources} ConflictingResources + */ + ConflictingResources.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources(); + if (object.intentDisplayNames) { + if (!Array.isArray(object.intentDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.intentDisplayNames: array expected"); + message.intentDisplayNames = []; + for (var i = 0; i < object.intentDisplayNames.length; ++i) + message.intentDisplayNames[i] = String(object.intentDisplayNames[i]); + } + if (object.entityDisplayNames) { + if (!Array.isArray(object.entityDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources.entityDisplayNames: array expected"); + message.entityDisplayNames = []; + for (var i = 0; i < object.entityDisplayNames.length; ++i) + message.entityDisplayNames[i] = String(object.entityDisplayNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources} message ConflictingResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConflictingResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.intentDisplayNames = []; + object.entityDisplayNames = []; + } + if (message.intentDisplayNames && message.intentDisplayNames.length) { + object.intentDisplayNames = []; + for (var j = 0; j < message.intentDisplayNames.length; ++j) + object.intentDisplayNames[j] = message.intentDisplayNames[j]; + } + if (message.entityDisplayNames && message.entityDisplayNames.length) { + object.entityDisplayNames = []; + for (var j = 0; j < message.entityDisplayNames.length; ++j) + object.entityDisplayNames[j] = message.entityDisplayNames[j]; + } + return object; + }; + + /** + * Converts this ConflictingResources to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @instance + * @returns {Object.} JSON object + */ + ConflictingResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConflictingResources + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConflictingResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse.ConflictingResources"; + }; + + return ConflictingResources; + })(); + + return ImportIntentsResponse; + })(); + + v3beta1.ImportIntentsMetadata = (function() { + + /** + * Properties of an ImportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportIntentsMetadata + */ + + /** + * Constructs a new ImportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportIntentsMetadata. + * @implements IImportIntentsMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata=} [properties] Properties to set + */ + function ImportIntentsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ImportIntentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata} ImportIntentsMetadata instance + */ + ImportIntentsMetadata.create = function create(properties) { + return new ImportIntentsMetadata(properties); + }; + + /** + * Encodes the specified ImportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata} message ImportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata} message ImportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportIntentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata} ImportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportIntentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata} ImportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportIntentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportIntentsMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportIntentsMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ImportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata} ImportIntentsMetadata + */ + ImportIntentsMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata(); + }; + + /** + * Creates a plain object from an ImportIntentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata} message ImportIntentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportIntentsMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportIntentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportIntentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportIntentsMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportIntentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata"; + }; + + return ImportIntentsMetadata; + })(); + + v3beta1.ExportIntentsRequest = (function() { + + /** + * Properties of an ExportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportIntentsRequest + * @property {string|null} [parent] ExportIntentsRequest parent + * @property {Array.|null} [intents] ExportIntentsRequest intents + * @property {string|null} [intentsUri] ExportIntentsRequest intentsUri + * @property {boolean|null} [intentsContentInline] ExportIntentsRequest intentsContentInline + * @property {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat|null} [dataFormat] ExportIntentsRequest dataFormat + */ + + /** + * Constructs a new ExportIntentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportIntentsRequest. + * @implements IExportIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest=} [properties] Properties to set + */ + function ExportIntentsRequest(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.parent = ""; + + /** + * ExportIntentsRequest intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.intents = $util.emptyArray; + + /** + * ExportIntentsRequest intentsUri. + * @member {string|null|undefined} intentsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.intentsUri = null; + + /** + * ExportIntentsRequest intentsContentInline. + * @member {boolean|null|undefined} intentsContentInline + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.intentsContentInline = null; + + /** + * ExportIntentsRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @instance + */ + ExportIntentsRequest.prototype.dataFormat = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportIntentsRequest destination. + * @member {"intentsUri"|"intentsContentInline"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @instance + */ + Object.defineProperty(ExportIntentsRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["intentsUri", "intentsContentInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest} ExportIntentsRequest instance + */ + ExportIntentsRequest.create = function create(properties) { + return new ExportIntentsRequest(properties); + }; + + /** + * Encodes the specified ExportIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest} message ExportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsRequest.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.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intents[i]); + if (message.intentsUri != null && Object.hasOwnProperty.call(message, "intentsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.intentsUri); + if (message.intentsContentInline != null && Object.hasOwnProperty.call(message, "intentsContentInline")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.intentsContentInline); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified ExportIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest} message ExportIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest} ExportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push(reader.string()); + break; + } + case 3: { + message.intentsUri = reader.string(); + break; + } + case 4: { + message.intentsContentInline = reader.bool(); + break; + } + case 5: { + message.dataFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest} ExportIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIntentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) + if (!$util.isString(message.intents[i])) + return "intents: string[] expected"; + } + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + properties.destination = 1; + if (!$util.isString(message.intentsUri)) + return "intentsUri: string expected"; + } + if (message.intentsContentInline != null && message.hasOwnProperty("intentsContentInline")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (typeof message.intentsContentInline !== "boolean") + return "intentsContentInline: boolean expected"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ExportIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest} ExportIntentsRequest + */ + ExportIntentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) + message.intents[i] = String(object.intents[i]); + } + if (object.intentsUri != null) + message.intentsUri = String(object.intentsUri); + if (object.intentsContentInline != null) + message.intentsContentInline = Boolean(object.intentsContentInline); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON": + case 2: + message.dataFormat = 2; + break; + case "CSV": + case 3: + message.dataFormat = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExportIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest} message ExportIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) { + object.parent = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = message.intents[j]; + } + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + object.intentsUri = message.intentsUri; + if (options.oneofs) + object.destination = "intentsUri"; + } + if (message.intentsContentInline != null && message.hasOwnProperty("intentsContentInline")) { + object.intentsContentInline = message.intentsContentInline; + if (options.oneofs) + object.destination = "intentsContentInline"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this ExportIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportIntentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIntentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON=2 JSON value + * @property {number} CSV=3 CSV value + */ + ExportIntentsRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[2] = "JSON"] = 2; + values[valuesById[3] = "CSV"] = 3; + return values; + })(); + + return ExportIntentsRequest; + })(); + + v3beta1.ExportIntentsResponse = (function() { + + /** + * Properties of an ExportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportIntentsResponse + * @property {string|null} [intentsUri] ExportIntentsResponse intentsUri + * @property {google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null} [intentsContent] ExportIntentsResponse intentsContent + */ + + /** + * Constructs a new ExportIntentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportIntentsResponse. + * @implements IExportIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse=} [properties] Properties to set + */ + function ExportIntentsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportIntentsResponse intentsUri. + * @member {string|null|undefined} intentsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @instance + */ + ExportIntentsResponse.prototype.intentsUri = null; + + /** + * ExportIntentsResponse intentsContent. + * @member {google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null|undefined} intentsContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @instance + */ + ExportIntentsResponse.prototype.intentsContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportIntentsResponse intents. + * @member {"intentsUri"|"intentsContent"|undefined} intents + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @instance + */ + Object.defineProperty(ExportIntentsResponse.prototype, "intents", { + get: $util.oneOfGetter($oneOfFields = ["intentsUri", "intentsContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse} ExportIntentsResponse instance + */ + ExportIntentsResponse.create = function create(properties) { + return new ExportIntentsResponse(properties); + }; + + /** + * Encodes the specified ExportIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse} message ExportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentsUri != null && Object.hasOwnProperty.call(message, "intentsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intentsUri); + if (message.intentsContent != null && Object.hasOwnProperty.call(message, "intentsContent")) + $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.encode(message.intentsContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse} message ExportIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse} ExportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intentsUri = reader.string(); + break; + } + case 2: { + message.intentsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse} ExportIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIntentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + properties.intents = 1; + if (!$util.isString(message.intentsUri)) + return "intentsUri: string expected"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + if (properties.intents === 1) + return "intents: multiple values"; + properties.intents = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.verify(message.intentsContent, long + 1); + if (error) + return "intentsContent." + error; + } + } + return null; + }; + + /** + * Creates an ExportIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse} ExportIntentsResponse + */ + ExportIntentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse(); + if (object.intentsUri != null) + message.intentsUri = String(object.intentsUri); + if (object.intentsContent != null) { + if (typeof object.intentsContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse.intentsContent: object expected"); + message.intentsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.fromObject(object.intentsContent, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExportIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse} message ExportIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.intentsUri != null && message.hasOwnProperty("intentsUri")) { + object.intentsUri = message.intentsUri; + if (options.oneofs) + object.intents = "intentsUri"; + } + if (message.intentsContent != null && message.hasOwnProperty("intentsContent")) { + object.intentsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.toObject(message.intentsContent, options); + if (options.oneofs) + object.intents = "intentsContent"; + } + return object; + }; + + /** + * Converts this ExportIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportIntentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIntentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse"; + }; + + return ExportIntentsResponse; + })(); + + v3beta1.ExportIntentsMetadata = (function() { + + /** + * Properties of an ExportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportIntentsMetadata + */ + + /** + * Constructs a new ExportIntentsMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportIntentsMetadata. + * @implements IExportIntentsMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata=} [properties] Properties to set + */ + function ExportIntentsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportIntentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata} ExportIntentsMetadata instance + */ + ExportIntentsMetadata.create = function create(properties) { + return new ExportIntentsMetadata(properties); + }; + + /** + * Encodes the specified ExportIntentsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata} message ExportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportIntentsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata} message ExportIntentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIntentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata} ExportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIntentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata} ExportIntentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIntentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIntentsMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIntentsMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportIntentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata} ExportIntentsMetadata + */ + ExportIntentsMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata(); + }; + + /** + * Creates a plain object from an ExportIntentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata} message ExportIntentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIntentsMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportIntentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportIntentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportIntentsMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIntentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata"; + }; + + return ExportIntentsMetadata; + })(); + + v3beta1.InlineDestination = (function() { + + /** + * Properties of an InlineDestination. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IInlineDestination + * @property {Uint8Array|null} [content] InlineDestination content + */ + + /** + * Constructs a new InlineDestination. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an InlineDestination. + * @implements IInlineDestination + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineDestination=} [properties] Properties to set + */ + function InlineDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineDestination content. + * @member {Uint8Array} content + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @instance + */ + InlineDestination.prototype.content = $util.newBuffer([]); + + /** + * Creates a new InlineDestination instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineDestination=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineDestination} InlineDestination instance + */ + InlineDestination.create = function create(properties) { + return new InlineDestination(properties); + }; + + /** + * Encodes the specified InlineDestination message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineDestination} message InlineDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified InlineDestination message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineDestination} message InlineDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineDestination} InlineDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineDestination.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InlineDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineDestination} InlineDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineDestination message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineDestination.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + return null; + }; + + /** + * Creates an InlineDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineDestination} InlineDestination + */ + InlineDestination.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an InlineDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.InlineDestination} message InlineDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + return object; + }; + + /** + * Converts this InlineDestination to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @instance + * @returns {Object.} JSON object + */ + InlineDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineDestination + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.InlineDestination"; + }; + + return InlineDestination; + })(); + + v3beta1.InlineSource = (function() { + + /** + * Properties of an InlineSource. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IInlineSource + * @property {Uint8Array|null} [content] InlineSource content + */ + + /** + * Constructs a new InlineSource. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an InlineSource. + * @implements IInlineSource + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSource=} [properties] Properties to set + */ + function InlineSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSource content. + * @member {Uint8Array} content + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @instance + */ + InlineSource.prototype.content = $util.newBuffer([]); + + /** + * Creates a new InlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSource} InlineSource instance + */ + InlineSource.create = function create(properties) { + return new InlineSource(properties); + }; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.InlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.InlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSource message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + return null; + }; + + /** + * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.InlineSource} InlineSource + */ + InlineSource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.InlineSource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.InlineSource(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + return message; + }; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.InlineSource} message InlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + return object; + }; + + /** + * Converts this InlineSource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @instance + * @returns {Object.} JSON object + */ + InlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSource + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.InlineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.InlineSource"; + }; + + return InlineSource; + })(); + + v3beta1.Sessions = (function() { + + /** + * Constructs a new Sessions service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Sessions + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Sessions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Sessions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Sessions; + + /** + * Creates new Sessions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Sessions} RPC service. Useful where requests and/or responses are streamed. + */ + Sessions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|detectIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @typedef DetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} [response] DetectIntentResponse + */ + + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.detectIntent = function detectIntent(request, callback) { + return this.rpcCall(detectIntent, $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, request, callback); + }, "name", { value: "DetectIntent" }); + + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|serverStreamingDetectIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @typedef ServerStreamingDetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} [response] DetectIntentResponse + */ + + /** + * Calls ServerStreamingDetectIntent. + * @function serverStreamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Sessions.ServerStreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.serverStreamingDetectIntent = function serverStreamingDetectIntent(request, callback) { + return this.rpcCall(serverStreamingDetectIntent, $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, request, callback); + }, "name", { value: "ServerStreamingDetectIntent" }); + + /** + * Calls ServerStreamingDetectIntent. + * @function serverStreamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|streamingDetectIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @typedef StreamingDetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} [response] StreamingDetectIntentResponse + */ + + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.streamingDetectIntent = function streamingDetectIntent(request, callback) { + return this.rpcCall(streamingDetectIntent, $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse, request, callback); + }, "name", { value: "StreamingDetectIntent" }); + + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|matchIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @typedef MatchIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} [response] MatchIntentResponse + */ + + /** + * Calls MatchIntent. + * @function matchIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest} request MatchIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntentCallback} callback Node-style callback called with the error, if any, and MatchIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.matchIntent = function matchIntent(request, callback) { + return this.rpcCall(matchIntent, $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse, request, callback); + }, "name", { value: "MatchIntent" }); + + /** + * Calls MatchIntent. + * @function matchIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest} request MatchIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|fulfillIntent}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @typedef FulfillIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} [response] FulfillIntentResponse + */ + + /** + * Calls FulfillIntent. + * @function fulfillIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest} request FulfillIntentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Sessions.FulfillIntentCallback} callback Node-style callback called with the error, if any, and FulfillIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.fulfillIntent = function fulfillIntent(request, callback) { + return this.rpcCall(fulfillIntent, $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest, $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse, request, callback); + }, "name", { value: "FulfillIntent" }); + + /** + * Calls FulfillIntent. + * @function fulfillIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest} request FulfillIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Sessions|submitAnswerFeedback}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @typedef SubmitAnswerFeedbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback} [response] AnswerFeedback + */ + + /** + * Calls SubmitAnswerFeedback. + * @function submitAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest} request SubmitAnswerFeedbackRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Sessions.SubmitAnswerFeedbackCallback} callback Node-style callback called with the error, if any, and AnswerFeedback + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.submitAnswerFeedback = function submitAnswerFeedback(request, callback) { + return this.rpcCall(submitAnswerFeedback, $root.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest, $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback, request, callback); + }, "name", { value: "SubmitAnswerFeedback" }); + + /** + * Calls SubmitAnswerFeedback. + * @function submitAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest} request SubmitAnswerFeedbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Sessions; + })(); + + v3beta1.AnswerFeedback = (function() { + + /** + * Properties of an AnswerFeedback. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IAnswerFeedback + * @property {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating|null} [rating] AnswerFeedback rating + * @property {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason|null} [ratingReason] AnswerFeedback ratingReason + * @property {string|null} [customRating] AnswerFeedback customRating + */ + + /** + * Constructs a new AnswerFeedback. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an AnswerFeedback. + * @implements IAnswerFeedback + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback=} [properties] Properties to set + */ + function AnswerFeedback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerFeedback rating. + * @member {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating} rating + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.rating = 0; + + /** + * AnswerFeedback ratingReason. + * @member {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason|null|undefined} ratingReason + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.ratingReason = null; + + /** + * AnswerFeedback customRating. + * @member {string} customRating + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.customRating = ""; + + /** + * Creates a new AnswerFeedback instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback} AnswerFeedback instance + */ + AnswerFeedback.create = function create(properties) { + return new AnswerFeedback(properties); + }; + + /** + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback} message AnswerFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rating); + if (message.ratingReason != null && Object.hasOwnProperty.call(message, "ratingReason")) + $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.encode(message.ratingReason, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.customRating != null && Object.hasOwnProperty.call(message, "customRating")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customRating); + return writer; + }; + + /** + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback} message AnswerFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback} AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedback.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rating = reader.int32(); + break; + } + case 2: { + message.ratingReason = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.customRating = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback} AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerFeedback message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerFeedback.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rating != null && message.hasOwnProperty("rating")) + switch (message.rating) { + default: + return "rating: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ratingReason != null && message.hasOwnProperty("ratingReason")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.verify(message.ratingReason, long + 1); + if (error) + return "ratingReason." + error; + } + if (message.customRating != null && message.hasOwnProperty("customRating")) + if (!$util.isString(message.customRating)) + return "customRating: string expected"; + return null; + }; + + /** + * Creates an AnswerFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback} AnswerFeedback + */ + AnswerFeedback.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback(); + switch (object.rating) { + default: + if (typeof object.rating === "number") { + message.rating = object.rating; + break; + } + break; + case "RATING_UNSPECIFIED": + case 0: + message.rating = 0; + break; + case "THUMBS_UP": + case 1: + message.rating = 1; + break; + case "THUMBS_DOWN": + case 2: + message.rating = 2; + break; + } + if (object.ratingReason != null) { + if (typeof object.ratingReason !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.ratingReason: object expected"); + message.ratingReason = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.fromObject(object.ratingReason, long + 1); + } + if (object.customRating != null) + message.customRating = String(object.customRating); + return message; + }; + + /** + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback} message AnswerFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rating = options.enums === String ? "RATING_UNSPECIFIED" : 0; + object.ratingReason = null; + object.customRating = ""; + } + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating[message.rating] === undefined ? message.rating : $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating[message.rating] : message.rating; + if (message.ratingReason != null && message.hasOwnProperty("ratingReason")) + object.ratingReason = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.toObject(message.ratingReason, options); + if (message.customRating != null && message.hasOwnProperty("customRating")) + object.customRating = message.customRating; + return object; + }; + + /** + * Converts this AnswerFeedback to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @instance + * @returns {Object.} JSON object + */ + AnswerFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnswerFeedback + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnswerFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AnswerFeedback"; + }; + + /** + * Rating enum. + * @name google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.Rating + * @enum {number} + * @property {number} RATING_UNSPECIFIED=0 RATING_UNSPECIFIED value + * @property {number} THUMBS_UP=1 THUMBS_UP value + * @property {number} THUMBS_DOWN=2 THUMBS_DOWN value + */ + AnswerFeedback.Rating = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RATING_UNSPECIFIED"] = 0; + values[valuesById[1] = "THUMBS_UP"] = 1; + values[valuesById[2] = "THUMBS_DOWN"] = 2; + return values; + })(); + + AnswerFeedback.RatingReason = (function() { + + /** + * Properties of a RatingReason. + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @interface IRatingReason + * @property {Array.|null} [reasonLabels] RatingReason reasonLabels + * @property {string|null} [feedback] RatingReason feedback + */ + + /** + * Constructs a new RatingReason. + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback + * @classdesc Represents a RatingReason. + * @implements IRatingReason + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason=} [properties] Properties to set + */ + function RatingReason(properties) { + this.reasonLabels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RatingReason reasonLabels. + * @member {Array.} reasonLabels + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @instance + */ + RatingReason.prototype.reasonLabels = $util.emptyArray; + + /** + * RatingReason feedback. + * @member {string} feedback + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @instance + */ + RatingReason.prototype.feedback = ""; + + /** + * Creates a new RatingReason instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason} RatingReason instance + */ + RatingReason.create = function create(properties) { + return new RatingReason(properties); + }; + + /** + * Encodes the specified RatingReason message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason} message RatingReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RatingReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feedback != null && Object.hasOwnProperty.call(message, "feedback")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedback); + if (message.reasonLabels != null && message.reasonLabels.length) + for (var i = 0; i < message.reasonLabels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.reasonLabels[i]); + return writer; + }; + + /** + * Encodes the specified RatingReason message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.IRatingReason} message RatingReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RatingReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RatingReason message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason} RatingReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RatingReason.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.reasonLabels && message.reasonLabels.length)) + message.reasonLabels = []; + message.reasonLabels.push(reader.string()); + break; + } + case 2: { + message.feedback = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RatingReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason} RatingReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RatingReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RatingReason message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RatingReason.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.reasonLabels != null && message.hasOwnProperty("reasonLabels")) { + if (!Array.isArray(message.reasonLabels)) + return "reasonLabels: array expected"; + for (var i = 0; i < message.reasonLabels.length; ++i) + if (!$util.isString(message.reasonLabels[i])) + return "reasonLabels: string[] expected"; + } + if (message.feedback != null && message.hasOwnProperty("feedback")) + if (!$util.isString(message.feedback)) + return "feedback: string expected"; + return null; + }; + + /** + * Creates a RatingReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason} RatingReason + */ + RatingReason.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason(); + if (object.reasonLabels) { + if (!Array.isArray(object.reasonLabels)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason.reasonLabels: array expected"); + message.reasonLabels = []; + for (var i = 0; i < object.reasonLabels.length; ++i) + message.reasonLabels[i] = String(object.reasonLabels[i]); + } + if (object.feedback != null) + message.feedback = String(object.feedback); + return message; + }; + + /** + * Creates a plain object from a RatingReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason} message RatingReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RatingReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reasonLabels = []; + if (options.defaults) + object.feedback = ""; + if (message.feedback != null && message.hasOwnProperty("feedback")) + object.feedback = message.feedback; + if (message.reasonLabels && message.reasonLabels.length) { + object.reasonLabels = []; + for (var j = 0; j < message.reasonLabels.length; ++j) + object.reasonLabels[j] = message.reasonLabels[j]; + } + return object; + }; + + /** + * Converts this RatingReason to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @instance + * @returns {Object.} JSON object + */ + RatingReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RatingReason + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RatingReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.RatingReason"; + }; + + return RatingReason; + })(); + + return AnswerFeedback; + })(); + + v3beta1.SubmitAnswerFeedbackRequest = (function() { + + /** + * Properties of a SubmitAnswerFeedbackRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISubmitAnswerFeedbackRequest + * @property {string|null} [session] SubmitAnswerFeedbackRequest session + * @property {string|null} [responseId] SubmitAnswerFeedbackRequest responseId + * @property {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null} [answerFeedback] SubmitAnswerFeedbackRequest answerFeedback + * @property {google.protobuf.IFieldMask|null} [updateMask] SubmitAnswerFeedbackRequest updateMask + */ + + /** + * Constructs a new SubmitAnswerFeedbackRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SubmitAnswerFeedbackRequest. + * @implements ISubmitAnswerFeedbackRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest=} [properties] Properties to set + */ + function SubmitAnswerFeedbackRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubmitAnswerFeedbackRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.session = ""; + + /** + * SubmitAnswerFeedbackRequest responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.responseId = ""; + + /** + * SubmitAnswerFeedbackRequest answerFeedback. + * @member {google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback|null|undefined} answerFeedback + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.answerFeedback = null; + + /** + * SubmitAnswerFeedbackRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @instance + */ + SubmitAnswerFeedbackRequest.prototype.updateMask = null; + + /** + * Creates a new SubmitAnswerFeedbackRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest instance + */ + SubmitAnswerFeedbackRequest.create = function create(properties) { + return new SubmitAnswerFeedbackRequest(properties); + }; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest} message SubmitAnswerFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitAnswerFeedbackRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.responseId); + if (message.answerFeedback != null && Object.hasOwnProperty.call(message, "answerFeedback")) + $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.encode(message.answerFeedback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubmitAnswerFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest} message SubmitAnswerFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitAnswerFeedbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitAnswerFeedbackRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.responseId = reader.string(); + break; + } + case 3: { + message.answerFeedback = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SubmitAnswerFeedbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitAnswerFeedbackRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubmitAnswerFeedbackRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubmitAnswerFeedbackRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.verify(message.answerFeedback, long + 1); + if (error) + return "answerFeedback." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SubmitAnswerFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest} SubmitAnswerFeedbackRequest + */ + SubmitAnswerFeedbackRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.answerFeedback != null) { + if (typeof object.answerFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest.answerFeedback: object expected"); + message.answerFeedback = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.fromObject(object.answerFeedback, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SubmitAnswerFeedbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest} message SubmitAnswerFeedbackRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubmitAnswerFeedbackRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.responseId = ""; + object.answerFeedback = null; + object.updateMask = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) + object.answerFeedback = $root.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback.toObject(message.answerFeedback, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SubmitAnswerFeedbackRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @instance + * @returns {Object.} JSON object + */ + SubmitAnswerFeedbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubmitAnswerFeedbackRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubmitAnswerFeedbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest"; + }; + + return SubmitAnswerFeedbackRequest; + })(); + + v3beta1.DetectIntentRequest = (function() { + + /** + * Properties of a DetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDetectIntentRequest + * @property {string|null} [session] DetectIntentRequest session + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null} [queryParams] DetectIntentRequest queryParams + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null} [queryInput] DetectIntentRequest queryInput + * @property {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentRequest outputAudioConfig + * @property {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|null} [responseView] DetectIntentRequest responseView + */ + + /** + * Constructs a new DetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DetectIntentRequest. + * @implements IDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest=} [properties] Properties to set + */ + function DetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.session = ""; + + /** + * DetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryParams = null; + + /** + * DetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryInput = null; + + /** + * DetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.outputAudioConfig = null; + + /** + * DetectIntentRequest responseView. + * @member {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView} responseView + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.responseView = 0; + + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest} DetectIntentRequest instance + */ + DetectIntentRequest.create = function create(properties) { + return new DetectIntentRequest(properties); + }; + + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.responseView); + return writer; + }; + + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.responseView = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.verify(message.queryParams, long + 1); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.verify(message.queryInput, long + 1); + if (error) + return "queryInput." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + if (message.responseView != null && message.hasOwnProperty("responseView")) + switch (message.responseView) { + default: + return "responseView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest} DetectIntentRequest + */ + DetectIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.fromObject(object.queryParams, long + 1); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.fromObject(object.queryInput, long + 1); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + switch (object.responseView) { + default: + if (typeof object.responseView === "number") { + message.responseView = object.responseView; + break; + } + break; + case "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.responseView = 0; + break; + case "DETECT_INTENT_RESPONSE_VIEW_FULL": + case 1: + message.responseView = 1; + break; + case "DETECT_INTENT_RESPONSE_VIEW_BASIC": + case 2: + message.responseView = 2; + break; + case "DETECT_INTENT_RESPONSE_VIEW_DEFAULT": + case 3: + message.responseView = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest} message DetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.outputAudioConfig = null; + object.responseView = options.enums === String ? "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.toObject(message.queryInput, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.responseView != null && message.hasOwnProperty("responseView")) + object.responseView = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView[message.responseView] === undefined ? message.responseView : $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView[message.responseView] : message.responseView; + return object; + }; + + /** + * Converts this DetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + DetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest"; + }; + + return DetectIntentRequest; + })(); + + v3beta1.DetectIntentResponse = (function() { + + /** + * Properties of a DetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDetectIntentResponse + * @property {string|null} [responseId] DetectIntentResponse responseId + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryResult|null} [queryResult] DetectIntentResponse queryResult + * @property {Uint8Array|null} [outputAudio] DetectIntentResponse outputAudio + * @property {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentResponse outputAudioConfig + * @property {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType|null} [responseType] DetectIntentResponse responseType + * @property {boolean|null} [allowCancellation] DetectIntentResponse allowCancellation + */ + + /** + * Constructs a new DetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DetectIntentResponse. + * @implements IDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse=} [properties] Properties to set + */ + function DetectIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.responseId = ""; + + /** + * DetectIntentResponse queryResult. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.queryResult = null; + + /** + * DetectIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + + /** + * DetectIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudioConfig = null; + + /** + * DetectIntentResponse responseType. + * @member {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType} responseType + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.responseType = 0; + + /** + * DetectIntentResponse allowCancellation. + * @member {boolean} allowCancellation + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.allowCancellation = false; + + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} DetectIntentResponse instance + */ + DetectIntentResponse.create = function create(properties) { + return new DetectIntentResponse(properties); + }; + + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.outputAudio); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.responseType); + if (message.allowCancellation != null && Object.hasOwnProperty.call(message, "allowCancellation")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.allowCancellation); + return writer; + }; + + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseId = reader.string(); + break; + } + case 2: { + message.queryResult = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputAudio = reader.bytes(); + break; + } + case 5: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.responseType = reader.int32(); + break; + } + case 7: { + message.allowCancellation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.verify(message.queryResult, long + 1); + if (error) + return "queryResult." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + switch (message.responseType) { + default: + return "responseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allowCancellation != null && message.hasOwnProperty("allowCancellation")) + if (typeof message.allowCancellation !== "boolean") + return "allowCancellation: boolean expected"; + return null; + }; + + /** + * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} DetectIntentResponse + */ + DetectIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.fromObject(object.queryResult, long + 1); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length >= 0) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + switch (object.responseType) { + default: + if (typeof object.responseType === "number") { + message.responseType = object.responseType; + break; + } + break; + case "RESPONSE_TYPE_UNSPECIFIED": + case 0: + message.responseType = 0; + break; + case "PARTIAL": + case 1: + message.responseType = 1; + break; + case "FINAL": + case 2: + message.responseType = 2; + break; + } + if (object.allowCancellation != null) + message.allowCancellation = Boolean(object.allowCancellation); + return message; + }; + + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} message DetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseId = ""; + object.queryResult = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + object.responseType = options.enums === String ? "RESPONSE_TYPE_UNSPECIFIED" : 0; + object.allowCancellation = false; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.toObject(message.queryResult, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType[message.responseType] === undefined ? message.responseType : $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType[message.responseType] : message.responseType; + if (message.allowCancellation != null && message.hasOwnProperty("allowCancellation")) + object.allowCancellation = message.allowCancellation; + return object; + }; + + /** + * Converts this DetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + DetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse"; + }; + + /** + * ResponseType enum. + * @name google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.ResponseType + * @enum {number} + * @property {number} RESPONSE_TYPE_UNSPECIFIED=0 RESPONSE_TYPE_UNSPECIFIED value + * @property {number} PARTIAL=1 PARTIAL value + * @property {number} FINAL=2 FINAL value + */ + DetectIntentResponse.ResponseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARTIAL"] = 1; + values[valuesById[2] = "FINAL"] = 2; + return values; + })(); + + return DetectIntentResponse; + })(); + + v3beta1.StreamingDetectIntentRequest = (function() { + + /** + * Properties of a StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IStreamingDetectIntentRequest + * @property {string|null} [session] StreamingDetectIntentRequest session + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null} [queryParams] StreamingDetectIntentRequest queryParams + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null} [queryInput] StreamingDetectIntentRequest queryInput + * @property {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentRequest outputAudioConfig + * @property {boolean|null} [enablePartialResponse] StreamingDetectIntentRequest enablePartialResponse + * @property {boolean|null} [enableDebuggingInfo] StreamingDetectIntentRequest enableDebuggingInfo + * @property {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView|null} [responseView] StreamingDetectIntentRequest responseView + */ + + /** + * Constructs a new StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a StreamingDetectIntentRequest. + * @implements IStreamingDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest=} [properties] Properties to set + */ + function StreamingDetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingDetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.session = ""; + + /** + * StreamingDetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryParams = null; + + /** + * StreamingDetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryInput = null; + + /** + * StreamingDetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.outputAudioConfig = null; + + /** + * StreamingDetectIntentRequest enablePartialResponse. + * @member {boolean} enablePartialResponse + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.enablePartialResponse = false; + + /** + * StreamingDetectIntentRequest enableDebuggingInfo. + * @member {boolean} enableDebuggingInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.enableDebuggingInfo = false; + + /** + * StreamingDetectIntentRequest responseView. + * @member {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView} responseView + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.responseView = 0; + + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest instance + */ + StreamingDetectIntentRequest.create = function create(properties) { + return new StreamingDetectIntentRequest(properties); + }; + + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enablePartialResponse != null && Object.hasOwnProperty.call(message, "enablePartialResponse")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enablePartialResponse); + if (message.enableDebuggingInfo != null && Object.hasOwnProperty.call(message, "enableDebuggingInfo")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableDebuggingInfo); + if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.responseView); + return writer; + }; + + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.enablePartialResponse = reader.bool(); + break; + } + case 8: { + message.enableDebuggingInfo = reader.bool(); + break; + } + case 16: { + message.responseView = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingDetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.verify(message.queryParams, long + 1); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.verify(message.queryInput, long + 1); + if (error) + return "queryInput." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + if (message.enablePartialResponse != null && message.hasOwnProperty("enablePartialResponse")) + if (typeof message.enablePartialResponse !== "boolean") + return "enablePartialResponse: boolean expected"; + if (message.enableDebuggingInfo != null && message.hasOwnProperty("enableDebuggingInfo")) + if (typeof message.enableDebuggingInfo !== "boolean") + return "enableDebuggingInfo: boolean expected"; + if (message.responseView != null && message.hasOwnProperty("responseView")) + switch (message.responseView) { + default: + return "responseView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + */ + StreamingDetectIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.fromObject(object.queryParams, long + 1); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.fromObject(object.queryInput, long + 1); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + if (object.enablePartialResponse != null) + message.enablePartialResponse = Boolean(object.enablePartialResponse); + if (object.enableDebuggingInfo != null) + message.enableDebuggingInfo = Boolean(object.enableDebuggingInfo); + switch (object.responseView) { + default: + if (typeof object.responseView === "number") { + message.responseView = object.responseView; + break; + } + break; + case "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.responseView = 0; + break; + case "DETECT_INTENT_RESPONSE_VIEW_FULL": + case 1: + message.responseView = 1; + break; + case "DETECT_INTENT_RESPONSE_VIEW_BASIC": + case 2: + message.responseView = 2; + break; + case "DETECT_INTENT_RESPONSE_VIEW_DEFAULT": + case 3: + message.responseView = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest} message StreamingDetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.outputAudioConfig = null; + object.enablePartialResponse = false; + object.enableDebuggingInfo = false; + object.responseView = options.enums === String ? "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.toObject(message.queryInput, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.enablePartialResponse != null && message.hasOwnProperty("enablePartialResponse")) + object.enablePartialResponse = message.enablePartialResponse; + if (message.enableDebuggingInfo != null && message.hasOwnProperty("enableDebuggingInfo")) + object.enableDebuggingInfo = message.enableDebuggingInfo; + if (message.responseView != null && message.hasOwnProperty("responseView")) + object.responseView = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView[message.responseView] === undefined ? message.responseView : $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView[message.responseView] : message.responseView; + return object; + }; + + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingDetectIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingDetectIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest"; + }; + + return StreamingDetectIntentRequest; + })(); + + v3beta1.CloudConversationDebuggingInfo = (function() { + + /** + * Properties of a CloudConversationDebuggingInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICloudConversationDebuggingInfo + * @property {number|null} [audioDataChunks] CloudConversationDebuggingInfo audioDataChunks + * @property {google.protobuf.IDuration|null} [resultEndTimeOffset] CloudConversationDebuggingInfo resultEndTimeOffset + * @property {google.protobuf.IDuration|null} [firstAudioDuration] CloudConversationDebuggingInfo firstAudioDuration + * @property {boolean|null} [singleUtterance] CloudConversationDebuggingInfo singleUtterance + * @property {Array.|null} [speechPartialResultsEndTimes] CloudConversationDebuggingInfo speechPartialResultsEndTimes + * @property {Array.|null} [speechFinalResultsEndTimes] CloudConversationDebuggingInfo speechFinalResultsEndTimes + * @property {number|null} [partialResponses] CloudConversationDebuggingInfo partialResponses + * @property {number|null} [speakerIdPassiveLatencyMsOffset] CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset + * @property {boolean|null} [bargeinEventTriggered] CloudConversationDebuggingInfo bargeinEventTriggered + * @property {boolean|null} [speechSingleUtterance] CloudConversationDebuggingInfo speechSingleUtterance + * @property {Array.|null} [dtmfPartialResultsTimes] CloudConversationDebuggingInfo dtmfPartialResultsTimes + * @property {Array.|null} [dtmfFinalResultsTimes] CloudConversationDebuggingInfo dtmfFinalResultsTimes + * @property {google.protobuf.IDuration|null} [singleUtteranceEndTimeOffset] CloudConversationDebuggingInfo singleUtteranceEndTimeOffset + * @property {google.protobuf.IDuration|null} [noSpeechTimeout] CloudConversationDebuggingInfo noSpeechTimeout + * @property {google.protobuf.IDuration|null} [endpointingTimeout] CloudConversationDebuggingInfo endpointingTimeout + * @property {boolean|null} [isInputText] CloudConversationDebuggingInfo isInputText + * @property {google.protobuf.IDuration|null} [clientHalfCloseTimeOffset] CloudConversationDebuggingInfo clientHalfCloseTimeOffset + * @property {google.protobuf.IDuration|null} [clientHalfCloseStreamingTimeOffset] CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset + */ + + /** + * Constructs a new CloudConversationDebuggingInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CloudConversationDebuggingInfo. + * @implements ICloudConversationDebuggingInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo=} [properties] Properties to set + */ + function CloudConversationDebuggingInfo(properties) { + this.speechPartialResultsEndTimes = []; + this.speechFinalResultsEndTimes = []; + this.dtmfPartialResultsTimes = []; + this.dtmfFinalResultsTimes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudConversationDebuggingInfo audioDataChunks. + * @member {number} audioDataChunks + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.audioDataChunks = 0; + + /** + * CloudConversationDebuggingInfo resultEndTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} resultEndTimeOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.resultEndTimeOffset = null; + + /** + * CloudConversationDebuggingInfo firstAudioDuration. + * @member {google.protobuf.IDuration|null|undefined} firstAudioDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.firstAudioDuration = null; + + /** + * CloudConversationDebuggingInfo singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.singleUtterance = false; + + /** + * CloudConversationDebuggingInfo speechPartialResultsEndTimes. + * @member {Array.} speechPartialResultsEndTimes + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speechPartialResultsEndTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo speechFinalResultsEndTimes. + * @member {Array.} speechFinalResultsEndTimes + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speechFinalResultsEndTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo partialResponses. + * @member {number} partialResponses + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.partialResponses = 0; + + /** + * CloudConversationDebuggingInfo speakerIdPassiveLatencyMsOffset. + * @member {number} speakerIdPassiveLatencyMsOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speakerIdPassiveLatencyMsOffset = 0; + + /** + * CloudConversationDebuggingInfo bargeinEventTriggered. + * @member {boolean} bargeinEventTriggered + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.bargeinEventTriggered = false; + + /** + * CloudConversationDebuggingInfo speechSingleUtterance. + * @member {boolean} speechSingleUtterance + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.speechSingleUtterance = false; + + /** + * CloudConversationDebuggingInfo dtmfPartialResultsTimes. + * @member {Array.} dtmfPartialResultsTimes + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.dtmfPartialResultsTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo dtmfFinalResultsTimes. + * @member {Array.} dtmfFinalResultsTimes + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.dtmfFinalResultsTimes = $util.emptyArray; + + /** + * CloudConversationDebuggingInfo singleUtteranceEndTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} singleUtteranceEndTimeOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.singleUtteranceEndTimeOffset = null; + + /** + * CloudConversationDebuggingInfo noSpeechTimeout. + * @member {google.protobuf.IDuration|null|undefined} noSpeechTimeout + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.noSpeechTimeout = null; + + /** + * CloudConversationDebuggingInfo endpointingTimeout. + * @member {google.protobuf.IDuration|null|undefined} endpointingTimeout + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.endpointingTimeout = null; + + /** + * CloudConversationDebuggingInfo isInputText. + * @member {boolean} isInputText + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.isInputText = false; + + /** + * CloudConversationDebuggingInfo clientHalfCloseTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} clientHalfCloseTimeOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.clientHalfCloseTimeOffset = null; + + /** + * CloudConversationDebuggingInfo clientHalfCloseStreamingTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} clientHalfCloseStreamingTimeOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + */ + CloudConversationDebuggingInfo.prototype.clientHalfCloseStreamingTimeOffset = null; + + /** + * Creates a new CloudConversationDebuggingInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo instance + */ + CloudConversationDebuggingInfo.create = function create(properties) { + return new CloudConversationDebuggingInfo(properties); + }; + + /** + * Encodes the specified CloudConversationDebuggingInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo} message CloudConversationDebuggingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudConversationDebuggingInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioDataChunks != null && Object.hasOwnProperty.call(message, "audioDataChunks")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioDataChunks); + if (message.resultEndTimeOffset != null && Object.hasOwnProperty.call(message, "resultEndTimeOffset")) + $root.google.protobuf.Duration.encode(message.resultEndTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.firstAudioDuration != null && Object.hasOwnProperty.call(message, "firstAudioDuration")) + $root.google.protobuf.Duration.encode(message.firstAudioDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.singleUtterance); + if (message.speechPartialResultsEndTimes != null && message.speechPartialResultsEndTimes.length) + for (var i = 0; i < message.speechPartialResultsEndTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.speechPartialResultsEndTimes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.speechFinalResultsEndTimes != null && message.speechFinalResultsEndTimes.length) + for (var i = 0; i < message.speechFinalResultsEndTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.speechFinalResultsEndTimes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.partialResponses != null && Object.hasOwnProperty.call(message, "partialResponses")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.partialResponses); + if (message.speakerIdPassiveLatencyMsOffset != null && Object.hasOwnProperty.call(message, "speakerIdPassiveLatencyMsOffset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.speakerIdPassiveLatencyMsOffset); + if (message.bargeinEventTriggered != null && Object.hasOwnProperty.call(message, "bargeinEventTriggered")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.bargeinEventTriggered); + if (message.speechSingleUtterance != null && Object.hasOwnProperty.call(message, "speechSingleUtterance")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.speechSingleUtterance); + if (message.dtmfPartialResultsTimes != null && message.dtmfPartialResultsTimes.length) + for (var i = 0; i < message.dtmfPartialResultsTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.dtmfPartialResultsTimes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.dtmfFinalResultsTimes != null && message.dtmfFinalResultsTimes.length) + for (var i = 0; i < message.dtmfFinalResultsTimes.length; ++i) + $root.google.protobuf.Duration.encode(message.dtmfFinalResultsTimes[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.singleUtteranceEndTimeOffset != null && Object.hasOwnProperty.call(message, "singleUtteranceEndTimeOffset")) + $root.google.protobuf.Duration.encode(message.singleUtteranceEndTimeOffset, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.noSpeechTimeout != null && Object.hasOwnProperty.call(message, "noSpeechTimeout")) + $root.google.protobuf.Duration.encode(message.noSpeechTimeout, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.isInputText != null && Object.hasOwnProperty.call(message, "isInputText")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.isInputText); + if (message.clientHalfCloseTimeOffset != null && Object.hasOwnProperty.call(message, "clientHalfCloseTimeOffset")) + $root.google.protobuf.Duration.encode(message.clientHalfCloseTimeOffset, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.clientHalfCloseStreamingTimeOffset != null && Object.hasOwnProperty.call(message, "clientHalfCloseStreamingTimeOffset")) + $root.google.protobuf.Duration.encode(message.clientHalfCloseStreamingTimeOffset, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.endpointingTimeout != null && Object.hasOwnProperty.call(message, "endpointingTimeout")) + $root.google.protobuf.Duration.encode(message.endpointingTimeout, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudConversationDebuggingInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo} message CloudConversationDebuggingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudConversationDebuggingInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudConversationDebuggingInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioDataChunks = reader.int32(); + break; + } + case 2: { + message.resultEndTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.firstAudioDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.singleUtterance = reader.bool(); + break; + } + case 6: { + if (!(message.speechPartialResultsEndTimes && message.speechPartialResultsEndTimes.length)) + message.speechPartialResultsEndTimes = []; + message.speechPartialResultsEndTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.speechFinalResultsEndTimes && message.speechFinalResultsEndTimes.length)) + message.speechFinalResultsEndTimes = []; + message.speechFinalResultsEndTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.partialResponses = reader.int32(); + break; + } + case 9: { + message.speakerIdPassiveLatencyMsOffset = reader.int32(); + break; + } + case 10: { + message.bargeinEventTriggered = reader.bool(); + break; + } + case 11: { + message.speechSingleUtterance = reader.bool(); + break; + } + case 12: { + if (!(message.dtmfPartialResultsTimes && message.dtmfPartialResultsTimes.length)) + message.dtmfPartialResultsTimes = []; + message.dtmfPartialResultsTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 13: { + if (!(message.dtmfFinalResultsTimes && message.dtmfFinalResultsTimes.length)) + message.dtmfFinalResultsTimes = []; + message.dtmfFinalResultsTimes.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 14: { + message.singleUtteranceEndTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.noSpeechTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.endpointingTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.isInputText = reader.bool(); + break; + } + case 17: { + message.clientHalfCloseTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.clientHalfCloseStreamingTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CloudConversationDebuggingInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudConversationDebuggingInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudConversationDebuggingInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudConversationDebuggingInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.audioDataChunks != null && message.hasOwnProperty("audioDataChunks")) + if (!$util.isInteger(message.audioDataChunks)) + return "audioDataChunks: integer expected"; + if (message.resultEndTimeOffset != null && message.hasOwnProperty("resultEndTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTimeOffset, long + 1); + if (error) + return "resultEndTimeOffset." + error; + } + if (message.firstAudioDuration != null && message.hasOwnProperty("firstAudioDuration")) { + var error = $root.google.protobuf.Duration.verify(message.firstAudioDuration, long + 1); + if (error) + return "firstAudioDuration." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.speechPartialResultsEndTimes != null && message.hasOwnProperty("speechPartialResultsEndTimes")) { + if (!Array.isArray(message.speechPartialResultsEndTimes)) + return "speechPartialResultsEndTimes: array expected"; + for (var i = 0; i < message.speechPartialResultsEndTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.speechPartialResultsEndTimes[i], long + 1); + if (error) + return "speechPartialResultsEndTimes." + error; + } + } + if (message.speechFinalResultsEndTimes != null && message.hasOwnProperty("speechFinalResultsEndTimes")) { + if (!Array.isArray(message.speechFinalResultsEndTimes)) + return "speechFinalResultsEndTimes: array expected"; + for (var i = 0; i < message.speechFinalResultsEndTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.speechFinalResultsEndTimes[i], long + 1); + if (error) + return "speechFinalResultsEndTimes." + error; + } + } + if (message.partialResponses != null && message.hasOwnProperty("partialResponses")) + if (!$util.isInteger(message.partialResponses)) + return "partialResponses: integer expected"; + if (message.speakerIdPassiveLatencyMsOffset != null && message.hasOwnProperty("speakerIdPassiveLatencyMsOffset")) + if (!$util.isInteger(message.speakerIdPassiveLatencyMsOffset)) + return "speakerIdPassiveLatencyMsOffset: integer expected"; + if (message.bargeinEventTriggered != null && message.hasOwnProperty("bargeinEventTriggered")) + if (typeof message.bargeinEventTriggered !== "boolean") + return "bargeinEventTriggered: boolean expected"; + if (message.speechSingleUtterance != null && message.hasOwnProperty("speechSingleUtterance")) + if (typeof message.speechSingleUtterance !== "boolean") + return "speechSingleUtterance: boolean expected"; + if (message.dtmfPartialResultsTimes != null && message.hasOwnProperty("dtmfPartialResultsTimes")) { + if (!Array.isArray(message.dtmfPartialResultsTimes)) + return "dtmfPartialResultsTimes: array expected"; + for (var i = 0; i < message.dtmfPartialResultsTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.dtmfPartialResultsTimes[i], long + 1); + if (error) + return "dtmfPartialResultsTimes." + error; + } + } + if (message.dtmfFinalResultsTimes != null && message.hasOwnProperty("dtmfFinalResultsTimes")) { + if (!Array.isArray(message.dtmfFinalResultsTimes)) + return "dtmfFinalResultsTimes: array expected"; + for (var i = 0; i < message.dtmfFinalResultsTimes.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.dtmfFinalResultsTimes[i], long + 1); + if (error) + return "dtmfFinalResultsTimes." + error; + } + } + if (message.singleUtteranceEndTimeOffset != null && message.hasOwnProperty("singleUtteranceEndTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.singleUtteranceEndTimeOffset, long + 1); + if (error) + return "singleUtteranceEndTimeOffset." + error; + } + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.noSpeechTimeout, long + 1); + if (error) + return "noSpeechTimeout." + error; + } + if (message.endpointingTimeout != null && message.hasOwnProperty("endpointingTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.endpointingTimeout, long + 1); + if (error) + return "endpointingTimeout." + error; + } + if (message.isInputText != null && message.hasOwnProperty("isInputText")) + if (typeof message.isInputText !== "boolean") + return "isInputText: boolean expected"; + if (message.clientHalfCloseTimeOffset != null && message.hasOwnProperty("clientHalfCloseTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.clientHalfCloseTimeOffset, long + 1); + if (error) + return "clientHalfCloseTimeOffset." + error; + } + if (message.clientHalfCloseStreamingTimeOffset != null && message.hasOwnProperty("clientHalfCloseStreamingTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.clientHalfCloseStreamingTimeOffset, long + 1); + if (error) + return "clientHalfCloseStreamingTimeOffset." + error; + } + return null; + }; + + /** + * Creates a CloudConversationDebuggingInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo} CloudConversationDebuggingInfo + */ + CloudConversationDebuggingInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo(); + if (object.audioDataChunks != null) + message.audioDataChunks = object.audioDataChunks | 0; + if (object.resultEndTimeOffset != null) { + if (typeof object.resultEndTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.resultEndTimeOffset: object expected"); + message.resultEndTimeOffset = $root.google.protobuf.Duration.fromObject(object.resultEndTimeOffset, long + 1); + } + if (object.firstAudioDuration != null) { + if (typeof object.firstAudioDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.firstAudioDuration: object expected"); + message.firstAudioDuration = $root.google.protobuf.Duration.fromObject(object.firstAudioDuration, long + 1); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.speechPartialResultsEndTimes) { + if (!Array.isArray(object.speechPartialResultsEndTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.speechPartialResultsEndTimes: array expected"); + message.speechPartialResultsEndTimes = []; + for (var i = 0; i < object.speechPartialResultsEndTimes.length; ++i) { + if (typeof object.speechPartialResultsEndTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.speechPartialResultsEndTimes: object expected"); + message.speechPartialResultsEndTimes[i] = $root.google.protobuf.Duration.fromObject(object.speechPartialResultsEndTimes[i], long + 1); + } + } + if (object.speechFinalResultsEndTimes) { + if (!Array.isArray(object.speechFinalResultsEndTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.speechFinalResultsEndTimes: array expected"); + message.speechFinalResultsEndTimes = []; + for (var i = 0; i < object.speechFinalResultsEndTimes.length; ++i) { + if (typeof object.speechFinalResultsEndTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.speechFinalResultsEndTimes: object expected"); + message.speechFinalResultsEndTimes[i] = $root.google.protobuf.Duration.fromObject(object.speechFinalResultsEndTimes[i], long + 1); + } + } + if (object.partialResponses != null) + message.partialResponses = object.partialResponses | 0; + if (object.speakerIdPassiveLatencyMsOffset != null) + message.speakerIdPassiveLatencyMsOffset = object.speakerIdPassiveLatencyMsOffset | 0; + if (object.bargeinEventTriggered != null) + message.bargeinEventTriggered = Boolean(object.bargeinEventTriggered); + if (object.speechSingleUtterance != null) + message.speechSingleUtterance = Boolean(object.speechSingleUtterance); + if (object.dtmfPartialResultsTimes) { + if (!Array.isArray(object.dtmfPartialResultsTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.dtmfPartialResultsTimes: array expected"); + message.dtmfPartialResultsTimes = []; + for (var i = 0; i < object.dtmfPartialResultsTimes.length; ++i) { + if (typeof object.dtmfPartialResultsTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.dtmfPartialResultsTimes: object expected"); + message.dtmfPartialResultsTimes[i] = $root.google.protobuf.Duration.fromObject(object.dtmfPartialResultsTimes[i], long + 1); + } + } + if (object.dtmfFinalResultsTimes) { + if (!Array.isArray(object.dtmfFinalResultsTimes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.dtmfFinalResultsTimes: array expected"); + message.dtmfFinalResultsTimes = []; + for (var i = 0; i < object.dtmfFinalResultsTimes.length; ++i) { + if (typeof object.dtmfFinalResultsTimes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.dtmfFinalResultsTimes: object expected"); + message.dtmfFinalResultsTimes[i] = $root.google.protobuf.Duration.fromObject(object.dtmfFinalResultsTimes[i], long + 1); + } + } + if (object.singleUtteranceEndTimeOffset != null) { + if (typeof object.singleUtteranceEndTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.singleUtteranceEndTimeOffset: object expected"); + message.singleUtteranceEndTimeOffset = $root.google.protobuf.Duration.fromObject(object.singleUtteranceEndTimeOffset, long + 1); + } + if (object.noSpeechTimeout != null) { + if (typeof object.noSpeechTimeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.noSpeechTimeout: object expected"); + message.noSpeechTimeout = $root.google.protobuf.Duration.fromObject(object.noSpeechTimeout, long + 1); + } + if (object.endpointingTimeout != null) { + if (typeof object.endpointingTimeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.endpointingTimeout: object expected"); + message.endpointingTimeout = $root.google.protobuf.Duration.fromObject(object.endpointingTimeout, long + 1); + } + if (object.isInputText != null) + message.isInputText = Boolean(object.isInputText); + if (object.clientHalfCloseTimeOffset != null) { + if (typeof object.clientHalfCloseTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.clientHalfCloseTimeOffset: object expected"); + message.clientHalfCloseTimeOffset = $root.google.protobuf.Duration.fromObject(object.clientHalfCloseTimeOffset, long + 1); + } + if (object.clientHalfCloseStreamingTimeOffset != null) { + if (typeof object.clientHalfCloseStreamingTimeOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.clientHalfCloseStreamingTimeOffset: object expected"); + message.clientHalfCloseStreamingTimeOffset = $root.google.protobuf.Duration.fromObject(object.clientHalfCloseStreamingTimeOffset, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CloudConversationDebuggingInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo} message CloudConversationDebuggingInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudConversationDebuggingInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechPartialResultsEndTimes = []; + object.speechFinalResultsEndTimes = []; + object.dtmfPartialResultsTimes = []; + object.dtmfFinalResultsTimes = []; + } + if (options.defaults) { + object.audioDataChunks = 0; + object.resultEndTimeOffset = null; + object.firstAudioDuration = null; + object.singleUtterance = false; + object.partialResponses = 0; + object.speakerIdPassiveLatencyMsOffset = 0; + object.bargeinEventTriggered = false; + object.speechSingleUtterance = false; + object.singleUtteranceEndTimeOffset = null; + object.noSpeechTimeout = null; + object.isInputText = false; + object.clientHalfCloseTimeOffset = null; + object.clientHalfCloseStreamingTimeOffset = null; + object.endpointingTimeout = null; + } + if (message.audioDataChunks != null && message.hasOwnProperty("audioDataChunks")) + object.audioDataChunks = message.audioDataChunks; + if (message.resultEndTimeOffset != null && message.hasOwnProperty("resultEndTimeOffset")) + object.resultEndTimeOffset = $root.google.protobuf.Duration.toObject(message.resultEndTimeOffset, options); + if (message.firstAudioDuration != null && message.hasOwnProperty("firstAudioDuration")) + object.firstAudioDuration = $root.google.protobuf.Duration.toObject(message.firstAudioDuration, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.speechPartialResultsEndTimes && message.speechPartialResultsEndTimes.length) { + object.speechPartialResultsEndTimes = []; + for (var j = 0; j < message.speechPartialResultsEndTimes.length; ++j) + object.speechPartialResultsEndTimes[j] = $root.google.protobuf.Duration.toObject(message.speechPartialResultsEndTimes[j], options); + } + if (message.speechFinalResultsEndTimes && message.speechFinalResultsEndTimes.length) { + object.speechFinalResultsEndTimes = []; + for (var j = 0; j < message.speechFinalResultsEndTimes.length; ++j) + object.speechFinalResultsEndTimes[j] = $root.google.protobuf.Duration.toObject(message.speechFinalResultsEndTimes[j], options); + } + if (message.partialResponses != null && message.hasOwnProperty("partialResponses")) + object.partialResponses = message.partialResponses; + if (message.speakerIdPassiveLatencyMsOffset != null && message.hasOwnProperty("speakerIdPassiveLatencyMsOffset")) + object.speakerIdPassiveLatencyMsOffset = message.speakerIdPassiveLatencyMsOffset; + if (message.bargeinEventTriggered != null && message.hasOwnProperty("bargeinEventTriggered")) + object.bargeinEventTriggered = message.bargeinEventTriggered; + if (message.speechSingleUtterance != null && message.hasOwnProperty("speechSingleUtterance")) + object.speechSingleUtterance = message.speechSingleUtterance; + if (message.dtmfPartialResultsTimes && message.dtmfPartialResultsTimes.length) { + object.dtmfPartialResultsTimes = []; + for (var j = 0; j < message.dtmfPartialResultsTimes.length; ++j) + object.dtmfPartialResultsTimes[j] = $root.google.protobuf.Duration.toObject(message.dtmfPartialResultsTimes[j], options); + } + if (message.dtmfFinalResultsTimes && message.dtmfFinalResultsTimes.length) { + object.dtmfFinalResultsTimes = []; + for (var j = 0; j < message.dtmfFinalResultsTimes.length; ++j) + object.dtmfFinalResultsTimes[j] = $root.google.protobuf.Duration.toObject(message.dtmfFinalResultsTimes[j], options); + } + if (message.singleUtteranceEndTimeOffset != null && message.hasOwnProperty("singleUtteranceEndTimeOffset")) + object.singleUtteranceEndTimeOffset = $root.google.protobuf.Duration.toObject(message.singleUtteranceEndTimeOffset, options); + if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) + object.noSpeechTimeout = $root.google.protobuf.Duration.toObject(message.noSpeechTimeout, options); + if (message.isInputText != null && message.hasOwnProperty("isInputText")) + object.isInputText = message.isInputText; + if (message.clientHalfCloseTimeOffset != null && message.hasOwnProperty("clientHalfCloseTimeOffset")) + object.clientHalfCloseTimeOffset = $root.google.protobuf.Duration.toObject(message.clientHalfCloseTimeOffset, options); + if (message.clientHalfCloseStreamingTimeOffset != null && message.hasOwnProperty("clientHalfCloseStreamingTimeOffset")) + object.clientHalfCloseStreamingTimeOffset = $root.google.protobuf.Duration.toObject(message.clientHalfCloseStreamingTimeOffset, options); + if (message.endpointingTimeout != null && message.hasOwnProperty("endpointingTimeout")) + object.endpointingTimeout = $root.google.protobuf.Duration.toObject(message.endpointingTimeout, options); + return object; + }; + + /** + * Converts this CloudConversationDebuggingInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @instance + * @returns {Object.} JSON object + */ + CloudConversationDebuggingInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudConversationDebuggingInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudConversationDebuggingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo"; + }; + + return CloudConversationDebuggingInfo; + })(); + + v3beta1.StreamingDetectIntentResponse = (function() { + + /** + * Properties of a StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IStreamingDetectIntentResponse + * @property {google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult|null} [recognitionResult] StreamingDetectIntentResponse recognitionResult + * @property {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null} [detectIntentResponse] StreamingDetectIntentResponse detectIntentResponse + * @property {google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo|null} [debuggingInfo] StreamingDetectIntentResponse debuggingInfo + */ + + /** + * Constructs a new StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a StreamingDetectIntentResponse. + * @implements IStreamingDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse=} [properties] Properties to set + */ + function StreamingDetectIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingDetectIntentResponse recognitionResult. + * @member {google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.recognitionResult = null; + + /** + * StreamingDetectIntentResponse detectIntentResponse. + * @member {google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse|null|undefined} detectIntentResponse + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.detectIntentResponse = null; + + /** + * StreamingDetectIntentResponse debuggingInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.ICloudConversationDebuggingInfo|null|undefined} debuggingInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.debuggingInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingDetectIntentResponse response. + * @member {"recognitionResult"|"detectIntentResponse"|undefined} response + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @instance + */ + Object.defineProperty(StreamingDetectIntentResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["recognitionResult", "detectIntentResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse instance + */ + StreamingDetectIntentResponse.create = function create(properties) { + return new StreamingDetectIntentResponse(properties); + }; + + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectIntentResponse != null && Object.hasOwnProperty.call(message, "detectIntentResponse")) + $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.encode(message.detectIntentResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debuggingInfo != null && Object.hasOwnProperty.call(message, "debuggingInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.encode(message.debuggingInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recognitionResult = $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.detectIntentResponse = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.debuggingInfo = $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingDetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + properties.response = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.verify(message.recognitionResult, long + 1); + if (error) + return "recognitionResult." + error; + } + } + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.verify(message.detectIntentResponse, long + 1); + if (error) + return "detectIntentResponse." + error; + } + } + if (message.debuggingInfo != null && message.hasOwnProperty("debuggingInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.verify(message.debuggingInfo, long + 1); + if (error) + return "debuggingInfo." + error; + } + return null; + }; + + /** + * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + */ + StreamingDetectIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse(); + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.fromObject(object.recognitionResult, long + 1); + } + if (object.detectIntentResponse != null) { + if (typeof object.detectIntentResponse !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.detectIntentResponse: object expected"); + message.detectIntentResponse = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.fromObject(object.detectIntentResponse, long + 1); + } + if (object.debuggingInfo != null) { + if (typeof object.debuggingInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.debuggingInfo: object expected"); + message.debuggingInfo = $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.fromObject(object.debuggingInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} message StreamingDetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.debuggingInfo = null; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + object.recognitionResult = $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.toObject(message.recognitionResult, options); + if (options.oneofs) + object.response = "recognitionResult"; + } + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) { + object.detectIntentResponse = $root.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.toObject(message.detectIntentResponse, options); + if (options.oneofs) + object.response = "detectIntentResponse"; + } + if (message.debuggingInfo != null && message.hasOwnProperty("debuggingInfo")) + object.debuggingInfo = $root.google.cloud.dialogflow.cx.v3beta1.CloudConversationDebuggingInfo.toObject(message.debuggingInfo, options); + return object; + }; + + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingDetectIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingDetectIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse"; + }; + + return StreamingDetectIntentResponse; + })(); + + v3beta1.StreamingRecognitionResult = (function() { + + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IStreamingRecognitionResult + * @property {google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType|null} [messageType] StreamingRecognitionResult messageType + * @property {string|null} [transcript] StreamingRecognitionResult transcript + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [confidence] StreamingRecognitionResult confidence + * @property {number|null} [stability] StreamingRecognitionResult stability + * @property {Array.|null} [speechWordInfo] StreamingRecognitionResult speechWordInfo + * @property {google.protobuf.IDuration|null} [speechEndOffset] StreamingRecognitionResult speechEndOffset + * @property {string|null} [languageCode] StreamingRecognitionResult languageCode + */ + + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.speechWordInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionResult messageType. + * @member {google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType} messageType + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.messageType = 0; + + /** + * StreamingRecognitionResult transcript. + * @member {string} transcript + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.transcript = ""; + + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; + + /** + * StreamingRecognitionResult confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.confidence = 0; + + /** + * StreamingRecognitionResult stability. + * @member {number} stability + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.stability = 0; + + /** + * StreamingRecognitionResult speechWordInfo. + * @member {Array.} speechWordInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechWordInfo = $util.emptyArray; + + /** + * StreamingRecognitionResult speechEndOffset. + * @member {google.protobuf.IDuration|null|undefined} speechEndOffset + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechEndOffset = null; + + /** + * StreamingRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.messageType); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.transcript); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFinal); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.stability); + if (message.speechWordInfo != null && message.speechWordInfo.length) + for (var i = 0; i < message.speechWordInfo.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.encode(message.speechWordInfo[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.speechEndOffset != null && Object.hasOwnProperty.call(message, "speechEndOffset")) + $root.google.protobuf.Duration.encode(message.speechEndOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageType = reader.int32(); + break; + } + case 2: { + message.transcript = reader.string(); + break; + } + case 3: { + message.isFinal = reader.bool(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 6: { + message.stability = reader.float(); + break; + } + case 7: { + if (!(message.speechWordInfo && message.speechWordInfo.length)) + message.speechWordInfo = []; + message.speechWordInfo.push($root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.speechEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messageType != null && message.hasOwnProperty("messageType")) + switch (message.messageType) { + default: + return "messageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.stability != null && message.hasOwnProperty("stability")) + if (typeof message.stability !== "number") + return "stability: number expected"; + if (message.speechWordInfo != null && message.hasOwnProperty("speechWordInfo")) { + if (!Array.isArray(message.speechWordInfo)) + return "speechWordInfo: array expected"; + for (var i = 0; i < message.speechWordInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.verify(message.speechWordInfo[i], long + 1); + if (error) + return "speechWordInfo." + error; + } + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndOffset, long + 1); + if (error) + return "speechEndOffset." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult(); + switch (object.messageType) { + default: + if (typeof object.messageType === "number") { + message.messageType = object.messageType; + break; + } + break; + case "MESSAGE_TYPE_UNSPECIFIED": + case 0: + message.messageType = 0; + break; + case "TRANSCRIPT": + case 1: + message.messageType = 1; + break; + case "END_OF_SINGLE_UTTERANCE": + case 2: + message.messageType = 2; + break; + } + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.stability != null) + message.stability = Number(object.stability); + if (object.speechWordInfo) { + if (!Array.isArray(object.speechWordInfo)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.speechWordInfo: array expected"); + message.speechWordInfo = []; + for (var i = 0; i < object.speechWordInfo.length; ++i) { + if (typeof object.speechWordInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.speechWordInfo: object expected"); + message.speechWordInfo[i] = $root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.fromObject(object.speechWordInfo[i], long + 1); + } + } + if (object.speechEndOffset != null) { + if (typeof object.speechEndOffset !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.speechEndOffset: object expected"); + message.speechEndOffset = $root.google.protobuf.Duration.fromObject(object.speechEndOffset, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speechWordInfo = []; + if (options.defaults) { + object.messageType = options.enums === String ? "MESSAGE_TYPE_UNSPECIFIED" : 0; + object.transcript = ""; + object.isFinal = false; + object.confidence = 0; + object.stability = 0; + object.speechEndOffset = null; + object.languageCode = ""; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) + object.messageType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType[message.messageType] === undefined ? message.messageType : $root.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType[message.messageType] : message.messageType; + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.stability != null && message.hasOwnProperty("stability")) + object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; + if (message.speechWordInfo && message.speechWordInfo.length) { + object.speechWordInfo = []; + for (var j = 0; j < message.speechWordInfo.length; ++j) + object.speechWordInfo[j] = $root.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.toObject(message.speechWordInfo[j], options); + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) + object.speechEndOffset = $root.google.protobuf.Duration.toObject(message.speechEndOffset, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult"; + }; + + /** + * MessageType enum. + * @name google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType + * @enum {number} + * @property {number} MESSAGE_TYPE_UNSPECIFIED=0 MESSAGE_TYPE_UNSPECIFIED value + * @property {number} TRANSCRIPT=1 TRANSCRIPT value + * @property {number} END_OF_SINGLE_UTTERANCE=2 END_OF_SINGLE_UTTERANCE value + */ + StreamingRecognitionResult.MessageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSCRIPT"] = 1; + values[valuesById[2] = "END_OF_SINGLE_UTTERANCE"] = 2; + return values; + })(); + + return StreamingRecognitionResult; + })(); + + v3beta1.QueryParameters = (function() { + + /** + * Properties of a QueryParameters. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IQueryParameters + * @property {string|null} [timeZone] QueryParameters timeZone + * @property {google.type.ILatLng|null} [geoLocation] QueryParameters geoLocation + * @property {Array.|null} [sessionEntityTypes] QueryParameters sessionEntityTypes + * @property {google.protobuf.IStruct|null} [payload] QueryParameters payload + * @property {google.protobuf.IStruct|null} [parameters] QueryParameters parameters + * @property {string|null} [parameterScope] QueryParameters parameterScope + * @property {string|null} [currentPage] QueryParameters currentPage + * @property {boolean|null} [disableWebhook] QueryParameters disableWebhook + * @property {boolean|null} [analyzeQueryTextSentiment] QueryParameters analyzeQueryTextSentiment + * @property {Object.|null} [webhookHeaders] QueryParameters webhookHeaders + * @property {Array.|null} [flowVersions] QueryParameters flowVersions + * @property {string|null} [currentPlaybook] QueryParameters currentPlaybook + * @property {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null} [llmModelSettings] QueryParameters llmModelSettings + * @property {string|null} [channel] QueryParameters channel + * @property {google.protobuf.IDuration|null} [sessionTtl] QueryParameters sessionTtl + * @property {google.protobuf.IStruct|null} [endUserMetadata] QueryParameters endUserMetadata + * @property {google.cloud.dialogflow.cx.v3beta1.ISearchConfig|null} [searchConfig] QueryParameters searchConfig + * @property {boolean|null} [populateDataStoreConnectionSignals] QueryParameters populateDataStoreConnectionSignals + */ + + /** + * Constructs a new QueryParameters. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a QueryParameters. + * @implements IQueryParameters + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryParameters=} [properties] Properties to set + */ + function QueryParameters(properties) { + this.sessionEntityTypes = []; + this.webhookHeaders = {}; + this.flowVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameters timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.timeZone = ""; + + /** + * QueryParameters geoLocation. + * @member {google.type.ILatLng|null|undefined} geoLocation + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.geoLocation = null; + + /** + * QueryParameters sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.sessionEntityTypes = $util.emptyArray; + + /** + * QueryParameters payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.payload = null; + + /** + * QueryParameters parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.parameters = null; + + /** + * QueryParameters parameterScope. + * @member {string} parameterScope + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.parameterScope = ""; + + /** + * QueryParameters currentPage. + * @member {string} currentPage + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.currentPage = ""; + + /** + * QueryParameters disableWebhook. + * @member {boolean} disableWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.disableWebhook = false; + + /** + * QueryParameters analyzeQueryTextSentiment. + * @member {boolean} analyzeQueryTextSentiment + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.analyzeQueryTextSentiment = false; + + /** + * QueryParameters webhookHeaders. + * @member {Object.} webhookHeaders + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.webhookHeaders = $util.emptyObject; + + /** + * QueryParameters flowVersions. + * @member {Array.} flowVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.flowVersions = $util.emptyArray; + + /** + * QueryParameters currentPlaybook. + * @member {string} currentPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.currentPlaybook = ""; + + /** + * QueryParameters llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.llmModelSettings = null; + + /** + * QueryParameters channel. + * @member {string} channel + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.channel = ""; + + /** + * QueryParameters sessionTtl. + * @member {google.protobuf.IDuration|null|undefined} sessionTtl + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.sessionTtl = null; + + /** + * QueryParameters endUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} endUserMetadata + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.endUserMetadata = null; + + /** + * QueryParameters searchConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.ISearchConfig|null|undefined} searchConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.searchConfig = null; + + /** + * QueryParameters populateDataStoreConnectionSignals. + * @member {boolean} populateDataStoreConnectionSignals + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.populateDataStoreConnectionSignals = false; + + /** + * Creates a new QueryParameters instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryParameters=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryParameters} QueryParameters instance + */ + QueryParameters.create = function create(properties) { + return new QueryParameters(properties); + }; + + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + if (message.geoLocation != null && Object.hasOwnProperty.call(message, "geoLocation")) + $root.google.type.LatLng.encode(message.geoLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.currentPage); + if (message.disableWebhook != null && Object.hasOwnProperty.call(message, "disableWebhook")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.disableWebhook); + if (message.analyzeQueryTextSentiment != null && Object.hasOwnProperty.call(message, "analyzeQueryTextSentiment")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.analyzeQueryTextSentiment); + if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) + for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + if (message.parameterScope != null && Object.hasOwnProperty.call(message, "parameterScope")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.parameterScope); + if (message.flowVersions != null && message.flowVersions.length) + for (var i = 0; i < message.flowVersions.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.flowVersions[i]); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.channel); + if (message.sessionTtl != null && Object.hasOwnProperty.call(message, "sessionTtl")) + $root.google.protobuf.Duration.encode(message.sessionTtl, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) + $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.currentPlaybook != null && Object.hasOwnProperty.call(message, "currentPlaybook")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.currentPlaybook); + if (message.searchConfig != null && Object.hasOwnProperty.call(message, "searchConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig.encode(message.searchConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.populateDataStoreConnectionSignals != null && Object.hasOwnProperty.call(message, "populateDataStoreConnectionSignals")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.populateDataStoreConnectionSignals); + return writer; + }; + + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timeZone = reader.string(); + break; + } + case 2: { + message.geoLocation = $root.google.type.LatLng.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.parameterScope = reader.string(); + break; + } + case 6: { + message.currentPage = reader.string(); + break; + } + case 7: { + message.disableWebhook = reader.bool(); + break; + } + case 8: { + message.analyzeQueryTextSentiment = reader.bool(); + break; + } + case 10: { + if (message.webhookHeaders === $util.emptyObject) + message.webhookHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.webhookHeaders, key); + message.webhookHeaders[key] = value; + break; + } + case 14: { + if (!(message.flowVersions && message.flowVersions.length)) + message.flowVersions = []; + message.flowVersions.push(reader.string()); + break; + } + case 19: { + message.currentPlaybook = reader.string(); + break; + } + case 21: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.channel = reader.string(); + break; + } + case 16: { + message.sessionTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.searchConfig = $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.populateDataStoreConnectionSignals = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameters message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameters.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) { + var error = $root.google.type.LatLng.verify(message.geoLocation, long + 1); + if (error) + return "geoLocation." + error; + } + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify(message.sessionEntityTypes[i], long + 1); + if (error) + return "sessionEntityTypes." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters, long + 1); + if (error) + return "parameters." + error; + } + if (message.parameterScope != null && message.hasOwnProperty("parameterScope")) + if (!$util.isString(message.parameterScope)) + return "parameterScope: string expected"; + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + if (!$util.isString(message.currentPage)) + return "currentPage: string expected"; + if (message.disableWebhook != null && message.hasOwnProperty("disableWebhook")) + if (typeof message.disableWebhook !== "boolean") + return "disableWebhook: boolean expected"; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + if (typeof message.analyzeQueryTextSentiment !== "boolean") + return "analyzeQueryTextSentiment: boolean expected"; + if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { + if (!$util.isObject(message.webhookHeaders)) + return "webhookHeaders: object expected"; + var key = Object.keys(message.webhookHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.webhookHeaders[key[i]])) + return "webhookHeaders: string{k:string} expected"; + } + if (message.flowVersions != null && message.hasOwnProperty("flowVersions")) { + if (!Array.isArray(message.flowVersions)) + return "flowVersions: array expected"; + for (var i = 0; i < message.flowVersions.length; ++i) + if (!$util.isString(message.flowVersions[i])) + return "flowVersions: string[] expected"; + } + if (message.currentPlaybook != null && message.hasOwnProperty("currentPlaybook")) + if (!$util.isString(message.currentPlaybook)) + return "currentPlaybook: string expected"; + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + if (message.channel != null && message.hasOwnProperty("channel")) + if (!$util.isString(message.channel)) + return "channel: string expected"; + if (message.sessionTtl != null && message.hasOwnProperty("sessionTtl")) { + var error = $root.google.protobuf.Duration.verify(message.sessionTtl, long + 1); + if (error) + return "sessionTtl." + error; + } + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.endUserMetadata, long + 1); + if (error) + return "endUserMetadata." + error; + } + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig.verify(message.searchConfig, long + 1); + if (error) + return "searchConfig." + error; + } + if (message.populateDataStoreConnectionSignals != null && message.hasOwnProperty("populateDataStoreConnectionSignals")) + if (typeof message.populateDataStoreConnectionSignals !== "boolean") + return "populateDataStoreConnectionSignals: boolean expected"; + return null; + }; + + /** + * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryParameters} QueryParameters + */ + QueryParameters.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.geoLocation != null) { + if (typeof object.geoLocation !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.geoLocation: object expected"); + message.geoLocation = $root.google.type.LatLng.fromObject(object.geoLocation, long + 1); + } + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.fromObject(object.sessionEntityTypes[i], long + 1); + } + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters, long + 1); + } + if (object.parameterScope != null) + message.parameterScope = String(object.parameterScope); + if (object.currentPage != null) + message.currentPage = String(object.currentPage); + if (object.disableWebhook != null) + message.disableWebhook = Boolean(object.disableWebhook); + if (object.analyzeQueryTextSentiment != null) + message.analyzeQueryTextSentiment = Boolean(object.analyzeQueryTextSentiment); + if (object.webhookHeaders) { + if (typeof object.webhookHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.webhookHeaders: object expected"); + message.webhookHeaders = {}; + for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.webhookHeaders, keys[i]); + message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + } + } + if (object.flowVersions) { + if (!Array.isArray(object.flowVersions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.flowVersions: array expected"); + message.flowVersions = []; + for (var i = 0; i < object.flowVersions.length; ++i) + message.flowVersions[i] = String(object.flowVersions[i]); + } + if (object.currentPlaybook != null) + message.currentPlaybook = String(object.currentPlaybook); + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + if (object.channel != null) + message.channel = String(object.channel); + if (object.sessionTtl != null) { + if (typeof object.sessionTtl !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.sessionTtl: object expected"); + message.sessionTtl = $root.google.protobuf.Duration.fromObject(object.sessionTtl, long + 1); + } + if (object.endUserMetadata != null) { + if (typeof object.endUserMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.endUserMetadata: object expected"); + message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata, long + 1); + } + if (object.searchConfig != null) { + if (typeof object.searchConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryParameters.searchConfig: object expected"); + message.searchConfig = $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig.fromObject(object.searchConfig, long + 1); + } + if (object.populateDataStoreConnectionSignals != null) + message.populateDataStoreConnectionSignals = Boolean(object.populateDataStoreConnectionSignals); + return message; + }; + + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.QueryParameters} message QueryParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sessionEntityTypes = []; + object.flowVersions = []; + } + if (options.objects || options.defaults) + object.webhookHeaders = {}; + if (options.defaults) { + object.timeZone = ""; + object.geoLocation = null; + object.payload = null; + object.parameters = null; + object.currentPage = ""; + object.disableWebhook = false; + object.analyzeQueryTextSentiment = false; + object.parameterScope = ""; + object.channel = ""; + object.sessionTtl = null; + object.endUserMetadata = null; + object.currentPlaybook = ""; + object.searchConfig = null; + object.llmModelSettings = null; + object.populateDataStoreConnectionSignals = false; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) + object.geoLocation = $root.google.type.LatLng.toObject(message.geoLocation, options); + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = message.currentPage; + if (message.disableWebhook != null && message.hasOwnProperty("disableWebhook")) + object.disableWebhook = message.disableWebhook; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + object.analyzeQueryTextSentiment = message.analyzeQueryTextSentiment; + var keys2; + if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { + object.webhookHeaders = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.webhookHeaders, keys2[j]); + object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; + } + } + if (message.parameterScope != null && message.hasOwnProperty("parameterScope")) + object.parameterScope = message.parameterScope; + if (message.flowVersions && message.flowVersions.length) { + object.flowVersions = []; + for (var j = 0; j < message.flowVersions.length; ++j) + object.flowVersions[j] = message.flowVersions[j]; + } + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = message.channel; + if (message.sessionTtl != null && message.hasOwnProperty("sessionTtl")) + object.sessionTtl = $root.google.protobuf.Duration.toObject(message.sessionTtl, options); + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) + object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); + if (message.currentPlaybook != null && message.hasOwnProperty("currentPlaybook")) + object.currentPlaybook = message.currentPlaybook; + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) + object.searchConfig = $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig.toObject(message.searchConfig, options); + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.toObject(message.llmModelSettings, options); + if (message.populateDataStoreConnectionSignals != null && message.hasOwnProperty("populateDataStoreConnectionSignals")) + object.populateDataStoreConnectionSignals = message.populateDataStoreConnectionSignals; + return object; + }; + + /** + * Converts this QueryParameters to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @instance + * @returns {Object.} JSON object + */ + QueryParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryParameters + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.QueryParameters"; + }; + + return QueryParameters; + })(); + + v3beta1.SearchConfig = (function() { + + /** + * Properties of a SearchConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISearchConfig + * @property {Array.|null} [boostSpecs] SearchConfig boostSpecs + * @property {Array.|null} [filterSpecs] SearchConfig filterSpecs + */ + + /** + * Constructs a new SearchConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SearchConfig. + * @implements ISearchConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISearchConfig=} [properties] Properties to set + */ + function SearchConfig(properties) { + this.boostSpecs = []; + this.filterSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchConfig boostSpecs. + * @member {Array.} boostSpecs + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @instance + */ + SearchConfig.prototype.boostSpecs = $util.emptyArray; + + /** + * SearchConfig filterSpecs. + * @member {Array.} filterSpecs + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @instance + */ + SearchConfig.prototype.filterSpecs = $util.emptyArray; + + /** + * Creates a new SearchConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISearchConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SearchConfig} SearchConfig instance + */ + SearchConfig.create = function create(properties) { + return new SearchConfig(properties); + }; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SearchConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boostSpecs != null && message.boostSpecs.length) + for (var i = 0; i < message.boostSpecs.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.filterSpecs != null && message.filterSpecs.length) + for (var i = 0; i < message.filterSpecs.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs.encode(message.filterSpecs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SearchConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.boostSpecs && message.boostSpecs.length)) + message.boostSpecs = []; + message.boostSpecs.push($root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.filterSpecs && message.filterSpecs.length)) + message.filterSpecs = []; + message.filterSpecs.push($root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { + if (!Array.isArray(message.boostSpecs)) + return "boostSpecs: array expected"; + for (var i = 0; i < message.boostSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs.verify(message.boostSpecs[i], long + 1); + if (error) + return "boostSpecs." + error; + } + } + if (message.filterSpecs != null && message.hasOwnProperty("filterSpecs")) { + if (!Array.isArray(message.filterSpecs)) + return "filterSpecs: array expected"; + for (var i = 0; i < message.filterSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs.verify(message.filterSpecs[i], long + 1); + if (error) + return "filterSpecs." + error; + } + } + return null; + }; + + /** + * Creates a SearchConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SearchConfig} SearchConfig + */ + SearchConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SearchConfig(); + if (object.boostSpecs) { + if (!Array.isArray(object.boostSpecs)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SearchConfig.boostSpecs: array expected"); + message.boostSpecs = []; + for (var i = 0; i < object.boostSpecs.length; ++i) { + if (typeof object.boostSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SearchConfig.boostSpecs: object expected"); + message.boostSpecs[i] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs.fromObject(object.boostSpecs[i], long + 1); + } + } + if (object.filterSpecs) { + if (!Array.isArray(object.filterSpecs)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SearchConfig.filterSpecs: array expected"); + message.filterSpecs = []; + for (var i = 0; i < object.filterSpecs.length; ++i) { + if (typeof object.filterSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SearchConfig.filterSpecs: object expected"); + message.filterSpecs[i] = $root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs.fromObject(object.filterSpecs[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SearchConfig} message SearchConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.boostSpecs = []; + object.filterSpecs = []; + } + if (message.boostSpecs && message.boostSpecs.length) { + object.boostSpecs = []; + for (var j = 0; j < message.boostSpecs.length; ++j) + object.boostSpecs[j] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs.toObject(message.boostSpecs[j], options); + } + if (message.filterSpecs && message.filterSpecs.length) { + object.filterSpecs = []; + for (var j = 0; j < message.filterSpecs.length; ++j) + object.filterSpecs[j] = $root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs.toObject(message.filterSpecs[j], options); + } + return object; + }; + + /** + * Converts this SearchConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @instance + * @returns {Object.} JSON object + */ + SearchConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SearchConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SearchConfig"; + }; + + return SearchConfig; + })(); + + v3beta1.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i], long + 1); + if (error) + return "conditionBoostSpecs." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BoostSpec"; + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + * @property {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * ConditionBoostSpec boostControlSpec. + * @member {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boostControlSpec = null; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) + $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + case 4: { + message.boostControlSpec = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec, long + 1); + if (error) + return "boostControlSpec." + error; + } + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.boostControlSpec != null) { + if (typeof object.boostControlSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); + message.boostControlSpec = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + object.boostControlSpec = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) + object.boostControlSpec = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionBoostSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec"; + }; + + ConditionBoostSpec.BoostControlSpec = (function() { + + /** + * Properties of a BoostControlSpec. + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @interface IBoostControlSpec + * @property {string|null} [fieldName] BoostControlSpec fieldName + * @property {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType + * @property {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType + * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints + */ + + /** + * Constructs a new BoostControlSpec. + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec + * @classdesc Represents a BoostControlSpec. + * @implements IBoostControlSpec + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + */ + function BoostControlSpec(properties) { + this.controlPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostControlSpec fieldName. + * @member {string} fieldName + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.fieldName = ""; + + /** + * BoostControlSpec attributeType. + * @member {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.attributeType = 0; + + /** + * BoostControlSpec interpolationType. + * @member {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.interpolationType = 0; + + /** + * BoostControlSpec controlPoints. + * @member {Array.} controlPoints + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.controlPoints = $util.emptyArray; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance + */ + BoostControlSpec.create = function create(properties) { + return new BoostControlSpec(properties); + }; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); + if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); + if (message.controlPoints != null && message.controlPoints.length) + for (var i = 0; i < message.controlPoints.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.attributeType = reader.int32(); + break; + } + case 3: { + message.interpolationType = reader.int32(); + break; + } + case 4: { + if (!(message.controlPoints && message.controlPoints.length)) + message.controlPoints = []; + message.controlPoints.push($root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostControlSpec message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostControlSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + switch (message.attributeType) { + default: + return "attributeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + switch (message.interpolationType) { + default: + return "interpolationType: enum value expected"; + case 0: + case 1: + break; + } + if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { + if (!Array.isArray(message.controlPoints)) + return "controlPoints: array expected"; + for (var i = 0; i < message.controlPoints.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i], long + 1); + if (error) + return "controlPoints." + error; + } + } + return null; + }; + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + */ + BoostControlSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.attributeType) { + default: + if (typeof object.attributeType === "number") { + message.attributeType = object.attributeType; + break; + } + break; + case "ATTRIBUTE_TYPE_UNSPECIFIED": + case 0: + message.attributeType = 0; + break; + case "NUMERICAL": + case 1: + message.attributeType = 1; + break; + case "FRESHNESS": + case 2: + message.attributeType = 2; + break; + } + switch (object.interpolationType) { + default: + if (typeof object.interpolationType === "number") { + message.interpolationType = object.interpolationType; + break; + } + break; + case "INTERPOLATION_TYPE_UNSPECIFIED": + case 0: + message.interpolationType = 0; + break; + case "LINEAR": + case 1: + message.interpolationType = 1; + break; + } + if (object.controlPoints) { + if (!Array.isArray(object.controlPoints)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); + message.controlPoints = []; + for (var i = 0; i < object.controlPoints.length; ++i) { + if (typeof object.controlPoints[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); + message.controlPoints[i] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostControlSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controlPoints = []; + if (options.defaults) { + object.fieldName = ""; + object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; + object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + object.attributeType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + object.interpolationType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; + if (message.controlPoints && message.controlPoints.length) { + object.controlPoints = []; + for (var j = 0; j < message.controlPoints.length; ++j) + object.controlPoints[j] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); + } + return object; + }; + + /** + * Converts this BoostControlSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + * @returns {Object.} JSON object + */ + BoostControlSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostControlSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec"; + }; + + /** + * AttributeType enum. + * @name google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + * @enum {number} + * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value + * @property {number} NUMERICAL=1 NUMERICAL value + * @property {number} FRESHNESS=2 FRESHNESS value + */ + BoostControlSpec.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERICAL"] = 1; + values[valuesById[2] = "FRESHNESS"] = 2; + return values; + })(); + + /** + * InterpolationType enum. + * @name google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + * @enum {number} + * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value + * @property {number} LINEAR=1 LINEAR value + */ + BoostControlSpec.InterpolationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR"] = 1; + return values; + })(); + + BoostControlSpec.ControlPoint = (function() { + + /** + * Properties of a ControlPoint. + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @interface IControlPoint + * @property {string|null} [attributeValue] ControlPoint attributeValue + * @property {number|null} [boostAmount] ControlPoint boostAmount + */ + + /** + * Constructs a new ControlPoint. + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @classdesc Represents a ControlPoint. + * @implements IControlPoint + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + */ + function ControlPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ControlPoint attributeValue. + * @member {string} attributeValue + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.attributeValue = ""; + + /** + * ControlPoint boostAmount. + * @member {number} boostAmount + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.boostAmount = 0; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance + */ + ControlPoint.create = function create(properties) { + return new ControlPoint(properties); + }; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); + if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); + return writer; + }; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.attributeValue = reader.string(); + break; + } + case 2: { + message.boostAmount = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ControlPoint message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ControlPoint.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + if (!$util.isString(message.attributeValue)) + return "attributeValue: string expected"; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + if (typeof message.boostAmount !== "number") + return "boostAmount: number expected"; + return null; + }; + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + */ + ControlPoint.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + if (object.attributeValue != null) + message.attributeValue = String(object.attributeValue); + if (object.boostAmount != null) + message.boostAmount = Number(object.boostAmount); + return message; + }; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeValue = ""; + object.boostAmount = 0; + } + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + object.attributeValue = message.attributeValue; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; + return object; + }; + + /** + * Converts this ControlPoint to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + * @returns {Object.} JSON object + */ + ControlPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ControlPoint + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; + }; + + return ControlPoint; + })(); + + return BoostControlSpec; + })(); + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + v3beta1.BoostSpecs = (function() { + + /** + * Properties of a BoostSpecs. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IBoostSpecs + * @property {Array.|null} [dataStores] BoostSpecs dataStores + * @property {Array.|null} [spec] BoostSpecs spec + */ + + /** + * Constructs a new BoostSpecs. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a BoostSpecs. + * @implements IBoostSpecs + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpecs=} [properties] Properties to set + */ + function BoostSpecs(properties) { + this.dataStores = []; + this.spec = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @instance + */ + BoostSpecs.prototype.dataStores = $util.emptyArray; + + /** + * BoostSpecs spec. + * @member {Array.} spec + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @instance + */ + BoostSpecs.prototype.spec = $util.emptyArray; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpecs=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpecs} BoostSpecs instance + */ + BoostSpecs.create = function create(properties) { + return new BoostSpecs(properties); + }; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.spec != null && message.spec.length) + for (var i = 0; i < message.spec.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.BoostSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + if (!(message.spec && message.spec.length)) + message.spec = []; + message.spec.push($root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpecs message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpecs.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (!Array.isArray(message.spec)) + return "spec: array expected"; + for (var i = 0; i < message.spec.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.verify(message.spec[i], long + 1); + if (error) + return "spec." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.BoostSpecs} BoostSpecs + */ + BoostSpecs.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.BoostSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.spec) { + if (!Array.isArray(object.spec)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpecs.spec: array expected"); + message.spec = []; + for (var i = 0; i < object.spec.length; ++i) { + if (typeof object.spec[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.BoostSpecs.spec: object expected"); + message.spec[i] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.fromObject(object.spec[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.BoostSpecs} message BoostSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataStores = []; + object.spec = []; + } + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.spec && message.spec.length) { + object.spec = []; + for (var j = 0; j < message.spec.length; ++j) + object.spec[j] = $root.google.cloud.dialogflow.cx.v3beta1.BoostSpec.toObject(message.spec[j], options); + } + return object; + }; + + /** + * Converts this BoostSpecs to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @instance + * @returns {Object.} JSON object + */ + BoostSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpecs + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.BoostSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.BoostSpecs"; + }; + + return BoostSpecs; + })(); + + v3beta1.FilterSpecs = (function() { + + /** + * Properties of a FilterSpecs. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFilterSpecs + * @property {Array.|null} [dataStores] FilterSpecs dataStores + * @property {string|null} [filter] FilterSpecs filter + */ + + /** + * Constructs a new FilterSpecs. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FilterSpecs. + * @implements IFilterSpecs + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFilterSpecs=} [properties] Properties to set + */ + function FilterSpecs(properties) { + this.dataStores = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FilterSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @instance + */ + FilterSpecs.prototype.dataStores = $util.emptyArray; + + /** + * FilterSpecs filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @instance + */ + FilterSpecs.prototype.filter = ""; + + /** + * Creates a new FilterSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFilterSpecs=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FilterSpecs} FilterSpecs instance + */ + FilterSpecs.create = function create(properties) { + return new FilterSpecs(properties); + }; + + /** + * Encodes the specified FilterSpecs message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FilterSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFilterSpecs} message FilterSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + return writer; + }; + + /** + * Encodes the specified FilterSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FilterSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFilterSpecs} message FilterSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FilterSpecs} FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterSpecs.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FilterSpecs} FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FilterSpecs message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterSpecs.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a FilterSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FilterSpecs} FilterSpecs + */ + FilterSpecs.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FilterSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FilterSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a FilterSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FilterSpecs} message FilterSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStores = []; + if (options.defaults) + object.filter = ""; + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this FilterSpecs to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @instance + * @returns {Object.} JSON object + */ + FilterSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FilterSpecs + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FilterSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FilterSpecs"; + }; + + return FilterSpecs; + })(); + + v3beta1.QueryInput = (function() { + + /** + * Properties of a QueryInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IQueryInput + * @property {google.cloud.dialogflow.cx.v3beta1.ITextInput|null} [text] QueryInput text + * @property {google.cloud.dialogflow.cx.v3beta1.IIntentInput|null} [intent] QueryInput intent + * @property {google.cloud.dialogflow.cx.v3beta1.IAudioInput|null} [audio] QueryInput audio + * @property {google.cloud.dialogflow.cx.v3beta1.IEventInput|null} [event] QueryInput event + * @property {google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null} [dtmf] QueryInput dtmf + * @property {google.cloud.dialogflow.cx.v3beta1.IToolCallResult|null} [toolCallResult] QueryInput toolCallResult + * @property {string|null} [languageCode] QueryInput languageCode + */ + + /** + * Constructs a new QueryInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a QueryInput. + * @implements IQueryInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryInput=} [properties] Properties to set + */ + function QueryInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInput text. + * @member {google.cloud.dialogflow.cx.v3beta1.ITextInput|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + QueryInput.prototype.text = null; + + /** + * QueryInput intent. + * @member {google.cloud.dialogflow.cx.v3beta1.IIntentInput|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + QueryInput.prototype.intent = null; + + /** + * QueryInput audio. + * @member {google.cloud.dialogflow.cx.v3beta1.IAudioInput|null|undefined} audio + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + QueryInput.prototype.audio = null; + + /** + * QueryInput event. + * @member {google.cloud.dialogflow.cx.v3beta1.IEventInput|null|undefined} event + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + QueryInput.prototype.event = null; + + /** + * QueryInput dtmf. + * @member {google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null|undefined} dtmf + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + QueryInput.prototype.dtmf = null; + + /** + * QueryInput toolCallResult. + * @member {google.cloud.dialogflow.cx.v3beta1.IToolCallResult|null|undefined} toolCallResult + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + QueryInput.prototype.toolCallResult = null; + + /** + * QueryInput languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + QueryInput.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryInput input. + * @member {"text"|"intent"|"audio"|"event"|"dtmf"|"toolCallResult"|undefined} input + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + */ + Object.defineProperty(QueryInput.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["text", "intent", "audio", "event", "dtmf", "toolCallResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryInput} QueryInput instance + */ + QueryInput.create = function create(properties) { + return new QueryInput(properties); + }; + + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.cx.v3beta1.TextInput.encode(message.text, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3beta1.IntentInput.encode(message.intent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.dialogflow.cx.v3beta1.AudioInput.encode(message.audio, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.dialogflow.cx.v3beta1.EventInput.encode(message.event, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) + $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.encode(message.dtmf, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.toolCallResult != null && Object.hasOwnProperty.call(message, "toolCallResult")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.encode(message.toolCallResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.QueryInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.text = $root.google.cloud.dialogflow.cx.v3beta1.TextInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.IntentInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.audio = $root.google.cloud.dialogflow.cx.v3beta1.AudioInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.event = $root.google.cloud.dialogflow.cx.v3beta1.EventInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.dtmf = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.toolCallResult = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TextInput.verify(message.text, long + 1); + if (error) + return "text." + error; + } + } + if (message.intent != null && message.hasOwnProperty("intent")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.IntentInput.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AudioInput.verify(message.audio, long + 1); + if (error) + return "audio." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EventInput.verify(message.event, long + 1); + if (error) + return "event." + error; + } + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.verify(message.dtmf, long + 1); + if (error) + return "dtmf." + error; + } + } + if (message.toolCallResult != null && message.hasOwnProperty("toolCallResult")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify(message.toolCallResult, long + 1); + if (error) + return "toolCallResult." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryInput} QueryInput + */ + QueryInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.QueryInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.QueryInput(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryInput.text: object expected"); + message.text = $root.google.cloud.dialogflow.cx.v3beta1.TextInput.fromObject(object.text, long + 1); + } + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryInput.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.IntentInput.fromObject(object.intent, long + 1); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryInput.audio: object expected"); + message.audio = $root.google.cloud.dialogflow.cx.v3beta1.AudioInput.fromObject(object.audio, long + 1); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryInput.event: object expected"); + message.event = $root.google.cloud.dialogflow.cx.v3beta1.EventInput.fromObject(object.event, long + 1); + } + if (object.dtmf != null) { + if (typeof object.dtmf !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryInput.dtmf: object expected"); + message.dtmf = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.fromObject(object.dtmf, long + 1); + } + if (object.toolCallResult != null) { + if (typeof object.toolCallResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryInput.toolCallResult: object expected"); + message.toolCallResult = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.fromObject(object.toolCallResult, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.QueryInput} message QueryInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.languageCode = ""; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.cx.v3beta1.TextInput.toObject(message.text, options); + if (options.oneofs) + object.input = "text"; + } + if (message.intent != null && message.hasOwnProperty("intent")) { + object.intent = $root.google.cloud.dialogflow.cx.v3beta1.IntentInput.toObject(message.intent, options); + if (options.oneofs) + object.input = "intent"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = $root.google.cloud.dialogflow.cx.v3beta1.AudioInput.toObject(message.audio, options); + if (options.oneofs) + object.input = "audio"; + } + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.dialogflow.cx.v3beta1.EventInput.toObject(message.event, options); + if (options.oneofs) + object.input = "event"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + object.dtmf = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.toObject(message.dtmf, options); + if (options.oneofs) + object.input = "dtmf"; + } + if (message.toolCallResult != null && message.hasOwnProperty("toolCallResult")) { + object.toolCallResult = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.toObject(message.toolCallResult, options); + if (options.oneofs) + object.input = "toolCallResult"; + } + return object; + }; + + /** + * Converts this QueryInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @instance + * @returns {Object.} JSON object + */ + QueryInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.QueryInput"; + }; + + return QueryInput; + })(); + + v3beta1.GenerativeInfo = (function() { + + /** + * Properties of a GenerativeInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGenerativeInfo + * @property {Array.|null} [currentPlaybooks] GenerativeInfo currentPlaybooks + * @property {google.cloud.dialogflow.cx.v3beta1.IExample|null} [actionTracingInfo] GenerativeInfo actionTracingInfo + */ + + /** + * Constructs a new GenerativeInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GenerativeInfo. + * @implements IGenerativeInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo=} [properties] Properties to set + */ + function GenerativeInfo(properties) { + this.currentPlaybooks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerativeInfo currentPlaybooks. + * @member {Array.} currentPlaybooks + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @instance + */ + GenerativeInfo.prototype.currentPlaybooks = $util.emptyArray; + + /** + * GenerativeInfo actionTracingInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.IExample|null|undefined} actionTracingInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @instance + */ + GenerativeInfo.prototype.actionTracingInfo = null; + + /** + * Creates a new GenerativeInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeInfo} GenerativeInfo instance + */ + GenerativeInfo.create = function create(properties) { + return new GenerativeInfo(properties); + }; + + /** + * Encodes the specified GenerativeInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo} message GenerativeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentPlaybooks != null && message.currentPlaybooks.length) + for (var i = 0; i < message.currentPlaybooks.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currentPlaybooks[i]); + if (message.actionTracingInfo != null && Object.hasOwnProperty.call(message, "actionTracingInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.Example.encode(message.actionTracingInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerativeInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo} message GenerativeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerativeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeInfo} GenerativeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.currentPlaybooks && message.currentPlaybooks.length)) + message.currentPlaybooks = []; + message.currentPlaybooks.push(reader.string()); + break; + } + case 2: { + message.actionTracingInfo = $root.google.cloud.dialogflow.cx.v3beta1.Example.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenerativeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeInfo} GenerativeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerativeInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerativeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.currentPlaybooks != null && message.hasOwnProperty("currentPlaybooks")) { + if (!Array.isArray(message.currentPlaybooks)) + return "currentPlaybooks: array expected"; + for (var i = 0; i < message.currentPlaybooks.length; ++i) + if (!$util.isString(message.currentPlaybooks[i])) + return "currentPlaybooks: string[] expected"; + } + if (message.actionTracingInfo != null && message.hasOwnProperty("actionTracingInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Example.verify(message.actionTracingInfo, long + 1); + if (error) + return "actionTracingInfo." + error; + } + return null; + }; + + /** + * Creates a GenerativeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GenerativeInfo} GenerativeInfo + */ + GenerativeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo(); + if (object.currentPlaybooks) { + if (!Array.isArray(object.currentPlaybooks)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.currentPlaybooks: array expected"); + message.currentPlaybooks = []; + for (var i = 0; i < object.currentPlaybooks.length; ++i) + message.currentPlaybooks[i] = String(object.currentPlaybooks[i]); + } + if (object.actionTracingInfo != null) { + if (typeof object.actionTracingInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.actionTracingInfo: object expected"); + message.actionTracingInfo = $root.google.cloud.dialogflow.cx.v3beta1.Example.fromObject(object.actionTracingInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GenerativeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeInfo} message GenerativeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerativeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.currentPlaybooks = []; + if (options.defaults) + object.actionTracingInfo = null; + if (message.currentPlaybooks && message.currentPlaybooks.length) { + object.currentPlaybooks = []; + for (var j = 0; j < message.currentPlaybooks.length; ++j) + object.currentPlaybooks[j] = message.currentPlaybooks[j]; + } + if (message.actionTracingInfo != null && message.hasOwnProperty("actionTracingInfo")) + object.actionTracingInfo = $root.google.cloud.dialogflow.cx.v3beta1.Example.toObject(message.actionTracingInfo, options); + return object; + }; + + /** + * Converts this GenerativeInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @instance + * @returns {Object.} JSON object + */ + GenerativeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerativeInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GenerativeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerativeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GenerativeInfo"; + }; + + return GenerativeInfo; + })(); + + v3beta1.QueryResult = (function() { + + /** + * Properties of a QueryResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IQueryResult + * @property {string|null} [text] QueryResult text + * @property {string|null} [triggerIntent] QueryResult triggerIntent + * @property {string|null} [transcript] QueryResult transcript + * @property {string|null} [triggerEvent] QueryResult triggerEvent + * @property {google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null} [dtmf] QueryResult dtmf + * @property {string|null} [languageCode] QueryResult languageCode + * @property {google.protobuf.IStruct|null} [parameters] QueryResult parameters + * @property {Array.|null} [responseMessages] QueryResult responseMessages + * @property {Array.|null} [webhookIds] QueryResult webhookIds + * @property {Array.|null} [webhookDisplayNames] QueryResult webhookDisplayNames + * @property {Array.|null} [webhookLatencies] QueryResult webhookLatencies + * @property {Array.|null} [webhookTags] QueryResult webhookTags + * @property {Array.|null} [webhookStatuses] QueryResult webhookStatuses + * @property {Array.|null} [webhookPayloads] QueryResult webhookPayloads + * @property {google.cloud.dialogflow.cx.v3beta1.IPage|null} [currentPage] QueryResult currentPage + * @property {google.cloud.dialogflow.cx.v3beta1.IFlow|null} [currentFlow] QueryResult currentFlow + * @property {google.cloud.dialogflow.cx.v3beta1.IIntent|null} [intent] QueryResult intent + * @property {number|null} [intentDetectionConfidence] QueryResult intentDetectionConfidence + * @property {google.cloud.dialogflow.cx.v3beta1.IMatch|null} [match] QueryResult match + * @property {google.protobuf.IStruct|null} [diagnosticInfo] QueryResult diagnosticInfo + * @property {google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo|null} [generativeInfo] QueryResult generativeInfo + * @property {google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult|null} [sentimentAnalysisResult] QueryResult sentimentAnalysisResult + * @property {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null} [advancedSettings] QueryResult advancedSettings + * @property {boolean|null} [allowAnswerFeedback] QueryResult allowAnswerFeedback + * @property {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null} [dataStoreConnectionSignals] QueryResult dataStoreConnectionSignals + * @property {Array.|null} [traceBlocks] QueryResult traceBlocks + */ + + /** + * Constructs a new QueryResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a QueryResult. + * @implements IQueryResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryResult=} [properties] Properties to set + */ + function QueryResult(properties) { + this.responseMessages = []; + this.webhookIds = []; + this.webhookDisplayNames = []; + this.webhookLatencies = []; + this.webhookTags = []; + this.webhookStatuses = []; + this.webhookPayloads = []; + this.traceBlocks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryResult text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.text = null; + + /** + * QueryResult triggerIntent. + * @member {string|null|undefined} triggerIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.triggerIntent = null; + + /** + * QueryResult transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.transcript = null; + + /** + * QueryResult triggerEvent. + * @member {string|null|undefined} triggerEvent + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.triggerEvent = null; + + /** + * QueryResult dtmf. + * @member {google.cloud.dialogflow.cx.v3beta1.IDtmfInput|null|undefined} dtmf + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.dtmf = null; + + /** + * QueryResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.languageCode = ""; + + /** + * QueryResult parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.parameters = null; + + /** + * QueryResult responseMessages. + * @member {Array.} responseMessages + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.responseMessages = $util.emptyArray; + + /** + * QueryResult webhookIds. + * @member {Array.} webhookIds + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookIds = $util.emptyArray; + + /** + * QueryResult webhookDisplayNames. + * @member {Array.} webhookDisplayNames + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookDisplayNames = $util.emptyArray; + + /** + * QueryResult webhookLatencies. + * @member {Array.} webhookLatencies + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookLatencies = $util.emptyArray; + + /** + * QueryResult webhookTags. + * @member {Array.} webhookTags + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookTags = $util.emptyArray; + + /** + * QueryResult webhookStatuses. + * @member {Array.} webhookStatuses + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookStatuses = $util.emptyArray; + + /** + * QueryResult webhookPayloads. + * @member {Array.} webhookPayloads + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookPayloads = $util.emptyArray; + + /** + * QueryResult currentPage. + * @member {google.cloud.dialogflow.cx.v3beta1.IPage|null|undefined} currentPage + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.currentPage = null; + + /** + * QueryResult currentFlow. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlow|null|undefined} currentFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.currentFlow = null; + + /** + * QueryResult intent. + * @member {google.cloud.dialogflow.cx.v3beta1.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.intent = null; + + /** + * QueryResult intentDetectionConfidence. + * @member {number} intentDetectionConfidence + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.intentDetectionConfidence = 0; + + /** + * QueryResult match. + * @member {google.cloud.dialogflow.cx.v3beta1.IMatch|null|undefined} match + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.match = null; + + /** + * QueryResult diagnosticInfo. + * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.diagnosticInfo = null; + + /** + * QueryResult generativeInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.IGenerativeInfo|null|undefined} generativeInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.generativeInfo = null; + + /** + * QueryResult sentimentAnalysisResult. + * @member {google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.sentimentAnalysisResult = null; + + /** + * QueryResult advancedSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.IAdvancedSettings|null|undefined} advancedSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.advancedSettings = null; + + /** + * QueryResult allowAnswerFeedback. + * @member {boolean} allowAnswerFeedback + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.allowAnswerFeedback = false; + + /** + * QueryResult dataStoreConnectionSignals. + * @member {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null|undefined} dataStoreConnectionSignals + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.dataStoreConnectionSignals = null; + + /** + * QueryResult traceBlocks. + * @member {Array.} traceBlocks + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + QueryResult.prototype.traceBlocks = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryResult query. + * @member {"text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmf"|undefined} query + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + */ + Object.defineProperty(QueryResult.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["text", "triggerIntent", "transcript", "triggerEvent", "dtmf"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryResult} QueryResult instance + */ + QueryResult.create = function create(properties) { + return new QueryResult(properties); + }; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.responseMessages != null && message.responseMessages.length) + for (var i = 0; i < message.responseMessages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.encode(message.responseMessages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.webhookPayloads != null && message.webhookPayloads.length) + for (var i = 0; i < message.webhookPayloads.length; ++i) + $root.google.protobuf.Struct.encode(message.webhookPayloads[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.currentPage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.encode(message.intent, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.intentDetectionConfidence != null && Object.hasOwnProperty.call(message, "intentDetectionConfidence")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.intentDetectionConfidence); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.triggerIntent != null && Object.hasOwnProperty.call(message, "triggerIntent")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.triggerIntent); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.transcript); + if (message.webhookStatuses != null && message.webhookStatuses.length) + for (var i = 0; i < message.webhookStatuses.length; ++i) + $root.google.rpc.Status.encode(message.webhookStatuses[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.triggerEvent != null && Object.hasOwnProperty.call(message, "triggerEvent")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.triggerEvent); + if (message.match != null && Object.hasOwnProperty.call(message, "match")) + $root.google.cloud.dialogflow.cx.v3beta1.Match.encode(message.match, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) + $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.advancedSettings != null && Object.hasOwnProperty.call(message, "advancedSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.encode(message.advancedSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) + $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.encode(message.dtmf, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.webhookIds != null && message.webhookIds.length) + for (var i = 0; i < message.webhookIds.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.webhookIds[i]); + if (message.webhookDisplayNames != null && message.webhookDisplayNames.length) + for (var i = 0; i < message.webhookDisplayNames.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.webhookDisplayNames[i]); + if (message.webhookLatencies != null && message.webhookLatencies.length) + for (var i = 0; i < message.webhookLatencies.length; ++i) + $root.google.protobuf.Duration.encode(message.webhookLatencies[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.webhookTags != null && message.webhookTags.length) + for (var i = 0; i < message.webhookTags.length; ++i) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.webhookTags[i]); + if (message.currentFlow != null && Object.hasOwnProperty.call(message, "currentFlow")) + $root.google.cloud.dialogflow.cx.v3beta1.Flow.encode(message.currentFlow, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.allowAnswerFeedback != null && Object.hasOwnProperty.call(message, "allowAnswerFeedback")) + writer.uint32(/* id 32, wireType 0 =*/256).bool(message.allowAnswerFeedback); + if (message.generativeInfo != null && Object.hasOwnProperty.call(message, "generativeInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.encode(message.generativeInfo, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.dataStoreConnectionSignals != null && Object.hasOwnProperty.call(message, "dataStoreConnectionSignals")) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.encode(message.dataStoreConnectionSignals, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.traceBlocks != null && message.traceBlocks.length) + for (var i = 0; i < message.traceBlocks.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TraceBlock.encode(message.traceBlocks[i], writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.QueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.QueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 11: { + message.triggerIntent = reader.string(); + break; + } + case 12: { + message.transcript = reader.string(); + break; + } + case 14: { + message.triggerEvent = reader.string(); + break; + } + case 23: { + message.dtmf = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.responseMessages && message.responseMessages.length)) + message.responseMessages = []; + message.responseMessages.push($root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 25: { + if (!(message.webhookIds && message.webhookIds.length)) + message.webhookIds = []; + message.webhookIds.push(reader.string()); + break; + } + case 26: { + if (!(message.webhookDisplayNames && message.webhookDisplayNames.length)) + message.webhookDisplayNames = []; + message.webhookDisplayNames.push(reader.string()); + break; + } + case 27: { + if (!(message.webhookLatencies && message.webhookLatencies.length)) + message.webhookLatencies = []; + message.webhookLatencies.push($root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 29: { + if (!(message.webhookTags && message.webhookTags.length)) + message.webhookTags = []; + message.webhookTags.push(reader.string()); + break; + } + case 13: { + if (!(message.webhookStatuses && message.webhookStatuses.length)) + message.webhookStatuses = []; + message.webhookStatuses.push($root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.webhookPayloads && message.webhookPayloads.length)) + message.webhookPayloads = []; + message.webhookPayloads.push($root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.currentFlow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.intentDetectionConfidence = reader.float(); + break; + } + case 15: { + message.match = $root.google.cloud.dialogflow.cx.v3beta1.Match.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.generativeInfo = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 32: { + message.allowAnswerFeedback = reader.bool(); + break; + } + case 35: { + message.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 37: { + if (!(message.traceBlocks && message.traceBlocks.length)) + message.traceBlocks = []; + message.traceBlocks.push($root.google.cloud.dialogflow.cx.v3beta1.TraceBlock.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.query = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerIntent)) + return "triggerIntent: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerEvent)) + return "triggerEvent: string expected"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.verify(message.dtmf, long + 1); + if (error) + return "dtmf." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters, long + 1); + if (error) + return "parameters." + error; + } + if (message.responseMessages != null && message.hasOwnProperty("responseMessages")) { + if (!Array.isArray(message.responseMessages)) + return "responseMessages: array expected"; + for (var i = 0; i < message.responseMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify(message.responseMessages[i], long + 1); + if (error) + return "responseMessages." + error; + } + } + if (message.webhookIds != null && message.hasOwnProperty("webhookIds")) { + if (!Array.isArray(message.webhookIds)) + return "webhookIds: array expected"; + for (var i = 0; i < message.webhookIds.length; ++i) + if (!$util.isString(message.webhookIds[i])) + return "webhookIds: string[] expected"; + } + if (message.webhookDisplayNames != null && message.hasOwnProperty("webhookDisplayNames")) { + if (!Array.isArray(message.webhookDisplayNames)) + return "webhookDisplayNames: array expected"; + for (var i = 0; i < message.webhookDisplayNames.length; ++i) + if (!$util.isString(message.webhookDisplayNames[i])) + return "webhookDisplayNames: string[] expected"; + } + if (message.webhookLatencies != null && message.hasOwnProperty("webhookLatencies")) { + if (!Array.isArray(message.webhookLatencies)) + return "webhookLatencies: array expected"; + for (var i = 0; i < message.webhookLatencies.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.webhookLatencies[i], long + 1); + if (error) + return "webhookLatencies." + error; + } + } + if (message.webhookTags != null && message.hasOwnProperty("webhookTags")) { + if (!Array.isArray(message.webhookTags)) + return "webhookTags: array expected"; + for (var i = 0; i < message.webhookTags.length; ++i) + if (!$util.isString(message.webhookTags[i])) + return "webhookTags: string[] expected"; + } + if (message.webhookStatuses != null && message.hasOwnProperty("webhookStatuses")) { + if (!Array.isArray(message.webhookStatuses)) + return "webhookStatuses: array expected"; + for (var i = 0; i < message.webhookStatuses.length; ++i) { + var error = $root.google.rpc.Status.verify(message.webhookStatuses[i], long + 1); + if (error) + return "webhookStatuses." + error; + } + } + if (message.webhookPayloads != null && message.hasOwnProperty("webhookPayloads")) { + if (!Array.isArray(message.webhookPayloads)) + return "webhookPayloads: array expected"; + for (var i = 0; i < message.webhookPayloads.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.webhookPayloads[i], long + 1); + if (error) + return "webhookPayloads." + error; + } + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.currentPage, long + 1); + if (error) + return "currentPage." + error; + } + if (message.currentFlow != null && message.hasOwnProperty("currentFlow")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Flow.verify(message.currentFlow, long + 1); + if (error) + return "currentFlow." + error; + } + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + if (typeof message.intentDetectionConfidence !== "number") + return "intentDetectionConfidence: number expected"; + if (message.match != null && message.hasOwnProperty("match")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Match.verify(message.match, long + 1); + if (error) + return "match." + error; + } + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo, long + 1); + if (error) + return "diagnosticInfo." + error; + } + if (message.generativeInfo != null && message.hasOwnProperty("generativeInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.verify(message.generativeInfo, long + 1); + if (error) + return "generativeInfo." + error; + } + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.verify(message.sentimentAnalysisResult, long + 1); + if (error) + return "sentimentAnalysisResult." + error; + } + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.verify(message.advancedSettings, long + 1); + if (error) + return "advancedSettings." + error; + } + if (message.allowAnswerFeedback != null && message.hasOwnProperty("allowAnswerFeedback")) + if (typeof message.allowAnswerFeedback !== "boolean") + return "allowAnswerFeedback: boolean expected"; + if (message.dataStoreConnectionSignals != null && message.hasOwnProperty("dataStoreConnectionSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.verify(message.dataStoreConnectionSignals, long + 1); + if (error) + return "dataStoreConnectionSignals." + error; + } + if (message.traceBlocks != null && message.hasOwnProperty("traceBlocks")) { + if (!Array.isArray(message.traceBlocks)) + return "traceBlocks: array expected"; + for (var i = 0; i < message.traceBlocks.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TraceBlock.verify(message.traceBlocks[i], long + 1); + if (error) + return "traceBlocks." + error; + } + } + return null; + }; + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.QueryResult} QueryResult + */ + QueryResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.QueryResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.QueryResult(); + if (object.text != null) + message.text = String(object.text); + if (object.triggerIntent != null) + message.triggerIntent = String(object.triggerIntent); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.triggerEvent != null) + message.triggerEvent = String(object.triggerEvent); + if (object.dtmf != null) { + if (typeof object.dtmf !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.dtmf: object expected"); + message.dtmf = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.fromObject(object.dtmf, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters, long + 1); + } + if (object.responseMessages) { + if (!Array.isArray(object.responseMessages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.responseMessages: array expected"); + message.responseMessages = []; + for (var i = 0; i < object.responseMessages.length; ++i) { + if (typeof object.responseMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.responseMessages: object expected"); + message.responseMessages[i] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.fromObject(object.responseMessages[i], long + 1); + } + } + if (object.webhookIds) { + if (!Array.isArray(object.webhookIds)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookIds: array expected"); + message.webhookIds = []; + for (var i = 0; i < object.webhookIds.length; ++i) + message.webhookIds[i] = String(object.webhookIds[i]); + } + if (object.webhookDisplayNames) { + if (!Array.isArray(object.webhookDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookDisplayNames: array expected"); + message.webhookDisplayNames = []; + for (var i = 0; i < object.webhookDisplayNames.length; ++i) + message.webhookDisplayNames[i] = String(object.webhookDisplayNames[i]); + } + if (object.webhookLatencies) { + if (!Array.isArray(object.webhookLatencies)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookLatencies: array expected"); + message.webhookLatencies = []; + for (var i = 0; i < object.webhookLatencies.length; ++i) { + if (typeof object.webhookLatencies[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookLatencies: object expected"); + message.webhookLatencies[i] = $root.google.protobuf.Duration.fromObject(object.webhookLatencies[i], long + 1); + } + } + if (object.webhookTags) { + if (!Array.isArray(object.webhookTags)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookTags: array expected"); + message.webhookTags = []; + for (var i = 0; i < object.webhookTags.length; ++i) + message.webhookTags[i] = String(object.webhookTags[i]); + } + if (object.webhookStatuses) { + if (!Array.isArray(object.webhookStatuses)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookStatuses: array expected"); + message.webhookStatuses = []; + for (var i = 0; i < object.webhookStatuses.length; ++i) { + if (typeof object.webhookStatuses[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookStatuses: object expected"); + message.webhookStatuses[i] = $root.google.rpc.Status.fromObject(object.webhookStatuses[i], long + 1); + } + } + if (object.webhookPayloads) { + if (!Array.isArray(object.webhookPayloads)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookPayloads: array expected"); + message.webhookPayloads = []; + for (var i = 0; i < object.webhookPayloads.length; ++i) { + if (typeof object.webhookPayloads[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.webhookPayloads: object expected"); + message.webhookPayloads[i] = $root.google.protobuf.Struct.fromObject(object.webhookPayloads[i], long + 1); + } + } + if (object.currentPage != null) { + if (typeof object.currentPage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.currentPage: object expected"); + message.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.currentPage, long + 1); + } + if (object.currentFlow != null) { + if (typeof object.currentFlow !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.currentFlow: object expected"); + message.currentFlow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.fromObject(object.currentFlow, long + 1); + } + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.fromObject(object.intent, long + 1); + } + if (object.intentDetectionConfidence != null) + message.intentDetectionConfidence = Number(object.intentDetectionConfidence); + if (object.match != null) { + if (typeof object.match !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.match: object expected"); + message.match = $root.google.cloud.dialogflow.cx.v3beta1.Match.fromObject(object.match, long + 1); + } + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo, long + 1); + } + if (object.generativeInfo != null) { + if (typeof object.generativeInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.generativeInfo: object expected"); + message.generativeInfo = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.fromObject(object.generativeInfo, long + 1); + } + if (object.sentimentAnalysisResult != null) { + if (typeof object.sentimentAnalysisResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.sentimentAnalysisResult: object expected"); + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult, long + 1); + } + if (object.advancedSettings != null) { + if (typeof object.advancedSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.advancedSettings: object expected"); + message.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.fromObject(object.advancedSettings, long + 1); + } + if (object.allowAnswerFeedback != null) + message.allowAnswerFeedback = Boolean(object.allowAnswerFeedback); + if (object.dataStoreConnectionSignals != null) { + if (typeof object.dataStoreConnectionSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.dataStoreConnectionSignals: object expected"); + message.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.fromObject(object.dataStoreConnectionSignals, long + 1); + } + if (object.traceBlocks) { + if (!Array.isArray(object.traceBlocks)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.traceBlocks: array expected"); + message.traceBlocks = []; + for (var i = 0; i < object.traceBlocks.length; ++i) { + if (typeof object.traceBlocks[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.QueryResult.traceBlocks: object expected"); + message.traceBlocks[i] = $root.google.cloud.dialogflow.cx.v3beta1.TraceBlock.fromObject(object.traceBlocks[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.QueryResult} message QueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.responseMessages = []; + object.webhookPayloads = []; + object.webhookStatuses = []; + object.webhookIds = []; + object.webhookDisplayNames = []; + object.webhookLatencies = []; + object.webhookTags = []; + object.traceBlocks = []; + } + if (options.defaults) { + object.languageCode = ""; + object.parameters = null; + object.currentPage = null; + object.intent = null; + object.intentDetectionConfidence = 0; + object.diagnosticInfo = null; + object.match = null; + object.sentimentAnalysisResult = null; + object.advancedSettings = null; + object.currentFlow = null; + object.allowAnswerFeedback = false; + object.generativeInfo = null; + object.dataStoreConnectionSignals = null; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.query = "text"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.responseMessages && message.responseMessages.length) { + object.responseMessages = []; + for (var j = 0; j < message.responseMessages.length; ++j) + object.responseMessages[j] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.toObject(message.responseMessages[j], options); + } + if (message.webhookPayloads && message.webhookPayloads.length) { + object.webhookPayloads = []; + for (var j = 0; j < message.webhookPayloads.length; ++j) + object.webhookPayloads[j] = $root.google.protobuf.Struct.toObject(message.webhookPayloads[j], options); + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.currentPage, options); + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.toObject(message.intent, options); + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + object.intentDetectionConfidence = options.json && !isFinite(message.intentDetectionConfidence) ? String(message.intentDetectionConfidence) : message.intentDetectionConfidence; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + object.triggerIntent = message.triggerIntent; + if (options.oneofs) + object.query = "triggerIntent"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.query = "transcript"; + } + if (message.webhookStatuses && message.webhookStatuses.length) { + object.webhookStatuses = []; + for (var j = 0; j < message.webhookStatuses.length; ++j) + object.webhookStatuses[j] = $root.google.rpc.Status.toObject(message.webhookStatuses[j], options); + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + object.triggerEvent = message.triggerEvent; + if (options.oneofs) + object.query = "triggerEvent"; + } + if (message.match != null && message.hasOwnProperty("match")) + object.match = $root.google.cloud.dialogflow.cx.v3beta1.Match.toObject(message.match, options); + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) + object.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); + if (message.advancedSettings != null && message.hasOwnProperty("advancedSettings")) + object.advancedSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.toObject(message.advancedSettings, options); + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + object.dtmf = $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput.toObject(message.dtmf, options); + if (options.oneofs) + object.query = "dtmf"; + } + if (message.webhookIds && message.webhookIds.length) { + object.webhookIds = []; + for (var j = 0; j < message.webhookIds.length; ++j) + object.webhookIds[j] = message.webhookIds[j]; + } + if (message.webhookDisplayNames && message.webhookDisplayNames.length) { + object.webhookDisplayNames = []; + for (var j = 0; j < message.webhookDisplayNames.length; ++j) + object.webhookDisplayNames[j] = message.webhookDisplayNames[j]; + } + if (message.webhookLatencies && message.webhookLatencies.length) { + object.webhookLatencies = []; + for (var j = 0; j < message.webhookLatencies.length; ++j) + object.webhookLatencies[j] = $root.google.protobuf.Duration.toObject(message.webhookLatencies[j], options); + } + if (message.webhookTags && message.webhookTags.length) { + object.webhookTags = []; + for (var j = 0; j < message.webhookTags.length; ++j) + object.webhookTags[j] = message.webhookTags[j]; + } + if (message.currentFlow != null && message.hasOwnProperty("currentFlow")) + object.currentFlow = $root.google.cloud.dialogflow.cx.v3beta1.Flow.toObject(message.currentFlow, options); + if (message.allowAnswerFeedback != null && message.hasOwnProperty("allowAnswerFeedback")) + object.allowAnswerFeedback = message.allowAnswerFeedback; + if (message.generativeInfo != null && message.hasOwnProperty("generativeInfo")) + object.generativeInfo = $root.google.cloud.dialogflow.cx.v3beta1.GenerativeInfo.toObject(message.generativeInfo, options); + if (message.dataStoreConnectionSignals != null && message.hasOwnProperty("dataStoreConnectionSignals")) + object.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.toObject(message.dataStoreConnectionSignals, options); + if (message.traceBlocks && message.traceBlocks.length) { + object.traceBlocks = []; + for (var j = 0; j < message.traceBlocks.length; ++j) + object.traceBlocks[j] = $root.google.cloud.dialogflow.cx.v3beta1.TraceBlock.toObject(message.traceBlocks[j], options); + } + return object; + }; + + /** + * Converts this QueryResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @instance + * @returns {Object.} JSON object + */ + QueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.QueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.QueryResult"; + }; + + return QueryResult; + })(); + + v3beta1.TextInput = (function() { + + /** + * Properties of a TextInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITextInput + * @property {string|null} [text] TextInput text + */ + + /** + * Constructs a new TextInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TextInput. + * @implements ITextInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITextInput=} [properties] Properties to set + */ + function TextInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextInput text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @instance + */ + TextInput.prototype.text = ""; + + /** + * Creates a new TextInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITextInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TextInput} TextInput instance + */ + TextInput.create = function create(properties) { + return new TextInput(properties); + }; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TextInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TextInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TextInput} TextInput + */ + TextInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TextInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TextInput(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TextInput} message TextInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @instance + * @returns {Object.} JSON object + */ + TextInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TextInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TextInput"; + }; + + return TextInput; + })(); + + v3beta1.IntentInput = (function() { + + /** + * Properties of an IntentInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IIntentInput + * @property {string|null} [intent] IntentInput intent + */ + + /** + * Constructs a new IntentInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an IntentInput. + * @implements IIntentInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentInput=} [properties] Properties to set + */ + function IntentInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentInput intent. + * @member {string} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @instance + */ + IntentInput.prototype.intent = ""; + + /** + * Creates a new IntentInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentInput} IntentInput instance + */ + IntentInput.create = function create(properties) { + return new IntentInput(properties); + }; + + /** + * Encodes the specified IntentInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentInput} message IntentInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intent); + return writer; + }; + + /** + * Encodes the specified IntentInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.IntentInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IIntentInput} message IntentInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentInput} IntentInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.IntentInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentInput} IntentInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) + if (!$util.isString(message.intent)) + return "intent: string expected"; + return null; + }; + + /** + * Creates an IntentInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.IntentInput} IntentInput + */ + IntentInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.IntentInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.IntentInput(); + if (object.intent != null) + message.intent = String(object.intent); + return message; + }; + + /** + * Creates a plain object from an IntentInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IntentInput} message IntentInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.intent = ""; + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = message.intent; + return object; + }; + + /** + * Converts this IntentInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @instance + * @returns {Object.} JSON object + */ + IntentInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.IntentInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.IntentInput"; + }; + + return IntentInput; + })(); + + v3beta1.AudioInput = (function() { + + /** + * Properties of an AudioInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IAudioInput + * @property {google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig|null} [config] AudioInput config + * @property {Uint8Array|null} [audio] AudioInput audio + */ + + /** + * Constructs a new AudioInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an AudioInput. + * @implements IAudioInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IAudioInput=} [properties] Properties to set + */ + function AudioInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioInput config. + * @member {google.cloud.dialogflow.cx.v3beta1.IInputAudioConfig|null|undefined} config + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @instance + */ + AudioInput.prototype.config = null; + + /** + * AudioInput audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @instance + */ + AudioInput.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new AudioInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAudioInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AudioInput} AudioInput instance + */ + AudioInput.create = function create(properties) { + return new AudioInput(properties); + }; + + /** + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AudioInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAudioInput} message AudioInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AudioInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAudioInput} message AudioInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AudioInput} AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AudioInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AudioInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AudioInput} AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.verify(message.config, long + 1); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates an AudioInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AudioInput} AudioInput + */ + AudioInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AudioInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AudioInput(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AudioInput.config: object expected"); + message.config = $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.fromObject(object.config, long + 1); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AudioInput} message AudioInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this AudioInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @instance + * @returns {Object.} JSON object + */ + AudioInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AudioInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AudioInput"; + }; + + return AudioInput; + })(); + + v3beta1.EventInput = (function() { + + /** + * Properties of an EventInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IEventInput + * @property {string|null} [event] EventInput event + */ + + /** + * Constructs a new EventInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an EventInput. + * @implements IEventInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IEventInput=} [properties] Properties to set + */ + function EventInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventInput event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @instance + */ + EventInput.prototype.event = ""; + + /** + * Creates a new EventInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEventInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.EventInput} EventInput instance + */ + EventInput.create = function create(properties) { + return new EventInput(properties); + }; + + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + return writer; + }; + + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EventInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.EventInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + return null; + }; + + /** + * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.EventInput} EventInput + */ + EventInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.EventInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.EventInput(); + if (object.event != null) + message.event = String(object.event); + return message; + }; + + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EventInput} message EventInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.event = ""; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this EventInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @instance + * @returns {Object.} JSON object + */ + EventInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.EventInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.EventInput"; + }; + + return EventInput; + })(); + + v3beta1.DtmfInput = (function() { + + /** + * Properties of a DtmfInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDtmfInput + * @property {string|null} [digits] DtmfInput digits + * @property {string|null} [finishDigit] DtmfInput finishDigit + */ + + /** + * Constructs a new DtmfInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DtmfInput. + * @implements IDtmfInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDtmfInput=} [properties] Properties to set + */ + function DtmfInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DtmfInput digits. + * @member {string} digits + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @instance + */ + DtmfInput.prototype.digits = ""; + + /** + * DtmfInput finishDigit. + * @member {string} finishDigit + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @instance + */ + DtmfInput.prototype.finishDigit = ""; + + /** + * Creates a new DtmfInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDtmfInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DtmfInput} DtmfInput instance + */ + DtmfInput.create = function create(properties) { + return new DtmfInput(properties); + }; + + /** + * Encodes the specified DtmfInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DtmfInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDtmfInput} message DtmfInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.digits != null && Object.hasOwnProperty.call(message, "digits")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.digits); + if (message.finishDigit != null && Object.hasOwnProperty.call(message, "finishDigit")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.finishDigit); + return writer; + }; + + /** + * Encodes the specified DtmfInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DtmfInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDtmfInput} message DtmfInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DtmfInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DtmfInput} DtmfInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.digits = reader.string(); + break; + } + case 2: { + message.finishDigit = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DtmfInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DtmfInput} DtmfInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DtmfInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DtmfInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.digits != null && message.hasOwnProperty("digits")) + if (!$util.isString(message.digits)) + return "digits: string expected"; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + if (!$util.isString(message.finishDigit)) + return "finishDigit: string expected"; + return null; + }; + + /** + * Creates a DtmfInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DtmfInput} DtmfInput + */ + DtmfInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DtmfInput(); + if (object.digits != null) + message.digits = String(object.digits); + if (object.finishDigit != null) + message.finishDigit = String(object.finishDigit); + return message; + }; + + /** + * Creates a plain object from a DtmfInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DtmfInput} message DtmfInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DtmfInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.digits = ""; + object.finishDigit = ""; + } + if (message.digits != null && message.hasOwnProperty("digits")) + object.digits = message.digits; + if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) + object.finishDigit = message.finishDigit; + return object; + }; + + /** + * Converts this DtmfInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @instance + * @returns {Object.} JSON object + */ + DtmfInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DtmfInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DtmfInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DtmfInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DtmfInput"; + }; + + return DtmfInput; + })(); + + v3beta1.Match = (function() { + + /** + * Properties of a Match. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IMatch + * @property {google.cloud.dialogflow.cx.v3beta1.IIntent|null} [intent] Match intent + * @property {string|null} [event] Match event + * @property {google.protobuf.IStruct|null} [parameters] Match parameters + * @property {string|null} [resolvedInput] Match resolvedInput + * @property {google.cloud.dialogflow.cx.v3beta1.Match.MatchType|null} [matchType] Match matchType + * @property {number|null} [confidence] Match confidence + */ + + /** + * Constructs a new Match. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Match. + * @implements IMatch + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IMatch=} [properties] Properties to set + */ + function Match(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Match intent. + * @member {google.cloud.dialogflow.cx.v3beta1.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @instance + */ + Match.prototype.intent = null; + + /** + * Match event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @instance + */ + Match.prototype.event = ""; + + /** + * Match parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @instance + */ + Match.prototype.parameters = null; + + /** + * Match resolvedInput. + * @member {string} resolvedInput + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @instance + */ + Match.prototype.resolvedInput = ""; + + /** + * Match matchType. + * @member {google.cloud.dialogflow.cx.v3beta1.Match.MatchType} matchType + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @instance + */ + Match.prototype.matchType = 0; + + /** + * Match confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @instance + */ + Match.prototype.confidence = 0; + + /** + * Creates a new Match instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatch=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Match} Match instance + */ + Match.create = function create(properties) { + return new Match(properties); + }; + + /** + * Encodes the specified Match message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Match.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatch} message Match message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Match.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.cx.v3beta1.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resolvedInput != null && Object.hasOwnProperty.call(message, "resolvedInput")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resolvedInput); + if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchType); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.event); + return writer; + }; + + /** + * Encodes the specified Match message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Match.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatch} message Match message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Match.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Match message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Match} Match + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Match.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Match(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.event = reader.string(); + break; + } + case 2: { + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.resolvedInput = reader.string(); + break; + } + case 4: { + message.matchType = reader.int32(); + break; + } + case 5: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Match message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Match} Match + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Match.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Match message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Match.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Intent.verify(message.intent, long + 1); + if (error) + return "intent." + error; + } + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters, long + 1); + if (error) + return "parameters." + error; + } + if (message.resolvedInput != null && message.hasOwnProperty("resolvedInput")) + if (!$util.isString(message.resolvedInput)) + return "resolvedInput: string expected"; + if (message.matchType != null && message.hasOwnProperty("matchType")) + switch (message.matchType) { + default: + return "matchType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + break; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Match message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Match} Match + */ + Match.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Match) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Match(); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Match.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.fromObject(object.intent, long + 1); + } + if (object.event != null) + message.event = String(object.event); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Match.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters, long + 1); + } + if (object.resolvedInput != null) + message.resolvedInput = String(object.resolvedInput); + switch (object.matchType) { + default: + if (typeof object.matchType === "number") { + message.matchType = object.matchType; + break; + } + break; + case "MATCH_TYPE_UNSPECIFIED": + case 0: + message.matchType = 0; + break; + case "INTENT": + case 1: + message.matchType = 1; + break; + case "DIRECT_INTENT": + case 2: + message.matchType = 2; + break; + case "PARAMETER_FILLING": + case 3: + message.matchType = 3; + break; + case "NO_MATCH": + case 4: + message.matchType = 4; + break; + case "NO_INPUT": + case 5: + message.matchType = 5; + break; + case "EVENT": + case 6: + message.matchType = 6; + break; + case "KNOWLEDGE_CONNECTOR": + case 8: + message.matchType = 8; + break; + case "PLAYBOOK": + case 9: + message.matchType = 9; + break; + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Match message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Match} message Match + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Match.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = null; + object.parameters = null; + object.resolvedInput = ""; + object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; + object.confidence = 0; + object.event = ""; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.cx.v3beta1.Intent.toObject(message.intent, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.resolvedInput != null && message.hasOwnProperty("resolvedInput")) + object.resolvedInput = message.resolvedInput; + if (message.matchType != null && message.hasOwnProperty("matchType")) + object.matchType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Match.MatchType[message.matchType] === undefined ? message.matchType : $root.google.cloud.dialogflow.cx.v3beta1.Match.MatchType[message.matchType] : message.matchType; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this Match to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @instance + * @returns {Object.} JSON object + */ + Match.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Match + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Match + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Match.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Match"; + }; + + /** + * MatchType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Match.MatchType + * @enum {number} + * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value + * @property {number} INTENT=1 INTENT value + * @property {number} DIRECT_INTENT=2 DIRECT_INTENT value + * @property {number} PARAMETER_FILLING=3 PARAMETER_FILLING value + * @property {number} NO_MATCH=4 NO_MATCH value + * @property {number} NO_INPUT=5 NO_INPUT value + * @property {number} EVENT=6 EVENT value + * @property {number} KNOWLEDGE_CONNECTOR=8 KNOWLEDGE_CONNECTOR value + * @property {number} PLAYBOOK=9 PLAYBOOK value + */ + Match.MatchType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT"] = 1; + values[valuesById[2] = "DIRECT_INTENT"] = 2; + values[valuesById[3] = "PARAMETER_FILLING"] = 3; + values[valuesById[4] = "NO_MATCH"] = 4; + values[valuesById[5] = "NO_INPUT"] = 5; + values[valuesById[6] = "EVENT"] = 6; + values[valuesById[8] = "KNOWLEDGE_CONNECTOR"] = 8; + values[valuesById[9] = "PLAYBOOK"] = 9; + return values; + })(); + + return Match; + })(); + + v3beta1.MatchIntentRequest = (function() { + + /** + * Properties of a MatchIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IMatchIntentRequest + * @property {string|null} [session] MatchIntentRequest session + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null} [queryParams] MatchIntentRequest queryParams + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null} [queryInput] MatchIntentRequest queryInput + * @property {boolean|null} [persistParameterChanges] MatchIntentRequest persistParameterChanges + */ + + /** + * Constructs a new MatchIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a MatchIntentRequest. + * @implements IMatchIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest=} [properties] Properties to set + */ + function MatchIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.session = ""; + + /** + * MatchIntentRequest queryParams. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.queryParams = null; + + /** + * MatchIntentRequest queryInput. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.queryInput = null; + + /** + * MatchIntentRequest persistParameterChanges. + * @member {boolean} persistParameterChanges + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @instance + */ + MatchIntentRequest.prototype.persistParameterChanges = false; + + /** + * Creates a new MatchIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} MatchIntentRequest instance + */ + MatchIntentRequest.create = function create(properties) { + return new MatchIntentRequest(properties); + }; + + /** + * Encodes the specified MatchIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest} message MatchIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.persistParameterChanges != null && Object.hasOwnProperty.call(message, "persistParameterChanges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.persistParameterChanges); + return writer; + }; + + /** + * Encodes the specified MatchIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest} message MatchIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} MatchIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.persistParameterChanges = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MatchIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} MatchIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.verify(message.queryParams, long + 1); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.verify(message.queryInput, long + 1); + if (error) + return "queryInput." + error; + } + if (message.persistParameterChanges != null && message.hasOwnProperty("persistParameterChanges")) + if (typeof message.persistParameterChanges !== "boolean") + return "persistParameterChanges: boolean expected"; + return null; + }; + + /** + * Creates a MatchIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} MatchIntentRequest + */ + MatchIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.fromObject(object.queryParams, long + 1); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.fromObject(object.queryInput, long + 1); + } + if (object.persistParameterChanges != null) + message.persistParameterChanges = Boolean(object.persistParameterChanges); + return message; + }; + + /** + * Creates a plain object from a MatchIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} message MatchIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.persistParameterChanges = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.cx.v3beta1.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.cx.v3beta1.QueryInput.toObject(message.queryInput, options); + if (message.persistParameterChanges != null && message.hasOwnProperty("persistParameterChanges")) + object.persistParameterChanges = message.persistParameterChanges; + return object; + }; + + /** + * Converts this MatchIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @instance + * @returns {Object.} JSON object + */ + MatchIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest"; + }; + + return MatchIntentRequest; + })(); + + v3beta1.MatchIntentResponse = (function() { + + /** + * Properties of a MatchIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IMatchIntentResponse + * @property {string|null} [text] MatchIntentResponse text + * @property {string|null} [triggerIntent] MatchIntentResponse triggerIntent + * @property {string|null} [transcript] MatchIntentResponse transcript + * @property {string|null} [triggerEvent] MatchIntentResponse triggerEvent + * @property {Array.|null} [matches] MatchIntentResponse matches + * @property {google.cloud.dialogflow.cx.v3beta1.IPage|null} [currentPage] MatchIntentResponse currentPage + */ + + /** + * Constructs a new MatchIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a MatchIntentResponse. + * @implements IMatchIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse=} [properties] Properties to set + */ + function MatchIntentResponse(properties) { + this.matches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchIntentResponse text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.text = null; + + /** + * MatchIntentResponse triggerIntent. + * @member {string|null|undefined} triggerIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.triggerIntent = null; + + /** + * MatchIntentResponse transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.transcript = null; + + /** + * MatchIntentResponse triggerEvent. + * @member {string|null|undefined} triggerEvent + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.triggerEvent = null; + + /** + * MatchIntentResponse matches. + * @member {Array.} matches + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.matches = $util.emptyArray; + + /** + * MatchIntentResponse currentPage. + * @member {google.cloud.dialogflow.cx.v3beta1.IPage|null|undefined} currentPage + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + */ + MatchIntentResponse.prototype.currentPage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MatchIntentResponse query. + * @member {"text"|"triggerIntent"|"transcript"|"triggerEvent"|undefined} query + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + */ + Object.defineProperty(MatchIntentResponse.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["text", "triggerIntent", "transcript", "triggerEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MatchIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} MatchIntentResponse instance + */ + MatchIntentResponse.create = function create(properties) { + return new MatchIntentResponse(properties); + }; + + /** + * Encodes the specified MatchIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse} message MatchIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.triggerIntent != null && Object.hasOwnProperty.call(message, "triggerIntent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerIntent); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transcript); + if (message.matches != null && message.matches.length) + for (var i = 0; i < message.matches.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Match.encode(message.matches[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + $root.google.cloud.dialogflow.cx.v3beta1.Page.encode(message.currentPage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.triggerEvent != null && Object.hasOwnProperty.call(message, "triggerEvent")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.triggerEvent); + return writer; + }; + + /** + * Encodes the specified MatchIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse} message MatchIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} MatchIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.triggerIntent = reader.string(); + break; + } + case 3: { + message.transcript = reader.string(); + break; + } + case 6: { + message.triggerEvent = reader.string(); + break; + } + case 4: { + if (!(message.matches && message.matches.length)) + message.matches = []; + message.matches.push($root.google.cloud.dialogflow.cx.v3beta1.Match.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MatchIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} MatchIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.query = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerIntent)) + return "triggerIntent: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerEvent)) + return "triggerEvent: string expected"; + } + if (message.matches != null && message.hasOwnProperty("matches")) { + if (!Array.isArray(message.matches)) + return "matches: array expected"; + for (var i = 0; i < message.matches.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Match.verify(message.matches[i], long + 1); + if (error) + return "matches." + error; + } + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Page.verify(message.currentPage, long + 1); + if (error) + return "currentPage." + error; + } + return null; + }; + + /** + * Creates a MatchIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} MatchIntentResponse + */ + MatchIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse(); + if (object.text != null) + message.text = String(object.text); + if (object.triggerIntent != null) + message.triggerIntent = String(object.triggerIntent); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.triggerEvent != null) + message.triggerEvent = String(object.triggerEvent); + if (object.matches) { + if (!Array.isArray(object.matches)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.matches: array expected"); + message.matches = []; + for (var i = 0; i < object.matches.length; ++i) { + if (typeof object.matches[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.matches: object expected"); + message.matches[i] = $root.google.cloud.dialogflow.cx.v3beta1.Match.fromObject(object.matches[i], long + 1); + } + } + if (object.currentPage != null) { + if (typeof object.currentPage !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.currentPage: object expected"); + message.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.fromObject(object.currentPage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MatchIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} message MatchIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matches = []; + if (options.defaults) + object.currentPage = null; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.query = "text"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + object.triggerIntent = message.triggerIntent; + if (options.oneofs) + object.query = "triggerIntent"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.query = "transcript"; + } + if (message.matches && message.matches.length) { + object.matches = []; + for (var j = 0; j < message.matches.length; ++j) + object.matches[j] = $root.google.cloud.dialogflow.cx.v3beta1.Match.toObject(message.matches[j], options); + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = $root.google.cloud.dialogflow.cx.v3beta1.Page.toObject(message.currentPage, options); + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + object.triggerEvent = message.triggerEvent; + if (options.oneofs) + object.query = "triggerEvent"; + } + return object; + }; + + /** + * Converts this MatchIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @instance + * @returns {Object.} JSON object + */ + MatchIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse"; + }; + + return MatchIntentResponse; + })(); + + v3beta1.FulfillIntentRequest = (function() { + + /** + * Properties of a FulfillIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFulfillIntentRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest|null} [matchIntentRequest] FulfillIntentRequest matchIntentRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IMatch|null} [match] FulfillIntentRequest match + * @property {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null} [outputAudioConfig] FulfillIntentRequest outputAudioConfig + */ + + /** + * Constructs a new FulfillIntentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FulfillIntentRequest. + * @implements IFulfillIntentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest=} [properties] Properties to set + */ + function FulfillIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillIntentRequest matchIntentRequest. + * @member {google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest|null|undefined} matchIntentRequest + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @instance + */ + FulfillIntentRequest.prototype.matchIntentRequest = null; + + /** + * FulfillIntentRequest match. + * @member {google.cloud.dialogflow.cx.v3beta1.IMatch|null|undefined} match + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @instance + */ + FulfillIntentRequest.prototype.match = null; + + /** + * FulfillIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @instance + */ + FulfillIntentRequest.prototype.outputAudioConfig = null; + + /** + * Creates a new FulfillIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest} FulfillIntentRequest instance + */ + FulfillIntentRequest.create = function create(properties) { + return new FulfillIntentRequest(properties); + }; + + /** + * Encodes the specified FulfillIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest} message FulfillIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchIntentRequest != null && Object.hasOwnProperty.call(message, "matchIntentRequest")) + $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.encode(message.matchIntentRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.match != null && Object.hasOwnProperty.call(message, "match")) + $root.google.cloud.dialogflow.cx.v3beta1.Match.encode(message.match, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FulfillIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest} message FulfillIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest} FulfillIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.matchIntentRequest = $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.match = $root.google.cloud.dialogflow.cx.v3beta1.Match.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest} FulfillIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillIntentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.matchIntentRequest != null && message.hasOwnProperty("matchIntentRequest")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.verify(message.matchIntentRequest, long + 1); + if (error) + return "matchIntentRequest." + error; + } + if (message.match != null && message.hasOwnProperty("match")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Match.verify(message.match, long + 1); + if (error) + return "match." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; + + /** + * Creates a FulfillIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest} FulfillIntentRequest + */ + FulfillIntentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(); + if (object.matchIntentRequest != null) { + if (typeof object.matchIntentRequest !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.matchIntentRequest: object expected"); + message.matchIntentRequest = $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.fromObject(object.matchIntentRequest, long + 1); + } + if (object.match != null) { + if (typeof object.match !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.match: object expected"); + message.match = $root.google.cloud.dialogflow.cx.v3beta1.Match.fromObject(object.match, long + 1); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FulfillIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest} message FulfillIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.matchIntentRequest = null; + object.match = null; + object.outputAudioConfig = null; + } + if (message.matchIntentRequest != null && message.hasOwnProperty("matchIntentRequest")) + object.matchIntentRequest = $root.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.toObject(message.matchIntentRequest, options); + if (message.match != null && message.hasOwnProperty("match")) + object.match = $root.google.cloud.dialogflow.cx.v3beta1.Match.toObject(message.match, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + return object; + }; + + /** + * Converts this FulfillIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @instance + * @returns {Object.} JSON object + */ + FulfillIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillIntentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillIntentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest"; + }; + + return FulfillIntentRequest; + })(); + + v3beta1.FulfillIntentResponse = (function() { + + /** + * Properties of a FulfillIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFulfillIntentResponse + * @property {string|null} [responseId] FulfillIntentResponse responseId + * @property {google.cloud.dialogflow.cx.v3beta1.IQueryResult|null} [queryResult] FulfillIntentResponse queryResult + * @property {Uint8Array|null} [outputAudio] FulfillIntentResponse outputAudio + * @property {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null} [outputAudioConfig] FulfillIntentResponse outputAudioConfig + */ + + /** + * Constructs a new FulfillIntentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FulfillIntentResponse. + * @implements IFulfillIntentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse=} [properties] Properties to set + */ + function FulfillIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.responseId = ""; + + /** + * FulfillIntentResponse queryResult. + * @member {google.cloud.dialogflow.cx.v3beta1.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.queryResult = null; + + /** + * FulfillIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.outputAudio = $util.newBuffer([]); + + /** + * FulfillIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @instance + */ + FulfillIntentResponse.prototype.outputAudioConfig = null; + + /** + * Creates a new FulfillIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} FulfillIntentResponse instance + */ + FulfillIntentResponse.create = function create(properties) { + return new FulfillIntentResponse(properties); + }; + + /** + * Encodes the specified FulfillIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse} message FulfillIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.outputAudio); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FulfillIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse} message FulfillIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} FulfillIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseId = reader.string(); + break; + } + case 2: { + message.queryResult = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.outputAudio = reader.bytes(); + break; + } + case 4: { + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} FulfillIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillIntentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.verify(message.queryResult, long + 1); + if (error) + return "queryResult." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.verify(message.outputAudioConfig, long + 1); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; + + /** + * Creates a FulfillIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} FulfillIntentResponse + */ + FulfillIntentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.fromObject(object.queryResult, long + 1); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length >= 0) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.fromObject(object.outputAudioConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FulfillIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} message FulfillIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseId = ""; + object.queryResult = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.cx.v3beta1.QueryResult.toObject(message.queryResult, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + return object; + }; + + /** + * Converts this FulfillIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @instance + * @returns {Object.} JSON object + */ + FulfillIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillIntentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillIntentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse"; + }; + + return FulfillIntentResponse; + })(); + + v3beta1.SentimentAnalysisResult = (function() { + + /** + * Properties of a SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISentimentAnalysisResult + * @property {number|null} [score] SentimentAnalysisResult score + * @property {number|null} [magnitude] SentimentAnalysisResult magnitude + */ + + /** + * Constructs a new SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SentimentAnalysisResult. + * @implements ISentimentAnalysisResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult=} [properties] Properties to set + */ + function SentimentAnalysisResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SentimentAnalysisResult score. + * @member {number} score + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.score = 0; + + /** + * SentimentAnalysisResult magnitude. + * @member {number} magnitude + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.magnitude = 0; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult} SentimentAnalysisResult instance + */ + SentimentAnalysisResult.create = function create(properties) { + return new SentimentAnalysisResult(properties); + }; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + return writer; + }; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + case 2: { + message.magnitude = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SentimentAnalysisResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + return null; + }; + + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult} SentimentAnalysisResult + */ + SentimentAnalysisResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult(); + if (object.score != null) + message.score = Number(object.score); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + return message; + }; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult} message SentimentAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.magnitude = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + return object; + }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SentimentAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SentimentAnalysisResult"; + }; + + return SentimentAnalysisResult; + })(); + + /** + * DetectIntentResponseView enum. + * @name google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView + * @enum {number} + * @property {number} DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED=0 DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED value + * @property {number} DETECT_INTENT_RESPONSE_VIEW_FULL=1 DETECT_INTENT_RESPONSE_VIEW_FULL value + * @property {number} DETECT_INTENT_RESPONSE_VIEW_BASIC=2 DETECT_INTENT_RESPONSE_VIEW_BASIC value + * @property {number} DETECT_INTENT_RESPONSE_VIEW_DEFAULT=3 DETECT_INTENT_RESPONSE_VIEW_DEFAULT value + */ + v3beta1.DetectIntentResponseView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "DETECT_INTENT_RESPONSE_VIEW_FULL"] = 1; + values[valuesById[2] = "DETECT_INTENT_RESPONSE_VIEW_BASIC"] = 2; + values[valuesById[3] = "DETECT_INTENT_RESPONSE_VIEW_DEFAULT"] = 3; + return values; + })(); + + v3beta1.Examples = (function() { + + /** + * Constructs a new Examples service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Examples + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Examples(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Examples.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Examples; + + /** + * Creates new Examples service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Examples} RPC service. Useful where requests and/or responses are streamed. + */ + Examples.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|createExample}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @typedef CreateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Example} [response] Example + */ + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Examples.CreateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.createExample = function createExample(request, callback) { + return this.rpcCall(createExample, $root.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest, $root.google.cloud.dialogflow.cx.v3beta1.Example, request, callback); + }, "name", { value: "CreateExample" }); + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|deleteExample}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @typedef DeleteExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Examples.DeleteExampleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.deleteExample = function deleteExample(request, callback) { + return this.rpcCall(deleteExample, $root.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExample" }); + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|listExamples}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @typedef ListExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse} [response] ListExamplesResponse + */ + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest} request ListExamplesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Examples.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.listExamples = function listExamples(request, callback) { + return this.rpcCall(listExamples, $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse, request, callback); + }, "name", { value: "ListExamples" }); + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest} request ListExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|getExample}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @typedef GetExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Example} [response] Example + */ + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest} request GetExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Examples.GetExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.getExample = function getExample(request, callback) { + return this.rpcCall(getExample, $root.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest, $root.google.cloud.dialogflow.cx.v3beta1.Example, request, callback); + }, "name", { value: "GetExample" }); + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest} request GetExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Examples|updateExample}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @typedef UpdateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Example} [response] Example + */ + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Examples.UpdateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Examples.prototype.updateExample = function updateExample(request, callback) { + return this.rpcCall(updateExample, $root.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest, $root.google.cloud.dialogflow.cx.v3beta1.Example, request, callback); + }, "name", { value: "UpdateExample" }); + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.dialogflow.cx.v3beta1.Examples + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Examples; + })(); + + v3beta1.CreateExampleRequest = (function() { + + /** + * Properties of a CreateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateExampleRequest + * @property {string|null} [parent] CreateExampleRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IExample|null} [example] CreateExampleRequest example + */ + + /** + * Constructs a new CreateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateExampleRequest. + * @implements ICreateExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest=} [properties] Properties to set + */ + function CreateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExampleRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.parent = ""; + + /** + * CreateExampleRequest example. + * @member {google.cloud.dialogflow.cx.v3beta1.IExample|null|undefined} example + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.example = null; + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest} CreateExampleRequest instance + */ + CreateExampleRequest.create = function create(properties) { + return new CreateExampleRequest(properties); + }; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.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.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.dialogflow.cx.v3beta1.Example.encode(message.example, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.example = $root.google.cloud.dialogflow.cx.v3beta1.Example.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Example.verify(message.example, long + 1); + if (error) + return "example." + error; + } + return null; + }; + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest} CreateExampleRequest + */ + CreateExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest.example: object expected"); + message.example = $root.google.cloud.dialogflow.cx.v3beta1.Example.fromObject(object.example, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest} message CreateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.example = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.dialogflow.cx.v3beta1.Example.toObject(message.example, options); + return object; + }; + + /** + * Converts this CreateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest"; + }; + + return CreateExampleRequest; + })(); + + v3beta1.DeleteExampleRequest = (function() { + + /** + * Properties of a DeleteExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteExampleRequest + * @property {string|null} [name] DeleteExampleRequest name + */ + + /** + * Constructs a new DeleteExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteExampleRequest. + * @implements IDeleteExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest=} [properties] Properties to set + */ + function DeleteExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExampleRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.name = ""; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest} DeleteExampleRequest instance + */ + DeleteExampleRequest.create = function create(properties) { + return new DeleteExampleRequest(properties); + }; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.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 DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest} DeleteExampleRequest + */ + DeleteExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest} message DeleteExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExampleRequest.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 DeleteExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest"; + }; + + return DeleteExampleRequest; + })(); + + v3beta1.ListExamplesRequest = (function() { + + /** + * Properties of a ListExamplesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListExamplesRequest + * @property {string|null} [parent] ListExamplesRequest parent + * @property {number|null} [pageSize] ListExamplesRequest pageSize + * @property {string|null} [pageToken] ListExamplesRequest pageToken + * @property {string|null} [languageCode] ListExamplesRequest languageCode + */ + + /** + * Constructs a new ListExamplesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListExamplesRequest. + * @implements IListExamplesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest=} [properties] Properties to set + */ + function ListExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.parent = ""; + + /** + * ListExamplesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageSize = 0; + + /** + * ListExamplesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageToken = ""; + + /** + * ListExamplesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.languageCode = ""; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest} ListExamplesRequest instance + */ + ListExamplesRequest.create = function create(properties) { + return new ListExamplesRequest(properties); + }; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest} ListExamplesRequest + */ + ListExamplesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest} message ListExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ListExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest"; + }; + + return ListExamplesRequest; + })(); + + v3beta1.ListExamplesResponse = (function() { + + /** + * Properties of a ListExamplesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListExamplesResponse + * @property {Array.|null} [examples] ListExamplesResponse examples + * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken + */ + + /** + * Constructs a new ListExamplesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListExamplesResponse. + * @implements IListExamplesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse=} [properties] Properties to set + */ + function ListExamplesResponse(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesResponse examples. + * @member {Array.} examples + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.examples = $util.emptyArray; + + /** + * ListExamplesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse} ListExamplesResponse instance + */ + ListExamplesResponse.create = function create(properties) { + return new ListExamplesResponse(properties); + }; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.dialogflow.cx.v3beta1.Example.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Example.verify(message.examples[i], long + 1); + if (error) + return "examples." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse} ListExamplesResponse + */ + ListExamplesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse.examples: object expected"); + message.examples[i] = $root.google.cloud.dialogflow.cx.v3beta1.Example.fromObject(object.examples[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse} message ListExamplesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.dialogflow.cx.v3beta1.Example.toObject(message.examples[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExamplesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @instance + * @returns {Object.} JSON object + */ + ListExamplesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListExamplesResponse"; + }; + + return ListExamplesResponse; + })(); + + v3beta1.GetExampleRequest = (function() { + + /** + * Properties of a GetExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetExampleRequest + * @property {string|null} [name] GetExampleRequest name + */ + + /** + * Constructs a new GetExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetExampleRequest. + * @implements IGetExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest=} [properties] Properties to set + */ + function GetExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExampleRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @instance + */ + GetExampleRequest.prototype.name = ""; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExampleRequest} GetExampleRequest instance + */ + GetExampleRequest.create = function create(properties) { + return new GetExampleRequest(properties); + }; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.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 GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExampleRequest} GetExampleRequest + */ + GetExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetExampleRequest} message GetExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExampleRequest.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 GetExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @instance + * @returns {Object.} JSON object + */ + GetExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetExampleRequest"; + }; + + return GetExampleRequest; + })(); + + v3beta1.UpdateExampleRequest = (function() { + + /** + * Properties of an UpdateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateExampleRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IExample|null} [example] UpdateExampleRequest example + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExampleRequest updateMask + */ + + /** + * Constructs a new UpdateExampleRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateExampleRequest. + * @implements IUpdateExampleRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest=} [properties] Properties to set + */ + function UpdateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExampleRequest example. + * @member {google.cloud.dialogflow.cx.v3beta1.IExample|null|undefined} example + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.example = null; + + /** + * UpdateExampleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest} UpdateExampleRequest instance + */ + UpdateExampleRequest.create = function create(properties) { + return new UpdateExampleRequest(properties); + }; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.dialogflow.cx.v3beta1.Example.encode(message.example, 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 UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.example = $root.google.cloud.dialogflow.cx.v3beta1.Example.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExampleRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExampleRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Example.verify(message.example, long + 1); + if (error) + return "example." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest} UpdateExampleRequest + */ + UpdateExampleRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest(); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest.example: object expected"); + message.example = $root.google.cloud.dialogflow.cx.v3beta1.Example.fromObject(object.example, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest} message UpdateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.example = null; + object.updateMask = null; + } + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.dialogflow.cx.v3beta1.Example.toObject(message.example, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest"; + }; + + return UpdateExampleRequest; + })(); + + v3beta1.Example = (function() { + + /** + * Properties of an Example. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExample + * @property {string|null} [name] Example name + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null} [playbookInput] Example playbookInput + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null} [playbookOutput] Example playbookOutput + * @property {Array.|null} [actions] Example actions + * @property {string|null} [displayName] Example displayName + * @property {string|null} [description] Example description + * @property {number|Long|null} [tokenCount] Example tokenCount + * @property {google.protobuf.ITimestamp|null} [createTime] Example createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Example updateTime + * @property {google.cloud.dialogflow.cx.v3beta1.OutputState|null} [conversationState] Example conversationState + * @property {string|null} [languageCode] Example languageCode + */ + + /** + * Constructs a new Example. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExample=} [properties] Properties to set + */ + function Example(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Example name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.name = ""; + + /** + * Example playbookInput. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null|undefined} playbookInput + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.playbookInput = null; + + /** + * Example playbookOutput. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null|undefined} playbookOutput + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.playbookOutput = null; + + /** + * Example actions. + * @member {Array.} actions + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.actions = $util.emptyArray; + + /** + * Example displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.displayName = ""; + + /** + * Example description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.description = ""; + + /** + * Example tokenCount. + * @member {number|Long} tokenCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.tokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Example createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.createTime = null; + + /** + * Example updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.updateTime = null; + + /** + * Example conversationState. + * @member {google.cloud.dialogflow.cx.v3beta1.OutputState} conversationState + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.conversationState = 0; + + /** + * Example languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + */ + Example.prototype.languageCode = ""; + + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExample=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Example.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.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.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Action.encode(message.actions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.playbookInput != null && Object.hasOwnProperty.call(message, "playbookInput")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.encode(message.playbookInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.playbookOutput != null && Object.hasOwnProperty.call(message, "playbookOutput")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.encode(message.playbookOutput, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.tokenCount); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.conversationState != null && Object.hasOwnProperty.call(message, "conversationState")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.conversationState); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.playbookInput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.dialogflow.cx.v3beta1.Action.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 9: { + message.tokenCount = reader.int64(); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.conversationState = reader.int32(); + break; + } + case 13: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Example message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.verify(message.playbookInput, long + 1); + if (error) + return "playbookInput." + error; + } + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.verify(message.playbookOutput, long + 1); + if (error) + return "playbookOutput." + error; + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.verify(message.actions[i], long + 1); + if (error) + return "actions." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount) && !(message.tokenCount && $util.isInteger(message.tokenCount.low) && $util.isInteger(message.tokenCount.high))) + return "tokenCount: integer|Long expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.conversationState != null && message.hasOwnProperty("conversationState")) + switch (message.conversationState) { + default: + return "conversationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Example} Example + */ + Example.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Example) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Example(); + if (object.name != null) + message.name = String(object.name); + if (object.playbookInput != null) { + if (typeof object.playbookInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Example.playbookInput: object expected"); + message.playbookInput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.fromObject(object.playbookInput, long + 1); + } + if (object.playbookOutput != null) { + if (typeof object.playbookOutput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Example.playbookOutput: object expected"); + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.fromObject(object.playbookOutput, long + 1); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Example.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Example.actions: object expected"); + message.actions[i] = $root.google.cloud.dialogflow.cx.v3beta1.Action.fromObject(object.actions[i], long + 1); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.tokenCount != null) + if ($util.Long) + (message.tokenCount = $util.Long.fromValue(object.tokenCount)).unsigned = false; + else if (typeof object.tokenCount === "string") + message.tokenCount = parseInt(object.tokenCount, 10); + else if (typeof object.tokenCount === "number") + message.tokenCount = object.tokenCount; + else if (typeof object.tokenCount === "object") + message.tokenCount = new $util.LongBits(object.tokenCount.low >>> 0, object.tokenCount.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Example.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Example.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + switch (object.conversationState) { + default: + if (typeof object.conversationState === "number") { + message.conversationState = object.conversationState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.conversationState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.conversationState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.conversationState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.conversationState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.conversationState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.conversationState = 5; + break; + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.name = ""; + object.playbookInput = null; + object.playbookOutput = null; + object.displayName = ""; + object.description = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.tokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tokenCount = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.conversationState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.dialogflow.cx.v3beta1.Action.toObject(message.actions[j], options); + } + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) + object.playbookInput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.toObject(message.playbookInput, options); + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) + object.playbookOutput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.toObject(message.playbookOutput, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (typeof message.tokenCount === "number") + object.tokenCount = options.longs === String ? String(message.tokenCount) : message.tokenCount; + else + object.tokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.tokenCount) : options.longs === Number ? new $util.LongBits(message.tokenCount.low >>> 0, message.tokenCount.high >>> 0).toNumber() : message.tokenCount; + if (message.createTime != null && message.hasOwnProperty("createTime")) + 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.conversationState != null && message.hasOwnProperty("conversationState")) + object.conversationState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.conversationState] === undefined ? message.conversationState : $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.conversationState] : message.conversationState; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Example"; + }; + + return Example; + })(); + + v3beta1.TraceBlock = (function() { + + /** + * Properties of a TraceBlock. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITraceBlock + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata|null} [playbookTraceMetadata] TraceBlock playbookTraceMetadata + * @property {google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata|null} [flowTraceMetadata] TraceBlock flowTraceMetadata + * @property {google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata|null} [speechProcessingMetadata] TraceBlock speechProcessingMetadata + * @property {Array.|null} [actions] TraceBlock actions + * @property {google.protobuf.ITimestamp|null} [startTime] TraceBlock startTime + * @property {google.protobuf.ITimestamp|null} [completeTime] TraceBlock completeTime + * @property {google.protobuf.IStruct|null} [inputParameters] TraceBlock inputParameters + * @property {google.protobuf.IStruct|null} [outputParameters] TraceBlock outputParameters + * @property {google.cloud.dialogflow.cx.v3beta1.OutputState|null} [endState] TraceBlock endState + */ + + /** + * Constructs a new TraceBlock. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TraceBlock. + * @implements ITraceBlock + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITraceBlock=} [properties] Properties to set + */ + function TraceBlock(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TraceBlock playbookTraceMetadata. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata|null|undefined} playbookTraceMetadata + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.playbookTraceMetadata = null; + + /** + * TraceBlock flowTraceMetadata. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata|null|undefined} flowTraceMetadata + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.flowTraceMetadata = null; + + /** + * TraceBlock speechProcessingMetadata. + * @member {google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata|null|undefined} speechProcessingMetadata + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.speechProcessingMetadata = null; + + /** + * TraceBlock actions. + * @member {Array.} actions + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.actions = $util.emptyArray; + + /** + * TraceBlock startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.startTime = null; + + /** + * TraceBlock completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.completeTime = null; + + /** + * TraceBlock inputParameters. + * @member {google.protobuf.IStruct|null|undefined} inputParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.inputParameters = null; + + /** + * TraceBlock outputParameters. + * @member {google.protobuf.IStruct|null|undefined} outputParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.outputParameters = null; + + /** + * TraceBlock endState. + * @member {google.cloud.dialogflow.cx.v3beta1.OutputState} endState + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + TraceBlock.prototype.endState = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TraceBlock traceMetadata. + * @member {"playbookTraceMetadata"|"flowTraceMetadata"|"speechProcessingMetadata"|undefined} traceMetadata + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + */ + Object.defineProperty(TraceBlock.prototype, "traceMetadata", { + get: $util.oneOfGetter($oneOfFields = ["playbookTraceMetadata", "flowTraceMetadata", "speechProcessingMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TraceBlock instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITraceBlock=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TraceBlock} TraceBlock instance + */ + TraceBlock.create = function create(properties) { + return new TraceBlock(properties); + }; + + /** + * Encodes the specified TraceBlock message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TraceBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITraceBlock} message TraceBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TraceBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbookTraceMetadata != null && Object.hasOwnProperty.call(message, "playbookTraceMetadata")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.encode(message.playbookTraceMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.flowTraceMetadata != null && Object.hasOwnProperty.call(message, "flowTraceMetadata")) + $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.encode(message.flowTraceMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Action.encode(message.actions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputParameters != null && Object.hasOwnProperty.call(message, "outputParameters")) + $root.google.protobuf.Struct.encode(message.outputParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endState != null && Object.hasOwnProperty.call(message, "endState")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.endState); + if (message.speechProcessingMetadata != null && Object.hasOwnProperty.call(message, "speechProcessingMetadata")) + $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.encode(message.speechProcessingMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.inputParameters != null && Object.hasOwnProperty.call(message, "inputParameters")) + $root.google.protobuf.Struct.encode(message.inputParameters, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TraceBlock message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TraceBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITraceBlock} message TraceBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TraceBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TraceBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TraceBlock} TraceBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TraceBlock.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TraceBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbookTraceMetadata = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.flowTraceMetadata = $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.speechProcessingMetadata = $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.dialogflow.cx.v3beta1.Action.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.inputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.outputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.endState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TraceBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TraceBlock} TraceBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TraceBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TraceBlock message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TraceBlock.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.playbookTraceMetadata != null && message.hasOwnProperty("playbookTraceMetadata")) { + properties.traceMetadata = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.verify(message.playbookTraceMetadata, long + 1); + if (error) + return "playbookTraceMetadata." + error; + } + } + if (message.flowTraceMetadata != null && message.hasOwnProperty("flowTraceMetadata")) { + if (properties.traceMetadata === 1) + return "traceMetadata: multiple values"; + properties.traceMetadata = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.verify(message.flowTraceMetadata, long + 1); + if (error) + return "flowTraceMetadata." + error; + } + } + if (message.speechProcessingMetadata != null && message.hasOwnProperty("speechProcessingMetadata")) { + if (properties.traceMetadata === 1) + return "traceMetadata: multiple values"; + properties.traceMetadata = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.verify(message.speechProcessingMetadata, long + 1); + if (error) + return "speechProcessingMetadata." + error; + } + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.verify(message.actions[i], long + 1); + if (error) + return "actions." + error; + } + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime, long + 1); + if (error) + return "completeTime." + error; + } + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputParameters, long + 1); + if (error) + return "inputParameters." + error; + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + var error = $root.google.protobuf.Struct.verify(message.outputParameters, long + 1); + if (error) + return "outputParameters." + error; + } + if (message.endState != null && message.hasOwnProperty("endState")) + switch (message.endState) { + default: + return "endState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a TraceBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TraceBlock} TraceBlock + */ + TraceBlock.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TraceBlock) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TraceBlock(); + if (object.playbookTraceMetadata != null) { + if (typeof object.playbookTraceMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.playbookTraceMetadata: object expected"); + message.playbookTraceMetadata = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.fromObject(object.playbookTraceMetadata, long + 1); + } + if (object.flowTraceMetadata != null) { + if (typeof object.flowTraceMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.flowTraceMetadata: object expected"); + message.flowTraceMetadata = $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.fromObject(object.flowTraceMetadata, long + 1); + } + if (object.speechProcessingMetadata != null) { + if (typeof object.speechProcessingMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.speechProcessingMetadata: object expected"); + message.speechProcessingMetadata = $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.fromObject(object.speechProcessingMetadata, long + 1); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.actions: object expected"); + message.actions[i] = $root.google.cloud.dialogflow.cx.v3beta1.Action.fromObject(object.actions[i], long + 1); + } + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime, long + 1); + } + if (object.inputParameters != null) { + if (typeof object.inputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.inputParameters: object expected"); + message.inputParameters = $root.google.protobuf.Struct.fromObject(object.inputParameters, long + 1); + } + if (object.outputParameters != null) { + if (typeof object.outputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TraceBlock.outputParameters: object expected"); + message.outputParameters = $root.google.protobuf.Struct.fromObject(object.outputParameters, long + 1); + } + switch (object.endState) { + default: + if (typeof object.endState === "number") { + message.endState = object.endState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.endState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.endState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.endState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.endState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.endState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.endState = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a TraceBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TraceBlock} message TraceBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TraceBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.startTime = null; + object.completeTime = null; + object.outputParameters = null; + object.endState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.inputParameters = null; + } + if (message.playbookTraceMetadata != null && message.hasOwnProperty("playbookTraceMetadata")) { + object.playbookTraceMetadata = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.toObject(message.playbookTraceMetadata, options); + if (options.oneofs) + object.traceMetadata = "playbookTraceMetadata"; + } + if (message.flowTraceMetadata != null && message.hasOwnProperty("flowTraceMetadata")) { + object.flowTraceMetadata = $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.toObject(message.flowTraceMetadata, options); + if (options.oneofs) + object.traceMetadata = "flowTraceMetadata"; + } + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.dialogflow.cx.v3beta1.Action.toObject(message.actions[j], options); + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) + object.outputParameters = $root.google.protobuf.Struct.toObject(message.outputParameters, options); + if (message.endState != null && message.hasOwnProperty("endState")) + object.endState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.endState] === undefined ? message.endState : $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.endState] : message.endState; + if (message.speechProcessingMetadata != null && message.hasOwnProperty("speechProcessingMetadata")) { + object.speechProcessingMetadata = $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.toObject(message.speechProcessingMetadata, options); + if (options.oneofs) + object.traceMetadata = "speechProcessingMetadata"; + } + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) + object.inputParameters = $root.google.protobuf.Struct.toObject(message.inputParameters, options); + return object; + }; + + /** + * Converts this TraceBlock to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @instance + * @returns {Object.} JSON object + */ + TraceBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TraceBlock + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TraceBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TraceBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TraceBlock"; + }; + + return TraceBlock; + })(); + + v3beta1.SpeechProcessingMetadata = (function() { + + /** + * Properties of a SpeechProcessingMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISpeechProcessingMetadata + * @property {string|null} [displayName] SpeechProcessingMetadata displayName + */ + + /** + * Constructs a new SpeechProcessingMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SpeechProcessingMetadata. + * @implements ISpeechProcessingMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata=} [properties] Properties to set + */ + function SpeechProcessingMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechProcessingMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @instance + */ + SpeechProcessingMetadata.prototype.displayName = ""; + + /** + * Creates a new SpeechProcessingMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata} SpeechProcessingMetadata instance + */ + SpeechProcessingMetadata.create = function create(properties) { + return new SpeechProcessingMetadata(properties); + }; + + /** + * Encodes the specified SpeechProcessingMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata} message SpeechProcessingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechProcessingMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified SpeechProcessingMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpeechProcessingMetadata} message SpeechProcessingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechProcessingMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata} SpeechProcessingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechProcessingMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechProcessingMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata} SpeechProcessingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechProcessingMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechProcessingMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechProcessingMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a SpeechProcessingMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata} SpeechProcessingMetadata + */ + SpeechProcessingMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata(); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a SpeechProcessingMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata} message SpeechProcessingMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechProcessingMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.displayName = ""; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this SpeechProcessingMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @instance + * @returns {Object.} JSON object + */ + SpeechProcessingMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechProcessingMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechProcessingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SpeechProcessingMetadata"; + }; + + return SpeechProcessingMetadata; + })(); + + v3beta1.PlaybookTraceMetadata = (function() { + + /** + * Properties of a PlaybookTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybookTraceMetadata + * @property {string|null} [playbook] PlaybookTraceMetadata playbook + * @property {string|null} [displayName] PlaybookTraceMetadata displayName + */ + + /** + * Constructs a new PlaybookTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PlaybookTraceMetadata. + * @implements IPlaybookTraceMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata=} [properties] Properties to set + */ + function PlaybookTraceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookTraceMetadata playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @instance + */ + PlaybookTraceMetadata.prototype.playbook = ""; + + /** + * PlaybookTraceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @instance + */ + PlaybookTraceMetadata.prototype.displayName = ""; + + /** + * Creates a new PlaybookTraceMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata} PlaybookTraceMetadata instance + */ + PlaybookTraceMetadata.create = function create(properties) { + return new PlaybookTraceMetadata(properties); + }; + + /** + * Encodes the specified PlaybookTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata} message PlaybookTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTraceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PlaybookTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTraceMetadata} message PlaybookTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTraceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata} PlaybookTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTraceMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookTraceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata} PlaybookTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTraceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookTraceMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookTraceMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a PlaybookTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata} PlaybookTraceMetadata + */ + PlaybookTraceMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a PlaybookTraceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata} message PlaybookTraceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookTraceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.displayName = ""; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PlaybookTraceMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @instance + * @returns {Object.} JSON object + */ + PlaybookTraceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookTraceMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookTraceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PlaybookTraceMetadata"; + }; + + return PlaybookTraceMetadata; + })(); + + v3beta1.FlowTraceMetadata = (function() { + + /** + * Properties of a FlowTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFlowTraceMetadata + * @property {string|null} [flow] FlowTraceMetadata flow + * @property {string|null} [displayName] FlowTraceMetadata displayName + */ + + /** + * Constructs a new FlowTraceMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FlowTraceMetadata. + * @implements IFlowTraceMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata=} [properties] Properties to set + */ + function FlowTraceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowTraceMetadata flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @instance + */ + FlowTraceMetadata.prototype.flow = ""; + + /** + * FlowTraceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @instance + */ + FlowTraceMetadata.prototype.displayName = ""; + + /** + * Creates a new FlowTraceMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata} FlowTraceMetadata instance + */ + FlowTraceMetadata.create = function create(properties) { + return new FlowTraceMetadata(properties); + }; + + /** + * Encodes the specified FlowTraceMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata} message FlowTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTraceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified FlowTraceMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTraceMetadata} message FlowTraceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTraceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata} FlowTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTraceMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowTraceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata} FlowTraceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTraceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowTraceMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowTraceMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a FlowTraceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata} FlowTraceMetadata + */ + FlowTraceMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata(); + if (object.flow != null) + message.flow = String(object.flow); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a FlowTraceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata} message FlowTraceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowTraceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = ""; + object.displayName = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this FlowTraceMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @instance + * @returns {Object.} JSON object + */ + FlowTraceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowTraceMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowTraceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FlowTraceMetadata"; + }; + + return FlowTraceMetadata; + })(); + + v3beta1.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IAction + * @property {google.cloud.dialogflow.cx.v3beta1.IUserUtterance|null} [userUtterance] Action userUtterance + * @property {google.cloud.dialogflow.cx.v3beta1.IEvent|null} [event] Action event + * @property {google.cloud.dialogflow.cx.v3beta1.IAgentUtterance|null} [agentUtterance] Action agentUtterance + * @property {google.cloud.dialogflow.cx.v3beta1.IToolUse|null} [toolUse] Action toolUse + * @property {google.cloud.dialogflow.cx.v3beta1.ILlmCall|null} [llmCall] Action llmCall + * @property {google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch|null} [intentMatch] Action intentMatch + * @property {google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate|null} [flowStateUpdate] Action flowStateUpdate + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation|null} [playbookInvocation] Action playbookInvocation + * @property {google.cloud.dialogflow.cx.v3beta1.IFlowInvocation|null} [flowInvocation] Action flowInvocation + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition|null} [playbookTransition] Action playbookTransition + * @property {google.cloud.dialogflow.cx.v3beta1.IFlowTransition|null} [flowTransition] Action flowTransition + * @property {google.cloud.dialogflow.cx.v3beta1.Action.ITTS|null} [tts] Action tts + * @property {google.cloud.dialogflow.cx.v3beta1.Action.ISTT|null} [stt] Action stt + * @property {string|null} [displayName] Action displayName + * @property {google.protobuf.ITimestamp|null} [startTime] Action startTime + * @property {google.protobuf.ITimestamp|null} [completeTime] Action completeTime + * @property {Array.|null} [subExecutionSteps] Action subExecutionSteps + * @property {google.cloud.dialogflow.cx.v3beta1.IStatus|null} [status] Action status + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IAction=} [properties] Properties to set + */ + function Action(properties) { + this.subExecutionSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action userUtterance. + * @member {google.cloud.dialogflow.cx.v3beta1.IUserUtterance|null|undefined} userUtterance + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.userUtterance = null; + + /** + * Action event. + * @member {google.cloud.dialogflow.cx.v3beta1.IEvent|null|undefined} event + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.event = null; + + /** + * Action agentUtterance. + * @member {google.cloud.dialogflow.cx.v3beta1.IAgentUtterance|null|undefined} agentUtterance + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.agentUtterance = null; + + /** + * Action toolUse. + * @member {google.cloud.dialogflow.cx.v3beta1.IToolUse|null|undefined} toolUse + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.toolUse = null; + + /** + * Action llmCall. + * @member {google.cloud.dialogflow.cx.v3beta1.ILlmCall|null|undefined} llmCall + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.llmCall = null; + + /** + * Action intentMatch. + * @member {google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch|null|undefined} intentMatch + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.intentMatch = null; + + /** + * Action flowStateUpdate. + * @member {google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate|null|undefined} flowStateUpdate + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.flowStateUpdate = null; + + /** + * Action playbookInvocation. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation|null|undefined} playbookInvocation + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.playbookInvocation = null; + + /** + * Action flowInvocation. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlowInvocation|null|undefined} flowInvocation + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.flowInvocation = null; + + /** + * Action playbookTransition. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition|null|undefined} playbookTransition + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.playbookTransition = null; + + /** + * Action flowTransition. + * @member {google.cloud.dialogflow.cx.v3beta1.IFlowTransition|null|undefined} flowTransition + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.flowTransition = null; + + /** + * Action tts. + * @member {google.cloud.dialogflow.cx.v3beta1.Action.ITTS|null|undefined} tts + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.tts = null; + + /** + * Action stt. + * @member {google.cloud.dialogflow.cx.v3beta1.Action.ISTT|null|undefined} stt + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.stt = null; + + /** + * Action displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.displayName = ""; + + /** + * Action startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.startTime = null; + + /** + * Action completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.completeTime = null; + + /** + * Action subExecutionSteps. + * @member {Array.} subExecutionSteps + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.subExecutionSteps = $util.emptyArray; + + /** + * Action status. + * @member {google.cloud.dialogflow.cx.v3beta1.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Action.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action action. + * @member {"userUtterance"|"event"|"agentUtterance"|"toolUse"|"llmCall"|"intentMatch"|"flowStateUpdate"|"playbookInvocation"|"flowInvocation"|"playbookTransition"|"flowTransition"|"tts"|"stt"|undefined} action + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + */ + Object.defineProperty(Action.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["userUtterance", "event", "agentUtterance", "toolUse", "llmCall", "intentMatch", "flowStateUpdate", "playbookInvocation", "flowInvocation", "playbookTransition", "flowTransition", "tts", "stt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userUtterance != null && Object.hasOwnProperty.call(message, "userUtterance")) + $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance.encode(message.userUtterance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agentUtterance != null && Object.hasOwnProperty.call(message, "agentUtterance")) + $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance.encode(message.agentUtterance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolUse != null && Object.hasOwnProperty.call(message, "toolUse")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.encode(message.toolUse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.playbookInvocation != null && Object.hasOwnProperty.call(message, "playbookInvocation")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.encode(message.playbookInvocation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.flowInvocation != null && Object.hasOwnProperty.call(message, "flowInvocation")) + $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation.encode(message.flowInvocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.dialogflow.cx.v3beta1.Event.encode(message.event, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.subExecutionSteps != null && message.subExecutionSteps.length) + for (var i = 0; i < message.subExecutionSteps.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Span.encode(message.subExecutionSteps[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.playbookTransition != null && Object.hasOwnProperty.call(message, "playbookTransition")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.encode(message.playbookTransition, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.flowTransition != null && Object.hasOwnProperty.call(message, "flowTransition")) + $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition.encode(message.flowTransition, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.llmCall != null && Object.hasOwnProperty.call(message, "llmCall")) + $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.encode(message.llmCall, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.displayName); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.dialogflow.cx.v3beta1.Status.encode(message.status, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.intentMatch != null && Object.hasOwnProperty.call(message, "intentMatch")) + $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.encode(message.intentMatch, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.flowStateUpdate != null && Object.hasOwnProperty.call(message, "flowStateUpdate")) + $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.encode(message.flowStateUpdate, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.tts != null && Object.hasOwnProperty.call(message, "tts")) + $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS.encode(message.tts, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.stt != null && Object.hasOwnProperty.call(message, "stt")) + $root.google.cloud.dialogflow.cx.v3beta1.Action.STT.encode(message.stt, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userUtterance = $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.event = $root.google.cloud.dialogflow.cx.v3beta1.Event.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.agentUtterance = $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.toolUse = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.llmCall = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.intentMatch = $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.flowStateUpdate = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.playbookInvocation = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.flowInvocation = $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.playbookTransition = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.flowTransition = $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.tts = $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.stt = $root.google.cloud.dialogflow.cx.v3beta1.Action.STT.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.displayName = reader.string(); + break; + } + case 8: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + if (!(message.subExecutionSteps && message.subExecutionSteps.length)) + message.subExecutionSteps = []; + message.subExecutionSteps.push($root.google.cloud.dialogflow.cx.v3beta1.Span.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 16: { + message.status = $root.google.cloud.dialogflow.cx.v3beta1.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.userUtterance != null && message.hasOwnProperty("userUtterance")) { + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance.verify(message.userUtterance, long + 1); + if (error) + return "userUtterance." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Event.verify(message.event, long + 1); + if (error) + return "event." + error; + } + } + if (message.agentUtterance != null && message.hasOwnProperty("agentUtterance")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance.verify(message.agentUtterance, long + 1); + if (error) + return "agentUtterance." + error; + } + } + if (message.toolUse != null && message.hasOwnProperty("toolUse")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.verify(message.toolUse, long + 1); + if (error) + return "toolUse." + error; + } + } + if (message.llmCall != null && message.hasOwnProperty("llmCall")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.verify(message.llmCall, long + 1); + if (error) + return "llmCall." + error; + } + } + if (message.intentMatch != null && message.hasOwnProperty("intentMatch")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.verify(message.intentMatch, long + 1); + if (error) + return "intentMatch." + error; + } + } + if (message.flowStateUpdate != null && message.hasOwnProperty("flowStateUpdate")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.verify(message.flowStateUpdate, long + 1); + if (error) + return "flowStateUpdate." + error; + } + } + if (message.playbookInvocation != null && message.hasOwnProperty("playbookInvocation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.verify(message.playbookInvocation, long + 1); + if (error) + return "playbookInvocation." + error; + } + } + if (message.flowInvocation != null && message.hasOwnProperty("flowInvocation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation.verify(message.flowInvocation, long + 1); + if (error) + return "flowInvocation." + error; + } + } + if (message.playbookTransition != null && message.hasOwnProperty("playbookTransition")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.verify(message.playbookTransition, long + 1); + if (error) + return "playbookTransition." + error; + } + } + if (message.flowTransition != null && message.hasOwnProperty("flowTransition")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition.verify(message.flowTransition, long + 1); + if (error) + return "flowTransition." + error; + } + } + if (message.tts != null && message.hasOwnProperty("tts")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS.verify(message.tts, long + 1); + if (error) + return "tts." + error; + } + } + if (message.stt != null && message.hasOwnProperty("stt")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.STT.verify(message.stt, long + 1); + if (error) + return "stt." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime, long + 1); + if (error) + return "completeTime." + error; + } + if (message.subExecutionSteps != null && message.hasOwnProperty("subExecutionSteps")) { + if (!Array.isArray(message.subExecutionSteps)) + return "subExecutionSteps: array expected"; + for (var i = 0; i < message.subExecutionSteps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Span.verify(message.subExecutionSteps[i], long + 1); + if (error) + return "subExecutionSteps." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action} Action + */ + Action.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Action(); + if (object.userUtterance != null) { + if (typeof object.userUtterance !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.userUtterance: object expected"); + message.userUtterance = $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance.fromObject(object.userUtterance, long + 1); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.event: object expected"); + message.event = $root.google.cloud.dialogflow.cx.v3beta1.Event.fromObject(object.event, long + 1); + } + if (object.agentUtterance != null) { + if (typeof object.agentUtterance !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.agentUtterance: object expected"); + message.agentUtterance = $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance.fromObject(object.agentUtterance, long + 1); + } + if (object.toolUse != null) { + if (typeof object.toolUse !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.toolUse: object expected"); + message.toolUse = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.fromObject(object.toolUse, long + 1); + } + if (object.llmCall != null) { + if (typeof object.llmCall !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.llmCall: object expected"); + message.llmCall = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.fromObject(object.llmCall, long + 1); + } + if (object.intentMatch != null) { + if (typeof object.intentMatch !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.intentMatch: object expected"); + message.intentMatch = $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.fromObject(object.intentMatch, long + 1); + } + if (object.flowStateUpdate != null) { + if (typeof object.flowStateUpdate !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.flowStateUpdate: object expected"); + message.flowStateUpdate = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.fromObject(object.flowStateUpdate, long + 1); + } + if (object.playbookInvocation != null) { + if (typeof object.playbookInvocation !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.playbookInvocation: object expected"); + message.playbookInvocation = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.fromObject(object.playbookInvocation, long + 1); + } + if (object.flowInvocation != null) { + if (typeof object.flowInvocation !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.flowInvocation: object expected"); + message.flowInvocation = $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation.fromObject(object.flowInvocation, long + 1); + } + if (object.playbookTransition != null) { + if (typeof object.playbookTransition !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.playbookTransition: object expected"); + message.playbookTransition = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.fromObject(object.playbookTransition, long + 1); + } + if (object.flowTransition != null) { + if (typeof object.flowTransition !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.flowTransition: object expected"); + message.flowTransition = $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition.fromObject(object.flowTransition, long + 1); + } + if (object.tts != null) { + if (typeof object.tts !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.tts: object expected"); + message.tts = $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS.fromObject(object.tts, long + 1); + } + if (object.stt != null) { + if (typeof object.stt !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.stt: object expected"); + message.stt = $root.google.cloud.dialogflow.cx.v3beta1.Action.STT.fromObject(object.stt, long + 1); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime, long + 1); + } + if (object.subExecutionSteps) { + if (!Array.isArray(object.subExecutionSteps)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.subExecutionSteps: array expected"); + message.subExecutionSteps = []; + for (var i = 0; i < object.subExecutionSteps.length; ++i) { + if (typeof object.subExecutionSteps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.subExecutionSteps: object expected"); + message.subExecutionSteps[i] = $root.google.cloud.dialogflow.cx.v3beta1.Span.fromObject(object.subExecutionSteps[i], long + 1); + } + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.status: object expected"); + message.status = $root.google.cloud.dialogflow.cx.v3beta1.Status.fromObject(object.status, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subExecutionSteps = []; + if (options.defaults) { + object.startTime = null; + object.completeTime = null; + object.displayName = ""; + object.status = null; + } + if (message.userUtterance != null && message.hasOwnProperty("userUtterance")) { + object.userUtterance = $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance.toObject(message.userUtterance, options); + if (options.oneofs) + object.action = "userUtterance"; + } + if (message.agentUtterance != null && message.hasOwnProperty("agentUtterance")) { + object.agentUtterance = $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance.toObject(message.agentUtterance, options); + if (options.oneofs) + object.action = "agentUtterance"; + } + if (message.toolUse != null && message.hasOwnProperty("toolUse")) { + object.toolUse = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.toObject(message.toolUse, options); + if (options.oneofs) + object.action = "toolUse"; + } + if (message.playbookInvocation != null && message.hasOwnProperty("playbookInvocation")) { + object.playbookInvocation = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.toObject(message.playbookInvocation, options); + if (options.oneofs) + object.action = "playbookInvocation"; + } + if (message.flowInvocation != null && message.hasOwnProperty("flowInvocation")) { + object.flowInvocation = $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation.toObject(message.flowInvocation, options); + if (options.oneofs) + object.action = "flowInvocation"; + } + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.dialogflow.cx.v3beta1.Event.toObject(message.event, options); + if (options.oneofs) + object.action = "event"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.subExecutionSteps && message.subExecutionSteps.length) { + object.subExecutionSteps = []; + for (var j = 0; j < message.subExecutionSteps.length; ++j) + object.subExecutionSteps[j] = $root.google.cloud.dialogflow.cx.v3beta1.Span.toObject(message.subExecutionSteps[j], options); + } + if (message.playbookTransition != null && message.hasOwnProperty("playbookTransition")) { + object.playbookTransition = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.toObject(message.playbookTransition, options); + if (options.oneofs) + object.action = "playbookTransition"; + } + if (message.flowTransition != null && message.hasOwnProperty("flowTransition")) { + object.flowTransition = $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition.toObject(message.flowTransition, options); + if (options.oneofs) + object.action = "flowTransition"; + } + if (message.llmCall != null && message.hasOwnProperty("llmCall")) { + object.llmCall = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.toObject(message.llmCall, options); + if (options.oneofs) + object.action = "llmCall"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.dialogflow.cx.v3beta1.Status.toObject(message.status, options); + if (message.intentMatch != null && message.hasOwnProperty("intentMatch")) { + object.intentMatch = $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.toObject(message.intentMatch, options); + if (options.oneofs) + object.action = "intentMatch"; + } + if (message.flowStateUpdate != null && message.hasOwnProperty("flowStateUpdate")) { + object.flowStateUpdate = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.toObject(message.flowStateUpdate, options); + if (options.oneofs) + object.action = "flowStateUpdate"; + } + if (message.tts != null && message.hasOwnProperty("tts")) { + object.tts = $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS.toObject(message.tts, options); + if (options.oneofs) + object.action = "tts"; + } + if (message.stt != null && message.hasOwnProperty("stt")) { + object.stt = $root.google.cloud.dialogflow.cx.v3beta1.Action.STT.toObject(message.stt, options); + if (options.oneofs) + object.action = "stt"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action"; + }; + + Action.IntentMatch = (function() { + + /** + * Properties of an IntentMatch. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @interface IIntentMatch + * @property {Array.|null} [matchedIntents] IntentMatch matchedIntents + */ + + /** + * Constructs a new IntentMatch. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @classdesc Represents an IntentMatch. + * @implements IIntentMatch + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch=} [properties] Properties to set + */ + function IntentMatch(properties) { + this.matchedIntents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentMatch matchedIntents. + * @member {Array.} matchedIntents + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @instance + */ + IntentMatch.prototype.matchedIntents = $util.emptyArray; + + /** + * Creates a new IntentMatch instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch} IntentMatch instance + */ + IntentMatch.create = function create(properties) { + return new IntentMatch(properties); + }; + + /** + * Encodes the specified IntentMatch message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch} message IntentMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchedIntents != null && message.matchedIntents.length) + for (var i = 0; i < message.matchedIntents.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.encode(message.matchedIntents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntentMatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IIntentMatch} message IntentMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch} IntentMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentMatch.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.matchedIntents && message.matchedIntents.length)) + message.matchedIntents = []; + message.matchedIntents.push($root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch} IntentMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentMatch message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentMatch.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.matchedIntents != null && message.hasOwnProperty("matchedIntents")) { + if (!Array.isArray(message.matchedIntents)) + return "matchedIntents: array expected"; + for (var i = 0; i < message.matchedIntents.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.verify(message.matchedIntents[i], long + 1); + if (error) + return "matchedIntents." + error; + } + } + return null; + }; + + /** + * Creates an IntentMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch} IntentMatch + */ + IntentMatch.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch(); + if (object.matchedIntents) { + if (!Array.isArray(object.matchedIntents)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.matchedIntents: array expected"); + message.matchedIntents = []; + for (var i = 0; i < object.matchedIntents.length; ++i) { + if (typeof object.matchedIntents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.matchedIntents: object expected"); + message.matchedIntents[i] = $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.fromObject(object.matchedIntents[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an IntentMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch} message IntentMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matchedIntents = []; + if (message.matchedIntents && message.matchedIntents.length) { + object.matchedIntents = []; + for (var j = 0; j < message.matchedIntents.length; ++j) + object.matchedIntents[j] = $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.toObject(message.matchedIntents[j], options); + } + return object; + }; + + /** + * Converts this IntentMatch to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @instance + * @returns {Object.} JSON object + */ + IntentMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentMatch + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch"; + }; + + IntentMatch.MatchedIntent = (function() { + + /** + * Properties of a MatchedIntent. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @interface IMatchedIntent + * @property {string|null} [intentId] MatchedIntent intentId + * @property {string|null} [displayName] MatchedIntent displayName + * @property {number|null} [score] MatchedIntent score + * @property {google.protobuf.IStruct|null} [generativeFallback] MatchedIntent generativeFallback + */ + + /** + * Constructs a new MatchedIntent. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch + * @classdesc Represents a MatchedIntent. + * @implements IMatchedIntent + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent=} [properties] Properties to set + */ + function MatchedIntent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchedIntent intentId. + * @member {string} intentId + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @instance + */ + MatchedIntent.prototype.intentId = ""; + + /** + * MatchedIntent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @instance + */ + MatchedIntent.prototype.displayName = ""; + + /** + * MatchedIntent score. + * @member {number} score + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @instance + */ + MatchedIntent.prototype.score = 0; + + /** + * MatchedIntent generativeFallback. + * @member {google.protobuf.IStruct|null|undefined} generativeFallback + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @instance + */ + MatchedIntent.prototype.generativeFallback = null; + + /** + * Creates a new MatchedIntent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent} MatchedIntent instance + */ + MatchedIntent.create = function create(properties) { + return new MatchedIntent(properties); + }; + + /** + * Encodes the specified MatchedIntent message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent} message MatchedIntent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchedIntent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intentId != null && Object.hasOwnProperty.call(message, "intentId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.intentId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + if (message.generativeFallback != null && Object.hasOwnProperty.call(message, "generativeFallback")) + $root.google.protobuf.Struct.encode(message.generativeFallback, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MatchedIntent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.IMatchedIntent} message MatchedIntent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchedIntent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchedIntent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent} MatchedIntent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchedIntent.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intentId = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.score = reader.float(); + break; + } + case 4: { + message.generativeFallback = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MatchedIntent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent} MatchedIntent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchedIntent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchedIntent message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchedIntent.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intentId != null && message.hasOwnProperty("intentId")) + if (!$util.isString(message.intentId)) + return "intentId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.generativeFallback != null && message.hasOwnProperty("generativeFallback")) { + var error = $root.google.protobuf.Struct.verify(message.generativeFallback, long + 1); + if (error) + return "generativeFallback." + error; + } + return null; + }; + + /** + * Creates a MatchedIntent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent} MatchedIntent + */ + MatchedIntent.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent(); + if (object.intentId != null) + message.intentId = String(object.intentId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.score != null) + message.score = Number(object.score); + if (object.generativeFallback != null) { + if (typeof object.generativeFallback !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent.generativeFallback: object expected"); + message.generativeFallback = $root.google.protobuf.Struct.fromObject(object.generativeFallback, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MatchedIntent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent} message MatchedIntent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchedIntent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intentId = ""; + object.displayName = ""; + object.score = 0; + object.generativeFallback = null; + } + if (message.intentId != null && message.hasOwnProperty("intentId")) + object.intentId = message.intentId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.generativeFallback != null && message.hasOwnProperty("generativeFallback")) + object.generativeFallback = $root.google.protobuf.Struct.toObject(message.generativeFallback, options); + return object; + }; + + /** + * Converts this MatchedIntent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @instance + * @returns {Object.} JSON object + */ + MatchedIntent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchedIntent + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchedIntent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action.IntentMatch.MatchedIntent"; + }; + + return MatchedIntent; + })(); + + return IntentMatch; + })(); + + Action.FlowStateUpdate = (function() { + + /** + * Properties of a FlowStateUpdate. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @interface IFlowStateUpdate + * @property {string|null} [eventType] FlowStateUpdate eventType + * @property {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState|null} [pageState] FlowStateUpdate pageState + * @property {google.protobuf.IStruct|null} [updatedParameters] FlowStateUpdate updatedParameters + * @property {string|null} [destination] FlowStateUpdate destination + * @property {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall|null} [functionCall] FlowStateUpdate functionCall + */ + + /** + * Constructs a new FlowStateUpdate. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @classdesc Represents a FlowStateUpdate. + * @implements IFlowStateUpdate + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate=} [properties] Properties to set + */ + function FlowStateUpdate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowStateUpdate eventType. + * @member {string} eventType + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @instance + */ + FlowStateUpdate.prototype.eventType = ""; + + /** + * FlowStateUpdate pageState. + * @member {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState|null|undefined} pageState + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @instance + */ + FlowStateUpdate.prototype.pageState = null; + + /** + * FlowStateUpdate updatedParameters. + * @member {google.protobuf.IStruct|null|undefined} updatedParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @instance + */ + FlowStateUpdate.prototype.updatedParameters = null; + + /** + * FlowStateUpdate destination. + * @member {string} destination + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @instance + */ + FlowStateUpdate.prototype.destination = ""; + + /** + * FlowStateUpdate functionCall. + * @member {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall|null|undefined} functionCall + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @instance + */ + FlowStateUpdate.prototype.functionCall = null; + + /** + * Creates a new FlowStateUpdate instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate} FlowStateUpdate instance + */ + FlowStateUpdate.create = function create(properties) { + return new FlowStateUpdate(properties); + }; + + /** + * Encodes the specified FlowStateUpdate message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate} message FlowStateUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowStateUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); + if (message.pageState != null && Object.hasOwnProperty.call(message, "pageState")) + $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.encode(message.pageState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updatedParameters != null && Object.hasOwnProperty.call(message, "updatedParameters")) + $root.google.protobuf.Struct.encode(message.updatedParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.destination); + if (message.functionCall != null && Object.hasOwnProperty.call(message, "functionCall")) + $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.encode(message.functionCall, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FlowStateUpdate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.IFlowStateUpdate} message FlowStateUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowStateUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowStateUpdate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate} FlowStateUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowStateUpdate.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventType = reader.string(); + break; + } + case 2: { + message.pageState = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updatedParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.destination = reader.string(); + break; + } + case 5: { + message.functionCall = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowStateUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate} FlowStateUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowStateUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowStateUpdate message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowStateUpdate.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + if (!$util.isString(message.eventType)) + return "eventType: string expected"; + if (message.pageState != null && message.hasOwnProperty("pageState")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.verify(message.pageState, long + 1); + if (error) + return "pageState." + error; + } + if (message.updatedParameters != null && message.hasOwnProperty("updatedParameters")) { + var error = $root.google.protobuf.Struct.verify(message.updatedParameters, long + 1); + if (error) + return "updatedParameters." + error; + } + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.functionCall != null && message.hasOwnProperty("functionCall")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.verify(message.functionCall, long + 1); + if (error) + return "functionCall." + error; + } + return null; + }; + + /** + * Creates a FlowStateUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate} FlowStateUpdate + */ + FlowStateUpdate.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate(); + if (object.eventType != null) + message.eventType = String(object.eventType); + if (object.pageState != null) { + if (typeof object.pageState !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.pageState: object expected"); + message.pageState = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.fromObject(object.pageState, long + 1); + } + if (object.updatedParameters != null) { + if (typeof object.updatedParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.updatedParameters: object expected"); + message.updatedParameters = $root.google.protobuf.Struct.fromObject(object.updatedParameters, long + 1); + } + if (object.destination != null) + message.destination = String(object.destination); + if (object.functionCall != null) { + if (typeof object.functionCall !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.functionCall: object expected"); + message.functionCall = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.fromObject(object.functionCall, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FlowStateUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate} message FlowStateUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowStateUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventType = ""; + object.pageState = null; + object.updatedParameters = null; + object.destination = ""; + object.functionCall = null; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = message.eventType; + if (message.pageState != null && message.hasOwnProperty("pageState")) + object.pageState = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.toObject(message.pageState, options); + if (message.updatedParameters != null && message.hasOwnProperty("updatedParameters")) + object.updatedParameters = $root.google.protobuf.Struct.toObject(message.updatedParameters, options); + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.functionCall != null && message.hasOwnProperty("functionCall")) + object.functionCall = $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.toObject(message.functionCall, options); + return object; + }; + + /** + * Converts this FlowStateUpdate to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @instance + * @returns {Object.} JSON object + */ + FlowStateUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowStateUpdate + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowStateUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate"; + }; + + FlowStateUpdate.PageState = (function() { + + /** + * Properties of a PageState. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @interface IPageState + * @property {string|null} [page] PageState page + * @property {string|null} [displayName] PageState displayName + * @property {string|null} [status] PageState status + */ + + /** + * Constructs a new PageState. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @classdesc Represents a PageState. + * @implements IPageState + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState=} [properties] Properties to set + */ + function PageState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageState page. + * @member {string} page + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @instance + */ + PageState.prototype.page = ""; + + /** + * PageState displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @instance + */ + PageState.prototype.displayName = ""; + + /** + * PageState status. + * @member {string} status + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @instance + */ + PageState.prototype.status = ""; + + /** + * Creates a new PageState instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState} PageState instance + */ + PageState.create = function create(properties) { + return new PageState(properties); + }; + + /** + * Encodes the specified PageState message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState} message PageState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.page); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.status); + return writer; + }; + + /** + * Encodes the specified PageState message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IPageState} message PageState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState} PageState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageState.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.status = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PageState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState} PageState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageState message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageState.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.page != null && message.hasOwnProperty("page")) + if (!$util.isString(message.page)) + return "page: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + return null; + }; + + /** + * Creates a PageState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState} PageState + */ + PageState.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState(); + if (object.page != null) + message.page = String(object.page); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.status != null) + message.status = String(object.status); + return message; + }; + + /** + * Creates a plain object from a PageState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState} message PageState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.page = ""; + object.displayName = ""; + object.status = ""; + } + if (message.page != null && message.hasOwnProperty("page")) + object.page = message.page; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + return object; + }; + + /** + * Converts this PageState to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @instance + * @returns {Object.} JSON object + */ + PageState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageState + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.PageState"; + }; + + return PageState; + })(); + + FlowStateUpdate.FunctionCall = (function() { + + /** + * Properties of a FunctionCall. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @interface IFunctionCall + * @property {string|null} [name] FunctionCall name + */ + + /** + * Constructs a new FunctionCall. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate + * @classdesc Represents a FunctionCall. + * @implements IFunctionCall + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall=} [properties] Properties to set + */ + function FunctionCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionCall name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @instance + */ + FunctionCall.prototype.name = ""; + + /** + * Creates a new FunctionCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall} FunctionCall instance + */ + FunctionCall.create = function create(properties) { + return new FunctionCall(properties); + }; + + /** + * Encodes the specified FunctionCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall} message FunctionCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionCall.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 FunctionCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.IFunctionCall} message FunctionCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall} FunctionCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionCall.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall} FunctionCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionCall message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionCall.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a FunctionCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall} FunctionCall + */ + FunctionCall.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FunctionCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall} message FunctionCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionCall.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 FunctionCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @instance + * @returns {Object.} JSON object + */ + FunctionCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionCall + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action.FlowStateUpdate.FunctionCall"; + }; + + return FunctionCall; + })(); + + return FlowStateUpdate; + })(); + + Action.TTS = (function() { + + /** + * Properties of a TTS. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @interface ITTS + */ + + /** + * Constructs a new TTS. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @classdesc Represents a TTS. + * @implements ITTS + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ITTS=} [properties] Properties to set + */ + function TTS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new TTS instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ITTS=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.TTS} TTS instance + */ + TTS.create = function create(properties) { + return new TTS(properties); + }; + + /** + * Encodes the specified TTS message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.TTS.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ITTS} message TTS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TTS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TTS message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.TTS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ITTS} message TTS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TTS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TTS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.TTS} TTS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TTS.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TTS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.TTS} TTS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TTS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TTS message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TTS.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a TTS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.TTS} TTS + */ + TTS.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.Action.TTS(); + }; + + /** + * Creates a plain object from a TTS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.TTS} message TTS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TTS.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TTS to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @instance + * @returns {Object.} JSON object + */ + TTS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TTS + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.TTS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TTS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action.TTS"; + }; + + return TTS; + })(); + + Action.STT = (function() { + + /** + * Properties of a STT. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @interface ISTT + */ + + /** + * Constructs a new STT. + * @memberof google.cloud.dialogflow.cx.v3beta1.Action + * @classdesc Represents a STT. + * @implements ISTT + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ISTT=} [properties] Properties to set + */ + function STT(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new STT instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ISTT=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.STT} STT instance + */ + STT.create = function create(properties) { + return new STT(properties); + }; + + /** + * Encodes the specified STT message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.STT.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ISTT} message STT message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + STT.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified STT message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Action.STT.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.ISTT} message STT message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + STT.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a STT message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.STT} STT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + STT.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Action.STT(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a STT message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.STT} STT + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + STT.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a STT message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + STT.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a STT message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Action.STT} STT + */ + STT.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Action.STT) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.Action.STT(); + }; + + /** + * Creates a plain object from a STT message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Action.STT} message STT + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + STT.toObject = function toObject() { + return {}; + }; + + /** + * Converts this STT to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @instance + * @returns {Object.} JSON object + */ + STT.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for STT + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Action.STT + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + STT.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Action.STT"; + }; + + return STT; + })(); + + return Action; + })(); + + v3beta1.UserUtterance = (function() { + + /** + * Properties of a UserUtterance. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUserUtterance + * @property {string|null} [text] UserUtterance text + * @property {Array.|null} [audioTokens] UserUtterance audioTokens + * @property {Uint8Array|null} [audio] UserUtterance audio + */ + + /** + * Constructs a new UserUtterance. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a UserUtterance. + * @implements IUserUtterance + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUserUtterance=} [properties] Properties to set + */ + function UserUtterance(properties) { + this.audioTokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserUtterance text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @instance + */ + UserUtterance.prototype.text = ""; + + /** + * UserUtterance audioTokens. + * @member {Array.} audioTokens + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @instance + */ + UserUtterance.prototype.audioTokens = $util.emptyArray; + + /** + * UserUtterance audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @instance + */ + UserUtterance.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new UserUtterance instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUserUtterance=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UserUtterance} UserUtterance instance + */ + UserUtterance.create = function create(properties) { + return new UserUtterance(properties); + }; + + /** + * Encodes the specified UserUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UserUtterance.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUserUtterance} message UserUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserUtterance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.audioTokens != null && message.audioTokens.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.audioTokens.length; ++i) + writer.int32(message.audioTokens[i]); + writer.ldelim(); + } + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified UserUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UserUtterance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUserUtterance} message UserUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserUtterance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserUtterance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UserUtterance} UserUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserUtterance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.audioTokens && message.audioTokens.length)) + message.audioTokens = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.audioTokens.push(reader.int32()); + } else + message.audioTokens.push(reader.int32()); + break; + } + case 3: { + message.audio = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UserUtterance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UserUtterance} UserUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserUtterance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserUtterance message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserUtterance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.audioTokens != null && message.hasOwnProperty("audioTokens")) { + if (!Array.isArray(message.audioTokens)) + return "audioTokens: array expected"; + for (var i = 0; i < message.audioTokens.length; ++i) + if (!$util.isInteger(message.audioTokens[i])) + return "audioTokens: integer[] expected"; + } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates a UserUtterance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UserUtterance} UserUtterance + */ + UserUtterance.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UserUtterance(); + if (object.text != null) + message.text = String(object.text); + if (object.audioTokens) { + if (!Array.isArray(object.audioTokens)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UserUtterance.audioTokens: array expected"); + message.audioTokens = []; + for (var i = 0; i < object.audioTokens.length; ++i) + message.audioTokens[i] = object.audioTokens[i] | 0; + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from a UserUtterance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UserUtterance} message UserUtterance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserUtterance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.audioTokens = []; + if (options.defaults) { + object.text = ""; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.audioTokens && message.audioTokens.length) { + object.audioTokens = []; + for (var j = 0; j < message.audioTokens.length; ++j) + object.audioTokens[j] = message.audioTokens[j]; + } + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this UserUtterance to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @instance + * @returns {Object.} JSON object + */ + UserUtterance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserUtterance + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UserUtterance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserUtterance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UserUtterance"; + }; + + return UserUtterance; + })(); + + v3beta1.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IEvent + * @property {string|null} [event] Event event + * @property {string|null} [text] Event text + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IEvent=} [properties] Properties to set + */ + function Event(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @instance + */ + Event.prototype.event = ""; + + /** + * Event text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @instance + */ + Event.prototype.text = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Event payload. + * @member {"text"|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @instance + */ + Object.defineProperty(Event.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEvent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.text != null && message.hasOwnProperty("text")) { + properties.payload = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Event} Event + */ + Event.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Event) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Event(); + if (object.event != null) + message.event = String(object.event); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.event = ""; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.payload = "text"; + } + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Event"; + }; + + return Event; + })(); + + v3beta1.AgentUtterance = (function() { + + /** + * Properties of an AgentUtterance. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IAgentUtterance + * @property {string|null} [text] AgentUtterance text + * @property {boolean|null} [requireGeneration] AgentUtterance requireGeneration + */ + + /** + * Constructs a new AgentUtterance. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an AgentUtterance. + * @implements IAgentUtterance + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentUtterance=} [properties] Properties to set + */ + function AgentUtterance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentUtterance text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @instance + */ + AgentUtterance.prototype.text = ""; + + /** + * AgentUtterance requireGeneration. + * @member {boolean} requireGeneration + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @instance + */ + AgentUtterance.prototype.requireGeneration = false; + + /** + * Creates a new AgentUtterance instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentUtterance=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentUtterance} AgentUtterance instance + */ + AgentUtterance.create = function create(properties) { + return new AgentUtterance(properties); + }; + + /** + * Encodes the specified AgentUtterance message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentUtterance.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentUtterance} message AgentUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentUtterance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.requireGeneration != null && Object.hasOwnProperty.call(message, "requireGeneration")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.requireGeneration); + return writer; + }; + + /** + * Encodes the specified AgentUtterance message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.AgentUtterance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IAgentUtterance} message AgentUtterance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentUtterance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentUtterance} AgentUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentUtterance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.requireGeneration = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AgentUtterance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentUtterance} AgentUtterance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentUtterance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentUtterance message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentUtterance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.requireGeneration != null && message.hasOwnProperty("requireGeneration")) + if (typeof message.requireGeneration !== "boolean") + return "requireGeneration: boolean expected"; + return null; + }; + + /** + * Creates an AgentUtterance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.AgentUtterance} AgentUtterance + */ + AgentUtterance.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.AgentUtterance(); + if (object.text != null) + message.text = String(object.text); + if (object.requireGeneration != null) + message.requireGeneration = Boolean(object.requireGeneration); + return message; + }; + + /** + * Creates a plain object from an AgentUtterance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.AgentUtterance} message AgentUtterance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentUtterance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.requireGeneration = false; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.requireGeneration != null && message.hasOwnProperty("requireGeneration")) + object.requireGeneration = message.requireGeneration; + return object; + }; + + /** + * Converts this AgentUtterance to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @instance + * @returns {Object.} JSON object + */ + AgentUtterance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentUtterance + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.AgentUtterance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentUtterance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.AgentUtterance"; + }; + + return AgentUtterance; + })(); + + v3beta1.ToolUse = (function() { + + /** + * Properties of a ToolUse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IToolUse + * @property {string|null} [tool] ToolUse tool + * @property {string|null} [displayName] ToolUse displayName + * @property {string|null} [action] ToolUse action + * @property {google.protobuf.IStruct|null} [inputActionParameters] ToolUse inputActionParameters + * @property {google.protobuf.IStruct|null} [outputActionParameters] ToolUse outputActionParameters + * @property {google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace|null} [dataStoreToolTrace] ToolUse dataStoreToolTrace + * @property {google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace|null} [webhookToolTrace] ToolUse webhookToolTrace + */ + + /** + * Constructs a new ToolUse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ToolUse. + * @implements IToolUse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IToolUse=} [properties] Properties to set + */ + function ToolUse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolUse tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + ToolUse.prototype.tool = ""; + + /** + * ToolUse displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + ToolUse.prototype.displayName = ""; + + /** + * ToolUse action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + ToolUse.prototype.action = ""; + + /** + * ToolUse inputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} inputActionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + ToolUse.prototype.inputActionParameters = null; + + /** + * ToolUse outputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} outputActionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + ToolUse.prototype.outputActionParameters = null; + + /** + * ToolUse dataStoreToolTrace. + * @member {google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace|null|undefined} dataStoreToolTrace + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + ToolUse.prototype.dataStoreToolTrace = null; + + /** + * ToolUse webhookToolTrace. + * @member {google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace|null|undefined} webhookToolTrace + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + ToolUse.prototype.webhookToolTrace = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolUse ToolTrace. + * @member {"dataStoreToolTrace"|"webhookToolTrace"|undefined} ToolTrace + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + */ + Object.defineProperty(ToolUse.prototype, "ToolTrace", { + get: $util.oneOfGetter($oneOfFields = ["dataStoreToolTrace", "webhookToolTrace"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolUse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolUse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse} ToolUse instance + */ + ToolUse.create = function create(properties) { + return new ToolUse(properties); + }; + + /** + * Encodes the specified ToolUse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolUse} message ToolUse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolUse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.inputActionParameters != null && Object.hasOwnProperty.call(message, "inputActionParameters")) + $root.google.protobuf.Struct.encode(message.inputActionParameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputActionParameters != null && Object.hasOwnProperty.call(message, "outputActionParameters")) + $root.google.protobuf.Struct.encode(message.outputActionParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dataStoreToolTrace != null && Object.hasOwnProperty.call(message, "dataStoreToolTrace")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.encode(message.dataStoreToolTrace, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + if (message.webhookToolTrace != null && Object.hasOwnProperty.call(message, "webhookToolTrace")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.encode(message.webhookToolTrace, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolUse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolUse} message ToolUse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolUse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolUse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse} ToolUse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolUse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolUse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 5: { + message.inputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.outputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.dataStoreToolTrace = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.webhookToolTrace = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolUse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse} ToolUse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolUse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolUse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolUse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputActionParameters, long + 1); + if (error) + return "inputActionParameters." + error; + } + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.outputActionParameters, long + 1); + if (error) + return "outputActionParameters." + error; + } + if (message.dataStoreToolTrace != null && message.hasOwnProperty("dataStoreToolTrace")) { + properties.ToolTrace = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.verify(message.dataStoreToolTrace, long + 1); + if (error) + return "dataStoreToolTrace." + error; + } + } + if (message.webhookToolTrace != null && message.hasOwnProperty("webhookToolTrace")) { + if (properties.ToolTrace === 1) + return "ToolTrace: multiple values"; + properties.ToolTrace = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.verify(message.webhookToolTrace, long + 1); + if (error) + return "webhookToolTrace." + error; + } + } + return null; + }; + + /** + * Creates a ToolUse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse} ToolUse + */ + ToolUse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolUse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolUse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.action != null) + message.action = String(object.action); + if (object.inputActionParameters != null) { + if (typeof object.inputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.inputActionParameters: object expected"); + message.inputActionParameters = $root.google.protobuf.Struct.fromObject(object.inputActionParameters, long + 1); + } + if (object.outputActionParameters != null) { + if (typeof object.outputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.outputActionParameters: object expected"); + message.outputActionParameters = $root.google.protobuf.Struct.fromObject(object.outputActionParameters, long + 1); + } + if (object.dataStoreToolTrace != null) { + if (typeof object.dataStoreToolTrace !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.dataStoreToolTrace: object expected"); + message.dataStoreToolTrace = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.fromObject(object.dataStoreToolTrace, long + 1); + } + if (object.webhookToolTrace != null) { + if (typeof object.webhookToolTrace !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.webhookToolTrace: object expected"); + message.webhookToolTrace = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.fromObject(object.webhookToolTrace, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolUse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse} message ToolUse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolUse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + object.inputActionParameters = null; + object.outputActionParameters = null; + object.displayName = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) + object.inputActionParameters = $root.google.protobuf.Struct.toObject(message.inputActionParameters, options); + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) + object.outputActionParameters = $root.google.protobuf.Struct.toObject(message.outputActionParameters, options); + if (message.dataStoreToolTrace != null && message.hasOwnProperty("dataStoreToolTrace")) { + object.dataStoreToolTrace = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.toObject(message.dataStoreToolTrace, options); + if (options.oneofs) + object.ToolTrace = "dataStoreToolTrace"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.webhookToolTrace != null && message.hasOwnProperty("webhookToolTrace")) { + object.webhookToolTrace = $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.toObject(message.webhookToolTrace, options); + if (options.oneofs) + object.ToolTrace = "webhookToolTrace"; + } + return object; + }; + + /** + * Converts this ToolUse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @instance + * @returns {Object.} JSON object + */ + ToolUse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolUse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolUse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolUse"; + }; + + ToolUse.DataStoreToolTrace = (function() { + + /** + * Properties of a DataStoreToolTrace. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @interface IDataStoreToolTrace + * @property {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null} [dataStoreConnectionSignals] DataStoreToolTrace dataStoreConnectionSignals + */ + + /** + * Constructs a new DataStoreToolTrace. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @classdesc Represents a DataStoreToolTrace. + * @implements IDataStoreToolTrace + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace=} [properties] Properties to set + */ + function DataStoreToolTrace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreToolTrace dataStoreConnectionSignals. + * @member {google.cloud.dialogflow.cx.v3beta1.IDataStoreConnectionSignals|null|undefined} dataStoreConnectionSignals + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @instance + */ + DataStoreToolTrace.prototype.dataStoreConnectionSignals = null; + + /** + * Creates a new DataStoreToolTrace instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace} DataStoreToolTrace instance + */ + DataStoreToolTrace.create = function create(properties) { + return new DataStoreToolTrace(properties); + }; + + /** + * Encodes the specified DataStoreToolTrace message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace} message DataStoreToolTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreToolTrace.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStoreConnectionSignals != null && Object.hasOwnProperty.call(message, "dataStoreConnectionSignals")) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.encode(message.dataStoreConnectionSignals, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreToolTrace message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IDataStoreToolTrace} message DataStoreToolTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreToolTrace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreToolTrace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace} DataStoreToolTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreToolTrace.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreToolTrace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace} DataStoreToolTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreToolTrace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreToolTrace message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreToolTrace.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStoreConnectionSignals != null && message.hasOwnProperty("dataStoreConnectionSignals")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.verify(message.dataStoreConnectionSignals, long + 1); + if (error) + return "dataStoreConnectionSignals." + error; + } + return null; + }; + + /** + * Creates a DataStoreToolTrace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace} DataStoreToolTrace + */ + DataStoreToolTrace.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace(); + if (object.dataStoreConnectionSignals != null) { + if (typeof object.dataStoreConnectionSignals !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace.dataStoreConnectionSignals: object expected"); + message.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.fromObject(object.dataStoreConnectionSignals, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreToolTrace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace} message DataStoreToolTrace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreToolTrace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataStoreConnectionSignals = null; + if (message.dataStoreConnectionSignals != null && message.hasOwnProperty("dataStoreConnectionSignals")) + object.dataStoreConnectionSignals = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnectionSignals.toObject(message.dataStoreConnectionSignals, options); + return object; + }; + + /** + * Converts this DataStoreToolTrace to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @instance + * @returns {Object.} JSON object + */ + DataStoreToolTrace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreToolTrace + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreToolTrace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolUse.DataStoreToolTrace"; + }; + + return DataStoreToolTrace; + })(); + + ToolUse.WebhookToolTrace = (function() { + + /** + * Properties of a WebhookToolTrace. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @interface IWebhookToolTrace + * @property {string|null} [webhookTag] WebhookToolTrace webhookTag + * @property {string|null} [webhookUri] WebhookToolTrace webhookUri + */ + + /** + * Constructs a new WebhookToolTrace. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse + * @classdesc Represents a WebhookToolTrace. + * @implements IWebhookToolTrace + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace=} [properties] Properties to set + */ + function WebhookToolTrace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookToolTrace webhookTag. + * @member {string} webhookTag + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @instance + */ + WebhookToolTrace.prototype.webhookTag = ""; + + /** + * WebhookToolTrace webhookUri. + * @member {string} webhookUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @instance + */ + WebhookToolTrace.prototype.webhookUri = ""; + + /** + * Creates a new WebhookToolTrace instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace} WebhookToolTrace instance + */ + WebhookToolTrace.create = function create(properties) { + return new WebhookToolTrace(properties); + }; + + /** + * Encodes the specified WebhookToolTrace message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace} message WebhookToolTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookToolTrace.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhookTag != null && Object.hasOwnProperty.call(message, "webhookTag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.webhookTag); + if (message.webhookUri != null && Object.hasOwnProperty.call(message, "webhookUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.webhookUri); + return writer; + }; + + /** + * Encodes the specified WebhookToolTrace message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.IWebhookToolTrace} message WebhookToolTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookToolTrace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookToolTrace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace} WebhookToolTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookToolTrace.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.webhookTag = reader.string(); + break; + } + case 2: { + message.webhookUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookToolTrace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace} WebhookToolTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookToolTrace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookToolTrace message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookToolTrace.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.webhookTag != null && message.hasOwnProperty("webhookTag")) + if (!$util.isString(message.webhookTag)) + return "webhookTag: string expected"; + if (message.webhookUri != null && message.hasOwnProperty("webhookUri")) + if (!$util.isString(message.webhookUri)) + return "webhookUri: string expected"; + return null; + }; + + /** + * Creates a WebhookToolTrace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace} WebhookToolTrace + */ + WebhookToolTrace.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace(); + if (object.webhookTag != null) + message.webhookTag = String(object.webhookTag); + if (object.webhookUri != null) + message.webhookUri = String(object.webhookUri); + return message; + }; + + /** + * Creates a plain object from a WebhookToolTrace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace} message WebhookToolTrace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookToolTrace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.webhookTag = ""; + object.webhookUri = ""; + } + if (message.webhookTag != null && message.hasOwnProperty("webhookTag")) + object.webhookTag = message.webhookTag; + if (message.webhookUri != null && message.hasOwnProperty("webhookUri")) + object.webhookUri = message.webhookUri; + return object; + }; + + /** + * Converts this WebhookToolTrace to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @instance + * @returns {Object.} JSON object + */ + WebhookToolTrace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookToolTrace + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookToolTrace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolUse.WebhookToolTrace"; + }; + + return WebhookToolTrace; + })(); + + return ToolUse; + })(); + + v3beta1.LlmCall = (function() { + + /** + * Properties of a LlmCall. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ILlmCall + * @property {Array.|null} [retrievedExamples] LlmCall retrievedExamples + * @property {google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount|null} [tokenCount] LlmCall tokenCount + * @property {string|null} [model] LlmCall model + * @property {number|null} [temperature] LlmCall temperature + */ + + /** + * Constructs a new LlmCall. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a LlmCall. + * @implements ILlmCall + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmCall=} [properties] Properties to set + */ + function LlmCall(properties) { + this.retrievedExamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmCall retrievedExamples. + * @member {Array.} retrievedExamples + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @instance + */ + LlmCall.prototype.retrievedExamples = $util.emptyArray; + + /** + * LlmCall tokenCount. + * @member {google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount|null|undefined} tokenCount + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @instance + */ + LlmCall.prototype.tokenCount = null; + + /** + * LlmCall model. + * @member {string} model + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @instance + */ + LlmCall.prototype.model = ""; + + /** + * LlmCall temperature. + * @member {number} temperature + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @instance + */ + LlmCall.prototype.temperature = 0; + + /** + * Creates a new LlmCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall} LlmCall instance + */ + LlmCall.create = function create(properties) { + return new LlmCall(properties); + }; + + /** + * Encodes the specified LlmCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmCall} message LlmCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retrievedExamples != null && message.retrievedExamples.length) + for (var i = 0; i < message.retrievedExamples.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.encode(message.retrievedExamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.encode(message.tokenCount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.temperature); + return writer; + }; + + /** + * Encodes the specified LlmCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILlmCall} message LlmCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall} LlmCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCall.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.retrievedExamples && message.retrievedExamples.length)) + message.retrievedExamples = []; + message.retrievedExamples.push($root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.tokenCount = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.model = reader.string(); + break; + } + case 4: { + message.temperature = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LlmCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall} LlmCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmCall message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmCall.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.retrievedExamples != null && message.hasOwnProperty("retrievedExamples")) { + if (!Array.isArray(message.retrievedExamples)) + return "retrievedExamples: array expected"; + for (var i = 0; i < message.retrievedExamples.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.verify(message.retrievedExamples[i], long + 1); + if (error) + return "retrievedExamples." + error; + } + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.verify(message.tokenCount, long + 1); + if (error) + return "tokenCount." + error; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.temperature != null && message.hasOwnProperty("temperature")) + if (typeof message.temperature !== "number") + return "temperature: number expected"; + return null; + }; + + /** + * Creates a LlmCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall} LlmCall + */ + LlmCall.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LlmCall) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmCall(); + if (object.retrievedExamples) { + if (!Array.isArray(object.retrievedExamples)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.LlmCall.retrievedExamples: array expected"); + message.retrievedExamples = []; + for (var i = 0; i < object.retrievedExamples.length; ++i) { + if (typeof object.retrievedExamples[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.LlmCall.retrievedExamples: object expected"); + message.retrievedExamples[i] = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.fromObject(object.retrievedExamples[i], long + 1); + } + } + if (object.tokenCount != null) { + if (typeof object.tokenCount !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.LlmCall.tokenCount: object expected"); + message.tokenCount = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.fromObject(object.tokenCount, long + 1); + } + if (object.model != null) + message.model = String(object.model); + if (object.temperature != null) + message.temperature = Number(object.temperature); + return message; + }; + + /** + * Creates a plain object from a LlmCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall} message LlmCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.retrievedExamples = []; + if (options.defaults) { + object.tokenCount = null; + object.model = ""; + object.temperature = 0; + } + if (message.retrievedExamples && message.retrievedExamples.length) { + object.retrievedExamples = []; + for (var j = 0; j < message.retrievedExamples.length; ++j) + object.retrievedExamples[j] = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.toObject(message.retrievedExamples[j], options); + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.toObject(message.tokenCount, options); + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.temperature != null && message.hasOwnProperty("temperature")) + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + return object; + }; + + /** + * Converts this LlmCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @instance + * @returns {Object.} JSON object + */ + LlmCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmCall + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LlmCall"; + }; + + LlmCall.RetrievedExample = (function() { + + /** + * Properties of a RetrievedExample. + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @interface IRetrievedExample + * @property {string|null} [exampleId] RetrievedExample exampleId + * @property {string|null} [exampleDisplayName] RetrievedExample exampleDisplayName + * @property {google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy|null} [retrievalStrategy] RetrievedExample retrievalStrategy + * @property {string|null} [matchedRetrievalLabel] RetrievedExample matchedRetrievalLabel + */ + + /** + * Constructs a new RetrievedExample. + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @classdesc Represents a RetrievedExample. + * @implements IRetrievedExample + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample=} [properties] Properties to set + */ + function RetrievedExample(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrievedExample exampleId. + * @member {string} exampleId + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @instance + */ + RetrievedExample.prototype.exampleId = ""; + + /** + * RetrievedExample exampleDisplayName. + * @member {string} exampleDisplayName + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @instance + */ + RetrievedExample.prototype.exampleDisplayName = ""; + + /** + * RetrievedExample retrievalStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy} retrievalStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @instance + */ + RetrievedExample.prototype.retrievalStrategy = 0; + + /** + * RetrievedExample matchedRetrievalLabel. + * @member {string} matchedRetrievalLabel + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @instance + */ + RetrievedExample.prototype.matchedRetrievalLabel = ""; + + /** + * Creates a new RetrievedExample instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample} RetrievedExample instance + */ + RetrievedExample.create = function create(properties) { + return new RetrievedExample(properties); + }; + + /** + * Encodes the specified RetrievedExample message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample} message RetrievedExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievedExample.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exampleId != null && Object.hasOwnProperty.call(message, "exampleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.exampleId); + if (message.exampleDisplayName != null && Object.hasOwnProperty.call(message, "exampleDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exampleDisplayName); + if (message.retrievalStrategy != null && Object.hasOwnProperty.call(message, "retrievalStrategy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.retrievalStrategy); + if (message.matchedRetrievalLabel != null && Object.hasOwnProperty.call(message, "matchedRetrievalLabel")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.matchedRetrievalLabel); + return writer; + }; + + /** + * Encodes the specified RetrievedExample message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.IRetrievedExample} message RetrievedExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievedExample.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrievedExample message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample} RetrievedExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievedExample.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.exampleId = reader.string(); + break; + } + case 2: { + message.exampleDisplayName = reader.string(); + break; + } + case 3: { + message.retrievalStrategy = reader.int32(); + break; + } + case 14: { + message.matchedRetrievalLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RetrievedExample message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample} RetrievedExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievedExample.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrievedExample message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrievedExample.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.exampleId != null && message.hasOwnProperty("exampleId")) + if (!$util.isString(message.exampleId)) + return "exampleId: string expected"; + if (message.exampleDisplayName != null && message.hasOwnProperty("exampleDisplayName")) + if (!$util.isString(message.exampleDisplayName)) + return "exampleDisplayName: string expected"; + if (message.retrievalStrategy != null && message.hasOwnProperty("retrievalStrategy")) + switch (message.retrievalStrategy) { + default: + return "retrievalStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.matchedRetrievalLabel != null && message.hasOwnProperty("matchedRetrievalLabel")) + if (!$util.isString(message.matchedRetrievalLabel)) + return "matchedRetrievalLabel: string expected"; + return null; + }; + + /** + * Creates a RetrievedExample message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample} RetrievedExample + */ + RetrievedExample.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample(); + if (object.exampleId != null) + message.exampleId = String(object.exampleId); + if (object.exampleDisplayName != null) + message.exampleDisplayName = String(object.exampleDisplayName); + switch (object.retrievalStrategy) { + default: + if (typeof object.retrievalStrategy === "number") { + message.retrievalStrategy = object.retrievalStrategy; + break; + } + break; + case "RETRIEVAL_STRATEGY_UNSPECIFIED": + case 0: + message.retrievalStrategy = 0; + break; + case "DEFAULT": + case 1: + message.retrievalStrategy = 1; + break; + case "STATIC": + case 2: + message.retrievalStrategy = 2; + break; + case "NEVER": + case 3: + message.retrievalStrategy = 3; + break; + } + if (object.matchedRetrievalLabel != null) + message.matchedRetrievalLabel = String(object.matchedRetrievalLabel); + return message; + }; + + /** + * Creates a plain object from a RetrievedExample message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample} message RetrievedExample + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrievedExample.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.exampleId = ""; + object.exampleDisplayName = ""; + object.retrievalStrategy = options.enums === String ? "RETRIEVAL_STRATEGY_UNSPECIFIED" : 0; + object.matchedRetrievalLabel = ""; + } + if (message.exampleId != null && message.hasOwnProperty("exampleId")) + object.exampleId = message.exampleId; + if (message.exampleDisplayName != null && message.hasOwnProperty("exampleDisplayName")) + object.exampleDisplayName = message.exampleDisplayName; + if (message.retrievalStrategy != null && message.hasOwnProperty("retrievalStrategy")) + object.retrievalStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy[message.retrievalStrategy] === undefined ? message.retrievalStrategy : $root.google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy[message.retrievalStrategy] : message.retrievalStrategy; + if (message.matchedRetrievalLabel != null && message.hasOwnProperty("matchedRetrievalLabel")) + object.matchedRetrievalLabel = message.matchedRetrievalLabel; + return object; + }; + + /** + * Converts this RetrievedExample to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @instance + * @returns {Object.} JSON object + */ + RetrievedExample.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrievedExample + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrievedExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LlmCall.RetrievedExample"; + }; + + return RetrievedExample; + })(); + + LlmCall.TokenCount = (function() { + + /** + * Properties of a TokenCount. + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @interface ITokenCount + * @property {number|Long|null} [totalInputTokenCount] TokenCount totalInputTokenCount + * @property {number|Long|null} [conversationContextTokenCount] TokenCount conversationContextTokenCount + * @property {number|Long|null} [exampleTokenCount] TokenCount exampleTokenCount + * @property {number|Long|null} [totalOutputTokenCount] TokenCount totalOutputTokenCount + */ + + /** + * Constructs a new TokenCount. + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall + * @classdesc Represents a TokenCount. + * @implements ITokenCount + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount=} [properties] Properties to set + */ + function TokenCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenCount totalInputTokenCount. + * @member {number|Long} totalInputTokenCount + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @instance + */ + TokenCount.prototype.totalInputTokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TokenCount conversationContextTokenCount. + * @member {number|Long} conversationContextTokenCount + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @instance + */ + TokenCount.prototype.conversationContextTokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TokenCount exampleTokenCount. + * @member {number|Long} exampleTokenCount + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @instance + */ + TokenCount.prototype.exampleTokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TokenCount totalOutputTokenCount. + * @member {number|Long} totalOutputTokenCount + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @instance + */ + TokenCount.prototype.totalOutputTokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenCount instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount} TokenCount instance + */ + TokenCount.create = function create(properties) { + return new TokenCount(properties); + }; + + /** + * Encodes the specified TokenCount message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount} message TokenCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalInputTokenCount != null && Object.hasOwnProperty.call(message, "totalInputTokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalInputTokenCount); + if (message.conversationContextTokenCount != null && Object.hasOwnProperty.call(message, "conversationContextTokenCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.conversationContextTokenCount); + if (message.exampleTokenCount != null && Object.hasOwnProperty.call(message, "exampleTokenCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.exampleTokenCount); + if (message.totalOutputTokenCount != null && Object.hasOwnProperty.call(message, "totalOutputTokenCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalOutputTokenCount); + return writer; + }; + + /** + * Encodes the specified TokenCount message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.ITokenCount} message TokenCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount} TokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.totalInputTokenCount = reader.int64(); + break; + } + case 3: { + message.conversationContextTokenCount = reader.int64(); + break; + } + case 4: { + message.exampleTokenCount = reader.int64(); + break; + } + case 5: { + message.totalOutputTokenCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TokenCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount} TokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenCount message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.totalInputTokenCount != null && message.hasOwnProperty("totalInputTokenCount")) + if (!$util.isInteger(message.totalInputTokenCount) && !(message.totalInputTokenCount && $util.isInteger(message.totalInputTokenCount.low) && $util.isInteger(message.totalInputTokenCount.high))) + return "totalInputTokenCount: integer|Long expected"; + if (message.conversationContextTokenCount != null && message.hasOwnProperty("conversationContextTokenCount")) + if (!$util.isInteger(message.conversationContextTokenCount) && !(message.conversationContextTokenCount && $util.isInteger(message.conversationContextTokenCount.low) && $util.isInteger(message.conversationContextTokenCount.high))) + return "conversationContextTokenCount: integer|Long expected"; + if (message.exampleTokenCount != null && message.hasOwnProperty("exampleTokenCount")) + if (!$util.isInteger(message.exampleTokenCount) && !(message.exampleTokenCount && $util.isInteger(message.exampleTokenCount.low) && $util.isInteger(message.exampleTokenCount.high))) + return "exampleTokenCount: integer|Long expected"; + if (message.totalOutputTokenCount != null && message.hasOwnProperty("totalOutputTokenCount")) + if (!$util.isInteger(message.totalOutputTokenCount) && !(message.totalOutputTokenCount && $util.isInteger(message.totalOutputTokenCount.low) && $util.isInteger(message.totalOutputTokenCount.high))) + return "totalOutputTokenCount: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount} TokenCount + */ + TokenCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount(); + if (object.totalInputTokenCount != null) + if ($util.Long) + (message.totalInputTokenCount = $util.Long.fromValue(object.totalInputTokenCount)).unsigned = false; + else if (typeof object.totalInputTokenCount === "string") + message.totalInputTokenCount = parseInt(object.totalInputTokenCount, 10); + else if (typeof object.totalInputTokenCount === "number") + message.totalInputTokenCount = object.totalInputTokenCount; + else if (typeof object.totalInputTokenCount === "object") + message.totalInputTokenCount = new $util.LongBits(object.totalInputTokenCount.low >>> 0, object.totalInputTokenCount.high >>> 0).toNumber(); + if (object.conversationContextTokenCount != null) + if ($util.Long) + (message.conversationContextTokenCount = $util.Long.fromValue(object.conversationContextTokenCount)).unsigned = false; + else if (typeof object.conversationContextTokenCount === "string") + message.conversationContextTokenCount = parseInt(object.conversationContextTokenCount, 10); + else if (typeof object.conversationContextTokenCount === "number") + message.conversationContextTokenCount = object.conversationContextTokenCount; + else if (typeof object.conversationContextTokenCount === "object") + message.conversationContextTokenCount = new $util.LongBits(object.conversationContextTokenCount.low >>> 0, object.conversationContextTokenCount.high >>> 0).toNumber(); + if (object.exampleTokenCount != null) + if ($util.Long) + (message.exampleTokenCount = $util.Long.fromValue(object.exampleTokenCount)).unsigned = false; + else if (typeof object.exampleTokenCount === "string") + message.exampleTokenCount = parseInt(object.exampleTokenCount, 10); + else if (typeof object.exampleTokenCount === "number") + message.exampleTokenCount = object.exampleTokenCount; + else if (typeof object.exampleTokenCount === "object") + message.exampleTokenCount = new $util.LongBits(object.exampleTokenCount.low >>> 0, object.exampleTokenCount.high >>> 0).toNumber(); + if (object.totalOutputTokenCount != null) + if ($util.Long) + (message.totalOutputTokenCount = $util.Long.fromValue(object.totalOutputTokenCount)).unsigned = false; + else if (typeof object.totalOutputTokenCount === "string") + message.totalOutputTokenCount = parseInt(object.totalOutputTokenCount, 10); + else if (typeof object.totalOutputTokenCount === "number") + message.totalOutputTokenCount = object.totalOutputTokenCount; + else if (typeof object.totalOutputTokenCount === "object") + message.totalOutputTokenCount = new $util.LongBits(object.totalOutputTokenCount.low >>> 0, object.totalOutputTokenCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TokenCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount} message TokenCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalInputTokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalInputTokenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.conversationContextTokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.conversationContextTokenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.exampleTokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.exampleTokenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalOutputTokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalOutputTokenCount = options.longs === String ? "0" : 0; + } + if (message.totalInputTokenCount != null && message.hasOwnProperty("totalInputTokenCount")) + if (typeof message.totalInputTokenCount === "number") + object.totalInputTokenCount = options.longs === String ? String(message.totalInputTokenCount) : message.totalInputTokenCount; + else + object.totalInputTokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalInputTokenCount) : options.longs === Number ? new $util.LongBits(message.totalInputTokenCount.low >>> 0, message.totalInputTokenCount.high >>> 0).toNumber() : message.totalInputTokenCount; + if (message.conversationContextTokenCount != null && message.hasOwnProperty("conversationContextTokenCount")) + if (typeof message.conversationContextTokenCount === "number") + object.conversationContextTokenCount = options.longs === String ? String(message.conversationContextTokenCount) : message.conversationContextTokenCount; + else + object.conversationContextTokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.conversationContextTokenCount) : options.longs === Number ? new $util.LongBits(message.conversationContextTokenCount.low >>> 0, message.conversationContextTokenCount.high >>> 0).toNumber() : message.conversationContextTokenCount; + if (message.exampleTokenCount != null && message.hasOwnProperty("exampleTokenCount")) + if (typeof message.exampleTokenCount === "number") + object.exampleTokenCount = options.longs === String ? String(message.exampleTokenCount) : message.exampleTokenCount; + else + object.exampleTokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.exampleTokenCount) : options.longs === Number ? new $util.LongBits(message.exampleTokenCount.low >>> 0, message.exampleTokenCount.high >>> 0).toNumber() : message.exampleTokenCount; + if (message.totalOutputTokenCount != null && message.hasOwnProperty("totalOutputTokenCount")) + if (typeof message.totalOutputTokenCount === "number") + object.totalOutputTokenCount = options.longs === String ? String(message.totalOutputTokenCount) : message.totalOutputTokenCount; + else + object.totalOutputTokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalOutputTokenCount) : options.longs === Number ? new $util.LongBits(message.totalOutputTokenCount.low >>> 0, message.totalOutputTokenCount.high >>> 0).toNumber() : message.totalOutputTokenCount; + return object; + }; + + /** + * Converts this TokenCount to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @instance + * @returns {Object.} JSON object + */ + TokenCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TokenCount + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LlmCall.TokenCount"; + }; + + return TokenCount; + })(); + + return LlmCall; + })(); + + v3beta1.PlaybookInvocation = (function() { + + /** + * Properties of a PlaybookInvocation. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybookInvocation + * @property {string|null} [playbook] PlaybookInvocation playbook + * @property {string|null} [displayName] PlaybookInvocation displayName + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null} [playbookInput] PlaybookInvocation playbookInput + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null} [playbookOutput] PlaybookInvocation playbookOutput + * @property {google.cloud.dialogflow.cx.v3beta1.OutputState|null} [playbookState] PlaybookInvocation playbookState + */ + + /** + * Constructs a new PlaybookInvocation. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PlaybookInvocation. + * @implements IPlaybookInvocation + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation=} [properties] Properties to set + */ + function PlaybookInvocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookInvocation playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbook = ""; + + /** + * PlaybookInvocation displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.displayName = ""; + + /** + * PlaybookInvocation playbookInput. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput|null|undefined} playbookInput + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbookInput = null; + + /** + * PlaybookInvocation playbookOutput. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput|null|undefined} playbookOutput + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbookOutput = null; + + /** + * PlaybookInvocation playbookState. + * @member {google.cloud.dialogflow.cx.v3beta1.OutputState} playbookState + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @instance + */ + PlaybookInvocation.prototype.playbookState = 0; + + /** + * Creates a new PlaybookInvocation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation} PlaybookInvocation instance + */ + PlaybookInvocation.create = function create(properties) { + return new PlaybookInvocation(properties); + }; + + /** + * Encodes the specified PlaybookInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation} message PlaybookInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInvocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.playbookInput != null && Object.hasOwnProperty.call(message, "playbookInput")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.encode(message.playbookInput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.playbookOutput != null && Object.hasOwnProperty.call(message, "playbookOutput")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.encode(message.playbookOutput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.playbookState != null && Object.hasOwnProperty.call(message, "playbookState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.playbookState); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PlaybookInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInvocation} message PlaybookInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInvocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation} PlaybookInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInvocation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 2: { + message.playbookInput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.playbookState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookInvocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation} PlaybookInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInvocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookInvocation message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookInvocation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.verify(message.playbookInput, long + 1); + if (error) + return "playbookInput." + error; + } + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.verify(message.playbookOutput, long + 1); + if (error) + return "playbookOutput." + error; + } + if (message.playbookState != null && message.hasOwnProperty("playbookState")) + switch (message.playbookState) { + default: + return "playbookState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a PlaybookInvocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation} PlaybookInvocation + */ + PlaybookInvocation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.playbookInput != null) { + if (typeof object.playbookInput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.playbookInput: object expected"); + message.playbookInput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.fromObject(object.playbookInput, long + 1); + } + if (object.playbookOutput != null) { + if (typeof object.playbookOutput !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation.playbookOutput: object expected"); + message.playbookOutput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.fromObject(object.playbookOutput, long + 1); + } + switch (object.playbookState) { + default: + if (typeof object.playbookState === "number") { + message.playbookState = object.playbookState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.playbookState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.playbookState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.playbookState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.playbookState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.playbookState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.playbookState = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a PlaybookInvocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation} message PlaybookInvocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookInvocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.playbookInput = null; + object.playbookOutput = null; + object.playbookState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.playbookInput != null && message.hasOwnProperty("playbookInput")) + object.playbookInput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput.toObject(message.playbookInput, options); + if (message.playbookOutput != null && message.hasOwnProperty("playbookOutput")) + object.playbookOutput = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.toObject(message.playbookOutput, options); + if (message.playbookState != null && message.hasOwnProperty("playbookState")) + object.playbookState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.playbookState] === undefined ? message.playbookState : $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.playbookState] : message.playbookState; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PlaybookInvocation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @instance + * @returns {Object.} JSON object + */ + PlaybookInvocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookInvocation + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookInvocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PlaybookInvocation"; + }; + + return PlaybookInvocation; + })(); + + v3beta1.FlowInvocation = (function() { + + /** + * Properties of a FlowInvocation. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFlowInvocation + * @property {string|null} [flow] FlowInvocation flow + * @property {string|null} [displayName] FlowInvocation displayName + * @property {google.protobuf.IStruct|null} [inputActionParameters] FlowInvocation inputActionParameters + * @property {google.protobuf.IStruct|null} [outputActionParameters] FlowInvocation outputActionParameters + * @property {google.cloud.dialogflow.cx.v3beta1.OutputState|null} [flowState] FlowInvocation flowState + */ + + /** + * Constructs a new FlowInvocation. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FlowInvocation. + * @implements IFlowInvocation + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowInvocation=} [properties] Properties to set + */ + function FlowInvocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowInvocation flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @instance + */ + FlowInvocation.prototype.flow = ""; + + /** + * FlowInvocation displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @instance + */ + FlowInvocation.prototype.displayName = ""; + + /** + * FlowInvocation inputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} inputActionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @instance + */ + FlowInvocation.prototype.inputActionParameters = null; + + /** + * FlowInvocation outputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} outputActionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @instance + */ + FlowInvocation.prototype.outputActionParameters = null; + + /** + * FlowInvocation flowState. + * @member {google.cloud.dialogflow.cx.v3beta1.OutputState} flowState + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @instance + */ + FlowInvocation.prototype.flowState = 0; + + /** + * Creates a new FlowInvocation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowInvocation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowInvocation} FlowInvocation instance + */ + FlowInvocation.create = function create(properties) { + return new FlowInvocation(properties); + }; + + /** + * Encodes the specified FlowInvocation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowInvocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowInvocation} message FlowInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowInvocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + if (message.flowState != null && Object.hasOwnProperty.call(message, "flowState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.flowState); + if (message.inputActionParameters != null && Object.hasOwnProperty.call(message, "inputActionParameters")) + $root.google.protobuf.Struct.encode(message.inputActionParameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputActionParameters != null && Object.hasOwnProperty.call(message, "outputActionParameters")) + $root.google.protobuf.Struct.encode(message.outputActionParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified FlowInvocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowInvocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowInvocation} message FlowInvocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowInvocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowInvocation} FlowInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowInvocation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + case 7: { + message.displayName = reader.string(); + break; + } + case 5: { + message.inputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.outputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.flowState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowInvocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowInvocation} FlowInvocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowInvocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowInvocation message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowInvocation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputActionParameters, long + 1); + if (error) + return "inputActionParameters." + error; + } + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.outputActionParameters, long + 1); + if (error) + return "outputActionParameters." + error; + } + if (message.flowState != null && message.hasOwnProperty("flowState")) + switch (message.flowState) { + default: + return "flowState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FlowInvocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowInvocation} FlowInvocation + */ + FlowInvocation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation(); + if (object.flow != null) + message.flow = String(object.flow); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.inputActionParameters != null) { + if (typeof object.inputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.inputActionParameters: object expected"); + message.inputActionParameters = $root.google.protobuf.Struct.fromObject(object.inputActionParameters, long + 1); + } + if (object.outputActionParameters != null) { + if (typeof object.outputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.outputActionParameters: object expected"); + message.outputActionParameters = $root.google.protobuf.Struct.fromObject(object.outputActionParameters, long + 1); + } + switch (object.flowState) { + default: + if (typeof object.flowState === "number") { + message.flowState = object.flowState; + break; + } + break; + case "OUTPUT_STATE_UNSPECIFIED": + case 0: + message.flowState = 0; + break; + case "OUTPUT_STATE_OK": + case 1: + message.flowState = 1; + break; + case "OUTPUT_STATE_CANCELLED": + case 2: + message.flowState = 2; + break; + case "OUTPUT_STATE_FAILED": + case 3: + message.flowState = 3; + break; + case "OUTPUT_STATE_ESCALATED": + case 4: + message.flowState = 4; + break; + case "OUTPUT_STATE_PENDING": + case 5: + message.flowState = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FlowInvocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FlowInvocation} message FlowInvocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowInvocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = ""; + object.flowState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.inputActionParameters = null; + object.outputActionParameters = null; + object.displayName = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.flowState != null && message.hasOwnProperty("flowState")) + object.flowState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.flowState] === undefined ? message.flowState : $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.flowState] : message.flowState; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) + object.inputActionParameters = $root.google.protobuf.Struct.toObject(message.inputActionParameters, options); + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) + object.outputActionParameters = $root.google.protobuf.Struct.toObject(message.outputActionParameters, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this FlowInvocation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @instance + * @returns {Object.} JSON object + */ + FlowInvocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowInvocation + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowInvocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FlowInvocation"; + }; + + return FlowInvocation; + })(); + + v3beta1.PlaybookTransition = (function() { + + /** + * Properties of a PlaybookTransition. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybookTransition + * @property {string|null} [playbook] PlaybookTransition playbook + * @property {string|null} [displayName] PlaybookTransition displayName + * @property {google.protobuf.IStruct|null} [inputActionParameters] PlaybookTransition inputActionParameters + */ + + /** + * Constructs a new PlaybookTransition. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PlaybookTransition. + * @implements IPlaybookTransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition=} [properties] Properties to set + */ + function PlaybookTransition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookTransition playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @instance + */ + PlaybookTransition.prototype.playbook = ""; + + /** + * PlaybookTransition displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @instance + */ + PlaybookTransition.prototype.displayName = ""; + + /** + * PlaybookTransition inputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} inputActionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @instance + */ + PlaybookTransition.prototype.inputActionParameters = null; + + /** + * Creates a new PlaybookTransition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTransition} PlaybookTransition instance + */ + PlaybookTransition.create = function create(properties) { + return new PlaybookTransition(properties); + }; + + /** + * Encodes the specified PlaybookTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition} message PlaybookTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTransition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.inputActionParameters != null && Object.hasOwnProperty.call(message, "inputActionParameters")) + $root.google.protobuf.Struct.encode(message.inputActionParameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PlaybookTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookTransition} message PlaybookTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookTransition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTransition} PlaybookTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTransition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 2: { + message.inputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookTransition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTransition} PlaybookTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookTransition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookTransition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookTransition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputActionParameters, long + 1); + if (error) + return "inputActionParameters." + error; + } + return null; + }; + + /** + * Creates a PlaybookTransition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookTransition} PlaybookTransition + */ + PlaybookTransition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookTransition(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.inputActionParameters != null) { + if (typeof object.inputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookTransition.inputActionParameters: object expected"); + message.inputActionParameters = $root.google.protobuf.Struct.fromObject(object.inputActionParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PlaybookTransition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookTransition} message PlaybookTransition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookTransition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.inputActionParameters = null; + object.displayName = ""; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) + object.inputActionParameters = $root.google.protobuf.Struct.toObject(message.inputActionParameters, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PlaybookTransition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @instance + * @returns {Object.} JSON object + */ + PlaybookTransition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookTransition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookTransition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookTransition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PlaybookTransition"; + }; + + return PlaybookTransition; + })(); + + v3beta1.FlowTransition = (function() { + + /** + * Properties of a FlowTransition. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IFlowTransition + * @property {string|null} [flow] FlowTransition flow + * @property {string|null} [displayName] FlowTransition displayName + * @property {google.protobuf.IStruct|null} [inputActionParameters] FlowTransition inputActionParameters + */ + + /** + * Constructs a new FlowTransition. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a FlowTransition. + * @implements IFlowTransition + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTransition=} [properties] Properties to set + */ + function FlowTransition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlowTransition flow. + * @member {string} flow + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @instance + */ + FlowTransition.prototype.flow = ""; + + /** + * FlowTransition displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @instance + */ + FlowTransition.prototype.displayName = ""; + + /** + * FlowTransition inputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} inputActionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @instance + */ + FlowTransition.prototype.inputActionParameters = null; + + /** + * Creates a new FlowTransition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTransition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTransition} FlowTransition instance + */ + FlowTransition.create = function create(properties) { + return new FlowTransition(properties); + }; + + /** + * Encodes the specified FlowTransition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTransition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTransition} message FlowTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTransition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); + if (message.inputActionParameters != null && Object.hasOwnProperty.call(message, "inputActionParameters")) + $root.google.protobuf.Struct.encode(message.inputActionParameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified FlowTransition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.FlowTransition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IFlowTransition} message FlowTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlowTransition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlowTransition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTransition} FlowTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTransition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flow = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 2: { + message.inputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FlowTransition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTransition} FlowTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlowTransition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlowTransition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlowTransition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.flow != null && message.hasOwnProperty("flow")) + if (!$util.isString(message.flow)) + return "flow: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputActionParameters, long + 1); + if (error) + return "inputActionParameters." + error; + } + return null; + }; + + /** + * Creates a FlowTransition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.FlowTransition} FlowTransition + */ + FlowTransition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowTransition(); + if (object.flow != null) + message.flow = String(object.flow); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.inputActionParameters != null) { + if (typeof object.inputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowTransition.inputActionParameters: object expected"); + message.inputActionParameters = $root.google.protobuf.Struct.fromObject(object.inputActionParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FlowTransition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.FlowTransition} message FlowTransition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlowTransition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flow = ""; + object.inputActionParameters = null; + object.displayName = ""; + } + if (message.flow != null && message.hasOwnProperty("flow")) + object.flow = message.flow; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) + object.inputActionParameters = $root.google.protobuf.Struct.toObject(message.inputActionParameters, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this FlowTransition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @instance + * @returns {Object.} JSON object + */ + FlowTransition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlowTransition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.FlowTransition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlowTransition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.FlowTransition"; + }; + + return FlowTransition; + })(); + + v3beta1.PlaybookInput = (function() { + + /** + * Properties of a PlaybookInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybookInput + * @property {string|null} [precedingConversationSummary] PlaybookInput precedingConversationSummary + * @property {google.protobuf.IStruct|null} [actionParameters] PlaybookInput actionParameters + */ + + /** + * Constructs a new PlaybookInput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PlaybookInput. + * @implements IPlaybookInput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput=} [properties] Properties to set + */ + function PlaybookInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookInput precedingConversationSummary. + * @member {string} precedingConversationSummary + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @instance + */ + PlaybookInput.prototype.precedingConversationSummary = ""; + + /** + * PlaybookInput actionParameters. + * @member {google.protobuf.IStruct|null|undefined} actionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @instance + */ + PlaybookInput.prototype.actionParameters = null; + + /** + * Creates a new PlaybookInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInput} PlaybookInput instance + */ + PlaybookInput.create = function create(properties) { + return new PlaybookInput(properties); + }; + + /** + * Encodes the specified PlaybookInput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput} message PlaybookInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precedingConversationSummary != null && Object.hasOwnProperty.call(message, "precedingConversationSummary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.precedingConversationSummary); + if (message.actionParameters != null && Object.hasOwnProperty.call(message, "actionParameters")) + $root.google.protobuf.Struct.encode(message.actionParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PlaybookInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput} message PlaybookInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInput} PlaybookInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.precedingConversationSummary = reader.string(); + break; + } + case 3: { + message.actionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInput} PlaybookInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookInput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.precedingConversationSummary != null && message.hasOwnProperty("precedingConversationSummary")) + if (!$util.isString(message.precedingConversationSummary)) + return "precedingConversationSummary: string expected"; + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.actionParameters, long + 1); + if (error) + return "actionParameters." + error; + } + return null; + }; + + /** + * Creates a PlaybookInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookInput} PlaybookInput + */ + PlaybookInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput(); + if (object.precedingConversationSummary != null) + message.precedingConversationSummary = String(object.precedingConversationSummary); + if (object.actionParameters != null) { + if (typeof object.actionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookInput.actionParameters: object expected"); + message.actionParameters = $root.google.protobuf.Struct.fromObject(object.actionParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PlaybookInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookInput} message PlaybookInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.precedingConversationSummary = ""; + object.actionParameters = null; + } + if (message.precedingConversationSummary != null && message.hasOwnProperty("precedingConversationSummary")) + object.precedingConversationSummary = message.precedingConversationSummary; + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) + object.actionParameters = $root.google.protobuf.Struct.toObject(message.actionParameters, options); + return object; + }; + + /** + * Converts this PlaybookInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @instance + * @returns {Object.} JSON object + */ + PlaybookInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookInput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PlaybookInput"; + }; + + return PlaybookInput; + })(); + + v3beta1.PlaybookOutput = (function() { + + /** + * Properties of a PlaybookOutput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybookOutput + * @property {string|null} [executionSummary] PlaybookOutput executionSummary + * @property {google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State|null} [state] PlaybookOutput state + * @property {google.protobuf.IStruct|null} [actionParameters] PlaybookOutput actionParameters + */ + + /** + * Constructs a new PlaybookOutput. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PlaybookOutput. + * @implements IPlaybookOutput + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput=} [properties] Properties to set + */ + function PlaybookOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookOutput executionSummary. + * @member {string} executionSummary + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @instance + */ + PlaybookOutput.prototype.executionSummary = ""; + + /** + * PlaybookOutput state. + * @member {google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State} state + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @instance + */ + PlaybookOutput.prototype.state = 0; + + /** + * PlaybookOutput actionParameters. + * @member {google.protobuf.IStruct|null|undefined} actionParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @instance + */ + PlaybookOutput.prototype.actionParameters = null; + + /** + * Creates a new PlaybookOutput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookOutput} PlaybookOutput instance + */ + PlaybookOutput.create = function create(properties) { + return new PlaybookOutput(properties); + }; + + /** + * Encodes the specified PlaybookOutput message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput} message PlaybookOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executionSummary != null && Object.hasOwnProperty.call(message, "executionSummary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionSummary); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.actionParameters != null && Object.hasOwnProperty.call(message, "actionParameters")) + $root.google.protobuf.Struct.encode(message.actionParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PlaybookOutput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput} message PlaybookOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookOutput} PlaybookOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookOutput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.executionSummary = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 4: { + message.actionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookOutput} PlaybookOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookOutput message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookOutput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.executionSummary != null && message.hasOwnProperty("executionSummary")) + if (!$util.isString(message.executionSummary)) + return "executionSummary: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.actionParameters, long + 1); + if (error) + return "actionParameters." + error; + } + return null; + }; + + /** + * Creates a PlaybookOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookOutput} PlaybookOutput + */ + PlaybookOutput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput(); + if (object.executionSummary != null) + message.executionSummary = String(object.executionSummary); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "OK": + case 1: + message.state = 1; + break; + case "CANCELLED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "ESCALATED": + case 4: + message.state = 4; + break; + } + if (object.actionParameters != null) { + if (typeof object.actionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.actionParameters: object expected"); + message.actionParameters = $root.google.protobuf.Struct.fromObject(object.actionParameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PlaybookOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookOutput} message PlaybookOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.executionSummary = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.actionParameters = null; + } + if (message.executionSummary != null && message.hasOwnProperty("executionSummary")) + object.executionSummary = message.executionSummary; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State[message.state] : message.state; + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) + object.actionParameters = $root.google.protobuf.Struct.toObject(message.actionParameters, options); + return object; + }; + + /** + * Converts this PlaybookOutput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @instance + * @returns {Object.} JSON object + */ + PlaybookOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookOutput + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PlaybookOutput"; + }; + + /** + * State enum. + * @name google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} OK=1 OK value + * @property {number} CANCELLED=2 CANCELLED value + * @property {number} FAILED=3 FAILED value + * @property {number} ESCALATED=4 ESCALATED value + */ + PlaybookOutput.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "CANCELLED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "ESCALATED"] = 4; + return values; + })(); + + return PlaybookOutput; + })(); + + v3beta1.Span = (function() { + + /** + * Properties of a Span. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISpan + * @property {string|null} [name] Span name + * @property {Array.|null} [tags] Span tags + * @property {Array.|null} [metrics] Span metrics + * @property {google.protobuf.ITimestamp|null} [startTime] Span startTime + * @property {google.protobuf.ITimestamp|null} [completeTime] Span completeTime + */ + + /** + * Constructs a new Span. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Span. + * @implements ISpan + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISpan=} [properties] Properties to set + */ + function Span(properties) { + this.tags = []; + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Span name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @instance + */ + Span.prototype.name = ""; + + /** + * Span tags. + * @member {Array.} tags + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @instance + */ + Span.prototype.tags = $util.emptyArray; + + /** + * Span metrics. + * @member {Array.} metrics + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @instance + */ + Span.prototype.metrics = $util.emptyArray; + + /** + * Span startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @instance + */ + Span.prototype.startTime = null; + + /** + * Span completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @instance + */ + Span.prototype.completeTime = null; + + /** + * Creates a new Span instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpan=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Span} Span instance + */ + Span.create = function create(properties) { + return new Span(properties); + }; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Span.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.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.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tags[i]); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.NamedMetric.encode(message.metrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Span.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Span message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Span(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 3: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.cloud.dialogflow.cx.v3beta1.NamedMetric.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Span message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Span.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.NamedMetric.verify(message.metrics[i], long + 1); + if (error) + return "metrics." + error; + } + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime, long + 1); + if (error) + return "completeTime." + error; + } + return null; + }; + + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Span} Span + */ + Span.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Span) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Span(); + if (object.name != null) + message.name = String(object.name); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Span.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Span.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Span.metrics: object expected"); + message.metrics[i] = $root.google.cloud.dialogflow.cx.v3beta1.NamedMetric.fromObject(object.metrics[i], long + 1); + } + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Span.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Span.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Span} message Span + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Span.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tags = []; + object.metrics = []; + } + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.completeTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.cloud.dialogflow.cx.v3beta1.NamedMetric.toObject(message.metrics[j], options); + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + return object; + }; + + /** + * Converts this Span to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @instance + * @returns {Object.} JSON object + */ + Span.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Span + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Span + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Span"; + }; + + return Span; + })(); + + v3beta1.NamedMetric = (function() { + + /** + * Properties of a NamedMetric. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface INamedMetric + * @property {string|null} [name] NamedMetric name + * @property {google.protobuf.IValue|null} [value] NamedMetric value + * @property {string|null} [unit] NamedMetric unit + */ + + /** + * Constructs a new NamedMetric. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a NamedMetric. + * @implements INamedMetric + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.INamedMetric=} [properties] Properties to set + */ + function NamedMetric(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamedMetric name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @instance + */ + NamedMetric.prototype.name = ""; + + /** + * NamedMetric value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @instance + */ + NamedMetric.prototype.value = null; + + /** + * NamedMetric unit. + * @member {string} unit + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @instance + */ + NamedMetric.prototype.unit = ""; + + /** + * Creates a new NamedMetric instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.INamedMetric=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.NamedMetric} NamedMetric instance + */ + NamedMetric.create = function create(properties) { + return new NamedMetric(properties); + }; + + /** + * Encodes the specified NamedMetric message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NamedMetric.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.INamedMetric} message NamedMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamedMetric.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.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unit); + return writer; + }; + + /** + * Encodes the specified NamedMetric message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.NamedMetric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.INamedMetric} message NamedMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamedMetric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamedMetric message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.NamedMetric} NamedMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamedMetric.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.NamedMetric(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.unit = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NamedMetric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.NamedMetric} NamedMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamedMetric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamedMetric message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamedMetric.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value, long + 1); + if (error) + return "value." + error; + } + if (message.unit != null && message.hasOwnProperty("unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + return null; + }; + + /** + * Creates a NamedMetric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.NamedMetric} NamedMetric + */ + NamedMetric.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.NamedMetric) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.NamedMetric(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.NamedMetric.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value, long + 1); + } + if (object.unit != null) + message.unit = String(object.unit); + return message; + }; + + /** + * Creates a plain object from a NamedMetric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.NamedMetric} message NamedMetric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamedMetric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = null; + object.unit = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = message.unit; + return object; + }; + + /** + * Converts this NamedMetric to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @instance + * @returns {Object.} JSON object + */ + NamedMetric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamedMetric + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.NamedMetric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamedMetric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.NamedMetric"; + }; + + return NamedMetric; + })(); + + v3beta1.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IStatus + * @property {google.cloud.dialogflow.cx.v3beta1.IExceptionDetail|null} [exception] Status exception + */ + + /** + * Constructs a new Status. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IStatus=} [properties] Properties to set + */ + function Status(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status exception. + * @member {google.cloud.dialogflow.cx.v3beta1.IExceptionDetail|null|undefined} exception + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @instance + */ + Status.prototype.exception = null; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStatus=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Status.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exception != null && Object.hasOwnProperty.call(message, "exception")) + $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.encode(message.exception, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.exception = $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.exception != null && message.hasOwnProperty("exception")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.verify(message.exception, long + 1); + if (error) + return "exception." + error; + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Status} Status + */ + Status.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Status) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Status(); + if (object.exception != null) { + if (typeof object.exception !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Status.exception: object expected"); + message.exception = $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.fromObject(object.exception, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.exception = null; + if (message.exception != null && message.hasOwnProperty("exception")) + object.exception = $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.toObject(message.exception, options); + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Status"; + }; + + return Status; + })(); + + v3beta1.ExceptionDetail = (function() { + + /** + * Properties of an ExceptionDetail. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExceptionDetail + * @property {string|null} [errorMessage] ExceptionDetail errorMessage + */ + + /** + * Constructs a new ExceptionDetail. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExceptionDetail. + * @implements IExceptionDetail + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExceptionDetail=} [properties] Properties to set + */ + function ExceptionDetail(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExceptionDetail errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @instance + */ + ExceptionDetail.prototype.errorMessage = ""; + + /** + * Creates a new ExceptionDetail instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExceptionDetail=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExceptionDetail} ExceptionDetail instance + */ + ExceptionDetail.create = function create(properties) { + return new ExceptionDetail(properties); + }; + + /** + * Encodes the specified ExceptionDetail message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExceptionDetail} message ExceptionDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExceptionDetail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified ExceptionDetail message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExceptionDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExceptionDetail} message ExceptionDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExceptionDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExceptionDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExceptionDetail} ExceptionDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExceptionDetail.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExceptionDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExceptionDetail} ExceptionDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExceptionDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExceptionDetail message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExceptionDetail.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates an ExceptionDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExceptionDetail} ExceptionDetail + */ + ExceptionDetail.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExceptionDetail(); + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from an ExceptionDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExceptionDetail} message ExceptionDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExceptionDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.errorMessage = ""; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this ExceptionDetail to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @instance + * @returns {Object.} JSON object + */ + ExceptionDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExceptionDetail + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExceptionDetail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExceptionDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExceptionDetail"; + }; + + return ExceptionDetail; + })(); + + /** + * OutputState enum. + * @name google.cloud.dialogflow.cx.v3beta1.OutputState + * @enum {number} + * @property {number} OUTPUT_STATE_UNSPECIFIED=0 OUTPUT_STATE_UNSPECIFIED value + * @property {number} OUTPUT_STATE_OK=1 OUTPUT_STATE_OK value + * @property {number} OUTPUT_STATE_CANCELLED=2 OUTPUT_STATE_CANCELLED value + * @property {number} OUTPUT_STATE_FAILED=3 OUTPUT_STATE_FAILED value + * @property {number} OUTPUT_STATE_ESCALATED=4 OUTPUT_STATE_ESCALATED value + * @property {number} OUTPUT_STATE_PENDING=5 OUTPUT_STATE_PENDING value + */ + v3beta1.OutputState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTPUT_STATE_OK"] = 1; + values[valuesById[2] = "OUTPUT_STATE_CANCELLED"] = 2; + values[valuesById[3] = "OUTPUT_STATE_FAILED"] = 3; + values[valuesById[4] = "OUTPUT_STATE_ESCALATED"] = 4; + values[valuesById[5] = "OUTPUT_STATE_PENDING"] = 5; + return values; + })(); + + /** + * RetrievalStrategy enum. + * @name google.cloud.dialogflow.cx.v3beta1.RetrievalStrategy + * @enum {number} + * @property {number} RETRIEVAL_STRATEGY_UNSPECIFIED=0 RETRIEVAL_STRATEGY_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} STATIC=2 STATIC value + * @property {number} NEVER=3 NEVER value + */ + v3beta1.RetrievalStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETRIEVAL_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "STATIC"] = 2; + values[valuesById[3] = "NEVER"] = 3; + return values; + })(); + + v3beta1.SessionEntityTypes = (function() { + + /** + * Constructs a new SessionEntityTypes service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SessionEntityTypes + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SessionEntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionEntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionEntityTypes; + + /** + * Creates new SessionEntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SessionEntityTypes} RPC service. Useful where requests and/or responses are streamed. + */ + SessionEntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|listSessionEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @typedef ListSessionEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} [response] ListSessionEntityTypesResponse + */ + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypesCallback} callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.listSessionEntityTypes = function listSessionEntityTypes(request, callback) { + return this.rpcCall(listSessionEntityTypes, $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse, request, callback); + }, "name", { value: "ListSessionEntityTypes" }); + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|getSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @typedef GetSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.getSessionEntityType = function getSessionEntityType(request, callback) { + return this.rpcCall(getSessionEntityType, $root.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, request, callback); + }, "name", { value: "GetSessionEntityType" }); + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|createSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @typedef CreateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.createSessionEntityType = function createSessionEntityType(request, callback) { + return this.rpcCall(createSessionEntityType, $root.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, request, callback); + }, "name", { value: "CreateSessionEntityType" }); + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|updateSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @typedef UpdateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.updateSessionEntityType = function updateSessionEntityType(request, callback) { + return this.rpcCall(updateSessionEntityType, $root.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, request, callback); + }, "name", { value: "UpdateSessionEntityType" }); + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes|deleteSessionEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @typedef DeleteSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.deleteSessionEntityType = function deleteSessionEntityType(request, callback) { + return this.rpcCall(deleteSessionEntityType, $root.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSessionEntityType" }); + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionEntityTypes; + })(); + + v3beta1.SessionEntityType = (function() { + + /** + * Properties of a SessionEntityType. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISessionEntityType + * @property {string|null} [name] SessionEntityType name + * @property {google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode|null} [entityOverrideMode] SessionEntityType entityOverrideMode + * @property {Array.|null} [entities] SessionEntityType entities + */ + + /** + * Constructs a new SessionEntityType. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SessionEntityType. + * @implements ISessionEntityType + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType=} [properties] Properties to set + */ + function SessionEntityType(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionEntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @instance + */ + SessionEntityType.prototype.name = ""; + + /** + * SessionEntityType entityOverrideMode. + * @member {google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode} entityOverrideMode + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entityOverrideMode = 0; + + /** + * SessionEntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entities = $util.emptyArray; + + /** + * Creates a new SessionEntityType instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} SessionEntityType instance + */ + SessionEntityType.create = function create(properties) { + return new SessionEntityType(properties); + }; + + /** + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEntityType.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.entityOverrideMode != null && Object.hasOwnProperty.call(message, "entityOverrideMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.entityOverrideMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEntityType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.entityOverrideMode = reader.int32(); + break; + } + case 4: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionEntityType message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionEntityType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + switch (message.entityOverrideMode) { + default: + return "entityOverrideMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.verify(message.entities[i], long + 1); + if (error) + return "entities." + error; + } + } + return null; + }; + + /** + * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} SessionEntityType + */ + SessionEntityType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(); + if (object.name != null) + message.name = String(object.name); + switch (object.entityOverrideMode) { + default: + if (typeof object.entityOverrideMode === "number") { + message.entityOverrideMode = object.entityOverrideMode; + break; + } + break; + case "ENTITY_OVERRIDE_MODE_UNSPECIFIED": + case 0: + message.entityOverrideMode = 0; + break; + case "ENTITY_OVERRIDE_MODE_OVERRIDE": + case 1: + message.entityOverrideMode = 1; + break; + case "ENTITY_OVERRIDE_MODE_SUPPLEMENT": + case 2: + message.entityOverrideMode = 2; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SessionEntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SessionEntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.fromObject(object.entities[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} message SessionEntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionEntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.name = ""; + object.entityOverrideMode = options.enums === String ? "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + object.entityOverrideMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] === undefined ? message.entityOverrideMode : $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] : message.entityOverrideMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.toObject(message.entities[j], options); + } + return object; + }; + + /** + * Converts this SessionEntityType to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @instance + * @returns {Object.} JSON object + */ + SessionEntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionEntityType + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionEntityType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionEntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SessionEntityType"; + }; + + /** + * EntityOverrideMode enum. + * @name google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode + * @enum {number} + * @property {number} ENTITY_OVERRIDE_MODE_UNSPECIFIED=0 ENTITY_OVERRIDE_MODE_UNSPECIFIED value + * @property {number} ENTITY_OVERRIDE_MODE_OVERRIDE=1 ENTITY_OVERRIDE_MODE_OVERRIDE value + * @property {number} ENTITY_OVERRIDE_MODE_SUPPLEMENT=2 ENTITY_OVERRIDE_MODE_SUPPLEMENT value + */ + SessionEntityType.EntityOverrideMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_OVERRIDE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTITY_OVERRIDE_MODE_OVERRIDE"] = 1; + values[valuesById[2] = "ENTITY_OVERRIDE_MODE_SUPPLEMENT"] = 2; + return values; + })(); + + return SessionEntityType; + })(); + + v3beta1.ListSessionEntityTypesRequest = (function() { + + /** + * Properties of a ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListSessionEntityTypesRequest + * @property {string|null} [parent] ListSessionEntityTypesRequest parent + * @property {number|null} [pageSize] ListSessionEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListSessionEntityTypesRequest pageToken + */ + + /** + * Constructs a new ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListSessionEntityTypesRequest. + * @implements IListSessionEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest=} [properties] Properties to set + */ + function ListSessionEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.parent = ""; + + /** + * ListSessionEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.pageSize = 0; + + /** + * ListSessionEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest instance + */ + ListSessionEntityTypesRequest.create = function create(properties) { + return new ListSessionEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesRequest.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); + return writer; + }; + + /** + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + */ + ListSessionEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest} message ListSessionEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListSessionEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest"; + }; + + return ListSessionEntityTypesRequest; + })(); + + v3beta1.ListSessionEntityTypesResponse = (function() { + + /** + * Properties of a ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListSessionEntityTypesResponse + * @property {Array.|null} [sessionEntityTypes] ListSessionEntityTypesResponse sessionEntityTypes + * @property {string|null} [nextPageToken] ListSessionEntityTypesResponse nextPageToken + */ + + /** + * Constructs a new ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListSessionEntityTypesResponse. + * @implements IListSessionEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse=} [properties] Properties to set + */ + function ListSessionEntityTypesResponse(properties) { + this.sessionEntityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionEntityTypesResponse sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @instance + */ + ListSessionEntityTypesResponse.prototype.sessionEntityTypes = $util.emptyArray; + + /** + * ListSessionEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @instance + */ + ListSessionEntityTypesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse instance + */ + ListSessionEntityTypesResponse.create = function create(properties) { + return new ListSessionEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.encode(message.sessionEntityTypes[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 ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify(message.sessionEntityTypes[i], long + 1); + if (error) + return "sessionEntityTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + */ + ListSessionEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse(); + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.fromObject(object.sessionEntityTypes[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} message ListSessionEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessionEntityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSessionEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse"; + }; + + return ListSessionEntityTypesResponse; + })(); + + v3beta1.GetSessionEntityTypeRequest = (function() { + + /** + * Properties of a GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetSessionEntityTypeRequest + * @property {string|null} [name] GetSessionEntityTypeRequest name + */ + + /** + * Constructs a new GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetSessionEntityTypeRequest. + * @implements IGetSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest=} [properties] Properties to set + */ + function GetSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSessionEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @instance + */ + GetSessionEntityTypeRequest.prototype.name = ""; + + /** + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest instance + */ + GetSessionEntityTypeRequest.create = function create(properties) { + return new GetSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionEntityTypeRequest.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 GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + */ + GetSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest} message GetSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSessionEntityTypeRequest.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 GetSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest"; + }; + + return GetSessionEntityTypeRequest; + })(); + + v3beta1.CreateSessionEntityTypeRequest = (function() { + + /** + * Properties of a CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateSessionEntityTypeRequest + * @property {string|null} [parent] CreateSessionEntityTypeRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null} [sessionEntityType] CreateSessionEntityTypeRequest sessionEntityType + */ + + /** + * Constructs a new CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateSessionEntityTypeRequest. + * @implements ICreateSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest=} [properties] Properties to set + */ + function CreateSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSessionEntityTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @instance + */ + CreateSessionEntityTypeRequest.prototype.parent = ""; + + /** + * CreateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @instance + */ + CreateSessionEntityTypeRequest.prototype.sessionEntityType = null; + + /** + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest instance + */ + CreateSessionEntityTypeRequest.create = function create(properties) { + return new CreateSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionEntityTypeRequest.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.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify(message.sessionEntityType, long + 1); + if (error) + return "sessionEntityType." + error; + } + return null; + }; + + /** + * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + */ + CreateSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.fromObject(object.sessionEntityType, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sessionEntityType = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.toObject(message.sessionEntityType, options); + return object; + }; + + /** + * Converts this CreateSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest"; + }; + + return CreateSessionEntityTypeRequest; + })(); + + v3beta1.UpdateSessionEntityTypeRequest = (function() { + + /** + * Properties of an UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateSessionEntityTypeRequest + * @property {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null} [sessionEntityType] UpdateSessionEntityTypeRequest sessionEntityType + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSessionEntityTypeRequest updateMask + */ + + /** + * Constructs a new UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateSessionEntityTypeRequest. + * @implements IUpdateSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + */ + function UpdateSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.cx.v3beta1.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @instance + */ + UpdateSessionEntityTypeRequest.prototype.sessionEntityType = null; + + /** + * UpdateSessionEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @instance + */ + UpdateSessionEntityTypeRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest instance + */ + UpdateSessionEntityTypeRequest.create = function create(properties) { + return new UpdateSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.encode(message.sessionEntityType, 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 UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.verify(message.sessionEntityType, long + 1); + if (error) + return "sessionEntityType." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + */ + UpdateSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(); + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.fromObject(object.sessionEntityType, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sessionEntityType = null; + object.updateMask = null; + } + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.toObject(message.sessionEntityType, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest"; + }; + + return UpdateSessionEntityTypeRequest; + })(); + + v3beta1.DeleteSessionEntityTypeRequest = (function() { + + /** + * Properties of a DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteSessionEntityTypeRequest + * @property {string|null} [name] DeleteSessionEntityTypeRequest name + */ + + /** + * Constructs a new DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteSessionEntityTypeRequest. + * @implements IDeleteSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + */ + function DeleteSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSessionEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @instance + */ + DeleteSessionEntityTypeRequest.prototype.name = ""; + + /** + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest instance + */ + DeleteSessionEntityTypeRequest.create = function create(properties) { + return new DeleteSessionEntityTypeRequest(properties); + }; + + /** + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionEntityTypeRequest.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 DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSessionEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + */ + DeleteSessionEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSessionEntityTypeRequest.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 DeleteSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSessionEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSessionEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest"; + }; + + return DeleteSessionEntityTypeRequest; + })(); + + v3beta1.EntityTypes = (function() { + + /** + * Constructs a new EntityTypes service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an EntityTypes + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function EntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EntityTypes; + + /** + * Creates new EntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {EntityTypes} RPC service. Useful where requests and/or responses are streamed. + */ + EntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|getEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @typedef GetEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType} [response] EntityType + */ + + /** + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.getEntityType = function getEntityType(request, callback) { + return this.rpcCall(getEntityType, $root.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3beta1.EntityType, request, callback); + }, "name", { value: "GetEntityType" }); + + /** + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|createEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @typedef CreateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType} [response] EntityType + */ + + /** + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.createEntityType = function createEntityType(request, callback) { + return this.rpcCall(createEntityType, $root.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3beta1.EntityType, request, callback); + }, "name", { value: "CreateEntityType" }); + + /** + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|updateEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @typedef UpdateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType} [response] EntityType + */ + + /** + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.updateEntityType = function updateEntityType(request, callback) { + return this.rpcCall(updateEntityType, $root.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest, $root.google.cloud.dialogflow.cx.v3beta1.EntityType, request, callback); + }, "name", { value: "UpdateEntityType" }); + + /** + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|deleteEntityType}. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @typedef DeleteEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.deleteEntityType = function deleteEntityType(request, callback) { + return this.rpcCall(deleteEntityType, $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEntityType" }); + + /** + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|listEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @typedef ListEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} [response] ListEntityTypesResponse + */ + + /** + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypesCallback} callback Node-style callback called with the error, if any, and ListEntityTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.listEntityTypes = function listEntityTypes(request, callback) { + return this.rpcCall(listEntityTypes, $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse, request, callback); + }, "name", { value: "ListEntityTypes" }); + + /** + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|exportEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @typedef ExportEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportEntityTypes. + * @function exportEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest} request ExportEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.EntityTypes.ExportEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.exportEntityTypes = function exportEntityTypes(request, callback) { + return this.rpcCall(exportEntityTypes, $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportEntityTypes" }); + + /** + * Calls ExportEntityTypes. + * @function exportEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest} request ExportEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.EntityTypes|importEntityTypes}. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @typedef ImportEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportEntityTypes. + * @function importEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest} request ImportEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.EntityTypes.ImportEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.importEntityTypes = function importEntityTypes(request, callback) { + return this.rpcCall(importEntityTypes, $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportEntityTypes" }); + + /** + * Calls ImportEntityTypes. + * @function importEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest} request ImportEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EntityTypes; + })(); + + v3beta1.EntityType = (function() { + + /** + * Properties of an EntityType. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IEntityType + * @property {string|null} [name] EntityType name + * @property {string|null} [displayName] EntityType displayName + * @property {google.cloud.dialogflow.cx.v3beta1.EntityType.Kind|null} [kind] EntityType kind + * @property {google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode|null} [autoExpansionMode] EntityType autoExpansionMode + * @property {Array.|null} [entities] EntityType entities + * @property {Array.|null} [excludedPhrases] EntityType excludedPhrases + * @property {boolean|null} [enableFuzzyExtraction] EntityType enableFuzzyExtraction + * @property {boolean|null} [redact] EntityType redact + */ + + /** + * Constructs a new EntityType. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an EntityType. + * @implements IEntityType + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IEntityType=} [properties] Properties to set + */ + function EntityType(properties) { + this.entities = []; + this.excludedPhrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.name = ""; + + /** + * EntityType displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.displayName = ""; + + /** + * EntityType kind. + * @member {google.cloud.dialogflow.cx.v3beta1.EntityType.Kind} kind + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.kind = 0; + + /** + * EntityType autoExpansionMode. + * @member {google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode} autoExpansionMode + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.autoExpansionMode = 0; + + /** + * EntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.entities = $util.emptyArray; + + /** + * EntityType excludedPhrases. + * @member {Array.} excludedPhrases + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.excludedPhrases = $util.emptyArray; + + /** + * EntityType enableFuzzyExtraction. + * @member {boolean} enableFuzzyExtraction + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.enableFuzzyExtraction = false; + + /** + * EntityType redact. + * @member {boolean} redact + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + */ + EntityType.prototype.redact = false; + + /** + * Creates a new EntityType instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType} EntityType instance + */ + EntityType.create = function create(properties) { + return new EntityType(properties); + }; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); + if (message.autoExpansionMode != null && Object.hasOwnProperty.call(message, "autoExpansionMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoExpansionMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.excludedPhrases != null && message.excludedPhrases.length) + for (var i = 0; i < message.excludedPhrases.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.encode(message.excludedPhrases[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.enableFuzzyExtraction != null && Object.hasOwnProperty.call(message, "enableFuzzyExtraction")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFuzzyExtraction); + if (message.redact != null && Object.hasOwnProperty.call(message, "redact")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.redact); + return writer; + }; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.EntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.kind = reader.int32(); + break; + } + case 4: { + message.autoExpansionMode = reader.int32(); + break; + } + case 5: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.excludedPhrases && message.excludedPhrases.length)) + message.excludedPhrases = []; + message.excludedPhrases.push($root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.enableFuzzyExtraction = reader.bool(); + break; + } + case 9: { + message.redact = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityType message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + switch (message.autoExpansionMode) { + default: + return "autoExpansionMode: enum value expected"; + case 0: + case 1: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.verify(message.entities[i], long + 1); + if (error) + return "entities." + error; + } + } + if (message.excludedPhrases != null && message.hasOwnProperty("excludedPhrases")) { + if (!Array.isArray(message.excludedPhrases)) + return "excludedPhrases: array expected"; + for (var i = 0; i < message.excludedPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.verify(message.excludedPhrases[i], long + 1); + if (error) + return "excludedPhrases." + error; + } + } + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + if (typeof message.enableFuzzyExtraction !== "boolean") + return "enableFuzzyExtraction: boolean expected"; + if (message.redact != null && message.hasOwnProperty("redact")) + if (typeof message.redact !== "boolean") + return "redact: boolean expected"; + return null; + }; + + /** + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType} EntityType + */ + EntityType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.EntityType) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.EntityType(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "KIND_MAP": + case 1: + message.kind = 1; + break; + case "KIND_LIST": + case 2: + message.kind = 2; + break; + case "KIND_REGEXP": + case 3: + message.kind = 3; + break; + } + switch (object.autoExpansionMode) { + default: + if (typeof object.autoExpansionMode === "number") { + message.autoExpansionMode = object.autoExpansionMode; + break; + } + break; + case "AUTO_EXPANSION_MODE_UNSPECIFIED": + case 0: + message.autoExpansionMode = 0; + break; + case "AUTO_EXPANSION_MODE_DEFAULT": + case 1: + message.autoExpansionMode = 1; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.EntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.EntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.fromObject(object.entities[i], long + 1); + } + } + if (object.excludedPhrases) { + if (!Array.isArray(object.excludedPhrases)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.EntityType.excludedPhrases: array expected"); + message.excludedPhrases = []; + for (var i = 0; i < object.excludedPhrases.length; ++i) { + if (typeof object.excludedPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.EntityType.excludedPhrases: object expected"); + message.excludedPhrases[i] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.fromObject(object.excludedPhrases[i], long + 1); + } + } + if (object.enableFuzzyExtraction != null) + message.enableFuzzyExtraction = Boolean(object.enableFuzzyExtraction); + if (object.redact != null) + message.redact = Boolean(object.redact); + return message; + }; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType} message EntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.entities = []; + object.excludedPhrases = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.autoExpansionMode = options.enums === String ? "AUTO_EXPANSION_MODE_UNSPECIFIED" : 0; + object.enableFuzzyExtraction = false; + object.redact = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind[message.kind] === undefined ? message.kind : $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind[message.kind] : message.kind; + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + object.autoExpansionMode = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode[message.autoExpansionMode] === undefined ? message.autoExpansionMode : $root.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode[message.autoExpansionMode] : message.autoExpansionMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.excludedPhrases && message.excludedPhrases.length) { + object.excludedPhrases = []; + for (var j = 0; j < message.excludedPhrases.length; ++j) + object.excludedPhrases[j] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.toObject(message.excludedPhrases[j], options); + } + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + object.enableFuzzyExtraction = message.enableFuzzyExtraction; + if (message.redact != null && message.hasOwnProperty("redact")) + object.redact = message.redact; + return object; + }; + + /** + * Converts this EntityType to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @instance + * @returns {Object.} JSON object + */ + EntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityType + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.EntityType"; + }; + + /** + * Kind enum. + * @name google.cloud.dialogflow.cx.v3beta1.EntityType.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} KIND_MAP=1 KIND_MAP value + * @property {number} KIND_LIST=2 KIND_LIST value + * @property {number} KIND_REGEXP=3 KIND_REGEXP value + */ + EntityType.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "KIND_MAP"] = 1; + values[valuesById[2] = "KIND_LIST"] = 2; + values[valuesById[3] = "KIND_REGEXP"] = 3; + return values; + })(); + + /** + * AutoExpansionMode enum. + * @name google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode + * @enum {number} + * @property {number} AUTO_EXPANSION_MODE_UNSPECIFIED=0 AUTO_EXPANSION_MODE_UNSPECIFIED value + * @property {number} AUTO_EXPANSION_MODE_DEFAULT=1 AUTO_EXPANSION_MODE_DEFAULT value + */ + EntityType.AutoExpansionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTO_EXPANSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO_EXPANSION_MODE_DEFAULT"] = 1; + return values; + })(); + + EntityType.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @interface IEntity + * @property {string|null} [value] Entity value + * @property {Array.|null} [synonyms] Entity synonyms + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + this.synonyms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity value. + * @member {string} value + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @instance + */ + Entity.prototype.value = ""; + + /** + * Entity synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @instance + */ + Entity.prototype.synonyms = $util.emptyArray; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.Entity} Entity + */ + Entity.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity(); + if (object.value != null) + message.value = String(object.value); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.EntityType.Entity"; + }; + + return Entity; + })(); + + EntityType.ExcludedPhrase = (function() { + + /** + * Properties of an ExcludedPhrase. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @interface IExcludedPhrase + * @property {string|null} [value] ExcludedPhrase value + */ + + /** + * Constructs a new ExcludedPhrase. + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType + * @classdesc Represents an ExcludedPhrase. + * @implements IExcludedPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase=} [properties] Properties to set + */ + function ExcludedPhrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExcludedPhrase value. + * @member {string} value + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @instance + */ + ExcludedPhrase.prototype.value = ""; + + /** + * Creates a new ExcludedPhrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase} ExcludedPhrase instance + */ + ExcludedPhrase.create = function create(properties) { + return new ExcludedPhrase(properties); + }; + + /** + * Encodes the specified ExcludedPhrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase} message ExcludedPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludedPhrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified ExcludedPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.IExcludedPhrase} message ExcludedPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludedPhrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase} ExcludedPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludedPhrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExcludedPhrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase} ExcludedPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludedPhrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExcludedPhrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExcludedPhrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an ExcludedPhrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase} ExcludedPhrase + */ + ExcludedPhrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an ExcludedPhrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase} message ExcludedPhrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExcludedPhrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ExcludedPhrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @instance + * @returns {Object.} JSON object + */ + ExcludedPhrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExcludedPhrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExcludedPhrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase"; + }; + + return ExcludedPhrase; + })(); + + return EntityType; + })(); + + v3beta1.ExportEntityTypesRequest = (function() { + + /** + * Properties of an ExportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportEntityTypesRequest + * @property {string|null} [parent] ExportEntityTypesRequest parent + * @property {Array.|null} [entityTypes] ExportEntityTypesRequest entityTypes + * @property {string|null} [entityTypesUri] ExportEntityTypesRequest entityTypesUri + * @property {boolean|null} [entityTypesContentInline] ExportEntityTypesRequest entityTypesContentInline + * @property {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat|null} [dataFormat] ExportEntityTypesRequest dataFormat + * @property {string|null} [languageCode] ExportEntityTypesRequest languageCode + */ + + /** + * Constructs a new ExportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportEntityTypesRequest. + * @implements IExportEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest=} [properties] Properties to set + */ + function ExportEntityTypesRequest(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.parent = ""; + + /** + * ExportEntityTypesRequest entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.entityTypes = $util.emptyArray; + + /** + * ExportEntityTypesRequest entityTypesUri. + * @member {string|null|undefined} entityTypesUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.entityTypesUri = null; + + /** + * ExportEntityTypesRequest entityTypesContentInline. + * @member {boolean|null|undefined} entityTypesContentInline + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.entityTypesContentInline = null; + + /** + * ExportEntityTypesRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.dataFormat = 0; + + /** + * ExportEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + */ + ExportEntityTypesRequest.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportEntityTypesRequest destination. + * @member {"entityTypesUri"|"entityTypesContentInline"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + */ + Object.defineProperty(ExportEntityTypesRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["entityTypesUri", "entityTypesContentInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest} ExportEntityTypesRequest instance + */ + ExportEntityTypesRequest.create = function create(properties) { + return new ExportEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ExportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest} message ExportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesRequest.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.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypes[i]); + if (message.entityTypesUri != null && Object.hasOwnProperty.call(message, "entityTypesUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityTypesUri); + if (message.entityTypesContentInline != null && Object.hasOwnProperty.call(message, "entityTypesContentInline")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.entityTypesContentInline); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.dataFormat); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ExportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest} message ExportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest} ExportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push(reader.string()); + break; + } + case 3: { + message.entityTypesUri = reader.string(); + break; + } + case 4: { + message.entityTypesContentInline = reader.bool(); + break; + } + case 5: { + message.dataFormat = reader.int32(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest} ExportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) + if (!$util.isString(message.entityTypes[i])) + return "entityTypes: string[] expected"; + } + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + properties.destination = 1; + if (!$util.isString(message.entityTypesUri)) + return "entityTypesUri: string expected"; + } + if (message.entityTypesContentInline != null && message.hasOwnProperty("entityTypesContentInline")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (typeof message.entityTypesContentInline !== "boolean") + return "entityTypesContentInline: boolean expected"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 5: + break; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an ExportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest} ExportEntityTypesRequest + */ + ExportEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) + message.entityTypes[i] = String(object.entityTypes[i]); + } + if (object.entityTypesUri != null) + message.entityTypesUri = String(object.entityTypesUri); + if (object.entityTypesContentInline != null) + message.entityTypesContentInline = Boolean(object.entityTypesContentInline); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON_PACKAGE": + case 5: + message.dataFormat = 5; + break; + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an ExportEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest} message ExportEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) { + object.parent = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = message.entityTypes[j]; + } + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + object.entityTypesUri = message.entityTypesUri; + if (options.oneofs) + object.destination = "entityTypesUri"; + } + if (message.entityTypesContentInline != null && message.hasOwnProperty("entityTypesContentInline")) { + object.entityTypesContentInline = message.entityTypesContentInline; + if (options.oneofs) + object.destination = "entityTypesContentInline"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat[message.dataFormat] : message.dataFormat; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ExportEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON_PACKAGE=5 JSON_PACKAGE value + */ + ExportEntityTypesRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[5] = "JSON_PACKAGE"] = 5; + return values; + })(); + + return ExportEntityTypesRequest; + })(); + + v3beta1.ExportEntityTypesResponse = (function() { + + /** + * Properties of an ExportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportEntityTypesResponse + * @property {string|null} [entityTypesUri] ExportEntityTypesResponse entityTypesUri + * @property {google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null} [entityTypesContent] ExportEntityTypesResponse entityTypesContent + */ + + /** + * Constructs a new ExportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportEntityTypesResponse. + * @implements IExportEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse=} [properties] Properties to set + */ + function ExportEntityTypesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEntityTypesResponse entityTypesUri. + * @member {string|null|undefined} entityTypesUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @instance + */ + ExportEntityTypesResponse.prototype.entityTypesUri = null; + + /** + * ExportEntityTypesResponse entityTypesContent. + * @member {google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null|undefined} entityTypesContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @instance + */ + ExportEntityTypesResponse.prototype.entityTypesContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportEntityTypesResponse exportedEntityTypes. + * @member {"entityTypesUri"|"entityTypesContent"|undefined} exportedEntityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @instance + */ + Object.defineProperty(ExportEntityTypesResponse.prototype, "exportedEntityTypes", { + get: $util.oneOfGetter($oneOfFields = ["entityTypesUri", "entityTypesContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse} ExportEntityTypesResponse instance + */ + ExportEntityTypesResponse.create = function create(properties) { + return new ExportEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ExportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse} message ExportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypesUri != null && Object.hasOwnProperty.call(message, "entityTypesUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityTypesUri); + if (message.entityTypesContent != null && Object.hasOwnProperty.call(message, "entityTypesContent")) + $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.encode(message.entityTypesContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse} message ExportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse} ExportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityTypesUri = reader.string(); + break; + } + case 2: { + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse} ExportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + properties.exportedEntityTypes = 1; + if (!$util.isString(message.entityTypesUri)) + return "entityTypesUri: string expected"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + if (properties.exportedEntityTypes === 1) + return "exportedEntityTypes: multiple values"; + properties.exportedEntityTypes = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.verify(message.entityTypesContent, long + 1); + if (error) + return "entityTypesContent." + error; + } + } + return null; + }; + + /** + * Creates an ExportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse} ExportEntityTypesResponse + */ + ExportEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse(); + if (object.entityTypesUri != null) + message.entityTypesUri = String(object.entityTypesUri); + if (object.entityTypesContent != null) { + if (typeof object.entityTypesContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse.entityTypesContent: object expected"); + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.fromObject(object.entityTypesContent, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExportEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse} message ExportEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + object.entityTypesUri = message.entityTypesUri; + if (options.oneofs) + object.exportedEntityTypes = "entityTypesUri"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + object.entityTypesContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.toObject(message.entityTypesContent, options); + if (options.oneofs) + object.exportedEntityTypes = "entityTypesContent"; + } + return object; + }; + + /** + * Converts this ExportEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ExportEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse"; + }; + + return ExportEntityTypesResponse; + })(); + + v3beta1.ExportEntityTypesMetadata = (function() { + + /** + * Properties of an ExportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportEntityTypesMetadata + */ + + /** + * Constructs a new ExportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportEntityTypesMetadata. + * @implements IExportEntityTypesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata=} [properties] Properties to set + */ + function ExportEntityTypesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportEntityTypesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata} ExportEntityTypesMetadata instance + */ + ExportEntityTypesMetadata.create = function create(properties) { + return new ExportEntityTypesMetadata(properties); + }; + + /** + * Encodes the specified ExportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata} message ExportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata} message ExportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntityTypesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata} ExportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata} ExportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntityTypesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEntityTypesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntityTypesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata} ExportEntityTypesMetadata + */ + ExportEntityTypesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata(); + }; + + /** + * Creates a plain object from an ExportEntityTypesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata} message ExportEntityTypesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntityTypesMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportEntityTypesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportEntityTypesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEntityTypesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEntityTypesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata"; + }; + + return ExportEntityTypesMetadata; + })(); + + v3beta1.ImportEntityTypesRequest = (function() { + + /** + * Properties of an ImportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportEntityTypesRequest + * @property {string|null} [parent] ImportEntityTypesRequest parent + * @property {string|null} [entityTypesUri] ImportEntityTypesRequest entityTypesUri + * @property {google.cloud.dialogflow.cx.v3beta1.IInlineSource|null} [entityTypesContent] ImportEntityTypesRequest entityTypesContent + * @property {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption|null} [mergeOption] ImportEntityTypesRequest mergeOption + * @property {string|null} [targetEntityType] ImportEntityTypesRequest targetEntityType + */ + + /** + * Constructs a new ImportEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportEntityTypesRequest. + * @implements IImportEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest=} [properties] Properties to set + */ + function ImportEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.parent = ""; + + /** + * ImportEntityTypesRequest entityTypesUri. + * @member {string|null|undefined} entityTypesUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.entityTypesUri = null; + + /** + * ImportEntityTypesRequest entityTypesContent. + * @member {google.cloud.dialogflow.cx.v3beta1.IInlineSource|null|undefined} entityTypesContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.entityTypesContent = null; + + /** + * ImportEntityTypesRequest mergeOption. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption} mergeOption + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.mergeOption = 0; + + /** + * ImportEntityTypesRequest targetEntityType. + * @member {string} targetEntityType + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @instance + */ + ImportEntityTypesRequest.prototype.targetEntityType = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportEntityTypesRequest entityTypes. + * @member {"entityTypesUri"|"entityTypesContent"|undefined} entityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @instance + */ + Object.defineProperty(ImportEntityTypesRequest.prototype, "entityTypes", { + get: $util.oneOfGetter($oneOfFields = ["entityTypesUri", "entityTypesContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest} ImportEntityTypesRequest instance + */ + ImportEntityTypesRequest.create = function create(properties) { + return new ImportEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ImportEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest} message ImportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesRequest.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.entityTypesUri != null && Object.hasOwnProperty.call(message, "entityTypesUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypesUri); + if (message.entityTypesContent != null && Object.hasOwnProperty.call(message, "entityTypesContent")) + $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.encode(message.entityTypesContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mergeOption != null && Object.hasOwnProperty.call(message, "mergeOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mergeOption); + if (message.targetEntityType != null && Object.hasOwnProperty.call(message, "targetEntityType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetEntityType); + return writer; + }; + + /** + * Encodes the specified ImportEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest} message ImportEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest} ImportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.entityTypesUri = reader.string(); + break; + } + case 3: { + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.mergeOption = reader.int32(); + break; + } + case 5: { + message.targetEntityType = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest} ImportEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + properties.entityTypes = 1; + if (!$util.isString(message.entityTypesUri)) + return "entityTypesUri: string expected"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + if (properties.entityTypes === 1) + return "entityTypes: multiple values"; + properties.entityTypes = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.verify(message.entityTypesContent, long + 1); + if (error) + return "entityTypesContent." + error; + } + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + switch (message.mergeOption) { + default: + return "mergeOption: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.targetEntityType != null && message.hasOwnProperty("targetEntityType")) + if (!$util.isString(message.targetEntityType)) + return "targetEntityType: string expected"; + return null; + }; + + /** + * Creates an ImportEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest} ImportEntityTypesRequest + */ + ImportEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypesUri != null) + message.entityTypesUri = String(object.entityTypesUri); + if (object.entityTypesContent != null) { + if (typeof object.entityTypesContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.entityTypesContent: object expected"); + message.entityTypesContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.fromObject(object.entityTypesContent, long + 1); + } + switch (object.mergeOption) { + default: + if (typeof object.mergeOption === "number") { + message.mergeOption = object.mergeOption; + break; + } + break; + case "MERGE_OPTION_UNSPECIFIED": + case 0: + message.mergeOption = 0; + break; + case "REPLACE": + case 1: + message.mergeOption = 1; + break; + case "MERGE": + case 2: + message.mergeOption = 2; + break; + case "RENAME": + case 3: + message.mergeOption = 3; + break; + case "REPORT_CONFLICT": + case 4: + message.mergeOption = 4; + break; + case "KEEP": + case 5: + message.mergeOption = 5; + break; + } + if (object.targetEntityType != null) + message.targetEntityType = String(object.targetEntityType); + return message; + }; + + /** + * Creates a plain object from an ImportEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest} message ImportEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mergeOption = options.enums === String ? "MERGE_OPTION_UNSPECIFIED" : 0; + object.targetEntityType = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypesUri != null && message.hasOwnProperty("entityTypesUri")) { + object.entityTypesUri = message.entityTypesUri; + if (options.oneofs) + object.entityTypes = "entityTypesUri"; + } + if (message.entityTypesContent != null && message.hasOwnProperty("entityTypesContent")) { + object.entityTypesContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineSource.toObject(message.entityTypesContent, options); + if (options.oneofs) + object.entityTypes = "entityTypesContent"; + } + if (message.mergeOption != null && message.hasOwnProperty("mergeOption")) + object.mergeOption = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption[message.mergeOption] === undefined ? message.mergeOption : $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption[message.mergeOption] : message.mergeOption; + if (message.targetEntityType != null && message.hasOwnProperty("targetEntityType")) + object.targetEntityType = message.targetEntityType; + return object; + }; + + /** + * Converts this ImportEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest"; + }; + + /** + * MergeOption enum. + * @name google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption + * @enum {number} + * @property {number} MERGE_OPTION_UNSPECIFIED=0 MERGE_OPTION_UNSPECIFIED value + * @property {number} REPLACE=1 REPLACE value + * @property {number} MERGE=2 MERGE value + * @property {number} RENAME=3 RENAME value + * @property {number} REPORT_CONFLICT=4 REPORT_CONFLICT value + * @property {number} KEEP=5 KEEP value + */ + ImportEntityTypesRequest.MergeOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MERGE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "REPLACE"] = 1; + values[valuesById[2] = "MERGE"] = 2; + values[valuesById[3] = "RENAME"] = 3; + values[valuesById[4] = "REPORT_CONFLICT"] = 4; + values[valuesById[5] = "KEEP"] = 5; + return values; + })(); + + return ImportEntityTypesRequest; + })(); + + v3beta1.ImportEntityTypesResponse = (function() { + + /** + * Properties of an ImportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportEntityTypesResponse + * @property {Array.|null} [entityTypes] ImportEntityTypesResponse entityTypes + * @property {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources|null} [conflictingResources] ImportEntityTypesResponse conflictingResources + */ + + /** + * Constructs a new ImportEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportEntityTypesResponse. + * @implements IImportEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse=} [properties] Properties to set + */ + function ImportEntityTypesResponse(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @instance + */ + ImportEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + + /** + * ImportEntityTypesResponse conflictingResources. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources|null|undefined} conflictingResources + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @instance + */ + ImportEntityTypesResponse.prototype.conflictingResources = null; + + /** + * Creates a new ImportEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse} ImportEntityTypesResponse instance + */ + ImportEntityTypesResponse.create = function create(properties) { + return new ImportEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ImportEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse} message ImportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityTypes[i]); + if (message.conflictingResources != null && Object.hasOwnProperty.call(message, "conflictingResources")) + $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.encode(message.conflictingResources, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse} message ImportEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse} ImportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push(reader.string()); + break; + } + case 2: { + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse} ImportEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) + if (!$util.isString(message.entityTypes[i])) + return "entityTypes: string[] expected"; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.verify(message.conflictingResources, long + 1); + if (error) + return "conflictingResources." + error; + } + return null; + }; + + /** + * Creates an ImportEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse} ImportEntityTypesResponse + */ + ImportEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) + message.entityTypes[i] = String(object.entityTypes[i]); + } + if (object.conflictingResources != null) { + if (typeof object.conflictingResources !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.conflictingResources: object expected"); + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.fromObject(object.conflictingResources, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse} message ImportEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) + object.conflictingResources = null; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = message.entityTypes[j]; + } + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) + object.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.toObject(message.conflictingResources, options); + return object; + }; + + /** + * Converts this ImportEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ImportEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse"; + }; + + ImportEntityTypesResponse.ConflictingResources = (function() { + + /** + * Properties of a ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @interface IConflictingResources + * @property {Array.|null} [entityTypeDisplayNames] ConflictingResources entityTypeDisplayNames + * @property {Array.|null} [entityDisplayNames] ConflictingResources entityDisplayNames + */ + + /** + * Constructs a new ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse + * @classdesc Represents a ConflictingResources. + * @implements IConflictingResources + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources=} [properties] Properties to set + */ + function ConflictingResources(properties) { + this.entityTypeDisplayNames = []; + this.entityDisplayNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConflictingResources entityTypeDisplayNames. + * @member {Array.} entityTypeDisplayNames + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.entityTypeDisplayNames = $util.emptyArray; + + /** + * ConflictingResources entityDisplayNames. + * @member {Array.} entityDisplayNames + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.entityDisplayNames = $util.emptyArray; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources} ConflictingResources instance + */ + ConflictingResources.create = function create(properties) { + return new ConflictingResources(properties); + }; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypeDisplayNames != null && message.entityTypeDisplayNames.length) + for (var i = 0; i < message.entityTypeDisplayNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityTypeDisplayNames[i]); + if (message.entityDisplayNames != null && message.entityDisplayNames.length) + for (var i = 0; i < message.entityDisplayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityDisplayNames[i]); + return writer; + }; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entityTypeDisplayNames && message.entityTypeDisplayNames.length)) + message.entityTypeDisplayNames = []; + message.entityTypeDisplayNames.push(reader.string()); + break; + } + case 2: { + if (!(message.entityDisplayNames && message.entityDisplayNames.length)) + message.entityDisplayNames = []; + message.entityDisplayNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConflictingResources message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConflictingResources.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityTypeDisplayNames != null && message.hasOwnProperty("entityTypeDisplayNames")) { + if (!Array.isArray(message.entityTypeDisplayNames)) + return "entityTypeDisplayNames: array expected"; + for (var i = 0; i < message.entityTypeDisplayNames.length; ++i) + if (!$util.isString(message.entityTypeDisplayNames[i])) + return "entityTypeDisplayNames: string[] expected"; + } + if (message.entityDisplayNames != null && message.hasOwnProperty("entityDisplayNames")) { + if (!Array.isArray(message.entityDisplayNames)) + return "entityDisplayNames: array expected"; + for (var i = 0; i < message.entityDisplayNames.length; ++i) + if (!$util.isString(message.entityDisplayNames[i])) + return "entityDisplayNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources} ConflictingResources + */ + ConflictingResources.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources(); + if (object.entityTypeDisplayNames) { + if (!Array.isArray(object.entityTypeDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.entityTypeDisplayNames: array expected"); + message.entityTypeDisplayNames = []; + for (var i = 0; i < object.entityTypeDisplayNames.length; ++i) + message.entityTypeDisplayNames[i] = String(object.entityTypeDisplayNames[i]); + } + if (object.entityDisplayNames) { + if (!Array.isArray(object.entityDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources.entityDisplayNames: array expected"); + message.entityDisplayNames = []; + for (var i = 0; i < object.entityDisplayNames.length; ++i) + message.entityDisplayNames[i] = String(object.entityDisplayNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources} message ConflictingResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConflictingResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.entityTypeDisplayNames = []; + object.entityDisplayNames = []; + } + if (message.entityTypeDisplayNames && message.entityTypeDisplayNames.length) { + object.entityTypeDisplayNames = []; + for (var j = 0; j < message.entityTypeDisplayNames.length; ++j) + object.entityTypeDisplayNames[j] = message.entityTypeDisplayNames[j]; + } + if (message.entityDisplayNames && message.entityDisplayNames.length) { + object.entityDisplayNames = []; + for (var j = 0; j < message.entityDisplayNames.length; ++j) + object.entityDisplayNames[j] = message.entityDisplayNames[j]; + } + return object; + }; + + /** + * Converts this ConflictingResources to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @instance + * @returns {Object.} JSON object + */ + ConflictingResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConflictingResources + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConflictingResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse.ConflictingResources"; + }; + + return ConflictingResources; + })(); + + return ImportEntityTypesResponse; + })(); + + v3beta1.ImportEntityTypesMetadata = (function() { + + /** + * Properties of an ImportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportEntityTypesMetadata + */ + + /** + * Constructs a new ImportEntityTypesMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportEntityTypesMetadata. + * @implements IImportEntityTypesMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata=} [properties] Properties to set + */ + function ImportEntityTypesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ImportEntityTypesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata} ImportEntityTypesMetadata instance + */ + ImportEntityTypesMetadata.create = function create(properties) { + return new ImportEntityTypesMetadata(properties); + }; + + /** + * Encodes the specified ImportEntityTypesMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata} message ImportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportEntityTypesMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata} message ImportEntityTypesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntityTypesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata} ImportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEntityTypesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata} ImportEntityTypesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntityTypesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEntityTypesMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntityTypesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ImportEntityTypesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata} ImportEntityTypesMetadata + */ + ImportEntityTypesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata(); + }; + + /** + * Creates a plain object from an ImportEntityTypesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata} message ImportEntityTypesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntityTypesMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportEntityTypesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportEntityTypesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEntityTypesMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEntityTypesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata"; + }; + + return ImportEntityTypesMetadata; + })(); + + v3beta1.ListEntityTypesRequest = (function() { + + /** + * Properties of a ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListEntityTypesRequest + * @property {string|null} [parent] ListEntityTypesRequest parent + * @property {string|null} [languageCode] ListEntityTypesRequest languageCode + * @property {number|null} [pageSize] ListEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListEntityTypesRequest pageToken + */ + + /** + * Constructs a new ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListEntityTypesRequest. + * @implements IListEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest=} [properties] Properties to set + */ + function ListEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.parent = ""; + + /** + * ListEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.languageCode = ""; + + /** + * ListEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.pageSize = 0; + + /** + * ListEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest} ListEntityTypesRequest instance + */ + ListEntityTypesRequest.create = function create(properties) { + return new ListEntityTypesRequest(properties); + }; + + /** + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest} ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest} ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntityTypesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: 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"; + return null; + }; + + /** + * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest} ListEntityTypesRequest + */ + ListEntityTypesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest} message ListEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntityTypesRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntityTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest"; + }; + + return ListEntityTypesRequest; + })(); + + v3beta1.ListEntityTypesResponse = (function() { + + /** + * Properties of a ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListEntityTypesResponse + * @property {Array.|null} [entityTypes] ListEntityTypesResponse entityTypes + * @property {string|null} [nextPageToken] ListEntityTypesResponse nextPageToken + */ + + /** + * Constructs a new ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListEntityTypesResponse. + * @implements IListEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse=} [properties] Properties to set + */ + function ListEntityTypesResponse(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @instance + */ + ListEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + + /** + * ListEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @instance + */ + ListEntityTypesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} ListEntityTypesResponse instance + */ + ListEntityTypesResponse.create = function create(properties) { + return new ListEntityTypesResponse(properties); + }; + + /** + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.EntityType.encode(message.entityTypes[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 ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.cx.v3beta1.EntityType.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntityTypesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.verify(message.entityTypes[i], long + 1); + if (error) + return "entityTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} ListEntityTypesResponse + */ + ListEntityTypesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.fromObject(object.entityTypes[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} message ListEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.toObject(message.entityTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntityTypesResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntityTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse"; + }; + + return ListEntityTypesResponse; + })(); + + v3beta1.GetEntityTypeRequest = (function() { + + /** + * Properties of a GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetEntityTypeRequest + * @property {string|null} [name] GetEntityTypeRequest name + * @property {string|null} [languageCode] GetEntityTypeRequest languageCode + */ + + /** + * Constructs a new GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetEntityTypeRequest. + * @implements IGetEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest=} [properties] Properties to set + */ + function GetEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @instance + */ + GetEntityTypeRequest.prototype.name = ""; + + /** + * GetEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @instance + */ + GetEntityTypeRequest.prototype.languageCode = ""; + + /** + * Creates a new GetEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest} GetEntityTypeRequest instance + */ + GetEntityTypeRequest.create = function create(properties) { + return new GetEntityTypeRequest(properties); + }; + + /** + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityTypeRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest} GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest} GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest} GetEntityTypeRequest + */ + GetEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest} message GetEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest"; + }; + + return GetEntityTypeRequest; + })(); + + v3beta1.CreateEntityTypeRequest = (function() { + + /** + * Properties of a CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateEntityTypeRequest + * @property {string|null} [parent] CreateEntityTypeRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IEntityType|null} [entityType] CreateEntityTypeRequest entityType + * @property {string|null} [languageCode] CreateEntityTypeRequest languageCode + */ + + /** + * Constructs a new CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateEntityTypeRequest. + * @implements ICreateEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest=} [properties] Properties to set + */ + function CreateEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEntityTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.parent = ""; + + /** + * CreateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.cx.v3beta1.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.entityType = null; + + /** + * CreateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest} CreateEntityTypeRequest instance + */ + CreateEntityTypeRequest.create = function create(properties) { + return new CreateEntityTypeRequest(properties); + }; + + /** + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityTypeRequest.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.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.cx.v3beta1.EntityType.encode(message.entityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.entityType = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.verify(message.entityType, long + 1); + if (error) + return "entityType." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + */ + CreateEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.fromObject(object.entityType, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest} message CreateEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.entityType = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest"; + }; + + return CreateEntityTypeRequest; + })(); + + v3beta1.UpdateEntityTypeRequest = (function() { + + /** + * Properties of an UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateEntityTypeRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IEntityType|null} [entityType] UpdateEntityTypeRequest entityType + * @property {string|null} [languageCode] UpdateEntityTypeRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEntityTypeRequest updateMask + */ + + /** + * Constructs a new UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateEntityTypeRequest. + * @implements IUpdateEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest=} [properties] Properties to set + */ + function UpdateEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.cx.v3beta1.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.entityType = null; + + /** + * UpdateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.languageCode = ""; + + /** + * UpdateEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest instance + */ + UpdateEntityTypeRequest.create = function create(properties) { + return new UpdateEntityTypeRequest(properties); + }; + + /** + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.cx.v3beta1.EntityType.encode(message.entityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityType = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.verify(message.entityType, long + 1); + if (error) + return "entityType." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + */ + UpdateEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.fromObject(object.entityType, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest} message UpdateEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityType = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.cx.v3beta1.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest"; + }; + + return UpdateEntityTypeRequest; + })(); + + v3beta1.DeleteEntityTypeRequest = (function() { + + /** + * Properties of a DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteEntityTypeRequest + * @property {string|null} [name] DeleteEntityTypeRequest name + * @property {boolean|null} [force] DeleteEntityTypeRequest force + */ + + /** + * Constructs a new DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteEntityTypeRequest. + * @implements IDeleteEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest=} [properties] Properties to set + */ + function DeleteEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @instance + */ + DeleteEntityTypeRequest.prototype.name = ""; + + /** + * DeleteEntityTypeRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @instance + */ + DeleteEntityTypeRequest.prototype.force = false; + + /** + * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest instance + */ + DeleteEntityTypeRequest.create = function create(properties) { + return new DeleteEntityTypeRequest(properties); + }; + + /** + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityTypeRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityTypeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEntityTypeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + */ + DeleteEntityTypeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} message DeleteEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEntityTypeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest"; + }; + + return DeleteEntityTypeRequest; + })(); + + v3beta1.TransitionRouteGroups = (function() { + + /** + * Constructs a new TransitionRouteGroups service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TransitionRouteGroups + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TransitionRouteGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TransitionRouteGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TransitionRouteGroups; + + /** + * Creates new TransitionRouteGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TransitionRouteGroups} RPC service. Useful where requests and/or responses are streamed. + */ + TransitionRouteGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|listTransitionRouteGroups}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @typedef ListTransitionRouteGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} [response] ListTransitionRouteGroupsResponse + */ + + /** + * Calls ListTransitionRouteGroups. + * @function listTransitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest} request ListTransitionRouteGroupsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroupsCallback} callback Node-style callback called with the error, if any, and ListTransitionRouteGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.listTransitionRouteGroups = function listTransitionRouteGroups(request, callback) { + return this.rpcCall(listTransitionRouteGroups, $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse, request, callback); + }, "name", { value: "ListTransitionRouteGroups" }); + + /** + * Calls ListTransitionRouteGroups. + * @function listTransitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest} request ListTransitionRouteGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|getTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @typedef GetTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} [response] TransitionRouteGroup + */ + + /** + * Calls GetTransitionRouteGroup. + * @function getTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest} request GetTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and TransitionRouteGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.getTransitionRouteGroup = function getTransitionRouteGroup(request, callback) { + return this.rpcCall(getTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest, $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, request, callback); + }, "name", { value: "GetTransitionRouteGroup" }); + + /** + * Calls GetTransitionRouteGroup. + * @function getTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest} request GetTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|createTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @typedef CreateTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} [response] TransitionRouteGroup + */ + + /** + * Calls CreateTransitionRouteGroup. + * @function createTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest} request CreateTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and TransitionRouteGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.createTransitionRouteGroup = function createTransitionRouteGroup(request, callback) { + return this.rpcCall(createTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest, $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, request, callback); + }, "name", { value: "CreateTransitionRouteGroup" }); + + /** + * Calls CreateTransitionRouteGroup. + * @function createTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest} request CreateTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|updateTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @typedef UpdateTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} [response] TransitionRouteGroup + */ + + /** + * Calls UpdateTransitionRouteGroup. + * @function updateTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest} request UpdateTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and TransitionRouteGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.updateTransitionRouteGroup = function updateTransitionRouteGroup(request, callback) { + return this.rpcCall(updateTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest, $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, request, callback); + }, "name", { value: "UpdateTransitionRouteGroup" }); + + /** + * Calls UpdateTransitionRouteGroup. + * @function updateTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest} request UpdateTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups|deleteTransitionRouteGroup}. + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @typedef DeleteTransitionRouteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTransitionRouteGroup. + * @function deleteTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest} request DeleteTransitionRouteGroupRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TransitionRouteGroups.prototype.deleteTransitionRouteGroup = function deleteTransitionRouteGroup(request, callback) { + return this.rpcCall(deleteTransitionRouteGroup, $root.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTransitionRouteGroup" }); + + /** + * Calls DeleteTransitionRouteGroup. + * @function deleteTransitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest} request DeleteTransitionRouteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TransitionRouteGroups; + })(); + + v3beta1.TransitionRouteGroup = (function() { + + /** + * Properties of a TransitionRouteGroup. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITransitionRouteGroup + * @property {string|null} [name] TransitionRouteGroup name + * @property {string|null} [displayName] TransitionRouteGroup displayName + * @property {Array.|null} [transitionRoutes] TransitionRouteGroup transitionRoutes + */ + + /** + * Constructs a new TransitionRouteGroup. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a TransitionRouteGroup. + * @implements ITransitionRouteGroup + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup=} [properties] Properties to set + */ + function TransitionRouteGroup(properties) { + this.transitionRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionRouteGroup name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @instance + */ + TransitionRouteGroup.prototype.name = ""; + + /** + * TransitionRouteGroup displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @instance + */ + TransitionRouteGroup.prototype.displayName = ""; + + /** + * TransitionRouteGroup transitionRoutes. + * @member {Array.} transitionRoutes + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @instance + */ + TransitionRouteGroup.prototype.transitionRoutes = $util.emptyArray; + + /** + * Creates a new TransitionRouteGroup instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} TransitionRouteGroup instance + */ + TransitionRouteGroup.create = function create(properties) { + return new TransitionRouteGroup(properties); + }; + + /** + * Encodes the specified TransitionRouteGroup message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup} message TransitionRouteGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroup.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.transitionRoutes != null && message.transitionRoutes.length) + for (var i = 0; i < message.transitionRoutes.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.encode(message.transitionRoutes[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitionRouteGroup message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup} message TransitionRouteGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionRouteGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} TransitionRouteGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroup.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 5: { + if (!(message.transitionRoutes && message.transitionRoutes.length)) + message.transitionRoutes = []; + message.transitionRoutes.push($root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionRouteGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} TransitionRouteGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionRouteGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionRouteGroup message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionRouteGroup.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.transitionRoutes != null && message.hasOwnProperty("transitionRoutes")) { + if (!Array.isArray(message.transitionRoutes)) + return "transitionRoutes: array expected"; + for (var i = 0; i < message.transitionRoutes.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.verify(message.transitionRoutes[i], long + 1); + if (error) + return "transitionRoutes." + error; + } + } + return null; + }; + + /** + * Creates a TransitionRouteGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} TransitionRouteGroup + */ + TransitionRouteGroup.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.transitionRoutes) { + if (!Array.isArray(object.transitionRoutes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.transitionRoutes: array expected"); + message.transitionRoutes = []; + for (var i = 0; i < object.transitionRoutes.length; ++i) { + if (typeof object.transitionRoutes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.transitionRoutes: object expected"); + message.transitionRoutes[i] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.fromObject(object.transitionRoutes[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TransitionRouteGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} message TransitionRouteGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionRouteGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitionRoutes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.transitionRoutes && message.transitionRoutes.length) { + object.transitionRoutes = []; + for (var j = 0; j < message.transitionRoutes.length; ++j) + object.transitionRoutes[j] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.toObject(message.transitionRoutes[j], options); + } + return object; + }; + + /** + * Converts this TransitionRouteGroup to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @instance + * @returns {Object.} JSON object + */ + TransitionRouteGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionRouteGroup + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionRouteGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup"; + }; + + return TransitionRouteGroup; + })(); + + v3beta1.ListTransitionRouteGroupsRequest = (function() { + + /** + * Properties of a ListTransitionRouteGroupsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListTransitionRouteGroupsRequest + * @property {string|null} [parent] ListTransitionRouteGroupsRequest parent + * @property {number|null} [pageSize] ListTransitionRouteGroupsRequest pageSize + * @property {string|null} [pageToken] ListTransitionRouteGroupsRequest pageToken + * @property {string|null} [languageCode] ListTransitionRouteGroupsRequest languageCode + */ + + /** + * Constructs a new ListTransitionRouteGroupsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListTransitionRouteGroupsRequest. + * @implements IListTransitionRouteGroupsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest=} [properties] Properties to set + */ + function ListTransitionRouteGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransitionRouteGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.parent = ""; + + /** + * ListTransitionRouteGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.pageSize = 0; + + /** + * ListTransitionRouteGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.pageToken = ""; + + /** + * ListTransitionRouteGroupsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @instance + */ + ListTransitionRouteGroupsRequest.prototype.languageCode = ""; + + /** + * Creates a new ListTransitionRouteGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest instance + */ + ListTransitionRouteGroupsRequest.create = function create(properties) { + return new ListTransitionRouteGroupsRequest(properties); + }; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest} message ListTransitionRouteGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListTransitionRouteGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest} message ListTransitionRouteGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransitionRouteGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransitionRouteGroupsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransitionRouteGroupsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListTransitionRouteGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest} ListTransitionRouteGroupsRequest + */ + ListTransitionRouteGroupsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListTransitionRouteGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest} message ListTransitionRouteGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransitionRouteGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListTransitionRouteGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransitionRouteGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransitionRouteGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransitionRouteGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest"; + }; + + return ListTransitionRouteGroupsRequest; + })(); + + v3beta1.ListTransitionRouteGroupsResponse = (function() { + + /** + * Properties of a ListTransitionRouteGroupsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListTransitionRouteGroupsResponse + * @property {Array.|null} [transitionRouteGroups] ListTransitionRouteGroupsResponse transitionRouteGroups + * @property {string|null} [nextPageToken] ListTransitionRouteGroupsResponse nextPageToken + */ + + /** + * Constructs a new ListTransitionRouteGroupsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListTransitionRouteGroupsResponse. + * @implements IListTransitionRouteGroupsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse=} [properties] Properties to set + */ + function ListTransitionRouteGroupsResponse(properties) { + this.transitionRouteGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransitionRouteGroupsResponse transitionRouteGroups. + * @member {Array.} transitionRouteGroups + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @instance + */ + ListTransitionRouteGroupsResponse.prototype.transitionRouteGroups = $util.emptyArray; + + /** + * ListTransitionRouteGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @instance + */ + ListTransitionRouteGroupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransitionRouteGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse instance + */ + ListTransitionRouteGroupsResponse.create = function create(properties) { + return new ListTransitionRouteGroupsResponse(properties); + }; + + /** + * Encodes the specified ListTransitionRouteGroupsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse} message ListTransitionRouteGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitionRouteGroups != null && message.transitionRouteGroups.length) + for (var i = 0; i < message.transitionRouteGroups.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.encode(message.transitionRouteGroups[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 ListTransitionRouteGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse} message ListTransitionRouteGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransitionRouteGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.transitionRouteGroups && message.transitionRouteGroups.length)) + message.transitionRouteGroups = []; + message.transitionRouteGroups.push($root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransitionRouteGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransitionRouteGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransitionRouteGroupsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransitionRouteGroupsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitionRouteGroups != null && message.hasOwnProperty("transitionRouteGroups")) { + if (!Array.isArray(message.transitionRouteGroups)) + return "transitionRouteGroups: array expected"; + for (var i = 0; i < message.transitionRouteGroups.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify(message.transitionRouteGroups[i], long + 1); + if (error) + return "transitionRouteGroups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransitionRouteGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} ListTransitionRouteGroupsResponse + */ + ListTransitionRouteGroupsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse(); + if (object.transitionRouteGroups) { + if (!Array.isArray(object.transitionRouteGroups)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.transitionRouteGroups: array expected"); + message.transitionRouteGroups = []; + for (var i = 0; i < object.transitionRouteGroups.length; ++i) { + if (typeof object.transitionRouteGroups[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.transitionRouteGroups: object expected"); + message.transitionRouteGroups[i] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.fromObject(object.transitionRouteGroups[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransitionRouteGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} message ListTransitionRouteGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransitionRouteGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transitionRouteGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transitionRouteGroups && message.transitionRouteGroups.length) { + object.transitionRouteGroups = []; + for (var j = 0; j < message.transitionRouteGroups.length; ++j) + object.transitionRouteGroups[j] = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.toObject(message.transitionRouteGroups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransitionRouteGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransitionRouteGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransitionRouteGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransitionRouteGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse"; + }; + + return ListTransitionRouteGroupsResponse; + })(); + + v3beta1.GetTransitionRouteGroupRequest = (function() { + + /** + * Properties of a GetTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetTransitionRouteGroupRequest + * @property {string|null} [name] GetTransitionRouteGroupRequest name + * @property {string|null} [languageCode] GetTransitionRouteGroupRequest languageCode + */ + + /** + * Constructs a new GetTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetTransitionRouteGroupRequest. + * @implements IGetTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest=} [properties] Properties to set + */ + function GetTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTransitionRouteGroupRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @instance + */ + GetTransitionRouteGroupRequest.prototype.name = ""; + + /** + * GetTransitionRouteGroupRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @instance + */ + GetTransitionRouteGroupRequest.prototype.languageCode = ""; + + /** + * Creates a new GetTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest instance + */ + GetTransitionRouteGroupRequest.create = function create(properties) { + return new GetTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest} message GetTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransitionRouteGroupRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest} message GetTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest} GetTransitionRouteGroupRequest + */ + GetTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest} message GetTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest"; + }; + + return GetTransitionRouteGroupRequest; + })(); + + v3beta1.CreateTransitionRouteGroupRequest = (function() { + + /** + * Properties of a CreateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateTransitionRouteGroupRequest + * @property {string|null} [parent] CreateTransitionRouteGroupRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null} [transitionRouteGroup] CreateTransitionRouteGroupRequest transitionRouteGroup + * @property {string|null} [languageCode] CreateTransitionRouteGroupRequest languageCode + */ + + /** + * Constructs a new CreateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateTransitionRouteGroupRequest. + * @implements ICreateTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest=} [properties] Properties to set + */ + function CreateTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTransitionRouteGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @instance + */ + CreateTransitionRouteGroupRequest.prototype.parent = ""; + + /** + * CreateTransitionRouteGroupRequest transitionRouteGroup. + * @member {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null|undefined} transitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @instance + */ + CreateTransitionRouteGroupRequest.prototype.transitionRouteGroup = null; + + /** + * CreateTransitionRouteGroupRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @instance + */ + CreateTransitionRouteGroupRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest instance + */ + CreateTransitionRouteGroupRequest.create = function create(properties) { + return new CreateTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest} message CreateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransitionRouteGroupRequest.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.transitionRouteGroup != null && Object.hasOwnProperty.call(message, "transitionRouteGroup")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.encode(message.transitionRouteGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest} message CreateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify(message.transitionRouteGroup, long + 1); + if (error) + return "transitionRouteGroup." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest} CreateTransitionRouteGroupRequest + */ + CreateTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.transitionRouteGroup != null) { + if (typeof object.transitionRouteGroup !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.transitionRouteGroup: object expected"); + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.fromObject(object.transitionRouteGroup, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest} message CreateTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.transitionRouteGroup = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) + object.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.toObject(message.transitionRouteGroup, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest"; + }; + + return CreateTransitionRouteGroupRequest; + })(); + + v3beta1.UpdateTransitionRouteGroupRequest = (function() { + + /** + * Properties of an UpdateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateTransitionRouteGroupRequest + * @property {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null} [transitionRouteGroup] UpdateTransitionRouteGroupRequest transitionRouteGroup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTransitionRouteGroupRequest updateMask + * @property {string|null} [languageCode] UpdateTransitionRouteGroupRequest languageCode + */ + + /** + * Constructs a new UpdateTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateTransitionRouteGroupRequest. + * @implements IUpdateTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest=} [properties] Properties to set + */ + function UpdateTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTransitionRouteGroupRequest transitionRouteGroup. + * @member {google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup|null|undefined} transitionRouteGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @instance + */ + UpdateTransitionRouteGroupRequest.prototype.transitionRouteGroup = null; + + /** + * UpdateTransitionRouteGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @instance + */ + UpdateTransitionRouteGroupRequest.prototype.updateMask = null; + + /** + * UpdateTransitionRouteGroupRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @instance + */ + UpdateTransitionRouteGroupRequest.prototype.languageCode = ""; + + /** + * Creates a new UpdateTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest instance + */ + UpdateTransitionRouteGroupRequest.create = function create(properties) { + return new UpdateTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest} message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransitionRouteGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transitionRouteGroup != null && Object.hasOwnProperty.call(message, "transitionRouteGroup")) + $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.encode(message.transitionRouteGroup, 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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified UpdateTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest} message UpdateTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.verify(message.transitionRouteGroup, long + 1); + if (error) + return "transitionRouteGroup." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an UpdateTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest} UpdateTransitionRouteGroupRequest + */ + UpdateTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(); + if (object.transitionRouteGroup != null) { + if (typeof object.transitionRouteGroup !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.transitionRouteGroup: object expected"); + message.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.fromObject(object.transitionRouteGroup, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an UpdateTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest} message UpdateTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transitionRouteGroup = null; + object.updateMask = null; + object.languageCode = ""; + } + if (message.transitionRouteGroup != null && message.hasOwnProperty("transitionRouteGroup")) + object.transitionRouteGroup = $root.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.toObject(message.transitionRouteGroup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this UpdateTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest"; + }; + + return UpdateTransitionRouteGroupRequest; + })(); + + v3beta1.DeleteTransitionRouteGroupRequest = (function() { + + /** + * Properties of a DeleteTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteTransitionRouteGroupRequest + * @property {string|null} [name] DeleteTransitionRouteGroupRequest name + * @property {boolean|null} [force] DeleteTransitionRouteGroupRequest force + */ + + /** + * Constructs a new DeleteTransitionRouteGroupRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteTransitionRouteGroupRequest. + * @implements IDeleteTransitionRouteGroupRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest=} [properties] Properties to set + */ + function DeleteTransitionRouteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTransitionRouteGroupRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @instance + */ + DeleteTransitionRouteGroupRequest.prototype.name = ""; + + /** + * DeleteTransitionRouteGroupRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @instance + */ + DeleteTransitionRouteGroupRequest.prototype.force = false; + + /** + * Creates a new DeleteTransitionRouteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest instance + */ + DeleteTransitionRouteGroupRequest.create = function create(properties) { + return new DeleteTransitionRouteGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest} message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransitionRouteGroupRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteTransitionRouteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest} message DeleteTransitionRouteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransitionRouteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransitionRouteGroupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTransitionRouteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransitionRouteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTransitionRouteGroupRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTransitionRouteGroupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteTransitionRouteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest} DeleteTransitionRouteGroupRequest + */ + DeleteTransitionRouteGroupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteTransitionRouteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest} message DeleteTransitionRouteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTransitionRouteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteTransitionRouteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTransitionRouteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTransitionRouteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTransitionRouteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest"; + }; + + return DeleteTransitionRouteGroupRequest; + })(); + + v3beta1.Webhooks = (function() { + + /** + * Constructs a new Webhooks service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Webhooks + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Webhooks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Webhooks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Webhooks; + + /** + * Creates new Webhooks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Webhooks} RPC service. Useful where requests and/or responses are streamed. + */ + Webhooks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|listWebhooks}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @typedef ListWebhooksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} [response] ListWebhooksResponse + */ + + /** + * Calls ListWebhooks. + * @function listWebhooks + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest} request ListWebhooksRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooksCallback} callback Node-style callback called with the error, if any, and ListWebhooksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.listWebhooks = function listWebhooks(request, callback) { + return this.rpcCall(listWebhooks, $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse, request, callback); + }, "name", { value: "ListWebhooks" }); + + /** + * Calls ListWebhooks. + * @function listWebhooks + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest} request ListWebhooksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|getWebhook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @typedef GetWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook} [response] Webhook + */ + + /** + * Calls GetWebhook. + * @function getWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest} request GetWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhookCallback} callback Node-style callback called with the error, if any, and Webhook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.getWebhook = function getWebhook(request, callback) { + return this.rpcCall(getWebhook, $root.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest, $root.google.cloud.dialogflow.cx.v3beta1.Webhook, request, callback); + }, "name", { value: "GetWebhook" }); + + /** + * Calls GetWebhook. + * @function getWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest} request GetWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|createWebhook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @typedef CreateWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook} [response] Webhook + */ + + /** + * Calls CreateWebhook. + * @function createWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest} request CreateWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhookCallback} callback Node-style callback called with the error, if any, and Webhook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.createWebhook = function createWebhook(request, callback) { + return this.rpcCall(createWebhook, $root.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest, $root.google.cloud.dialogflow.cx.v3beta1.Webhook, request, callback); + }, "name", { value: "CreateWebhook" }); + + /** + * Calls CreateWebhook. + * @function createWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest} request CreateWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|updateWebhook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @typedef UpdateWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook} [response] Webhook + */ + + /** + * Calls UpdateWebhook. + * @function updateWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest} request UpdateWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhookCallback} callback Node-style callback called with the error, if any, and Webhook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.updateWebhook = function updateWebhook(request, callback) { + return this.rpcCall(updateWebhook, $root.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest, $root.google.cloud.dialogflow.cx.v3beta1.Webhook, request, callback); + }, "name", { value: "UpdateWebhook" }); + + /** + * Calls UpdateWebhook. + * @function updateWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest} request UpdateWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Webhooks|deleteWebhook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @typedef DeleteWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteWebhook. + * @function deleteWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest} request DeleteWebhookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhookCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Webhooks.prototype.deleteWebhook = function deleteWebhook(request, callback) { + return this.rpcCall(deleteWebhook, $root.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteWebhook" }); + + /** + * Calls DeleteWebhook. + * @function deleteWebhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest} request DeleteWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Webhooks; + })(); + + v3beta1.Webhook = (function() { + + /** + * Properties of a Webhook. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IWebhook + * @property {string|null} [name] Webhook name + * @property {string|null} [displayName] Webhook displayName + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null} [genericWebService] Webhook genericWebService + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig|null} [serviceDirectory] Webhook serviceDirectory + * @property {google.protobuf.IDuration|null} [timeout] Webhook timeout + * @property {boolean|null} [disabled] Webhook disabled + */ + + /** + * Constructs a new Webhook. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Webhook. + * @implements IWebhook + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhook=} [properties] Properties to set + */ + function Webhook(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Webhook name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + */ + Webhook.prototype.name = ""; + + /** + * Webhook displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + */ + Webhook.prototype.displayName = ""; + + /** + * Webhook genericWebService. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null|undefined} genericWebService + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + */ + Webhook.prototype.genericWebService = null; + + /** + * Webhook serviceDirectory. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig|null|undefined} serviceDirectory + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + */ + Webhook.prototype.serviceDirectory = null; + + /** + * Webhook timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + */ + Webhook.prototype.timeout = null; + + /** + * Webhook disabled. + * @member {boolean} disabled + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + */ + Webhook.prototype.disabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Webhook webhook. + * @member {"genericWebService"|"serviceDirectory"|undefined} webhook + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + */ + Object.defineProperty(Webhook.prototype, "webhook", { + get: $util.oneOfGetter($oneOfFields = ["genericWebService", "serviceDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Webhook instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhook=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook} Webhook instance + */ + Webhook.create = function create(properties) { + return new Webhook(properties); + }; + + /** + * Encodes the specified Webhook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhook} message Webhook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Webhook.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.genericWebService != null && Object.hasOwnProperty.call(message, "genericWebService")) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.encode(message.genericWebService, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disabled); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.serviceDirectory != null && Object.hasOwnProperty.call(message, "serviceDirectory")) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.encode(message.serviceDirectory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Webhook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhook} message Webhook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Webhook.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Webhook message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook} Webhook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Webhook.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 4: { + message.genericWebService = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.serviceDirectory = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Webhook message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook} Webhook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Webhook.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Webhook message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Webhook.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) { + properties.webhook = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.verify(message.genericWebService, long + 1); + if (error) + return "genericWebService." + error; + } + } + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) { + if (properties.webhook === 1) + return "webhook: multiple values"; + properties.webhook = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.verify(message.serviceDirectory, long + 1); + if (error) + return "serviceDirectory." + error; + } + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout, long + 1); + if (error) + return "timeout." + error; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a Webhook message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook} Webhook + */ + Webhook.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Webhook) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.genericWebService != null) { + if (typeof object.genericWebService !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.genericWebService: object expected"); + message.genericWebService = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.fromObject(object.genericWebService, long + 1); + } + if (object.serviceDirectory != null) { + if (typeof object.serviceDirectory !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.serviceDirectory: object expected"); + message.serviceDirectory = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.fromObject(object.serviceDirectory, long + 1); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout, long + 1); + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a Webhook message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook} message Webhook + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Webhook.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.disabled = false; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) { + object.genericWebService = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.toObject(message.genericWebService, options); + if (options.oneofs) + object.webhook = "genericWebService"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) { + object.serviceDirectory = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.toObject(message.serviceDirectory, options); + if (options.oneofs) + object.webhook = "serviceDirectory"; + } + return object; + }; + + /** + * Converts this Webhook to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @instance + * @returns {Object.} JSON object + */ + Webhook.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Webhook + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Webhook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Webhook"; + }; + + Webhook.GenericWebService = (function() { + + /** + * Properties of a GenericWebService. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @interface IGenericWebService + * @property {string|null} [uri] GenericWebService uri + * @property {string|null} [username] GenericWebService username + * @property {string|null} [password] GenericWebService password + * @property {string|null} [secretVersionForUsernamePassword] GenericWebService secretVersionForUsernamePassword + * @property {Object.|null} [requestHeaders] GenericWebService requestHeaders + * @property {Object.|null} [secretVersionsForRequestHeaders] GenericWebService secretVersionsForRequestHeaders + * @property {Array.|null} [allowedCaCerts] GenericWebService allowedCaCerts + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig|null} [oauthConfig] GenericWebService oauthConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth|null} [serviceAgentAuth] GenericWebService serviceAgentAuth + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] GenericWebService serviceAccountAuthConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|null} [webhookType] GenericWebService webhookType + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|null} [httpMethod] GenericWebService httpMethod + * @property {string|null} [requestBody] GenericWebService requestBody + * @property {Object.|null} [parameterMapping] GenericWebService parameterMapping + */ + + /** + * Constructs a new GenericWebService. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @classdesc Represents a GenericWebService. + * @implements IGenericWebService + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService=} [properties] Properties to set + */ + function GenericWebService(properties) { + this.requestHeaders = {}; + this.secretVersionsForRequestHeaders = {}; + this.allowedCaCerts = []; + this.parameterMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenericWebService uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.uri = ""; + + /** + * GenericWebService username. + * @member {string} username + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.username = ""; + + /** + * GenericWebService password. + * @member {string} password + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.password = ""; + + /** + * GenericWebService secretVersionForUsernamePassword. + * @member {string} secretVersionForUsernamePassword + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.secretVersionForUsernamePassword = ""; + + /** + * GenericWebService requestHeaders. + * @member {Object.} requestHeaders + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.requestHeaders = $util.emptyObject; + + /** + * GenericWebService secretVersionsForRequestHeaders. + * @member {Object.} secretVersionsForRequestHeaders + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.secretVersionsForRequestHeaders = $util.emptyObject; + + /** + * GenericWebService allowedCaCerts. + * @member {Array.} allowedCaCerts + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.allowedCaCerts = $util.emptyArray; + + /** + * GenericWebService oauthConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig|null|undefined} oauthConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.oauthConfig = null; + + /** + * GenericWebService serviceAgentAuth. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth} serviceAgentAuth + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.serviceAgentAuth = 0; + + /** + * GenericWebService serviceAccountAuthConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.serviceAccountAuthConfig = null; + + /** + * GenericWebService webhookType. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType} webhookType + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.webhookType = 0; + + /** + * GenericWebService httpMethod. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod} httpMethod + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.httpMethod = 0; + + /** + * GenericWebService requestBody. + * @member {string} requestBody + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.requestBody = ""; + + /** + * GenericWebService parameterMapping. + * @member {Object.} parameterMapping + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.parameterMapping = $util.emptyObject; + + /** + * Creates a new GenericWebService instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService} GenericWebService instance + */ + GenericWebService.create = function create(properties) { + return new GenericWebService(properties); + }; + + /** + * Encodes the specified GenericWebService message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService} message GenericWebService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenericWebService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.password); + if (message.requestHeaders != null && Object.hasOwnProperty.call(message, "requestHeaders")) + for (var keys = Object.keys(message.requestHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.requestHeaders[keys[i]]).ldelim(); + if (message.allowedCaCerts != null && message.allowedCaCerts.length) + for (var i = 0; i < message.allowedCaCerts.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.allowedCaCerts[i]); + if (message.webhookType != null && Object.hasOwnProperty.call(message, "webhookType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookType); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.httpMethod); + if (message.requestBody != null && Object.hasOwnProperty.call(message, "requestBody")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.requestBody); + if (message.parameterMapping != null && Object.hasOwnProperty.call(message, "parameterMapping")) + for (var keys = Object.keys(message.parameterMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameterMapping[keys[i]]).ldelim(); + if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.serviceAgentAuth != null && Object.hasOwnProperty.call(message, "serviceAgentAuth")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.serviceAgentAuth); + if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.secretVersionForUsernamePassword != null && Object.hasOwnProperty.call(message, "secretVersionForUsernamePassword")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.secretVersionForUsernamePassword); + if (message.secretVersionsForRequestHeaders != null && Object.hasOwnProperty.call(message, "secretVersionsForRequestHeaders")) + for (var keys = Object.keys(message.secretVersionsForRequestHeaders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.encode(message.secretVersionsForRequestHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified GenericWebService message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService} message GenericWebService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenericWebService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenericWebService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService} GenericWebService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenericWebService.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.username = reader.string(); + break; + } + case 3: { + message.password = reader.string(); + break; + } + case 19: { + message.secretVersionForUsernamePassword = reader.string(); + break; + } + case 4: { + if (message.requestHeaders === $util.emptyObject) + message.requestHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.requestHeaders, key); + message.requestHeaders[key] = value; + break; + } + case 20: { + if (message.secretVersionsForRequestHeaders === $util.emptyObject) + message.secretVersionsForRequestHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.secretVersionsForRequestHeaders, key); + message.secretVersionsForRequestHeaders[key] = value; + break; + } + case 5: { + if (!(message.allowedCaCerts && message.allowedCaCerts.length)) + message.allowedCaCerts = []; + message.allowedCaCerts.push(reader.bytes()); + break; + } + case 11: { + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.serviceAgentAuth = reader.int32(); + break; + } + case 18: { + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.webhookType = reader.int32(); + break; + } + case 7: { + message.httpMethod = reader.int32(); + break; + } + case 8: { + message.requestBody = reader.string(); + break; + } + case 9: { + if (message.parameterMapping === $util.emptyObject) + message.parameterMapping = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameterMapping, key); + message.parameterMapping[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenericWebService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService} GenericWebService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenericWebService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenericWebService message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenericWebService.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.secretVersionForUsernamePassword != null && message.hasOwnProperty("secretVersionForUsernamePassword")) + if (!$util.isString(message.secretVersionForUsernamePassword)) + return "secretVersionForUsernamePassword: string expected"; + if (message.requestHeaders != null && message.hasOwnProperty("requestHeaders")) { + if (!$util.isObject(message.requestHeaders)) + return "requestHeaders: object expected"; + var key = Object.keys(message.requestHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.requestHeaders[key[i]])) + return "requestHeaders: string{k:string} expected"; + } + if (message.secretVersionsForRequestHeaders != null && message.hasOwnProperty("secretVersionsForRequestHeaders")) { + if (!$util.isObject(message.secretVersionsForRequestHeaders)) + return "secretVersionsForRequestHeaders: object expected"; + var key = Object.keys(message.secretVersionsForRequestHeaders); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.verify(message.secretVersionsForRequestHeaders[key[i]], long + 1); + if (error) + return "secretVersionsForRequestHeaders." + error; + } + } + if (message.allowedCaCerts != null && message.hasOwnProperty("allowedCaCerts")) { + if (!Array.isArray(message.allowedCaCerts)) + return "allowedCaCerts: array expected"; + for (var i = 0; i < message.allowedCaCerts.length; ++i) + if (!(message.allowedCaCerts[i] && typeof message.allowedCaCerts[i].length === "number" || $util.isString(message.allowedCaCerts[i]))) + return "allowedCaCerts: buffer[] expected"; + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.verify(message.oauthConfig, long + 1); + if (error) + return "oauthConfig." + error; + } + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + switch (message.serviceAgentAuth) { + default: + return "serviceAgentAuth: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig, long + 1); + if (error) + return "serviceAccountAuthConfig." + error; + } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + switch (message.webhookType) { + default: + return "webhookType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + switch (message.httpMethod) { + default: + return "httpMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + if (!$util.isString(message.requestBody)) + return "requestBody: string expected"; + if (message.parameterMapping != null && message.hasOwnProperty("parameterMapping")) { + if (!$util.isObject(message.parameterMapping)) + return "parameterMapping: object expected"; + var key = Object.keys(message.parameterMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameterMapping[key[i]])) + return "parameterMapping: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GenericWebService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService} GenericWebService + */ + GenericWebService.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.secretVersionForUsernamePassword != null) + message.secretVersionForUsernamePassword = String(object.secretVersionForUsernamePassword); + if (object.requestHeaders) { + if (typeof object.requestHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.requestHeaders: object expected"); + message.requestHeaders = {}; + for (var keys = Object.keys(object.requestHeaders), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.requestHeaders, keys[i]); + message.requestHeaders[keys[i]] = String(object.requestHeaders[keys[i]]); + } + } + if (object.secretVersionsForRequestHeaders) { + if (typeof object.secretVersionsForRequestHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.secretVersionsForRequestHeaders: object expected"); + message.secretVersionsForRequestHeaders = {}; + for (var keys = Object.keys(object.secretVersionsForRequestHeaders), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.secretVersionsForRequestHeaders, keys[i]); + if (typeof object.secretVersionsForRequestHeaders[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.secretVersionsForRequestHeaders: object expected"); + message.secretVersionsForRequestHeaders[keys[i]] = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.fromObject(object.secretVersionsForRequestHeaders[keys[i]], long + 1); + } + } + if (object.allowedCaCerts) { + if (!Array.isArray(object.allowedCaCerts)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.allowedCaCerts: array expected"); + message.allowedCaCerts = []; + for (var i = 0; i < object.allowedCaCerts.length; ++i) + if (typeof object.allowedCaCerts[i] === "string") + $util.base64.decode(object.allowedCaCerts[i], message.allowedCaCerts[i] = $util.newBuffer($util.base64.length(object.allowedCaCerts[i])), 0); + else if (object.allowedCaCerts[i].length >= 0) + message.allowedCaCerts[i] = object.allowedCaCerts[i]; + } + if (object.oauthConfig != null) { + if (typeof object.oauthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.oauthConfig: object expected"); + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.fromObject(object.oauthConfig, long + 1); + } + switch (object.serviceAgentAuth) { + default: + if (typeof object.serviceAgentAuth === "number") { + message.serviceAgentAuth = object.serviceAgentAuth; + break; + } + break; + case "SERVICE_AGENT_AUTH_UNSPECIFIED": + case 0: + message.serviceAgentAuth = 0; + break; + case "NONE": + case 1: + message.serviceAgentAuth = 1; + break; + case "ID_TOKEN": + case 2: + message.serviceAgentAuth = 2; + break; + case "ACCESS_TOKEN": + case 3: + message.serviceAgentAuth = 3; + break; + } + if (object.serviceAccountAuthConfig != null) { + if (typeof object.serviceAccountAuthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.serviceAccountAuthConfig: object expected"); + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig, long + 1); + } + switch (object.webhookType) { + default: + if (typeof object.webhookType === "number") { + message.webhookType = object.webhookType; + break; + } + break; + case "WEBHOOK_TYPE_UNSPECIFIED": + case 0: + message.webhookType = 0; + break; + case "STANDARD": + case 1: + message.webhookType = 1; + break; + case "FLEXIBLE": + case 2: + message.webhookType = 2; + break; + } + switch (object.httpMethod) { + default: + if (typeof object.httpMethod === "number") { + message.httpMethod = object.httpMethod; + break; + } + break; + case "HTTP_METHOD_UNSPECIFIED": + case 0: + message.httpMethod = 0; + break; + case "POST": + case 1: + message.httpMethod = 1; + break; + case "GET": + case 2: + message.httpMethod = 2; + break; + case "HEAD": + case 3: + message.httpMethod = 3; + break; + case "PUT": + case 4: + message.httpMethod = 4; + break; + case "DELETE": + case 5: + message.httpMethod = 5; + break; + case "PATCH": + case 6: + message.httpMethod = 6; + break; + case "OPTIONS": + case 7: + message.httpMethod = 7; + break; + } + if (object.requestBody != null) + message.requestBody = String(object.requestBody); + if (object.parameterMapping) { + if (typeof object.parameterMapping !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.parameterMapping: object expected"); + message.parameterMapping = {}; + for (var keys = Object.keys(object.parameterMapping), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameterMapping, keys[i]); + message.parameterMapping[keys[i]] = String(object.parameterMapping[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenericWebService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService} message GenericWebService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenericWebService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedCaCerts = []; + if (options.objects || options.defaults) { + object.requestHeaders = {}; + object.parameterMapping = {}; + object.secretVersionsForRequestHeaders = {}; + } + if (options.defaults) { + object.uri = ""; + object.username = ""; + object.password = ""; + object.webhookType = options.enums === String ? "WEBHOOK_TYPE_UNSPECIFIED" : 0; + object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; + object.requestBody = ""; + object.oauthConfig = null; + object.serviceAgentAuth = options.enums === String ? "SERVICE_AGENT_AUTH_UNSPECIFIED" : 0; + object.serviceAccountAuthConfig = null; + object.secretVersionForUsernamePassword = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + var keys2; + if (message.requestHeaders && (keys2 = Object.keys(message.requestHeaders)).length) { + object.requestHeaders = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.requestHeaders, keys2[j]); + object.requestHeaders[keys2[j]] = message.requestHeaders[keys2[j]]; + } + } + if (message.allowedCaCerts && message.allowedCaCerts.length) { + object.allowedCaCerts = []; + for (var j = 0; j < message.allowedCaCerts.length; ++j) + object.allowedCaCerts[j] = options.bytes === String ? $util.base64.encode(message.allowedCaCerts[j], 0, message.allowedCaCerts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.allowedCaCerts[j]) : message.allowedCaCerts[j]; + } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + object.webhookType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType[message.webhookType] === undefined ? message.webhookType : $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType[message.webhookType] : message.webhookType; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod[message.httpMethod] : message.httpMethod; + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + object.requestBody = message.requestBody; + if (message.parameterMapping && (keys2 = Object.keys(message.parameterMapping)).length) { + object.parameterMapping = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameterMapping, keys2[j]); + object.parameterMapping[keys2[j]] = message.parameterMapping[keys2[j]]; + } + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) + object.oauthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.toObject(message.oauthConfig, options); + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + object.serviceAgentAuth = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth[message.serviceAgentAuth] === undefined ? message.serviceAgentAuth : $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth[message.serviceAgentAuth] : message.serviceAgentAuth; + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) + object.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); + if (message.secretVersionForUsernamePassword != null && message.hasOwnProperty("secretVersionForUsernamePassword")) + object.secretVersionForUsernamePassword = message.secretVersionForUsernamePassword; + if (message.secretVersionsForRequestHeaders && (keys2 = Object.keys(message.secretVersionsForRequestHeaders)).length) { + object.secretVersionsForRequestHeaders = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.secretVersionsForRequestHeaders, keys2[j]); + object.secretVersionsForRequestHeaders[keys2[j]] = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.toObject(message.secretVersionsForRequestHeaders[keys2[j]], options); + } + } + return object; + }; + + /** + * Converts this GenericWebService to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + * @returns {Object.} JSON object + */ + GenericWebService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenericWebService + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenericWebService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService"; + }; + + GenericWebService.SecretVersionHeaderValue = (function() { + + /** + * Properties of a SecretVersionHeaderValue. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @interface ISecretVersionHeaderValue + * @property {string|null} [secretVersion] SecretVersionHeaderValue secretVersion + */ + + /** + * Constructs a new SecretVersionHeaderValue. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @classdesc Represents a SecretVersionHeaderValue. + * @implements ISecretVersionHeaderValue + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue=} [properties] Properties to set + */ + function SecretVersionHeaderValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecretVersionHeaderValue secretVersion. + * @member {string} secretVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @instance + */ + SecretVersionHeaderValue.prototype.secretVersion = ""; + + /** + * Creates a new SecretVersionHeaderValue instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue instance + */ + SecretVersionHeaderValue.create = function create(properties) { + return new SecretVersionHeaderValue(properties); + }; + + /** + * Encodes the specified SecretVersionHeaderValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue} message SecretVersionHeaderValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVersionHeaderValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secretVersion != null && Object.hasOwnProperty.call(message, "secretVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secretVersion); + return writer; + }; + + /** + * Encodes the specified SecretVersionHeaderValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ISecretVersionHeaderValue} message SecretVersionHeaderValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVersionHeaderValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVersionHeaderValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.secretVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SecretVersionHeaderValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVersionHeaderValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecretVersionHeaderValue message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretVersionHeaderValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + if (!$util.isString(message.secretVersion)) + return "secretVersion: string expected"; + return null; + }; + + /** + * Creates a SecretVersionHeaderValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue} SecretVersionHeaderValue + */ + SecretVersionHeaderValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue(); + if (object.secretVersion != null) + message.secretVersion = String(object.secretVersion); + return message; + }; + + /** + * Creates a plain object from a SecretVersionHeaderValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue} message SecretVersionHeaderValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretVersionHeaderValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.secretVersion = ""; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + object.secretVersion = message.secretVersion; + return object; + }; + + /** + * Converts this SecretVersionHeaderValue to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @instance + * @returns {Object.} JSON object + */ + SecretVersionHeaderValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretVersionHeaderValue + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretVersionHeaderValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.SecretVersionHeaderValue"; + }; + + return SecretVersionHeaderValue; + })(); + + GenericWebService.OAuthConfig = (function() { + + /** + * Properties of a OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @interface IOAuthConfig + * @property {string|null} [clientId] OAuthConfig clientId + * @property {string|null} [clientSecret] OAuthConfig clientSecret + * @property {string|null} [secretVersionForClientSecret] OAuthConfig secretVersionForClientSecret + * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint + * @property {Array.|null} [scopes] OAuthConfig scopes + */ + + /** + * Constructs a new OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @classdesc Represents a OAuthConfig. + * @implements IOAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig=} [properties] Properties to set + */ + function OAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthConfig clientId. + * @member {string} clientId + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientId = ""; + + /** + * OAuthConfig clientSecret. + * @member {string} clientSecret + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientSecret = ""; + + /** + * OAuthConfig secretVersionForClientSecret. + * @member {string} secretVersionForClientSecret + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.secretVersionForClientSecret = ""; + + /** + * OAuthConfig tokenEndpoint. + * @member {string} tokenEndpoint + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.tokenEndpoint = ""; + + /** + * OAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @instance + */ + OAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig} OAuthConfig instance + */ + OAuthConfig.create = function create(properties) { + return new OAuthConfig(properties); + }; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientSecret != null && Object.hasOwnProperty.call(message, "clientSecret")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientSecret); + if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tokenEndpoint); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.scopes[i]); + if (message.secretVersionForClientSecret != null && Object.hasOwnProperty.call(message, "secretVersionForClientSecret")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.secretVersionForClientSecret); + return writer; + }; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.clientSecret = reader.string(); + break; + } + case 5: { + message.secretVersionForClientSecret = reader.string(); + break; + } + case 3: { + message.tokenEndpoint = reader.string(); + break; + } + case 4: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + if (!$util.isString(message.clientSecret)) + return "clientSecret: string expected"; + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + if (!$util.isString(message.secretVersionForClientSecret)) + return "secretVersionForClientSecret: string expected"; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + if (!$util.isString(message.tokenEndpoint)) + return "tokenEndpoint: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig} OAuthConfig + */ + OAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecret != null) + message.clientSecret = String(object.clientSecret); + if (object.secretVersionForClientSecret != null) + message.secretVersionForClientSecret = String(object.secretVersionForClientSecret); + if (object.tokenEndpoint != null) + message.tokenEndpoint = String(object.tokenEndpoint); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig} message OAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.clientId = ""; + object.clientSecret = ""; + object.tokenEndpoint = ""; + object.secretVersionForClientSecret = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + object.clientSecret = message.clientSecret; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + object.tokenEndpoint = message.tokenEndpoint; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + object.secretVersionForClientSecret = message.secretVersionForClientSecret; + return object; + }; + + /** + * Converts this OAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @instance + * @returns {Object.} JSON object + */ + OAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.OAuthConfig"; + }; + + return OAuthConfig; + })(); + + /** + * ServiceAgentAuth enum. + * @name google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAgentAuth + * @enum {number} + * @property {number} SERVICE_AGENT_AUTH_UNSPECIFIED=0 SERVICE_AGENT_AUTH_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} ID_TOKEN=2 ID_TOKEN value + * @property {number} ACCESS_TOKEN=3 ACCESS_TOKEN value + */ + GenericWebService.ServiceAgentAuth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_AGENT_AUTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "ID_TOKEN"] = 2; + values[valuesById[3] = "ACCESS_TOKEN"] = 3; + return values; + })(); + + GenericWebService.ServiceAccountAuthConfig = (function() { + + /** + * Properties of a ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @interface IServiceAccountAuthConfig + * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount + */ + + /** + * Constructs a new ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @classdesc Represents a ServiceAccountAuthConfig. + * @implements IServiceAccountAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig=} [properties] Properties to set + */ + function ServiceAccountAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountAuthConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.serviceAccount = ""; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance + */ + ServiceAccountAuthConfig.create = function create(properties) { + return new ServiceAccountAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig} ServiceAccountAuthConfig + */ + ServiceAccountAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig} message ServiceAccountAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceAccount = ""; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.ServiceAccountAuthConfig"; + }; + + return ServiceAccountAuthConfig; + })(); + + /** + * WebhookType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType + * @enum {number} + * @property {number} WEBHOOK_TYPE_UNSPECIFIED=0 WEBHOOK_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} FLEXIBLE=2 FLEXIBLE value + */ + GenericWebService.WebhookType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEBHOOK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "FLEXIBLE"] = 2; + return values; + })(); + + /** + * HttpMethod enum. + * @name google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod + * @enum {number} + * @property {number} HTTP_METHOD_UNSPECIFIED=0 HTTP_METHOD_UNSPECIFIED value + * @property {number} POST=1 POST value + * @property {number} GET=2 GET value + * @property {number} HEAD=3 HEAD value + * @property {number} PUT=4 PUT value + * @property {number} DELETE=5 DELETE value + * @property {number} PATCH=6 PATCH value + * @property {number} OPTIONS=7 OPTIONS value + */ + GenericWebService.HttpMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HTTP_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "POST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "HEAD"] = 3; + values[valuesById[4] = "PUT"] = 4; + values[valuesById[5] = "DELETE"] = 5; + values[valuesById[6] = "PATCH"] = 6; + values[valuesById[7] = "OPTIONS"] = 7; + return values; + })(); + + return GenericWebService; + })(); + + Webhook.ServiceDirectoryConfig = (function() { + + /** + * Properties of a ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @interface IServiceDirectoryConfig + * @property {string|null} [service] ServiceDirectoryConfig service + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null} [genericWebService] ServiceDirectoryConfig genericWebService + */ + + /** + * Constructs a new ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook + * @classdesc Represents a ServiceDirectoryConfig. + * @implements IServiceDirectoryConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig=} [properties] Properties to set + */ + function ServiceDirectoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDirectoryConfig service. + * @member {string} service + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.service = ""; + + /** + * ServiceDirectoryConfig genericWebService. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.IGenericWebService|null|undefined} genericWebService + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.genericWebService = null; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig instance + */ + ServiceDirectoryConfig.create = function create(properties) { + return new ServiceDirectoryConfig(properties); + }; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.genericWebService != null && Object.hasOwnProperty.call(message, "genericWebService")) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.encode(message.genericWebService, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 2: { + message.genericWebService = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDirectoryConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDirectoryConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.verify(message.genericWebService, long + 1); + if (error) + return "genericWebService." + error; + } + return null; + }; + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig} ServiceDirectoryConfig + */ + ServiceDirectoryConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.genericWebService != null) { + if (typeof object.genericWebService !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig.genericWebService: object expected"); + message.genericWebService = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.fromObject(object.genericWebService, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig} message ServiceDirectoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDirectoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.service = ""; + object.genericWebService = null; + } + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.genericWebService != null && message.hasOwnProperty("genericWebService")) + object.genericWebService = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.toObject(message.genericWebService, options); + return object; + }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceDirectoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Webhook.ServiceDirectoryConfig"; + }; + + return ServiceDirectoryConfig; + })(); + + return Webhook; + })(); + + v3beta1.ListWebhooksRequest = (function() { + + /** + * Properties of a ListWebhooksRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListWebhooksRequest + * @property {string|null} [parent] ListWebhooksRequest parent + * @property {number|null} [pageSize] ListWebhooksRequest pageSize + * @property {string|null} [pageToken] ListWebhooksRequest pageToken + */ + + /** + * Constructs a new ListWebhooksRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListWebhooksRequest. + * @implements IListWebhooksRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest=} [properties] Properties to set + */ + function ListWebhooksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWebhooksRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @instance + */ + ListWebhooksRequest.prototype.parent = ""; + + /** + * ListWebhooksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @instance + */ + ListWebhooksRequest.prototype.pageSize = 0; + + /** + * ListWebhooksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @instance + */ + ListWebhooksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWebhooksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest} ListWebhooksRequest instance + */ + ListWebhooksRequest.create = function create(properties) { + return new ListWebhooksRequest(properties); + }; + + /** + * Encodes the specified ListWebhooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest} message ListWebhooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksRequest.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); + return writer; + }; + + /** + * Encodes the specified ListWebhooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest} message ListWebhooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest} ListWebhooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListWebhooksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest} ListWebhooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWebhooksRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWebhooksRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListWebhooksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest} ListWebhooksRequest + */ + ListWebhooksRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListWebhooksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest} message ListWebhooksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWebhooksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListWebhooksRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @instance + * @returns {Object.} JSON object + */ + ListWebhooksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWebhooksRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWebhooksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest"; + }; + + return ListWebhooksRequest; + })(); + + v3beta1.ListWebhooksResponse = (function() { + + /** + * Properties of a ListWebhooksResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListWebhooksResponse + * @property {Array.|null} [webhooks] ListWebhooksResponse webhooks + * @property {string|null} [nextPageToken] ListWebhooksResponse nextPageToken + */ + + /** + * Constructs a new ListWebhooksResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListWebhooksResponse. + * @implements IListWebhooksResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse=} [properties] Properties to set + */ + function ListWebhooksResponse(properties) { + this.webhooks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWebhooksResponse webhooks. + * @member {Array.} webhooks + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @instance + */ + ListWebhooksResponse.prototype.webhooks = $util.emptyArray; + + /** + * ListWebhooksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @instance + */ + ListWebhooksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListWebhooksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} ListWebhooksResponse instance + */ + ListWebhooksResponse.create = function create(properties) { + return new ListWebhooksResponse(properties); + }; + + /** + * Encodes the specified ListWebhooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse} message ListWebhooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhooks != null && message.webhooks.length) + for (var i = 0; i < message.webhooks.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.encode(message.webhooks[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 ListWebhooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse} message ListWebhooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWebhooksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} ListWebhooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.webhooks && message.webhooks.length)) + message.webhooks = []; + message.webhooks.push($root.google.cloud.dialogflow.cx.v3beta1.Webhook.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListWebhooksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} ListWebhooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWebhooksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWebhooksResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWebhooksResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.webhooks != null && message.hasOwnProperty("webhooks")) { + if (!Array.isArray(message.webhooks)) + return "webhooks: array expected"; + for (var i = 0; i < message.webhooks.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.verify(message.webhooks[i], long + 1); + if (error) + return "webhooks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListWebhooksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} ListWebhooksResponse + */ + ListWebhooksResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse(); + if (object.webhooks) { + if (!Array.isArray(object.webhooks)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.webhooks: array expected"); + message.webhooks = []; + for (var i = 0; i < object.webhooks.length; ++i) { + if (typeof object.webhooks[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.webhooks: object expected"); + message.webhooks[i] = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.fromObject(object.webhooks[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListWebhooksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} message ListWebhooksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWebhooksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.webhooks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.webhooks && message.webhooks.length) { + object.webhooks = []; + for (var j = 0; j < message.webhooks.length; ++j) + object.webhooks[j] = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.toObject(message.webhooks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListWebhooksResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @instance + * @returns {Object.} JSON object + */ + ListWebhooksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWebhooksResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWebhooksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse"; + }; + + return ListWebhooksResponse; + })(); + + v3beta1.GetWebhookRequest = (function() { + + /** + * Properties of a GetWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetWebhookRequest + * @property {string|null} [name] GetWebhookRequest name + */ + + /** + * Constructs a new GetWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetWebhookRequest. + * @implements IGetWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest=} [properties] Properties to set + */ + function GetWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWebhookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @instance + */ + GetWebhookRequest.prototype.name = ""; + + /** + * Creates a new GetWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest} GetWebhookRequest instance + */ + GetWebhookRequest.create = function create(properties) { + return new GetWebhookRequest(properties); + }; + + /** + * Encodes the specified GetWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest} message GetWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWebhookRequest.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 GetWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest} message GetWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest} GetWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest} GetWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest} GetWebhookRequest + */ + GetWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest} message GetWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWebhookRequest.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 GetWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + GetWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest"; + }; + + return GetWebhookRequest; + })(); + + v3beta1.CreateWebhookRequest = (function() { + + /** + * Properties of a CreateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateWebhookRequest + * @property {string|null} [parent] CreateWebhookRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IWebhook|null} [webhook] CreateWebhookRequest webhook + */ + + /** + * Constructs a new CreateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateWebhookRequest. + * @implements ICreateWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest=} [properties] Properties to set + */ + function CreateWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWebhookRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @instance + */ + CreateWebhookRequest.prototype.parent = ""; + + /** + * CreateWebhookRequest webhook. + * @member {google.cloud.dialogflow.cx.v3beta1.IWebhook|null|undefined} webhook + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @instance + */ + CreateWebhookRequest.prototype.webhook = null; + + /** + * Creates a new CreateWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest} CreateWebhookRequest instance + */ + CreateWebhookRequest.create = function create(properties) { + return new CreateWebhookRequest(properties); + }; + + /** + * Encodes the specified CreateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest} message CreateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWebhookRequest.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.webhook != null && Object.hasOwnProperty.call(message, "webhook")) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.encode(message.webhook, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest} message CreateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest} CreateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.webhook = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest} CreateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.webhook != null && message.hasOwnProperty("webhook")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.verify(message.webhook, long + 1); + if (error) + return "webhook." + error; + } + return null; + }; + + /** + * Creates a CreateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest} CreateWebhookRequest + */ + CreateWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.webhook != null) { + if (typeof object.webhook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.webhook: object expected"); + message.webhook = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.fromObject(object.webhook, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest} message CreateWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.webhook = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.webhook != null && message.hasOwnProperty("webhook")) + object.webhook = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.toObject(message.webhook, options); + return object; + }; + + /** + * Converts this CreateWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest"; + }; + + return CreateWebhookRequest; + })(); + + v3beta1.UpdateWebhookRequest = (function() { + + /** + * Properties of an UpdateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateWebhookRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IWebhook|null} [webhook] UpdateWebhookRequest webhook + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWebhookRequest updateMask + */ + + /** + * Constructs a new UpdateWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateWebhookRequest. + * @implements IUpdateWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest=} [properties] Properties to set + */ + function UpdateWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWebhookRequest webhook. + * @member {google.cloud.dialogflow.cx.v3beta1.IWebhook|null|undefined} webhook + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @instance + */ + UpdateWebhookRequest.prototype.webhook = null; + + /** + * UpdateWebhookRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @instance + */ + UpdateWebhookRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest} UpdateWebhookRequest instance + */ + UpdateWebhookRequest.create = function create(properties) { + return new UpdateWebhookRequest(properties); + }; + + /** + * Encodes the specified UpdateWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest} message UpdateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWebhookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhook != null && Object.hasOwnProperty.call(message, "webhook")) + $root.google.cloud.dialogflow.cx.v3beta1.Webhook.encode(message.webhook, 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 UpdateWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest} message UpdateWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest} UpdateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.webhook = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest} UpdateWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.webhook != null && message.hasOwnProperty("webhook")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.verify(message.webhook, long + 1); + if (error) + return "webhook." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest} UpdateWebhookRequest + */ + UpdateWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(); + if (object.webhook != null) { + if (typeof object.webhook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.webhook: object expected"); + message.webhook = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.fromObject(object.webhook, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest} message UpdateWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.webhook = null; + object.updateMask = null; + } + if (message.webhook != null && message.hasOwnProperty("webhook")) + object.webhook = $root.google.cloud.dialogflow.cx.v3beta1.Webhook.toObject(message.webhook, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest"; + }; + + return UpdateWebhookRequest; + })(); + + v3beta1.DeleteWebhookRequest = (function() { + + /** + * Properties of a DeleteWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteWebhookRequest + * @property {string|null} [name] DeleteWebhookRequest name + * @property {boolean|null} [force] DeleteWebhookRequest force + */ + + /** + * Constructs a new DeleteWebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteWebhookRequest. + * @implements IDeleteWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest=} [properties] Properties to set + */ + function DeleteWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWebhookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @instance + */ + DeleteWebhookRequest.prototype.name = ""; + + /** + * DeleteWebhookRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @instance + */ + DeleteWebhookRequest.prototype.force = false; + + /** + * Creates a new DeleteWebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest} DeleteWebhookRequest instance + */ + DeleteWebhookRequest.create = function create(properties) { + return new DeleteWebhookRequest(properties); + }; + + /** + * Encodes the specified DeleteWebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest} message DeleteWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWebhookRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteWebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest} message DeleteWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest} DeleteWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest} DeleteWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest} DeleteWebhookRequest + */ + DeleteWebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest} message DeleteWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteWebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest"; + }; + + return DeleteWebhookRequest; + })(); + + v3beta1.WebhookRequest = (function() { + + /** + * Properties of a WebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IWebhookRequest + * @property {string|null} [detectIntentResponseId] WebhookRequest detectIntentResponseId + * @property {string|null} [text] WebhookRequest text + * @property {string|null} [triggerIntent] WebhookRequest triggerIntent + * @property {string|null} [transcript] WebhookRequest transcript + * @property {string|null} [triggerEvent] WebhookRequest triggerEvent + * @property {string|null} [dtmfDigits] WebhookRequest dtmfDigits + * @property {string|null} [languageCode] WebhookRequest languageCode + * @property {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo|null} [fulfillmentInfo] WebhookRequest fulfillmentInfo + * @property {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo|null} [intentInfo] WebhookRequest intentInfo + * @property {google.cloud.dialogflow.cx.v3beta1.IPageInfo|null} [pageInfo] WebhookRequest pageInfo + * @property {google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null} [sessionInfo] WebhookRequest sessionInfo + * @property {Array.|null} [messages] WebhookRequest messages + * @property {google.protobuf.IStruct|null} [payload] WebhookRequest payload + * @property {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult|null} [sentimentAnalysisResult] WebhookRequest sentimentAnalysisResult + * @property {google.cloud.dialogflow.cx.v3beta1.ILanguageInfo|null} [languageInfo] WebhookRequest languageInfo + */ + + /** + * Constructs a new WebhookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a WebhookRequest. + * @implements IWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookRequest=} [properties] Properties to set + */ + function WebhookRequest(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookRequest detectIntentResponseId. + * @member {string} detectIntentResponseId + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.detectIntentResponseId = ""; + + /** + * WebhookRequest text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.text = null; + + /** + * WebhookRequest triggerIntent. + * @member {string|null|undefined} triggerIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.triggerIntent = null; + + /** + * WebhookRequest transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.transcript = null; + + /** + * WebhookRequest triggerEvent. + * @member {string|null|undefined} triggerEvent + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.triggerEvent = null; + + /** + * WebhookRequest dtmfDigits. + * @member {string|null|undefined} dtmfDigits + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.dtmfDigits = null; + + /** + * WebhookRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.languageCode = ""; + + /** + * WebhookRequest fulfillmentInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo|null|undefined} fulfillmentInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.fulfillmentInfo = null; + + /** + * WebhookRequest intentInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo|null|undefined} intentInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.intentInfo = null; + + /** + * WebhookRequest pageInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.IPageInfo|null|undefined} pageInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.pageInfo = null; + + /** + * WebhookRequest sessionInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null|undefined} sessionInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.sessionInfo = null; + + /** + * WebhookRequest messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.messages = $util.emptyArray; + + /** + * WebhookRequest payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.payload = null; + + /** + * WebhookRequest sentimentAnalysisResult. + * @member {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.sentimentAnalysisResult = null; + + /** + * WebhookRequest languageInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.ILanguageInfo|null|undefined} languageInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + WebhookRequest.prototype.languageInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WebhookRequest query. + * @member {"text"|"triggerIntent"|"transcript"|"triggerEvent"|"dtmfDigits"|undefined} query + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + */ + Object.defineProperty(WebhookRequest.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["text", "triggerIntent", "transcript", "triggerEvent", "dtmfDigits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest} WebhookRequest instance + */ + WebhookRequest.create = function create(properties) { + return new WebhookRequest(properties); + }; + + /** + * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookRequest} message WebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectIntentResponseId != null && Object.hasOwnProperty.call(message, "detectIntentResponseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.detectIntentResponseId); + if (message.intentInfo != null && Object.hasOwnProperty.call(message, "intentInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.encode(message.intentInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageInfo != null && Object.hasOwnProperty.call(message, "pageInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.encode(message.pageInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.encode(message.sessionInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fulfillmentInfo != null && Object.hasOwnProperty.call(message, "fulfillmentInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.encode(message.fulfillmentInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.encode(message.messages[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) + $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.text); + if (message.triggerIntent != null && Object.hasOwnProperty.call(message, "triggerIntent")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.triggerIntent); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.transcript); + if (message.triggerEvent != null && Object.hasOwnProperty.call(message, "triggerEvent")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.triggerEvent); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); + if (message.dtmfDigits != null && Object.hasOwnProperty.call(message, "dtmfDigits")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.dtmfDigits); + if (message.languageInfo != null && Object.hasOwnProperty.call(message, "languageInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo.encode(message.languageInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookRequest} message WebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest} WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.detectIntentResponseId = reader.string(); + break; + } + case 10: { + message.text = reader.string(); + break; + } + case 11: { + message.triggerIntent = reader.string(); + break; + } + case 12: { + message.transcript = reader.string(); + break; + } + case 14: { + message.triggerEvent = reader.string(); + break; + } + case 17: { + message.dtmfDigits = reader.string(); + break; + } + case 15: { + message.languageCode = reader.string(); + break; + } + case 6: { + message.fulfillmentInfo = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.intentInfo = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.pageInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.languageInfo = $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest} WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.detectIntentResponseId != null && message.hasOwnProperty("detectIntentResponseId")) + if (!$util.isString(message.detectIntentResponseId)) + return "detectIntentResponseId: string expected"; + if (message.text != null && message.hasOwnProperty("text")) { + properties.query = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerIntent)) + return "triggerIntent: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.triggerEvent)) + return "triggerEvent: string expected"; + } + if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.dtmfDigits)) + return "dtmfDigits: string expected"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.verify(message.fulfillmentInfo, long + 1); + if (error) + return "fulfillmentInfo." + error; + } + if (message.intentInfo != null && message.hasOwnProperty("intentInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.verify(message.intentInfo, long + 1); + if (error) + return "intentInfo." + error; + } + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.verify(message.pageInfo, long + 1); + if (error) + return "pageInfo." + error; + } + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.verify(message.sessionInfo, long + 1); + if (error) + return "sessionInfo." + error; + } + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify(message.messages[i], long + 1); + if (error) + return "messages." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.verify(message.sentimentAnalysisResult, long + 1); + if (error) + return "sentimentAnalysisResult." + error; + } + if (message.languageInfo != null && message.hasOwnProperty("languageInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo.verify(message.languageInfo, long + 1); + if (error) + return "languageInfo." + error; + } + return null; + }; + + /** + * Creates a WebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest} WebhookRequest + */ + WebhookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest(); + if (object.detectIntentResponseId != null) + message.detectIntentResponseId = String(object.detectIntentResponseId); + if (object.text != null) + message.text = String(object.text); + if (object.triggerIntent != null) + message.triggerIntent = String(object.triggerIntent); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.triggerEvent != null) + message.triggerEvent = String(object.triggerEvent); + if (object.dtmfDigits != null) + message.dtmfDigits = String(object.dtmfDigits); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.fulfillmentInfo != null) { + if (typeof object.fulfillmentInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.fulfillmentInfo: object expected"); + message.fulfillmentInfo = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.fromObject(object.fulfillmentInfo, long + 1); + } + if (object.intentInfo != null) { + if (typeof object.intentInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.intentInfo: object expected"); + message.intentInfo = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.fromObject(object.intentInfo, long + 1); + } + if (object.pageInfo != null) { + if (typeof object.pageInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.pageInfo: object expected"); + message.pageInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.fromObject(object.pageInfo, long + 1); + } + if (object.sessionInfo != null) { + if (typeof object.sessionInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.sessionInfo: object expected"); + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.fromObject(object.sessionInfo, long + 1); + } + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.fromObject(object.messages[i], long + 1); + } + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.sentimentAnalysisResult != null) { + if (typeof object.sentimentAnalysisResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.sentimentAnalysisResult: object expected"); + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult, long + 1); + } + if (object.languageInfo != null) { + if (typeof object.languageInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.languageInfo: object expected"); + message.languageInfo = $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo.fromObject(object.languageInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest} message WebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) { + object.detectIntentResponseId = ""; + object.intentInfo = null; + object.pageInfo = null; + object.sessionInfo = null; + object.fulfillmentInfo = null; + object.payload = null; + object.sentimentAnalysisResult = null; + object.languageCode = ""; + object.languageInfo = null; + } + if (message.detectIntentResponseId != null && message.hasOwnProperty("detectIntentResponseId")) + object.detectIntentResponseId = message.detectIntentResponseId; + if (message.intentInfo != null && message.hasOwnProperty("intentInfo")) + object.intentInfo = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.toObject(message.intentInfo, options); + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) + object.pageInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.toObject(message.pageInfo, options); + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) + object.sessionInfo = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.toObject(message.sessionInfo, options); + if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) + object.fulfillmentInfo = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.toObject(message.fulfillmentInfo, options); + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.toObject(message.messages[j], options); + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) + object.sentimentAnalysisResult = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.query = "text"; + } + if (message.triggerIntent != null && message.hasOwnProperty("triggerIntent")) { + object.triggerIntent = message.triggerIntent; + if (options.oneofs) + object.query = "triggerIntent"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.query = "transcript"; + } + if (message.triggerEvent != null && message.hasOwnProperty("triggerEvent")) { + object.triggerEvent = message.triggerEvent; + if (options.oneofs) + object.query = "triggerEvent"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) { + object.dtmfDigits = message.dtmfDigits; + if (options.oneofs) + object.query = "dtmfDigits"; + } + if (message.languageInfo != null && message.hasOwnProperty("languageInfo")) + object.languageInfo = $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo.toObject(message.languageInfo, options); + return object; + }; + + /** + * Converts this WebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @instance + * @returns {Object.} JSON object + */ + WebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.WebhookRequest"; + }; + + WebhookRequest.FulfillmentInfo = (function() { + + /** + * Properties of a FulfillmentInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @interface IFulfillmentInfo + * @property {string|null} [tag] FulfillmentInfo tag + */ + + /** + * Constructs a new FulfillmentInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @classdesc Represents a FulfillmentInfo. + * @implements IFulfillmentInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo=} [properties] Properties to set + */ + function FulfillmentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillmentInfo tag. + * @member {string} tag + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @instance + */ + FulfillmentInfo.prototype.tag = ""; + + /** + * Creates a new FulfillmentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo} FulfillmentInfo instance + */ + FulfillmentInfo.create = function create(properties) { + return new FulfillmentInfo(properties); + }; + + /** + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tag); + return writer; + }; + + /** + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo} FulfillmentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo} FulfillmentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillmentInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillmentInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo} FulfillmentInfo + */ + FulfillmentInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo(); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo} message FulfillmentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillmentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tag = ""; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + return object; + }; + + /** + * Converts this FulfillmentInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @instance + * @returns {Object.} JSON object + */ + FulfillmentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillmentInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillmentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo"; + }; + + return FulfillmentInfo; + })(); + + WebhookRequest.IntentInfo = (function() { + + /** + * Properties of an IntentInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @interface IIntentInfo + * @property {string|null} [lastMatchedIntent] IntentInfo lastMatchedIntent + * @property {string|null} [displayName] IntentInfo displayName + * @property {Object.|null} [parameters] IntentInfo parameters + * @property {number|null} [confidence] IntentInfo confidence + */ + + /** + * Constructs a new IntentInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @classdesc Represents an IntentInfo. + * @implements IIntentInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo=} [properties] Properties to set + */ + function IntentInfo(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentInfo lastMatchedIntent. + * @member {string} lastMatchedIntent + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.lastMatchedIntent = ""; + + /** + * IntentInfo displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.displayName = ""; + + /** + * IntentInfo parameters. + * @member {Object.} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.parameters = $util.emptyObject; + + /** + * IntentInfo confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @instance + */ + IntentInfo.prototype.confidence = 0; + + /** + * Creates a new IntentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo} IntentInfo instance + */ + IntentInfo.create = function create(properties) { + return new IntentInfo(properties); + }; + + /** + * Encodes the specified IntentInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo} message IntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastMatchedIntent != null && Object.hasOwnProperty.call(message, "lastMatchedIntent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.lastMatchedIntent); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.encode(message.parameters[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified IntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IIntentInfo} message IntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo} IntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lastMatchedIntent = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 2: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameters, key); + message.parameters[key] = value; + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo} IntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.lastMatchedIntent != null && message.hasOwnProperty("lastMatchedIntent")) + if (!$util.isString(message.lastMatchedIntent)) + return "lastMatchedIntent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.verify(message.parameters[key[i]], long + 1); + if (error) + return "parameters." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates an IntentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo} IntentInfo + */ + IntentInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo(); + if (object.lastMatchedIntent != null) + message.lastMatchedIntent = String(object.lastMatchedIntent); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameters, keys[i]); + if (typeof object.parameters[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.parameters: object expected"); + message.parameters[keys[i]] = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.fromObject(object.parameters[keys[i]], long + 1); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from an IntentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo} message IntentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) { + object.lastMatchedIntent = ""; + object.displayName = ""; + object.confidence = 0; + } + if (message.lastMatchedIntent != null && message.hasOwnProperty("lastMatchedIntent")) + object.lastMatchedIntent = message.lastMatchedIntent; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameters, keys2[j]); + object.parameters[keys2[j]] = $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.toObject(message.parameters[keys2[j]], options); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this IntentInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @instance + * @returns {Object.} JSON object + */ + IntentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo"; + }; + + IntentInfo.IntentParameterValue = (function() { + + /** + * Properties of an IntentParameterValue. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @interface IIntentParameterValue + * @property {string|null} [originalValue] IntentParameterValue originalValue + * @property {google.protobuf.IValue|null} [resolvedValue] IntentParameterValue resolvedValue + */ + + /** + * Constructs a new IntentParameterValue. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + * @classdesc Represents an IntentParameterValue. + * @implements IIntentParameterValue + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue=} [properties] Properties to set + */ + function IntentParameterValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentParameterValue originalValue. + * @member {string} originalValue + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @instance + */ + IntentParameterValue.prototype.originalValue = ""; + + /** + * IntentParameterValue resolvedValue. + * @member {google.protobuf.IValue|null|undefined} resolvedValue + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @instance + */ + IntentParameterValue.prototype.resolvedValue = null; + + /** + * Creates a new IntentParameterValue instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue instance + */ + IntentParameterValue.create = function create(properties) { + return new IntentParameterValue(properties); + }; + + /** + * Encodes the specified IntentParameterValue message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue} message IntentParameterValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentParameterValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalValue != null && Object.hasOwnProperty.call(message, "originalValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.originalValue); + if (message.resolvedValue != null && Object.hasOwnProperty.call(message, "resolvedValue")) + $root.google.protobuf.Value.encode(message.resolvedValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntentParameterValue message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IIntentParameterValue} message IntentParameterValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentParameterValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentParameterValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalValue = reader.string(); + break; + } + case 2: { + message.resolvedValue = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntentParameterValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentParameterValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentParameterValue message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentParameterValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.originalValue != null && message.hasOwnProperty("originalValue")) + if (!$util.isString(message.originalValue)) + return "originalValue: string expected"; + if (message.resolvedValue != null && message.hasOwnProperty("resolvedValue")) { + var error = $root.google.protobuf.Value.verify(message.resolvedValue, long + 1); + if (error) + return "resolvedValue." + error; + } + return null; + }; + + /** + * Creates an IntentParameterValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue} IntentParameterValue + */ + IntentParameterValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue(); + if (object.originalValue != null) + message.originalValue = String(object.originalValue); + if (object.resolvedValue != null) { + if (typeof object.resolvedValue !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.resolvedValue: object expected"); + message.resolvedValue = $root.google.protobuf.Value.fromObject(object.resolvedValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IntentParameterValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue} message IntentParameterValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentParameterValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalValue = ""; + object.resolvedValue = null; + } + if (message.originalValue != null && message.hasOwnProperty("originalValue")) + object.originalValue = message.originalValue; + if (message.resolvedValue != null && message.hasOwnProperty("resolvedValue")) + object.resolvedValue = $root.google.protobuf.Value.toObject(message.resolvedValue, options); + return object; + }; + + /** + * Converts this IntentParameterValue to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @instance + * @returns {Object.} JSON object + */ + IntentParameterValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntentParameterValue + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntentParameterValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue"; + }; + + return IntentParameterValue; + })(); + + return IntentInfo; + })(); + + WebhookRequest.SentimentAnalysisResult = (function() { + + /** + * Properties of a SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @interface ISentimentAnalysisResult + * @property {number|null} [score] SentimentAnalysisResult score + * @property {number|null} [magnitude] SentimentAnalysisResult magnitude + */ + + /** + * Constructs a new SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest + * @classdesc Represents a SentimentAnalysisResult. + * @implements ISentimentAnalysisResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult=} [properties] Properties to set + */ + function SentimentAnalysisResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SentimentAnalysisResult score. + * @member {number} score + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.score = 0; + + /** + * SentimentAnalysisResult magnitude. + * @member {number} magnitude + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.magnitude = 0; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult instance + */ + SentimentAnalysisResult.create = function create(properties) { + return new SentimentAnalysisResult(properties); + }; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + return writer; + }; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + case 2: { + message.magnitude = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SentimentAnalysisResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + return null; + }; + + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult} SentimentAnalysisResult + */ + SentimentAnalysisResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult(); + if (object.score != null) + message.score = Number(object.score); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + return message; + }; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult} message SentimentAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.magnitude = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + return object; + }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SentimentAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SentimentAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.WebhookRequest.SentimentAnalysisResult"; + }; + + return SentimentAnalysisResult; + })(); + + return WebhookRequest; + })(); + + v3beta1.WebhookResponse = (function() { + + /** + * Properties of a WebhookResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IWebhookResponse + * @property {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse|null} [fulfillmentResponse] WebhookResponse fulfillmentResponse + * @property {google.cloud.dialogflow.cx.v3beta1.IPageInfo|null} [pageInfo] WebhookResponse pageInfo + * @property {google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null} [sessionInfo] WebhookResponse sessionInfo + * @property {google.protobuf.IStruct|null} [payload] WebhookResponse payload + * @property {string|null} [targetPage] WebhookResponse targetPage + * @property {string|null} [targetFlow] WebhookResponse targetFlow + */ + + /** + * Constructs a new WebhookResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a WebhookResponse. + * @implements IWebhookResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookResponse=} [properties] Properties to set + */ + function WebhookResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookResponse fulfillmentResponse. + * @member {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse|null|undefined} fulfillmentResponse + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + */ + WebhookResponse.prototype.fulfillmentResponse = null; + + /** + * WebhookResponse pageInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.IPageInfo|null|undefined} pageInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + */ + WebhookResponse.prototype.pageInfo = null; + + /** + * WebhookResponse sessionInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.ISessionInfo|null|undefined} sessionInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + */ + WebhookResponse.prototype.sessionInfo = null; + + /** + * WebhookResponse payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + */ + WebhookResponse.prototype.payload = null; + + /** + * WebhookResponse targetPage. + * @member {string|null|undefined} targetPage + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + */ + WebhookResponse.prototype.targetPage = null; + + /** + * WebhookResponse targetFlow. + * @member {string|null|undefined} targetFlow + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + */ + WebhookResponse.prototype.targetFlow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WebhookResponse transition. + * @member {"targetPage"|"targetFlow"|undefined} transition + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + */ + Object.defineProperty(WebhookResponse.prototype, "transition", { + get: $util.oneOfGetter($oneOfFields = ["targetPage", "targetFlow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WebhookResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse} WebhookResponse instance + */ + WebhookResponse.create = function create(properties) { + return new WebhookResponse(properties); + }; + + /** + * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookResponse} message WebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fulfillmentResponse != null && Object.hasOwnProperty.call(message, "fulfillmentResponse")) + $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.encode(message.fulfillmentResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageInfo != null && Object.hasOwnProperty.call(message, "pageInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.encode(message.pageInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.encode(message.sessionInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.targetPage != null && Object.hasOwnProperty.call(message, "targetPage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetPage); + if (message.targetFlow != null && Object.hasOwnProperty.call(message, "targetFlow")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.targetFlow); + return writer; + }; + + /** + * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IWebhookResponse} message WebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse} WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fulfillmentResponse = $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.pageInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.targetPage = reader.string(); + break; + } + case 6: { + message.targetFlow = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse} WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.fulfillmentResponse != null && message.hasOwnProperty("fulfillmentResponse")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.verify(message.fulfillmentResponse, long + 1); + if (error) + return "fulfillmentResponse." + error; + } + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.verify(message.pageInfo, long + 1); + if (error) + return "pageInfo." + error; + } + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.verify(message.sessionInfo, long + 1); + if (error) + return "sessionInfo." + error; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + properties.transition = 1; + if (!$util.isString(message.targetPage)) + return "targetPage: string expected"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + if (properties.transition === 1) + return "transition: multiple values"; + properties.transition = 1; + if (!$util.isString(message.targetFlow)) + return "targetFlow: string expected"; + } + return null; + }; + + /** + * Creates a WebhookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse} WebhookResponse + */ + WebhookResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse(); + if (object.fulfillmentResponse != null) { + if (typeof object.fulfillmentResponse !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillmentResponse: object expected"); + message.fulfillmentResponse = $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.fromObject(object.fulfillmentResponse, long + 1); + } + if (object.pageInfo != null) { + if (typeof object.pageInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookResponse.pageInfo: object expected"); + message.pageInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.fromObject(object.pageInfo, long + 1); + } + if (object.sessionInfo != null) { + if (typeof object.sessionInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookResponse.sessionInfo: object expected"); + message.sessionInfo = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.fromObject(object.sessionInfo, long + 1); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.targetPage != null) + message.targetPage = String(object.targetPage); + if (object.targetFlow != null) + message.targetFlow = String(object.targetFlow); + return message; + }; + + /** + * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookResponse} message WebhookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fulfillmentResponse = null; + object.pageInfo = null; + object.sessionInfo = null; + object.payload = null; + } + if (message.fulfillmentResponse != null && message.hasOwnProperty("fulfillmentResponse")) + object.fulfillmentResponse = $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.toObject(message.fulfillmentResponse, options); + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) + object.pageInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.toObject(message.pageInfo, options); + if (message.sessionInfo != null && message.hasOwnProperty("sessionInfo")) + object.sessionInfo = $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo.toObject(message.sessionInfo, options); + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.targetPage != null && message.hasOwnProperty("targetPage")) { + object.targetPage = message.targetPage; + if (options.oneofs) + object.transition = "targetPage"; + } + if (message.targetFlow != null && message.hasOwnProperty("targetFlow")) { + object.targetFlow = message.targetFlow; + if (options.oneofs) + object.transition = "targetFlow"; + } + return object; + }; + + /** + * Converts this WebhookResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @instance + * @returns {Object.} JSON object + */ + WebhookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.WebhookResponse"; + }; + + WebhookResponse.FulfillmentResponse = (function() { + + /** + * Properties of a FulfillmentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @interface IFulfillmentResponse + * @property {Array.|null} [messages] FulfillmentResponse messages + * @property {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior|null} [mergeBehavior] FulfillmentResponse mergeBehavior + */ + + /** + * Constructs a new FulfillmentResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse + * @classdesc Represents a FulfillmentResponse. + * @implements IFulfillmentResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse=} [properties] Properties to set + */ + function FulfillmentResponse(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FulfillmentResponse messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @instance + */ + FulfillmentResponse.prototype.messages = $util.emptyArray; + + /** + * FulfillmentResponse mergeBehavior. + * @member {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior} mergeBehavior + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @instance + */ + FulfillmentResponse.prototype.mergeBehavior = 0; + + /** + * Creates a new FulfillmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse} FulfillmentResponse instance + */ + FulfillmentResponse.create = function create(properties) { + return new FulfillmentResponse(properties); + }; + + /** + * Encodes the specified FulfillmentResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse} message FulfillmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mergeBehavior != null && Object.hasOwnProperty.call(message, "mergeBehavior")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mergeBehavior); + return writer; + }; + + /** + * Encodes the specified FulfillmentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.IFulfillmentResponse} message FulfillmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FulfillmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse} FulfillmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.mergeBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FulfillmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse} FulfillmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FulfillmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FulfillmentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FulfillmentResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.verify(message.messages[i], long + 1); + if (error) + return "messages." + error; + } + } + if (message.mergeBehavior != null && message.hasOwnProperty("mergeBehavior")) + switch (message.mergeBehavior) { + default: + return "mergeBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FulfillmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse} FulfillmentResponse + */ + FulfillmentResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.fromObject(object.messages[i], long + 1); + } + } + switch (object.mergeBehavior) { + default: + if (typeof object.mergeBehavior === "number") { + message.mergeBehavior = object.mergeBehavior; + break; + } + break; + case "MERGE_BEHAVIOR_UNSPECIFIED": + case 0: + message.mergeBehavior = 0; + break; + case "APPEND": + case 1: + message.mergeBehavior = 1; + break; + case "REPLACE": + case 2: + message.mergeBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FulfillmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse} message FulfillmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FulfillmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.mergeBehavior = options.enums === String ? "MERGE_BEHAVIOR_UNSPECIFIED" : 0; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.toObject(message.messages[j], options); + } + if (message.mergeBehavior != null && message.hasOwnProperty("mergeBehavior")) + object.mergeBehavior = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior[message.mergeBehavior] === undefined ? message.mergeBehavior : $root.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior[message.mergeBehavior] : message.mergeBehavior; + return object; + }; + + /** + * Converts this FulfillmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @instance + * @returns {Object.} JSON object + */ + FulfillmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FulfillmentResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FulfillmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse"; + }; + + /** + * MergeBehavior enum. + * @name google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior + * @enum {number} + * @property {number} MERGE_BEHAVIOR_UNSPECIFIED=0 MERGE_BEHAVIOR_UNSPECIFIED value + * @property {number} APPEND=1 APPEND value + * @property {number} REPLACE=2 REPLACE value + */ + FulfillmentResponse.MergeBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MERGE_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "APPEND"] = 1; + values[valuesById[2] = "REPLACE"] = 2; + return values; + })(); + + return FulfillmentResponse; + })(); + + return WebhookResponse; + })(); + + v3beta1.PageInfo = (function() { + + /** + * Properties of a PageInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPageInfo + * @property {string|null} [currentPage] PageInfo currentPage + * @property {string|null} [displayName] PageInfo displayName + * @property {google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo|null} [formInfo] PageInfo formInfo + */ + + /** + * Constructs a new PageInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PageInfo. + * @implements IPageInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPageInfo=} [properties] Properties to set + */ + function PageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageInfo currentPage. + * @member {string} currentPage + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @instance + */ + PageInfo.prototype.currentPage = ""; + + /** + * PageInfo displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @instance + */ + PageInfo.prototype.displayName = ""; + + /** + * PageInfo formInfo. + * @member {google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo|null|undefined} formInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @instance + */ + PageInfo.prototype.formInfo = null; + + /** + * Creates a new PageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPageInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo} PageInfo instance + */ + PageInfo.create = function create(properties) { + return new PageInfo(properties); + }; + + /** + * Encodes the specified PageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPageInfo} message PageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentPage != null && Object.hasOwnProperty.call(message, "currentPage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currentPage); + if (message.formInfo != null && Object.hasOwnProperty.call(message, "formInfo")) + $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.encode(message.formInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified PageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPageInfo} message PageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo} PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.currentPage = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.formInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo} PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + if (!$util.isString(message.currentPage)) + return "currentPage: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.formInfo != null && message.hasOwnProperty("formInfo")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.verify(message.formInfo, long + 1); + if (error) + return "formInfo." + error; + } + return null; + }; + + /** + * Creates a PageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo} PageInfo + */ + PageInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PageInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PageInfo(); + if (object.currentPage != null) + message.currentPage = String(object.currentPage); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.formInfo != null) { + if (typeof object.formInfo !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PageInfo.formInfo: object expected"); + message.formInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.fromObject(object.formInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo} message PageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currentPage = ""; + object.formInfo = null; + object.displayName = ""; + } + if (message.currentPage != null && message.hasOwnProperty("currentPage")) + object.currentPage = message.currentPage; + if (message.formInfo != null && message.hasOwnProperty("formInfo")) + object.formInfo = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.toObject(message.formInfo, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this PageInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @instance + * @returns {Object.} JSON object + */ + PageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PageInfo"; + }; + + PageInfo.FormInfo = (function() { + + /** + * Properties of a FormInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @interface IFormInfo + * @property {Array.|null} [parameterInfo] FormInfo parameterInfo + */ + + /** + * Constructs a new FormInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo + * @classdesc Represents a FormInfo. + * @implements IFormInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo=} [properties] Properties to set + */ + function FormInfo(properties) { + this.parameterInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FormInfo parameterInfo. + * @member {Array.} parameterInfo + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @instance + */ + FormInfo.prototype.parameterInfo = $util.emptyArray; + + /** + * Creates a new FormInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo} FormInfo instance + */ + FormInfo.create = function create(properties) { + return new FormInfo(properties); + }; + + /** + * Encodes the specified FormInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo} message FormInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterInfo != null && message.parameterInfo.length) + for (var i = 0; i < message.parameterInfo.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.encode(message.parameterInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FormInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.IFormInfo} message FormInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FormInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo} FormInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.parameterInfo && message.parameterInfo.length)) + message.parameterInfo = []; + message.parameterInfo.push($root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FormInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo} FormInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FormInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FormInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameterInfo != null && message.hasOwnProperty("parameterInfo")) { + if (!Array.isArray(message.parameterInfo)) + return "parameterInfo: array expected"; + for (var i = 0; i < message.parameterInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.verify(message.parameterInfo[i], long + 1); + if (error) + return "parameterInfo." + error; + } + } + return null; + }; + + /** + * Creates a FormInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo} FormInfo + */ + FormInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo(); + if (object.parameterInfo) { + if (!Array.isArray(object.parameterInfo)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.parameterInfo: array expected"); + message.parameterInfo = []; + for (var i = 0; i < object.parameterInfo.length; ++i) { + if (typeof object.parameterInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.parameterInfo: object expected"); + message.parameterInfo[i] = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.fromObject(object.parameterInfo[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FormInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo} message FormInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FormInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameterInfo = []; + if (message.parameterInfo && message.parameterInfo.length) { + object.parameterInfo = []; + for (var j = 0; j < message.parameterInfo.length; ++j) + object.parameterInfo[j] = $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.toObject(message.parameterInfo[j], options); + } + return object; + }; + + /** + * Converts this FormInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @instance + * @returns {Object.} JSON object + */ + FormInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FormInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FormInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo"; + }; + + FormInfo.ParameterInfo = (function() { + + /** + * Properties of a ParameterInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @interface IParameterInfo + * @property {string|null} [displayName] ParameterInfo displayName + * @property {boolean|null} [required] ParameterInfo required + * @property {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState|null} [state] ParameterInfo state + * @property {google.protobuf.IValue|null} [value] ParameterInfo value + * @property {boolean|null} [justCollected] ParameterInfo justCollected + */ + + /** + * Constructs a new ParameterInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo + * @classdesc Represents a ParameterInfo. + * @implements IParameterInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo=} [properties] Properties to set + */ + function ParameterInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterInfo displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.displayName = ""; + + /** + * ParameterInfo required. + * @member {boolean} required + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.required = false; + + /** + * ParameterInfo state. + * @member {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState} state + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.state = 0; + + /** + * ParameterInfo value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.value = null; + + /** + * ParameterInfo justCollected. + * @member {boolean} justCollected + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @instance + */ + ParameterInfo.prototype.justCollected = false; + + /** + * Creates a new ParameterInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo} ParameterInfo instance + */ + ParameterInfo.create = function create(properties) { + return new ParameterInfo(properties); + }; + + /** + * Encodes the specified ParameterInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo} message ParameterInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.required); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.justCollected != null && Object.hasOwnProperty.call(message, "justCollected")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.justCollected); + return writer; + }; + + /** + * Encodes the specified ParameterInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.IParameterInfo} message ParameterInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo} ParameterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.required = reader.bool(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.justCollected = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo} ParameterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value, long + 1); + if (error) + return "value." + error; + } + if (message.justCollected != null && message.hasOwnProperty("justCollected")) + if (typeof message.justCollected !== "boolean") + return "justCollected: boolean expected"; + return null; + }; + + /** + * Creates a ParameterInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo} ParameterInfo + */ + ParameterInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.required != null) + message.required = Boolean(object.required); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "PARAMETER_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "EMPTY": + case 1: + message.state = 1; + break; + case "INVALID": + case 2: + message.state = 2; + break; + case "FILLED": + case 3: + message.state = 3; + break; + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value, long + 1); + } + if (object.justCollected != null) + message.justCollected = Boolean(object.justCollected); + return message; + }; + + /** + * Creates a plain object from a ParameterInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo} message ParameterInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.required = false; + object.state = options.enums === String ? "PARAMETER_STATE_UNSPECIFIED" : 0; + object.value = null; + object.justCollected = false; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState[message.state] : message.state; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (message.justCollected != null && message.hasOwnProperty("justCollected")) + object.justCollected = message.justCollected; + return object; + }; + + /** + * Converts this ParameterInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @instance + * @returns {Object.} JSON object + */ + ParameterInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo"; + }; + + /** + * ParameterState enum. + * @name google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + * @enum {number} + * @property {number} PARAMETER_STATE_UNSPECIFIED=0 PARAMETER_STATE_UNSPECIFIED value + * @property {number} EMPTY=1 EMPTY value + * @property {number} INVALID=2 INVALID value + * @property {number} FILLED=3 FILLED value + */ + ParameterInfo.ParameterState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARAMETER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EMPTY"] = 1; + values[valuesById[2] = "INVALID"] = 2; + values[valuesById[3] = "FILLED"] = 3; + return values; + })(); + + return ParameterInfo; + })(); + + return FormInfo; + })(); + + return PageInfo; + })(); + + v3beta1.SessionInfo = (function() { + + /** + * Properties of a SessionInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISessionInfo + * @property {string|null} [session] SessionInfo session + * @property {Object.|null} [parameters] SessionInfo parameters + */ + + /** + * Constructs a new SessionInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SessionInfo. + * @implements ISessionInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionInfo=} [properties] Properties to set + */ + function SessionInfo(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionInfo session. + * @member {string} session + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @instance + */ + SessionInfo.prototype.session = ""; + + /** + * SessionInfo parameters. + * @member {Object.} parameters + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @instance + */ + SessionInfo.prototype.parameters = $util.emptyObject; + + /** + * Creates a new SessionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionInfo} SessionInfo instance + */ + SessionInfo.create = function create(properties) { + return new SessionInfo(properties); + }; + + /** + * Encodes the specified SessionInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionInfo} message SessionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.parameters[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SessionInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SessionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISessionInfo} message SessionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionInfo} SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameters, key); + message.parameters[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SessionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionInfo} SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.parameters[key[i]], long + 1); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a SessionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SessionInfo} SessionInfo + */ + SessionInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SessionInfo(); + if (object.session != null) + message.session = String(object.session); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameters, keys[i]); + if (typeof object.parameters[keys[i]] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters: object expected"); + message.parameters[keys[i]] = $root.google.protobuf.Value.fromObject(object.parameters[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SessionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SessionInfo} message SessionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) + object.session = ""; + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameters, keys2[j]); + object.parameters[keys2[j]] = $root.google.protobuf.Value.toObject(message.parameters[keys2[j]], options); + } + } + return object; + }; + + /** + * Converts this SessionInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @instance + * @returns {Object.} JSON object + */ + SessionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SessionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SessionInfo"; + }; + + return SessionInfo; + })(); + + v3beta1.LanguageInfo = (function() { + + /** + * Properties of a LanguageInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ILanguageInfo + * @property {string|null} [inputLanguageCode] LanguageInfo inputLanguageCode + * @property {string|null} [resolvedLanguageCode] LanguageInfo resolvedLanguageCode + * @property {number|null} [confidenceScore] LanguageInfo confidenceScore + */ + + /** + * Constructs a new LanguageInfo. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a LanguageInfo. + * @implements ILanguageInfo + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ILanguageInfo=} [properties] Properties to set + */ + function LanguageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageInfo inputLanguageCode. + * @member {string} inputLanguageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @instance + */ + LanguageInfo.prototype.inputLanguageCode = ""; + + /** + * LanguageInfo resolvedLanguageCode. + * @member {string} resolvedLanguageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @instance + */ + LanguageInfo.prototype.resolvedLanguageCode = ""; + + /** + * LanguageInfo confidenceScore. + * @member {number} confidenceScore + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @instance + */ + LanguageInfo.prototype.confidenceScore = 0; + + /** + * Creates a new LanguageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILanguageInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LanguageInfo} LanguageInfo instance + */ + LanguageInfo.create = function create(properties) { + return new LanguageInfo(properties); + }; + + /** + * Encodes the specified LanguageInfo message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LanguageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILanguageInfo} message LanguageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputLanguageCode != null && Object.hasOwnProperty.call(message, "inputLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputLanguageCode); + if (message.resolvedLanguageCode != null && Object.hasOwnProperty.call(message, "resolvedLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resolvedLanguageCode); + if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidenceScore); + return writer; + }; + + /** + * Encodes the specified LanguageInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LanguageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILanguageInfo} message LanguageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LanguageInfo} LanguageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputLanguageCode = reader.string(); + break; + } + case 2: { + message.resolvedLanguageCode = reader.string(); + break; + } + case 3: { + message.confidenceScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LanguageInfo} LanguageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageInfo message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.inputLanguageCode != null && message.hasOwnProperty("inputLanguageCode")) + if (!$util.isString(message.inputLanguageCode)) + return "inputLanguageCode: string expected"; + if (message.resolvedLanguageCode != null && message.hasOwnProperty("resolvedLanguageCode")) + if (!$util.isString(message.resolvedLanguageCode)) + return "resolvedLanguageCode: string expected"; + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + if (typeof message.confidenceScore !== "number") + return "confidenceScore: number expected"; + return null; + }; + + /** + * Creates a LanguageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LanguageInfo} LanguageInfo + */ + LanguageInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LanguageInfo(); + if (object.inputLanguageCode != null) + message.inputLanguageCode = String(object.inputLanguageCode); + if (object.resolvedLanguageCode != null) + message.resolvedLanguageCode = String(object.resolvedLanguageCode); + if (object.confidenceScore != null) + message.confidenceScore = Number(object.confidenceScore); + return message; + }; + + /** + * Creates a plain object from a LanguageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LanguageInfo} message LanguageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputLanguageCode = ""; + object.resolvedLanguageCode = ""; + object.confidenceScore = 0; + } + if (message.inputLanguageCode != null && message.hasOwnProperty("inputLanguageCode")) + object.inputLanguageCode = message.inputLanguageCode; + if (message.resolvedLanguageCode != null && message.hasOwnProperty("resolvedLanguageCode")) + object.resolvedLanguageCode = message.resolvedLanguageCode; + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; + return object; + }; + + /** + * Converts this LanguageInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @instance + * @returns {Object.} JSON object + */ + LanguageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LanguageInfo + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LanguageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LanguageInfo"; + }; + + return LanguageInfo; + })(); + + v3beta1.Deployments = (function() { + + /** + * Constructs a new Deployments service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Deployments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Deployments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Deployments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Deployments; + + /** + * Creates new Deployments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Deployments} RPC service. Useful where requests and/or responses are streamed. + */ + Deployments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Deployments|listDeployments}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployments + * @typedef ListDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse} [response] ListDeploymentsResponse + */ + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Deployments.prototype.listDeployments = function listDeployments(request, callback) { + return this.rpcCall(listDeployments, $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse, request, callback); + }, "name", { value: "ListDeployments" }); + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Deployments|getDeployment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployments + * @typedef GetDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Deployment} [response] Deployment + */ + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Deployments.prototype.getDeployment = function getDeployment(request, callback) { + return this.rpcCall(getDeployment, $root.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Deployment, request, callback); + }, "name", { value: "GetDeployment" }); + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Deployments; + })(); + + v3beta1.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {string|null} [flowVersion] Deployment flowVersion + * @property {google.cloud.dialogflow.cx.v3beta1.Deployment.State|null} [state] Deployment state + * @property {google.cloud.dialogflow.cx.v3beta1.Deployment.IResult|null} [result] Deployment result + * @property {google.protobuf.ITimestamp|null} [startTime] Deployment startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Deployment endTime + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment flowVersion. + * @member {string} flowVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @instance + */ + Deployment.prototype.flowVersion = ""; + + /** + * Deployment state. + * @member {google.cloud.dialogflow.cx.v3beta1.Deployment.State} state + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @instance + */ + Deployment.prototype.state = 0; + + /** + * Deployment result. + * @member {google.cloud.dialogflow.cx.v3beta1.Deployment.IResult|null|undefined} result + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @instance + */ + Deployment.prototype.result = null; + + /** + * Deployment startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @instance + */ + Deployment.prototype.startTime = null; + + /** + * Deployment endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @instance + */ + Deployment.prototype.endTime = null; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.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.flowVersion != null && Object.hasOwnProperty.call(message, "flowVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowVersion); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result.encode(message.result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Deployment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flowVersion = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.result = $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + if (!$util.isString(message.flowVersion)) + return "flowVersion: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result.verify(message.result, long + 1); + if (error) + return "result." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Deployment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Deployment(); + if (object.name != null) + message.name = String(object.name); + if (object.flowVersion != null) + message.flowVersion = String(object.flowVersion); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Deployment.result: object expected"); + message.result = $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result.fromObject(object.result, long + 1); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Deployment.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Deployment.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.flowVersion = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.result = null; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flowVersion != null && message.hasOwnProperty("flowVersion")) + object.flowVersion = message.flowVersion; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Deployment.State[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3beta1.Deployment.State[message.state] : message.state; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result.toObject(message.result, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Deployment"; + }; + + /** + * State enum. + * @name google.cloud.dialogflow.cx.v3beta1.Deployment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + Deployment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + Deployment.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @interface IResult + * @property {Array.|null} [deploymentTestResults] Result deploymentTestResults + * @property {string|null} [experiment] Result experiment + */ + + /** + * Constructs a new Result. + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Deployment.IResult=} [properties] Properties to set + */ + function Result(properties) { + this.deploymentTestResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Result deploymentTestResults. + * @member {Array.} deploymentTestResults + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @instance + */ + Result.prototype.deploymentTestResults = $util.emptyArray; + + /** + * Result experiment. + * @member {string} experiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @instance + */ + Result.prototype.experiment = ""; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Deployment.IResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.Result.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Deployment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deploymentTestResults != null && message.deploymentTestResults.length) + for (var i = 0; i < message.deploymentTestResults.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deploymentTestResults[i]); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.experiment); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Deployment.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Deployment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deploymentTestResults && message.deploymentTestResults.length)) + message.deploymentTestResults = []; + message.deploymentTestResults.push(reader.string()); + break; + } + case 2: { + message.experiment = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deploymentTestResults != null && message.hasOwnProperty("deploymentTestResults")) { + if (!Array.isArray(message.deploymentTestResults)) + return "deploymentTestResults: array expected"; + for (var i = 0; i < message.deploymentTestResults.length; ++i) + if (!$util.isString(message.deploymentTestResults[i])) + return "deploymentTestResults: string[] expected"; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + if (!$util.isString(message.experiment)) + return "experiment: string expected"; + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Deployment.Result} Result + */ + Result.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Deployment.Result(); + if (object.deploymentTestResults) { + if (!Array.isArray(object.deploymentTestResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Deployment.Result.deploymentTestResults: array expected"); + message.deploymentTestResults = []; + for (var i = 0; i < object.deploymentTestResults.length; ++i) + message.deploymentTestResults[i] = String(object.deploymentTestResults[i]); + } + if (object.experiment != null) + message.experiment = String(object.experiment); + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Deployment.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deploymentTestResults = []; + if (options.defaults) + object.experiment = ""; + if (message.deploymentTestResults && message.deploymentTestResults.length) { + object.deploymentTestResults = []; + for (var j = 0; j < message.deploymentTestResults.length; ++j) + object.deploymentTestResults[j] = message.deploymentTestResults[j]; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = message.experiment; + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Result + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Deployment.Result + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Result.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Deployment.Result"; + }; + + return Result; + })(); + + return Deployment; + })(); + + v3beta1.ListDeploymentsRequest = (function() { + + /** + * Properties of a ListDeploymentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListDeploymentsRequest + * @property {string|null} [parent] ListDeploymentsRequest parent + * @property {number|null} [pageSize] ListDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListDeploymentsRequest pageToken + */ + + /** + * Constructs a new ListDeploymentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListDeploymentsRequest. + * @implements IListDeploymentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest=} [properties] Properties to set + */ + function ListDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.parent = ""; + + /** + * ListDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest} ListDeploymentsRequest instance + */ + ListDeploymentsRequest.create = function create(properties) { + return new ListDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest} ListDeploymentsRequest + */ + ListDeploymentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest} message ListDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest"; + }; + + return ListDeploymentsRequest; + })(); + + v3beta1.ListDeploymentsResponse = (function() { + + /** + * Properties of a ListDeploymentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListDeploymentsResponse + * @property {Array.|null} [deployments] ListDeploymentsResponse deployments + * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListDeploymentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListDeploymentsResponse. + * @implements IListDeploymentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse=} [properties] Properties to set + */ + function ListDeploymentsResponse(properties) { + this.deployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsResponse deployments. + * @member {Array.} deployments + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.deployments = $util.emptyArray; + + /** + * ListDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse} ListDeploymentsResponse instance + */ + ListDeploymentsResponse.create = function create(properties) { + return new ListDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push($root.google.cloud.dialogflow.cx.v3beta1.Deployment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Deployment.verify(message.deployments[i], long + 1); + if (error) + return "deployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse} ListDeploymentsResponse + */ + ListDeploymentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse(); + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) { + if (typeof object.deployments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse.deployments: object expected"); + message.deployments[i] = $root.google.cloud.dialogflow.cx.v3beta1.Deployment.fromObject(object.deployments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse} message ListDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = $root.google.cloud.dialogflow.cx.v3beta1.Deployment.toObject(message.deployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListDeploymentsResponse"; + }; + + return ListDeploymentsResponse; + })(); + + v3beta1.GetDeploymentRequest = (function() { + + /** + * Properties of a GetDeploymentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetDeploymentRequest + * @property {string|null} [name] GetDeploymentRequest name + */ + + /** + * Constructs a new GetDeploymentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetDeploymentRequest. + * @implements IGetDeploymentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest=} [properties] Properties to set + */ + function GetDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @instance + */ + GetDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest} GetDeploymentRequest instance + */ + GetDeploymentRequest.create = function create(properties) { + return new GetDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeploymentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeploymentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest} GetDeploymentRequest + */ + GetDeploymentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest} message GetDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeploymentRequest.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 GetDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest"; + }; + + return GetDeploymentRequest; + })(); + + v3beta1.Experiments = (function() { + + /** + * Constructs a new Experiments service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Experiments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Experiments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Experiments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Experiments; + + /** + * Creates new Experiments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Experiments} RPC service. Useful where requests and/or responses are streamed. + */ + Experiments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|listExperiments}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @typedef ListExperimentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse} [response] ListExperimentsResponse + */ + + /** + * Calls ListExperiments. + * @function listExperiments + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest} request ListExperimentsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperimentsCallback} callback Node-style callback called with the error, if any, and ListExperimentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.listExperiments = function listExperiments(request, callback) { + return this.rpcCall(listExperiments, $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse, request, callback); + }, "name", { value: "ListExperiments" }); + + /** + * Calls ListExperiments. + * @function listExperiments + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest} request ListExperimentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|getExperiment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @typedef GetExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} [response] Experiment + */ + + /** + * Calls GetExperiment. + * @function getExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest} request GetExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Experiments.GetExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.getExperiment = function getExperiment(request, callback) { + return this.rpcCall(getExperiment, $root.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Experiment, request, callback); + }, "name", { value: "GetExperiment" }); + + /** + * Calls GetExperiment. + * @function getExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest} request GetExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|createExperiment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @typedef CreateExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} [response] Experiment + */ + + /** + * Calls CreateExperiment. + * @function createExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest} request CreateExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Experiments.CreateExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.createExperiment = function createExperiment(request, callback) { + return this.rpcCall(createExperiment, $root.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Experiment, request, callback); + }, "name", { value: "CreateExperiment" }); + + /** + * Calls CreateExperiment. + * @function createExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest} request CreateExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|updateExperiment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @typedef UpdateExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} [response] Experiment + */ + + /** + * Calls UpdateExperiment. + * @function updateExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest} request UpdateExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Experiments.UpdateExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.updateExperiment = function updateExperiment(request, callback) { + return this.rpcCall(updateExperiment, $root.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Experiment, request, callback); + }, "name", { value: "UpdateExperiment" }); + + /** + * Calls UpdateExperiment. + * @function updateExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest} request UpdateExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|deleteExperiment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @typedef DeleteExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExperiment. + * @function deleteExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest} request DeleteExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Experiments.DeleteExperimentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.deleteExperiment = function deleteExperiment(request, callback) { + return this.rpcCall(deleteExperiment, $root.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExperiment" }); + + /** + * Calls DeleteExperiment. + * @function deleteExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest} request DeleteExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|startExperiment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @typedef StartExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} [response] Experiment + */ + + /** + * Calls StartExperiment. + * @function startExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest} request StartExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Experiments.StartExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.startExperiment = function startExperiment(request, callback) { + return this.rpcCall(startExperiment, $root.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Experiment, request, callback); + }, "name", { value: "StartExperiment" }); + + /** + * Calls StartExperiment. + * @function startExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest} request StartExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Experiments|stopExperiment}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @typedef StopExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} [response] Experiment + */ + + /** + * Calls StopExperiment. + * @function stopExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest} request StopExperimentRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Experiments.StopExperimentCallback} callback Node-style callback called with the error, if any, and Experiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Experiments.prototype.stopExperiment = function stopExperiment(request, callback) { + return this.rpcCall(stopExperiment, $root.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest, $root.google.cloud.dialogflow.cx.v3beta1.Experiment, request, callback); + }, "name", { value: "StopExperiment" }); + + /** + * Calls StopExperiment. + * @function stopExperiment + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiments + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest} request StopExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Experiments; + })(); + + v3beta1.Experiment = (function() { + + /** + * Properties of an Experiment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExperiment + * @property {string|null} [name] Experiment name + * @property {string|null} [displayName] Experiment displayName + * @property {string|null} [description] Experiment description + * @property {google.cloud.dialogflow.cx.v3beta1.Experiment.State|null} [state] Experiment state + * @property {google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition|null} [definition] Experiment definition + * @property {google.cloud.dialogflow.cx.v3beta1.IRolloutConfig|null} [rolloutConfig] Experiment rolloutConfig + * @property {google.cloud.dialogflow.cx.v3beta1.IRolloutState|null} [rolloutState] Experiment rolloutState + * @property {string|null} [rolloutFailureReason] Experiment rolloutFailureReason + * @property {google.cloud.dialogflow.cx.v3beta1.Experiment.IResult|null} [result] Experiment result + * @property {google.protobuf.ITimestamp|null} [createTime] Experiment createTime + * @property {google.protobuf.ITimestamp|null} [startTime] Experiment startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Experiment endTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Experiment lastUpdateTime + * @property {google.protobuf.IDuration|null} [experimentLength] Experiment experimentLength + * @property {Array.|null} [variantsHistory] Experiment variantsHistory + */ + + /** + * Constructs a new Experiment. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an Experiment. + * @implements IExperiment + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExperiment=} [properties] Properties to set + */ + function Experiment(properties) { + this.variantsHistory = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Experiment name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.name = ""; + + /** + * Experiment displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.displayName = ""; + + /** + * Experiment description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.description = ""; + + /** + * Experiment state. + * @member {google.cloud.dialogflow.cx.v3beta1.Experiment.State} state + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.state = 0; + + /** + * Experiment definition. + * @member {google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition|null|undefined} definition + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.definition = null; + + /** + * Experiment rolloutConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.IRolloutConfig|null|undefined} rolloutConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.rolloutConfig = null; + + /** + * Experiment rolloutState. + * @member {google.cloud.dialogflow.cx.v3beta1.IRolloutState|null|undefined} rolloutState + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.rolloutState = null; + + /** + * Experiment rolloutFailureReason. + * @member {string} rolloutFailureReason + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.rolloutFailureReason = ""; + + /** + * Experiment result. + * @member {google.cloud.dialogflow.cx.v3beta1.Experiment.IResult|null|undefined} result + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.result = null; + + /** + * Experiment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.createTime = null; + + /** + * Experiment startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.startTime = null; + + /** + * Experiment endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.endTime = null; + + /** + * Experiment lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.lastUpdateTime = null; + + /** + * Experiment experimentLength. + * @member {google.protobuf.IDuration|null|undefined} experimentLength + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.experimentLength = null; + + /** + * Experiment variantsHistory. + * @member {Array.} variantsHistory + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + */ + Experiment.prototype.variantsHistory = $util.emptyArray; + + /** + * Creates a new Experiment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExperiment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment} Experiment instance + */ + Experiment.create = function create(properties) { + return new Experiment(properties); + }; + + /** + * Encodes the specified Experiment message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExperiment} message Experiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Experiment.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.definition != null && Object.hasOwnProperty.call(message, "definition")) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.encode(message.definition, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.encode(message.result, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.experimentLength != null && Object.hasOwnProperty.call(message, "experimentLength")) + $root.google.protobuf.Duration.encode(message.experimentLength, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.variantsHistory != null && message.variantsHistory.length) + for (var i = 0; i < message.variantsHistory.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory.encode(message.variantsHistory[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.rolloutConfig != null && Object.hasOwnProperty.call(message, "rolloutConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.encode(message.rolloutConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.rolloutState != null && Object.hasOwnProperty.call(message, "rolloutState")) + $root.google.cloud.dialogflow.cx.v3beta1.RolloutState.encode(message.rolloutState, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.rolloutFailureReason != null && Object.hasOwnProperty.call(message, "rolloutFailureReason")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.rolloutFailureReason); + return writer; + }; + + /** + * Encodes the specified Experiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExperiment} message Experiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Experiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Experiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment} Experiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Experiment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.definition = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.rolloutConfig = $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.rolloutState = $root.google.cloud.dialogflow.cx.v3beta1.RolloutState.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.rolloutFailureReason = reader.string(); + break; + } + case 6: { + message.result = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.experimentLength = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + if (!(message.variantsHistory && message.variantsHistory.length)) + message.variantsHistory = []; + message.variantsHistory.push($root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Experiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment} Experiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Experiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Experiment message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Experiment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.definition != null && message.hasOwnProperty("definition")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.verify(message.definition, long + 1); + if (error) + return "definition." + error; + } + if (message.rolloutConfig != null && message.hasOwnProperty("rolloutConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.verify(message.rolloutConfig, long + 1); + if (error) + return "rolloutConfig." + error; + } + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.RolloutState.verify(message.rolloutState, long + 1); + if (error) + return "rolloutState." + error; + } + if (message.rolloutFailureReason != null && message.hasOwnProperty("rolloutFailureReason")) + if (!$util.isString(message.rolloutFailureReason)) + return "rolloutFailureReason: string expected"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.verify(message.result, long + 1); + if (error) + return "result." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime, long + 1); + if (error) + return "lastUpdateTime." + error; + } + if (message.experimentLength != null && message.hasOwnProperty("experimentLength")) { + var error = $root.google.protobuf.Duration.verify(message.experimentLength, long + 1); + if (error) + return "experimentLength." + error; + } + if (message.variantsHistory != null && message.hasOwnProperty("variantsHistory")) { + if (!Array.isArray(message.variantsHistory)) + return "variantsHistory: array expected"; + for (var i = 0; i < message.variantsHistory.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory.verify(message.variantsHistory[i], long + 1); + if (error) + return "variantsHistory." + error; + } + } + return null; + }; + + /** + * Creates an Experiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment} Experiment + */ + Experiment.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Experiment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "DRAFT": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + case "ROLLOUT_FAILED": + case 4: + message.state = 4; + break; + } + if (object.definition != null) { + if (typeof object.definition !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.definition: object expected"); + message.definition = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.fromObject(object.definition, long + 1); + } + if (object.rolloutConfig != null) { + if (typeof object.rolloutConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.rolloutConfig: object expected"); + message.rolloutConfig = $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.fromObject(object.rolloutConfig, long + 1); + } + if (object.rolloutState != null) { + if (typeof object.rolloutState !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.rolloutState: object expected"); + message.rolloutState = $root.google.cloud.dialogflow.cx.v3beta1.RolloutState.fromObject(object.rolloutState, long + 1); + } + if (object.rolloutFailureReason != null) + message.rolloutFailureReason = String(object.rolloutFailureReason); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.result: object expected"); + message.result = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.fromObject(object.result, long + 1); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime, long + 1); + } + if (object.experimentLength != null) { + if (typeof object.experimentLength !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.experimentLength: object expected"); + message.experimentLength = $root.google.protobuf.Duration.fromObject(object.experimentLength, long + 1); + } + if (object.variantsHistory) { + if (!Array.isArray(object.variantsHistory)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.variantsHistory: array expected"); + message.variantsHistory = []; + for (var i = 0; i < object.variantsHistory.length; ++i) { + if (typeof object.variantsHistory[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.variantsHistory: object expected"); + message.variantsHistory[i] = $root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory.fromObject(object.variantsHistory[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an Experiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} message Experiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Experiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.variantsHistory = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.definition = null; + object.result = null; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.lastUpdateTime = null; + object.experimentLength = null; + object.rolloutConfig = null; + object.rolloutState = null; + object.rolloutFailureReason = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Experiment.State[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3beta1.Experiment.State[message.state] : message.state; + if (message.definition != null && message.hasOwnProperty("definition")) + object.definition = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.toObject(message.definition, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.toObject(message.result, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.experimentLength != null && message.hasOwnProperty("experimentLength")) + object.experimentLength = $root.google.protobuf.Duration.toObject(message.experimentLength, options); + if (message.variantsHistory && message.variantsHistory.length) { + object.variantsHistory = []; + for (var j = 0; j < message.variantsHistory.length; ++j) + object.variantsHistory[j] = $root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory.toObject(message.variantsHistory[j], options); + } + if (message.rolloutConfig != null && message.hasOwnProperty("rolloutConfig")) + object.rolloutConfig = $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.toObject(message.rolloutConfig, options); + if (message.rolloutState != null && message.hasOwnProperty("rolloutState")) + object.rolloutState = $root.google.cloud.dialogflow.cx.v3beta1.RolloutState.toObject(message.rolloutState, options); + if (message.rolloutFailureReason != null && message.hasOwnProperty("rolloutFailureReason")) + object.rolloutFailureReason = message.rolloutFailureReason; + return object; + }; + + /** + * Converts this Experiment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @instance + * @returns {Object.} JSON object + */ + Experiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Experiment + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Experiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Experiment"; + }; + + /** + * State enum. + * @name google.cloud.dialogflow.cx.v3beta1.Experiment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} DRAFT=1 DRAFT value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + * @property {number} ROLLOUT_FAILED=4 ROLLOUT_FAILED value + */ + Experiment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRAFT"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + values[valuesById[4] = "ROLLOUT_FAILED"] = 4; + return values; + })(); + + Experiment.Definition = (function() { + + /** + * Properties of a Definition. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @interface IDefinition + * @property {string|null} [condition] Definition condition + * @property {google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null} [versionVariants] Definition versionVariants + */ + + /** + * Constructs a new Definition. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @classdesc Represents a Definition. + * @implements IDefinition + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition=} [properties] Properties to set + */ + function Definition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Definition condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @instance + */ + Definition.prototype.condition = ""; + + /** + * Definition versionVariants. + * @member {google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null|undefined} versionVariants + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @instance + */ + Definition.prototype.versionVariants = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Definition variants. + * @member {"versionVariants"|undefined} variants + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @instance + */ + Object.defineProperty(Definition.prototype, "variants", { + get: $util.oneOfGetter($oneOfFields = ["versionVariants"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Definition instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Definition} Definition instance + */ + Definition.create = function create(properties) { + return new Definition(properties); + }; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.versionVariants != null && Object.hasOwnProperty.call(message, "versionVariants")) + $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.encode(message.versionVariants, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.versionVariants = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Definition message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Definition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + properties.variants = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.verify(message.versionVariants, long + 1); + if (error) + return "versionVariants." + error; + } + } + return null; + }; + + /** + * Creates a Definition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Definition} Definition + */ + Definition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Definition(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.versionVariants != null) { + if (typeof object.versionVariants !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.Definition.versionVariants: object expected"); + message.versionVariants = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.fromObject(object.versionVariants, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Definition} message Definition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Definition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.condition = ""; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + object.versionVariants = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.toObject(message.versionVariants, options); + if (options.oneofs) + object.variants = "versionVariants"; + } + return object; + }; + + /** + * Converts this Definition to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @instance + * @returns {Object.} JSON object + */ + Definition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Definition + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Definition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Definition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Experiment.Definition"; + }; + + return Definition; + })(); + + Experiment.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @interface IResult + * @property {Array.|null} [versionMetrics] Result versionMetrics + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Result lastUpdateTime + */ + + /** + * Constructs a new Result. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IResult=} [properties] Properties to set + */ + function Result(properties) { + this.versionMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Result versionMetrics. + * @member {Array.} versionMetrics + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @instance + */ + Result.prototype.versionMetrics = $util.emptyArray; + + /** + * Result lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @instance + */ + Result.prototype.lastUpdateTime = null; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionMetrics != null && message.versionMetrics.length) + for (var i = 0; i < message.versionMetrics.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.encode(message.versionMetrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.versionMetrics && message.versionMetrics.length)) + message.versionMetrics = []; + message.versionMetrics.push($root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.versionMetrics != null && message.hasOwnProperty("versionMetrics")) { + if (!Array.isArray(message.versionMetrics)) + return "versionMetrics: array expected"; + for (var i = 0; i < message.versionMetrics.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.verify(message.versionMetrics[i], long + 1); + if (error) + return "versionMetrics." + error; + } + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime, long + 1); + if (error) + return "lastUpdateTime." + error; + } + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result} Result + */ + Result.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result(); + if (object.versionMetrics) { + if (!Array.isArray(object.versionMetrics)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.Result.versionMetrics: array expected"); + message.versionMetrics = []; + for (var i = 0; i < object.versionMetrics.length; ++i) { + if (typeof object.versionMetrics[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.Result.versionMetrics: object expected"); + message.versionMetrics[i] = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.fromObject(object.versionMetrics[i], long + 1); + } + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.Result.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionMetrics = []; + if (options.defaults) + object.lastUpdateTime = null; + if (message.versionMetrics && message.versionMetrics.length) { + object.versionMetrics = []; + for (var j = 0; j < message.versionMetrics.length; ++j) + object.versionMetrics[j] = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.toObject(message.versionMetrics[j], options); + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Result + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Result.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Experiment.Result"; + }; + + /** + * MetricType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType + * @enum {number} + * @property {number} METRIC_UNSPECIFIED=0 METRIC_UNSPECIFIED value + * @property {number} CONTAINED_SESSION_NO_CALLBACK_RATE=1 CONTAINED_SESSION_NO_CALLBACK_RATE value + * @property {number} LIVE_AGENT_HANDOFF_RATE=2 LIVE_AGENT_HANDOFF_RATE value + * @property {number} CALLBACK_SESSION_RATE=3 CALLBACK_SESSION_RATE value + * @property {number} ABANDONED_SESSION_RATE=4 ABANDONED_SESSION_RATE value + * @property {number} SESSION_END_RATE=5 SESSION_END_RATE value + */ + Result.MetricType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTAINED_SESSION_NO_CALLBACK_RATE"] = 1; + values[valuesById[2] = "LIVE_AGENT_HANDOFF_RATE"] = 2; + values[valuesById[3] = "CALLBACK_SESSION_RATE"] = 3; + values[valuesById[4] = "ABANDONED_SESSION_RATE"] = 4; + values[valuesById[5] = "SESSION_END_RATE"] = 5; + return values; + })(); + + /** + * CountType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType + * @enum {number} + * @property {number} COUNT_TYPE_UNSPECIFIED=0 COUNT_TYPE_UNSPECIFIED value + * @property {number} TOTAL_NO_MATCH_COUNT=1 TOTAL_NO_MATCH_COUNT value + * @property {number} TOTAL_TURN_COUNT=2 TOTAL_TURN_COUNT value + * @property {number} AVERAGE_TURN_COUNT=3 AVERAGE_TURN_COUNT value + */ + Result.CountType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COUNT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOTAL_NO_MATCH_COUNT"] = 1; + values[valuesById[2] = "TOTAL_TURN_COUNT"] = 2; + values[valuesById[3] = "AVERAGE_TURN_COUNT"] = 3; + return values; + })(); + + Result.ConfidenceInterval = (function() { + + /** + * Properties of a ConfidenceInterval. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @interface IConfidenceInterval + * @property {number|null} [confidenceLevel] ConfidenceInterval confidenceLevel + * @property {number|null} [ratio] ConfidenceInterval ratio + * @property {number|null} [lowerBound] ConfidenceInterval lowerBound + * @property {number|null} [upperBound] ConfidenceInterval upperBound + */ + + /** + * Constructs a new ConfidenceInterval. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @classdesc Represents a ConfidenceInterval. + * @implements IConfidenceInterval + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval=} [properties] Properties to set + */ + function ConfidenceInterval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceInterval confidenceLevel. + * @member {number} confidenceLevel + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.confidenceLevel = 0; + + /** + * ConfidenceInterval ratio. + * @member {number} ratio + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.ratio = 0; + + /** + * ConfidenceInterval lowerBound. + * @member {number} lowerBound + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.lowerBound = 0; + + /** + * ConfidenceInterval upperBound. + * @member {number} upperBound + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @instance + */ + ConfidenceInterval.prototype.upperBound = 0; + + /** + * Creates a new ConfidenceInterval instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval} ConfidenceInterval instance + */ + ConfidenceInterval.create = function create(properties) { + return new ConfidenceInterval(properties); + }; + + /** + * Encodes the specified ConfidenceInterval message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval} message ConfidenceInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceInterval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceLevel != null && Object.hasOwnProperty.call(message, "confidenceLevel")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.confidenceLevel); + if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.ratio); + if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.lowerBound); + if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.upperBound); + return writer; + }; + + /** + * Encodes the specified ConfidenceInterval message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval} message ConfidenceInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceInterval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval} ConfidenceInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceInterval.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidenceLevel = reader.double(); + break; + } + case 2: { + message.ratio = reader.double(); + break; + } + case 3: { + message.lowerBound = reader.double(); + break; + } + case 4: { + message.upperBound = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceInterval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval} ConfidenceInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceInterval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceInterval message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceInterval.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + if (typeof message.confidenceLevel !== "number") + return "confidenceLevel: number expected"; + if (message.ratio != null && message.hasOwnProperty("ratio")) + if (typeof message.ratio !== "number") + return "ratio: number expected"; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + if (typeof message.lowerBound !== "number") + return "lowerBound: number expected"; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + if (typeof message.upperBound !== "number") + return "upperBound: number expected"; + return null; + }; + + /** + * Creates a ConfidenceInterval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval} ConfidenceInterval + */ + ConfidenceInterval.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval(); + if (object.confidenceLevel != null) + message.confidenceLevel = Number(object.confidenceLevel); + if (object.ratio != null) + message.ratio = Number(object.ratio); + if (object.lowerBound != null) + message.lowerBound = Number(object.lowerBound); + if (object.upperBound != null) + message.upperBound = Number(object.upperBound); + return message; + }; + + /** + * Creates a plain object from a ConfidenceInterval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval} message ConfidenceInterval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceInterval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceLevel = 0; + object.ratio = 0; + object.lowerBound = 0; + object.upperBound = 0; + } + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + object.confidenceLevel = options.json && !isFinite(message.confidenceLevel) ? String(message.confidenceLevel) : message.confidenceLevel; + if (message.ratio != null && message.hasOwnProperty("ratio")) + object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + object.lowerBound = options.json && !isFinite(message.lowerBound) ? String(message.lowerBound) : message.lowerBound; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + object.upperBound = options.json && !isFinite(message.upperBound) ? String(message.upperBound) : message.upperBound; + return object; + }; + + /** + * Converts this ConfidenceInterval to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @instance + * @returns {Object.} JSON object + */ + ConfidenceInterval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceInterval + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceInterval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval"; + }; + + return ConfidenceInterval; + })(); + + Result.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @interface IMetric + * @property {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType|null} [type] Metric type + * @property {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType|null} [countType] Metric countType + * @property {number|null} [ratio] Metric ratio + * @property {number|null} [count] Metric count + * @property {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval|null} [confidenceInterval] Metric confidenceInterval + */ + + /** + * Constructs a new Metric. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric=} [properties] Properties to set + */ + function Metric(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metric type. + * @member {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType} type + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @instance + */ + Metric.prototype.type = 0; + + /** + * Metric countType. + * @member {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType} countType + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @instance + */ + Metric.prototype.countType = 0; + + /** + * Metric ratio. + * @member {number|null|undefined} ratio + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @instance + */ + Metric.prototype.ratio = null; + + /** + * Metric count. + * @member {number|null|undefined} count + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @instance + */ + Metric.prototype.count = null; + + /** + * Metric confidenceInterval. + * @member {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IConfidenceInterval|null|undefined} confidenceInterval + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @instance + */ + Metric.prototype.confidenceInterval = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Metric value. + * @member {"ratio"|"count"|undefined} value + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @instance + */ + Object.defineProperty(Metric.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["ratio", "count"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.ratio); + if (message.confidenceInterval != null && Object.hasOwnProperty.call(message, "confidenceInterval")) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.encode(message.confidenceInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.count); + if (message.countType != null && Object.hasOwnProperty.call(message, "countType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.countType); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 5: { + message.countType = reader.int32(); + break; + } + case 2: { + message.ratio = reader.double(); + break; + } + case 4: { + message.count = reader.double(); + break; + } + case 3: { + message.confidenceInterval = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metric message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.countType != null && message.hasOwnProperty("countType")) + switch (message.countType) { + default: + return "countType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.ratio != null && message.hasOwnProperty("ratio")) { + properties.value = 1; + if (typeof message.ratio !== "number") + return "ratio: number expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.count !== "number") + return "count: number expected"; + } + if (message.confidenceInterval != null && message.hasOwnProperty("confidenceInterval")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.verify(message.confidenceInterval, long + 1); + if (error) + return "confidenceInterval." + error; + } + return null; + }; + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric} Metric + */ + Metric.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "METRIC_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CONTAINED_SESSION_NO_CALLBACK_RATE": + case 1: + message.type = 1; + break; + case "LIVE_AGENT_HANDOFF_RATE": + case 2: + message.type = 2; + break; + case "CALLBACK_SESSION_RATE": + case 3: + message.type = 3; + break; + case "ABANDONED_SESSION_RATE": + case 4: + message.type = 4; + break; + case "SESSION_END_RATE": + case 5: + message.type = 5; + break; + } + switch (object.countType) { + default: + if (typeof object.countType === "number") { + message.countType = object.countType; + break; + } + break; + case "COUNT_TYPE_UNSPECIFIED": + case 0: + message.countType = 0; + break; + case "TOTAL_NO_MATCH_COUNT": + case 1: + message.countType = 1; + break; + case "TOTAL_TURN_COUNT": + case 2: + message.countType = 2; + break; + case "AVERAGE_TURN_COUNT": + case 3: + message.countType = 3; + break; + } + if (object.ratio != null) + message.ratio = Number(object.ratio); + if (object.count != null) + message.count = Number(object.count); + if (object.confidenceInterval != null) { + if (typeof object.confidenceInterval !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.confidenceInterval: object expected"); + message.confidenceInterval = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.fromObject(object.confidenceInterval, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "METRIC_UNSPECIFIED" : 0; + object.confidenceInterval = null; + object.countType = options.enums === String ? "COUNT_TYPE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType[message.type] === undefined ? message.type : $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.MetricType[message.type] : message.type; + if (message.ratio != null && message.hasOwnProperty("ratio")) { + object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; + if (options.oneofs) + object.value = "ratio"; + } + if (message.confidenceInterval != null && message.hasOwnProperty("confidenceInterval")) + object.confidenceInterval = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.ConfidenceInterval.toObject(message.confidenceInterval, options); + if (message.count != null && message.hasOwnProperty("count")) { + object.count = options.json && !isFinite(message.count) ? String(message.count) : message.count; + if (options.oneofs) + object.value = "count"; + } + if (message.countType != null && message.hasOwnProperty("countType")) + object.countType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType[message.countType] === undefined ? message.countType : $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.CountType[message.countType] : message.countType; + return object; + }; + + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric"; + }; + + return Metric; + })(); + + Result.VersionMetrics = (function() { + + /** + * Properties of a VersionMetrics. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @interface IVersionMetrics + * @property {string|null} [version] VersionMetrics version + * @property {Array.|null} [metrics] VersionMetrics metrics + * @property {number|null} [sessionCount] VersionMetrics sessionCount + */ + + /** + * Constructs a new VersionMetrics. + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result + * @classdesc Represents a VersionMetrics. + * @implements IVersionMetrics + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics=} [properties] Properties to set + */ + function VersionMetrics(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionMetrics version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @instance + */ + VersionMetrics.prototype.version = ""; + + /** + * VersionMetrics metrics. + * @member {Array.} metrics + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @instance + */ + VersionMetrics.prototype.metrics = $util.emptyArray; + + /** + * VersionMetrics sessionCount. + * @member {number} sessionCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @instance + */ + VersionMetrics.prototype.sessionCount = 0; + + /** + * Creates a new VersionMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics} VersionMetrics instance + */ + VersionMetrics.create = function create(properties) { + return new VersionMetrics(properties); + }; + + /** + * Encodes the specified VersionMetrics message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics} message VersionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.encode(message.metrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sessionCount); + return writer; + }; + + /** + * Encodes the specified VersionMetrics message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.IVersionMetrics} message VersionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics} VersionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.sessionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VersionMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics} VersionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionMetrics message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.verify(message.metrics[i], long + 1); + if (error) + return "metrics." + error; + } + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (!$util.isInteger(message.sessionCount)) + return "sessionCount: integer expected"; + return null; + }; + + /** + * Creates a VersionMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics} VersionMetrics + */ + VersionMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics(); + if (object.version != null) + message.version = String(object.version); + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics.metrics: object expected"); + message.metrics[i] = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.fromObject(object.metrics[i], long + 1); + } + } + if (object.sessionCount != null) + message.sessionCount = object.sessionCount | 0; + return message; + }; + + /** + * Creates a plain object from a VersionMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics} message VersionMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) { + object.version = ""; + object.sessionCount = 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.Result.Metric.toObject(message.metrics[j], options); + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + object.sessionCount = message.sessionCount; + return object; + }; + + /** + * Converts this VersionMetrics to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @instance + * @returns {Object.} JSON object + */ + VersionMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionMetrics + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Experiment.Result.VersionMetrics"; + }; + + return VersionMetrics; + })(); + + return Result; + })(); + + return Experiment; + })(); + + v3beta1.VersionVariants = (function() { + + /** + * Properties of a VersionVariants. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IVersionVariants + * @property {Array.|null} [variants] VersionVariants variants + */ + + /** + * Constructs a new VersionVariants. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a VersionVariants. + * @implements IVersionVariants + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IVersionVariants=} [properties] Properties to set + */ + function VersionVariants(properties) { + this.variants = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionVariants variants. + * @member {Array.} variants + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @instance + */ + VersionVariants.prototype.variants = $util.emptyArray; + + /** + * Creates a new VersionVariants instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVersionVariants=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants} VersionVariants instance + */ + VersionVariants.create = function create(properties) { + return new VersionVariants(properties); + }; + + /** + * Encodes the specified VersionVariants message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVersionVariants} message VersionVariants message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionVariants.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.variants != null && message.variants.length) + for (var i = 0; i < message.variants.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.encode(message.variants[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionVariants message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVersionVariants} message VersionVariants message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionVariants.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionVariants message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants} VersionVariants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionVariants.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.variants && message.variants.length)) + message.variants = []; + message.variants.push($root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VersionVariants message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants} VersionVariants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionVariants.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionVariants message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionVariants.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.variants != null && message.hasOwnProperty("variants")) { + if (!Array.isArray(message.variants)) + return "variants: array expected"; + for (var i = 0; i < message.variants.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.verify(message.variants[i], long + 1); + if (error) + return "variants." + error; + } + } + return null; + }; + + /** + * Creates a VersionVariants message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants} VersionVariants + */ + VersionVariants.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants(); + if (object.variants) { + if (!Array.isArray(object.variants)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.VersionVariants.variants: array expected"); + message.variants = []; + for (var i = 0; i < object.variants.length; ++i) { + if (typeof object.variants[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.VersionVariants.variants: object expected"); + message.variants[i] = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.fromObject(object.variants[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a VersionVariants message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.VersionVariants} message VersionVariants + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionVariants.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.variants = []; + if (message.variants && message.variants.length) { + object.variants = []; + for (var j = 0; j < message.variants.length; ++j) + object.variants[j] = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.toObject(message.variants[j], options); + } + return object; + }; + + /** + * Converts this VersionVariants to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @instance + * @returns {Object.} JSON object + */ + VersionVariants.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionVariants + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionVariants.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.VersionVariants"; + }; + + VersionVariants.Variant = (function() { + + /** + * Properties of a Variant. + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @interface IVariant + * @property {string|null} [version] Variant version + * @property {number|null} [trafficAllocation] Variant trafficAllocation + * @property {boolean|null} [isControlGroup] Variant isControlGroup + */ + + /** + * Constructs a new Variant. + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants + * @classdesc Represents a Variant. + * @implements IVariant + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant=} [properties] Properties to set + */ + function Variant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Variant version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @instance + */ + Variant.prototype.version = ""; + + /** + * Variant trafficAllocation. + * @member {number} trafficAllocation + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @instance + */ + Variant.prototype.trafficAllocation = 0; + + /** + * Variant isControlGroup. + * @member {boolean} isControlGroup + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @instance + */ + Variant.prototype.isControlGroup = false; + + /** + * Creates a new Variant instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant} Variant instance + */ + Variant.create = function create(properties) { + return new Variant(properties); + }; + + /** + * Encodes the specified Variant message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant} message Variant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Variant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.trafficAllocation != null && Object.hasOwnProperty.call(message, "trafficAllocation")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.trafficAllocation); + if (message.isControlGroup != null && Object.hasOwnProperty.call(message, "isControlGroup")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isControlGroup); + return writer; + }; + + /** + * Encodes the specified Variant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.VersionVariants.IVariant} message Variant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Variant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Variant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant} Variant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Variant.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.trafficAllocation = reader.float(); + break; + } + case 3: { + message.isControlGroup = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Variant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant} Variant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Variant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Variant message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Variant.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.trafficAllocation != null && message.hasOwnProperty("trafficAllocation")) + if (typeof message.trafficAllocation !== "number") + return "trafficAllocation: number expected"; + if (message.isControlGroup != null && message.hasOwnProperty("isControlGroup")) + if (typeof message.isControlGroup !== "boolean") + return "isControlGroup: boolean expected"; + return null; + }; + + /** + * Creates a Variant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant} Variant + */ + Variant.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant(); + if (object.version != null) + message.version = String(object.version); + if (object.trafficAllocation != null) + message.trafficAllocation = Number(object.trafficAllocation); + if (object.isControlGroup != null) + message.isControlGroup = Boolean(object.isControlGroup); + return message; + }; + + /** + * Creates a plain object from a Variant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant} message Variant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Variant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.trafficAllocation = 0; + object.isControlGroup = false; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.trafficAllocation != null && message.hasOwnProperty("trafficAllocation")) + object.trafficAllocation = options.json && !isFinite(message.trafficAllocation) ? String(message.trafficAllocation) : message.trafficAllocation; + if (message.isControlGroup != null && message.hasOwnProperty("isControlGroup")) + object.isControlGroup = message.isControlGroup; + return object; + }; + + /** + * Converts this Variant to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @instance + * @returns {Object.} JSON object + */ + Variant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Variant + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Variant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.VersionVariants.Variant"; + }; + + return Variant; + })(); + + return VersionVariants; + })(); + + v3beta1.RolloutConfig = (function() { + + /** + * Properties of a RolloutConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRolloutConfig + * @property {Array.|null} [rolloutSteps] RolloutConfig rolloutSteps + * @property {string|null} [rolloutCondition] RolloutConfig rolloutCondition + * @property {string|null} [failureCondition] RolloutConfig failureCondition + */ + + /** + * Constructs a new RolloutConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RolloutConfig. + * @implements IRolloutConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutConfig=} [properties] Properties to set + */ + function RolloutConfig(properties) { + this.rolloutSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutConfig rolloutSteps. + * @member {Array.} rolloutSteps + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @instance + */ + RolloutConfig.prototype.rolloutSteps = $util.emptyArray; + + /** + * RolloutConfig rolloutCondition. + * @member {string} rolloutCondition + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @instance + */ + RolloutConfig.prototype.rolloutCondition = ""; + + /** + * RolloutConfig failureCondition. + * @member {string} failureCondition + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @instance + */ + RolloutConfig.prototype.failureCondition = ""; + + /** + * Creates a new RolloutConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig} RolloutConfig instance + */ + RolloutConfig.create = function create(properties) { + return new RolloutConfig(properties); + }; + + /** + * Encodes the specified RolloutConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutConfig} message RolloutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rolloutSteps != null && message.rolloutSteps.length) + for (var i = 0; i < message.rolloutSteps.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.encode(message.rolloutSteps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rolloutCondition != null && Object.hasOwnProperty.call(message, "rolloutCondition")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rolloutCondition); + if (message.failureCondition != null && Object.hasOwnProperty.call(message, "failureCondition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.failureCondition); + return writer; + }; + + /** + * Encodes the specified RolloutConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutConfig} message RolloutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig} RolloutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rolloutSteps && message.rolloutSteps.length)) + message.rolloutSteps = []; + message.rolloutSteps.push($root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.rolloutCondition = reader.string(); + break; + } + case 3: { + message.failureCondition = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig} RolloutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rolloutSteps != null && message.hasOwnProperty("rolloutSteps")) { + if (!Array.isArray(message.rolloutSteps)) + return "rolloutSteps: array expected"; + for (var i = 0; i < message.rolloutSteps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.verify(message.rolloutSteps[i], long + 1); + if (error) + return "rolloutSteps." + error; + } + } + if (message.rolloutCondition != null && message.hasOwnProperty("rolloutCondition")) + if (!$util.isString(message.rolloutCondition)) + return "rolloutCondition: string expected"; + if (message.failureCondition != null && message.hasOwnProperty("failureCondition")) + if (!$util.isString(message.failureCondition)) + return "failureCondition: string expected"; + return null; + }; + + /** + * Creates a RolloutConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig} RolloutConfig + */ + RolloutConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig(); + if (object.rolloutSteps) { + if (!Array.isArray(object.rolloutSteps)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RolloutConfig.rolloutSteps: array expected"); + message.rolloutSteps = []; + for (var i = 0; i < object.rolloutSteps.length; ++i) { + if (typeof object.rolloutSteps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RolloutConfig.rolloutSteps: object expected"); + message.rolloutSteps[i] = $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.fromObject(object.rolloutSteps[i], long + 1); + } + } + if (object.rolloutCondition != null) + message.rolloutCondition = String(object.rolloutCondition); + if (object.failureCondition != null) + message.failureCondition = String(object.failureCondition); + return message; + }; + + /** + * Creates a plain object from a RolloutConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RolloutConfig} message RolloutConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rolloutSteps = []; + if (options.defaults) { + object.rolloutCondition = ""; + object.failureCondition = ""; + } + if (message.rolloutSteps && message.rolloutSteps.length) { + object.rolloutSteps = []; + for (var j = 0; j < message.rolloutSteps.length; ++j) + object.rolloutSteps[j] = $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.toObject(message.rolloutSteps[j], options); + } + if (message.rolloutCondition != null && message.hasOwnProperty("rolloutCondition")) + object.rolloutCondition = message.rolloutCondition; + if (message.failureCondition != null && message.hasOwnProperty("failureCondition")) + object.failureCondition = message.failureCondition; + return object; + }; + + /** + * Converts this RolloutConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @instance + * @returns {Object.} JSON object + */ + RolloutConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RolloutConfig"; + }; + + RolloutConfig.RolloutStep = (function() { + + /** + * Properties of a RolloutStep. + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @interface IRolloutStep + * @property {string|null} [displayName] RolloutStep displayName + * @property {number|null} [trafficPercent] RolloutStep trafficPercent + * @property {google.protobuf.IDuration|null} [minDuration] RolloutStep minDuration + */ + + /** + * Constructs a new RolloutStep. + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig + * @classdesc Represents a RolloutStep. + * @implements IRolloutStep + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep=} [properties] Properties to set + */ + function RolloutStep(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutStep displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @instance + */ + RolloutStep.prototype.displayName = ""; + + /** + * RolloutStep trafficPercent. + * @member {number} trafficPercent + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @instance + */ + RolloutStep.prototype.trafficPercent = 0; + + /** + * RolloutStep minDuration. + * @member {google.protobuf.IDuration|null|undefined} minDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @instance + */ + RolloutStep.prototype.minDuration = null; + + /** + * Creates a new RolloutStep instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep} RolloutStep instance + */ + RolloutStep.create = function create(properties) { + return new RolloutStep(properties); + }; + + /** + * Encodes the specified RolloutStep message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep} message RolloutStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.trafficPercent != null && Object.hasOwnProperty.call(message, "trafficPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trafficPercent); + if (message.minDuration != null && Object.hasOwnProperty.call(message, "minDuration")) + $root.google.protobuf.Duration.encode(message.minDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RolloutStep message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.IRolloutStep} message RolloutStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutStep message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep} RolloutStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutStep.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.trafficPercent = reader.int32(); + break; + } + case 3: { + message.minDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep} RolloutStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutStep message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutStep.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.trafficPercent != null && message.hasOwnProperty("trafficPercent")) + if (!$util.isInteger(message.trafficPercent)) + return "trafficPercent: integer expected"; + if (message.minDuration != null && message.hasOwnProperty("minDuration")) { + var error = $root.google.protobuf.Duration.verify(message.minDuration, long + 1); + if (error) + return "minDuration." + error; + } + return null; + }; + + /** + * Creates a RolloutStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep} RolloutStep + */ + RolloutStep.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.trafficPercent != null) + message.trafficPercent = object.trafficPercent | 0; + if (object.minDuration != null) { + if (typeof object.minDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep.minDuration: object expected"); + message.minDuration = $root.google.protobuf.Duration.fromObject(object.minDuration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RolloutStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep} message RolloutStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.trafficPercent = 0; + object.minDuration = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.trafficPercent != null && message.hasOwnProperty("trafficPercent")) + object.trafficPercent = message.trafficPercent; + if (message.minDuration != null && message.hasOwnProperty("minDuration")) + object.minDuration = $root.google.protobuf.Duration.toObject(message.minDuration, options); + return object; + }; + + /** + * Converts this RolloutStep to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @instance + * @returns {Object.} JSON object + */ + RolloutStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutStep + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RolloutConfig.RolloutStep"; + }; + + return RolloutStep; + })(); + + return RolloutConfig; + })(); + + v3beta1.RolloutState = (function() { + + /** + * Properties of a RolloutState. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRolloutState + * @property {string|null} [step] RolloutState step + * @property {number|null} [stepIndex] RolloutState stepIndex + * @property {google.protobuf.ITimestamp|null} [startTime] RolloutState startTime + */ + + /** + * Constructs a new RolloutState. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RolloutState. + * @implements IRolloutState + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutState=} [properties] Properties to set + */ + function RolloutState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutState step. + * @member {string} step + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @instance + */ + RolloutState.prototype.step = ""; + + /** + * RolloutState stepIndex. + * @member {number} stepIndex + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @instance + */ + RolloutState.prototype.stepIndex = 0; + + /** + * RolloutState startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @instance + */ + RolloutState.prototype.startTime = null; + + /** + * Creates a new RolloutState instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutState=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutState} RolloutState instance + */ + RolloutState.create = function create(properties) { + return new RolloutState(properties); + }; + + /** + * Encodes the specified RolloutState message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutState.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutState} message RolloutState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.step); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.stepIndex != null && Object.hasOwnProperty.call(message, "stepIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.stepIndex); + return writer; + }; + + /** + * Encodes the specified RolloutState message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RolloutState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRolloutState} message RolloutState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutState} RolloutState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutState.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RolloutState(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.step = reader.string(); + break; + } + case 3: { + message.stepIndex = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutState} RolloutState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutState message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutState.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.step != null && message.hasOwnProperty("step")) + if (!$util.isString(message.step)) + return "step: string expected"; + if (message.stepIndex != null && message.hasOwnProperty("stepIndex")) + if (!$util.isInteger(message.stepIndex)) + return "stepIndex: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a RolloutState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RolloutState} RolloutState + */ + RolloutState.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RolloutState) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RolloutState(); + if (object.step != null) + message.step = String(object.step); + if (object.stepIndex != null) + message.stepIndex = object.stepIndex | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RolloutState.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RolloutState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RolloutState} message RolloutState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.step = ""; + object.startTime = null; + object.stepIndex = 0; + } + if (message.step != null && message.hasOwnProperty("step")) + object.step = message.step; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.stepIndex != null && message.hasOwnProperty("stepIndex")) + object.stepIndex = message.stepIndex; + return object; + }; + + /** + * Converts this RolloutState to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @instance + * @returns {Object.} JSON object + */ + RolloutState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutState + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RolloutState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RolloutState"; + }; + + return RolloutState; + })(); + + v3beta1.VariantsHistory = (function() { + + /** + * Properties of a VariantsHistory. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IVariantsHistory + * @property {google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null} [versionVariants] VariantsHistory versionVariants + * @property {google.protobuf.ITimestamp|null} [updateTime] VariantsHistory updateTime + */ + + /** + * Constructs a new VariantsHistory. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a VariantsHistory. + * @implements IVariantsHistory + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IVariantsHistory=} [properties] Properties to set + */ + function VariantsHistory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VariantsHistory versionVariants. + * @member {google.cloud.dialogflow.cx.v3beta1.IVersionVariants|null|undefined} versionVariants + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @instance + */ + VariantsHistory.prototype.versionVariants = null; + + /** + * VariantsHistory updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @instance + */ + VariantsHistory.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VariantsHistory variants. + * @member {"versionVariants"|undefined} variants + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @instance + */ + Object.defineProperty(VariantsHistory.prototype, "variants", { + get: $util.oneOfGetter($oneOfFields = ["versionVariants"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VariantsHistory instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVariantsHistory=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.VariantsHistory} VariantsHistory instance + */ + VariantsHistory.create = function create(properties) { + return new VariantsHistory(properties); + }; + + /** + * Encodes the specified VariantsHistory message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VariantsHistory.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVariantsHistory} message VariantsHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariantsHistory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionVariants != null && Object.hasOwnProperty.call(message, "versionVariants")) + $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.encode(message.versionVariants, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VariantsHistory message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.VariantsHistory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVariantsHistory} message VariantsHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariantsHistory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.VariantsHistory} VariantsHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariantsHistory.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.versionVariants = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VariantsHistory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.VariantsHistory} VariantsHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariantsHistory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VariantsHistory message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VariantsHistory.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + properties.variants = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.verify(message.versionVariants, long + 1); + if (error) + return "versionVariants." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a VariantsHistory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.VariantsHistory} VariantsHistory + */ + VariantsHistory.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.VariantsHistory(); + if (object.versionVariants != null) { + if (typeof object.versionVariants !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.VariantsHistory.versionVariants: object expected"); + message.versionVariants = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.fromObject(object.versionVariants, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.VariantsHistory.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a VariantsHistory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.VariantsHistory} message VariantsHistory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VariantsHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.updateTime = null; + if (message.versionVariants != null && message.hasOwnProperty("versionVariants")) { + object.versionVariants = $root.google.cloud.dialogflow.cx.v3beta1.VersionVariants.toObject(message.versionVariants, options); + if (options.oneofs) + object.variants = "versionVariants"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this VariantsHistory to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @instance + * @returns {Object.} JSON object + */ + VariantsHistory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VariantsHistory + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.VariantsHistory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VariantsHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.VariantsHistory"; + }; + + return VariantsHistory; + })(); + + v3beta1.ListExperimentsRequest = (function() { + + /** + * Properties of a ListExperimentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListExperimentsRequest + * @property {string|null} [parent] ListExperimentsRequest parent + * @property {number|null} [pageSize] ListExperimentsRequest pageSize + * @property {string|null} [pageToken] ListExperimentsRequest pageToken + */ + + /** + * Constructs a new ListExperimentsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListExperimentsRequest. + * @implements IListExperimentsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest=} [properties] Properties to set + */ + function ListExperimentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExperimentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @instance + */ + ListExperimentsRequest.prototype.parent = ""; + + /** + * ListExperimentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @instance + */ + ListExperimentsRequest.prototype.pageSize = 0; + + /** + * ListExperimentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @instance + */ + ListExperimentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListExperimentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest} ListExperimentsRequest instance + */ + ListExperimentsRequest.create = function create(properties) { + return new ListExperimentsRequest(properties); + }; + + /** + * Encodes the specified ListExperimentsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest} message ListExperimentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest} message ListExperimentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest} ListExperimentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExperimentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest} ListExperimentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExperimentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExperimentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListExperimentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest} ListExperimentsRequest + */ + ListExperimentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListExperimentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest} message ListExperimentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExperimentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListExperimentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListExperimentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExperimentsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExperimentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest"; + }; + + return ListExperimentsRequest; + })(); + + v3beta1.ListExperimentsResponse = (function() { + + /** + * Properties of a ListExperimentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListExperimentsResponse + * @property {Array.|null} [experiments] ListExperimentsResponse experiments + * @property {string|null} [nextPageToken] ListExperimentsResponse nextPageToken + */ + + /** + * Constructs a new ListExperimentsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListExperimentsResponse. + * @implements IListExperimentsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse=} [properties] Properties to set + */ + function ListExperimentsResponse(properties) { + this.experiments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExperimentsResponse experiments. + * @member {Array.} experiments + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @instance + */ + ListExperimentsResponse.prototype.experiments = $util.emptyArray; + + /** + * ListExperimentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @instance + */ + ListExperimentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExperimentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse} ListExperimentsResponse instance + */ + ListExperimentsResponse.create = function create(properties) { + return new ListExperimentsResponse(properties); + }; + + /** + * Encodes the specified ListExperimentsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse} message ListExperimentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.experiments != null && message.experiments.length) + for (var i = 0; i < message.experiments.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.encode(message.experiments[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 ListExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse} message ListExperimentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExperimentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse} ListExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.experiments && message.experiments.length)) + message.experiments = []; + message.experiments.push($root.google.cloud.dialogflow.cx.v3beta1.Experiment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExperimentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse} ListExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExperimentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExperimentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExperimentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.experiments != null && message.hasOwnProperty("experiments")) { + if (!Array.isArray(message.experiments)) + return "experiments: array expected"; + for (var i = 0; i < message.experiments.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.verify(message.experiments[i], long + 1); + if (error) + return "experiments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse} ListExperimentsResponse + */ + ListExperimentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse(); + if (object.experiments) { + if (!Array.isArray(object.experiments)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse.experiments: array expected"); + message.experiments = []; + for (var i = 0; i < object.experiments.length; ++i) { + if (typeof object.experiments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse.experiments: object expected"); + message.experiments[i] = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.fromObject(object.experiments[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExperimentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse} message ListExperimentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExperimentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.experiments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.experiments && message.experiments.length) { + object.experiments = []; + for (var j = 0; j < message.experiments.length; ++j) + object.experiments[j] = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.toObject(message.experiments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExperimentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListExperimentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExperimentsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExperimentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListExperimentsResponse"; + }; + + return ListExperimentsResponse; + })(); + + v3beta1.GetExperimentRequest = (function() { + + /** + * Properties of a GetExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetExperimentRequest + * @property {string|null} [name] GetExperimentRequest name + */ + + /** + * Constructs a new GetExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetExperimentRequest. + * @implements IGetExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest=} [properties] Properties to set + */ + function GetExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @instance + */ + GetExperimentRequest.prototype.name = ""; + + /** + * Creates a new GetExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest} GetExperimentRequest instance + */ + GetExperimentRequest.create = function create(properties) { + return new GetExperimentRequest(properties); + }; + + /** + * Encodes the specified GetExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest} message GetExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExperimentRequest.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 GetExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest} message GetExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest} GetExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest} GetExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest} GetExperimentRequest + */ + GetExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest} message GetExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExperimentRequest.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 GetExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + GetExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest"; + }; + + return GetExperimentRequest; + })(); + + v3beta1.CreateExperimentRequest = (function() { + + /** + * Properties of a CreateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateExperimentRequest + * @property {string|null} [parent] CreateExperimentRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IExperiment|null} [experiment] CreateExperimentRequest experiment + */ + + /** + * Constructs a new CreateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateExperimentRequest. + * @implements ICreateExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest=} [properties] Properties to set + */ + function CreateExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExperimentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @instance + */ + CreateExperimentRequest.prototype.parent = ""; + + /** + * CreateExperimentRequest experiment. + * @member {google.cloud.dialogflow.cx.v3beta1.IExperiment|null|undefined} experiment + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @instance + */ + CreateExperimentRequest.prototype.experiment = null; + + /** + * Creates a new CreateExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest} CreateExperimentRequest instance + */ + CreateExperimentRequest.create = function create(properties) { + return new CreateExperimentRequest(properties); + }; + + /** + * Encodes the specified CreateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest} message CreateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExperimentRequest.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.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.encode(message.experiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest} message CreateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest} CreateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.experiment = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest} CreateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.experiment != null && message.hasOwnProperty("experiment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.verify(message.experiment, long + 1); + if (error) + return "experiment." + error; + } + return null; + }; + + /** + * Creates a CreateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest} CreateExperimentRequest + */ + CreateExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.experiment != null) { + if (typeof object.experiment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest.experiment: object expected"); + message.experiment = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.fromObject(object.experiment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest} message CreateExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExperimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.experiment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.toObject(message.experiment, options); + return object; + }; + + /** + * Converts this CreateExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest"; + }; + + return CreateExperimentRequest; + })(); + + v3beta1.UpdateExperimentRequest = (function() { + + /** + * Properties of an UpdateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateExperimentRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IExperiment|null} [experiment] UpdateExperimentRequest experiment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExperimentRequest updateMask + */ + + /** + * Constructs a new UpdateExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateExperimentRequest. + * @implements IUpdateExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest=} [properties] Properties to set + */ + function UpdateExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExperimentRequest experiment. + * @member {google.cloud.dialogflow.cx.v3beta1.IExperiment|null|undefined} experiment + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @instance + */ + UpdateExperimentRequest.prototype.experiment = null; + + /** + * UpdateExperimentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @instance + */ + UpdateExperimentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest} UpdateExperimentRequest instance + */ + UpdateExperimentRequest.create = function create(properties) { + return new UpdateExperimentRequest(properties); + }; + + /** + * Encodes the specified UpdateExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest} message UpdateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExperimentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + $root.google.cloud.dialogflow.cx.v3beta1.Experiment.encode(message.experiment, 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 UpdateExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest} message UpdateExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest} UpdateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.experiment = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest} UpdateExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.experiment != null && message.hasOwnProperty("experiment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.verify(message.experiment, long + 1); + if (error) + return "experiment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest} UpdateExperimentRequest + */ + UpdateExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest(); + if (object.experiment != null) { + if (typeof object.experiment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest.experiment: object expected"); + message.experiment = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.fromObject(object.experiment, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest} message UpdateExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExperimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.experiment = null; + object.updateMask = null; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = $root.google.cloud.dialogflow.cx.v3beta1.Experiment.toObject(message.experiment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest"; + }; + + return UpdateExperimentRequest; + })(); + + v3beta1.DeleteExperimentRequest = (function() { + + /** + * Properties of a DeleteExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteExperimentRequest + * @property {string|null} [name] DeleteExperimentRequest name + */ + + /** + * Constructs a new DeleteExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteExperimentRequest. + * @implements IDeleteExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest=} [properties] Properties to set + */ + function DeleteExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @instance + */ + DeleteExperimentRequest.prototype.name = ""; + + /** + * Creates a new DeleteExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest} DeleteExperimentRequest instance + */ + DeleteExperimentRequest.create = function create(properties) { + return new DeleteExperimentRequest(properties); + }; + + /** + * Encodes the specified DeleteExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest} message DeleteExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExperimentRequest.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 DeleteExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest} message DeleteExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest} DeleteExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest} DeleteExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest} DeleteExperimentRequest + */ + DeleteExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest} message DeleteExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExperimentRequest.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 DeleteExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest"; + }; + + return DeleteExperimentRequest; + })(); + + v3beta1.StartExperimentRequest = (function() { + + /** + * Properties of a StartExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IStartExperimentRequest + * @property {string|null} [name] StartExperimentRequest name + */ + + /** + * Constructs a new StartExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a StartExperimentRequest. + * @implements IStartExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest=} [properties] Properties to set + */ + function StartExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @instance + */ + StartExperimentRequest.prototype.name = ""; + + /** + * Creates a new StartExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest} StartExperimentRequest instance + */ + StartExperimentRequest.create = function create(properties) { + return new StartExperimentRequest(properties); + }; + + /** + * Encodes the specified StartExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest} message StartExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartExperimentRequest.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 StartExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest} message StartExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest} StartExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StartExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest} StartExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a StartExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest} StartExperimentRequest + */ + StartExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StartExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest} message StartExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartExperimentRequest.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 StartExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + StartExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest"; + }; + + return StartExperimentRequest; + })(); + + v3beta1.StopExperimentRequest = (function() { + + /** + * Properties of a StopExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IStopExperimentRequest + * @property {string|null} [name] StopExperimentRequest name + */ + + /** + * Constructs a new StopExperimentRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a StopExperimentRequest. + * @implements IStopExperimentRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest=} [properties] Properties to set + */ + function StopExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopExperimentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @instance + */ + StopExperimentRequest.prototype.name = ""; + + /** + * Creates a new StopExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest} StopExperimentRequest instance + */ + StopExperimentRequest.create = function create(properties) { + return new StopExperimentRequest(properties); + }; + + /** + * Encodes the specified StopExperimentRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest} message StopExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopExperimentRequest.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 StopExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest} message StopExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest} StopExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopExperimentRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StopExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest} StopExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopExperimentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopExperimentRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a StopExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest} StopExperimentRequest + */ + StopExperimentRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StopExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest} message StopExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopExperimentRequest.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 StopExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + StopExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest"; + }; + + return StopExperimentRequest; + })(); + + v3beta1.Generators = (function() { + + /** + * Constructs a new Generators service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Generators + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Generators(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Generators.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Generators; + + /** + * Creates new Generators service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Generators} RPC service. Useful where requests and/or responses are streamed. + */ + Generators.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|listGenerators}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @typedef ListGeneratorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse} [response] ListGeneratorsResponse + */ + + /** + * Calls ListGenerators. + * @function listGenerators + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest} request ListGeneratorsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Generators.ListGeneratorsCallback} callback Node-style callback called with the error, if any, and ListGeneratorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.listGenerators = function listGenerators(request, callback) { + return this.rpcCall(listGenerators, $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse, request, callback); + }, "name", { value: "ListGenerators" }); + + /** + * Calls ListGenerators. + * @function listGenerators + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest} request ListGeneratorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|getGenerator}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @typedef GetGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Generator} [response] Generator + */ + + /** + * Calls GetGenerator. + * @function getGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest} request GetGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Generators.GetGeneratorCallback} callback Node-style callback called with the error, if any, and Generator + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.getGenerator = function getGenerator(request, callback) { + return this.rpcCall(getGenerator, $root.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest, $root.google.cloud.dialogflow.cx.v3beta1.Generator, request, callback); + }, "name", { value: "GetGenerator" }); + + /** + * Calls GetGenerator. + * @function getGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest} request GetGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|createGenerator}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @typedef CreateGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Generator} [response] Generator + */ + + /** + * Calls CreateGenerator. + * @function createGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest} request CreateGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Generators.CreateGeneratorCallback} callback Node-style callback called with the error, if any, and Generator + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.createGenerator = function createGenerator(request, callback) { + return this.rpcCall(createGenerator, $root.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest, $root.google.cloud.dialogflow.cx.v3beta1.Generator, request, callback); + }, "name", { value: "CreateGenerator" }); + + /** + * Calls CreateGenerator. + * @function createGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest} request CreateGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|updateGenerator}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @typedef UpdateGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Generator} [response] Generator + */ + + /** + * Calls UpdateGenerator. + * @function updateGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest} request UpdateGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGeneratorCallback} callback Node-style callback called with the error, if any, and Generator + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.updateGenerator = function updateGenerator(request, callback) { + return this.rpcCall(updateGenerator, $root.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest, $root.google.cloud.dialogflow.cx.v3beta1.Generator, request, callback); + }, "name", { value: "UpdateGenerator" }); + + /** + * Calls UpdateGenerator. + * @function updateGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest} request UpdateGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Generators|deleteGenerator}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @typedef DeleteGeneratorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteGenerator. + * @function deleteGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest} request DeleteGeneratorRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGeneratorCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Generators.prototype.deleteGenerator = function deleteGenerator(request, callback) { + return this.rpcCall(deleteGenerator, $root.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteGenerator" }); + + /** + * Calls DeleteGenerator. + * @function deleteGenerator + * @memberof google.cloud.dialogflow.cx.v3beta1.Generators + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest} request DeleteGeneratorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Generators; + })(); + + v3beta1.Generator = (function() { + + /** + * Properties of a Generator. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGenerator + * @property {string|null} [name] Generator name + * @property {string|null} [displayName] Generator displayName + * @property {google.cloud.dialogflow.cx.v3beta1.IPhrase|null} [promptText] Generator promptText + * @property {Array.|null} [placeholders] Generator placeholders + * @property {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null} [llmModelSettings] Generator llmModelSettings + * @property {google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter|null} [modelParameter] Generator modelParameter + */ + + /** + * Constructs a new Generator. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Generator. + * @implements IGenerator + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerator=} [properties] Properties to set + */ + function Generator(properties) { + this.placeholders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Generator name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @instance + */ + Generator.prototype.name = ""; + + /** + * Generator displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @instance + */ + Generator.prototype.displayName = ""; + + /** + * Generator promptText. + * @member {google.cloud.dialogflow.cx.v3beta1.IPhrase|null|undefined} promptText + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @instance + */ + Generator.prototype.promptText = null; + + /** + * Generator placeholders. + * @member {Array.} placeholders + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @instance + */ + Generator.prototype.placeholders = $util.emptyArray; + + /** + * Generator llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @instance + */ + Generator.prototype.llmModelSettings = null; + + /** + * Generator modelParameter. + * @member {google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter|null|undefined} modelParameter + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @instance + */ + Generator.prototype.modelParameter = null; + + /** + * Creates a new Generator instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerator=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator} Generator instance + */ + Generator.create = function create(properties) { + return new Generator(properties); + }; + + /** + * Encodes the specified Generator message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerator} message Generator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Generator.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.promptText != null && Object.hasOwnProperty.call(message, "promptText")) + $root.google.cloud.dialogflow.cx.v3beta1.Phrase.encode(message.promptText, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.placeholders != null && message.placeholders.length) + for (var i = 0; i < message.placeholders.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.encode(message.placeholders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.modelParameter != null && Object.hasOwnProperty.call(message, "modelParameter")) + $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.encode(message.modelParameter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Generator message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGenerator} message Generator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Generator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Generator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator} Generator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Generator.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Generator(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.promptText = $root.google.cloud.dialogflow.cx.v3beta1.Phrase.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.placeholders && message.placeholders.length)) + message.placeholders = []; + message.placeholders.push($root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 9: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.modelParameter = $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Generator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator} Generator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Generator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Generator message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Generator.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.promptText != null && message.hasOwnProperty("promptText")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Phrase.verify(message.promptText, long + 1); + if (error) + return "promptText." + error; + } + if (message.placeholders != null && message.hasOwnProperty("placeholders")) { + if (!Array.isArray(message.placeholders)) + return "placeholders: array expected"; + for (var i = 0; i < message.placeholders.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.verify(message.placeholders[i], long + 1); + if (error) + return "placeholders." + error; + } + } + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + if (message.modelParameter != null && message.hasOwnProperty("modelParameter")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.verify(message.modelParameter, long + 1); + if (error) + return "modelParameter." + error; + } + return null; + }; + + /** + * Creates a Generator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator} Generator + */ + Generator.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Generator) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Generator(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.promptText != null) { + if (typeof object.promptText !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Generator.promptText: object expected"); + message.promptText = $root.google.cloud.dialogflow.cx.v3beta1.Phrase.fromObject(object.promptText, long + 1); + } + if (object.placeholders) { + if (!Array.isArray(object.placeholders)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Generator.placeholders: array expected"); + message.placeholders = []; + for (var i = 0; i < object.placeholders.length; ++i) { + if (typeof object.placeholders[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Generator.placeholders: object expected"); + message.placeholders[i] = $root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.fromObject(object.placeholders[i], long + 1); + } + } + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Generator.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + if (object.modelParameter != null) { + if (typeof object.modelParameter !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Generator.modelParameter: object expected"); + message.modelParameter = $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.fromObject(object.modelParameter, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Generator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator} message Generator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Generator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.placeholders = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.promptText = null; + object.modelParameter = null; + object.llmModelSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.promptText != null && message.hasOwnProperty("promptText")) + object.promptText = $root.google.cloud.dialogflow.cx.v3beta1.Phrase.toObject(message.promptText, options); + if (message.placeholders && message.placeholders.length) { + object.placeholders = []; + for (var j = 0; j < message.placeholders.length; ++j) + object.placeholders[j] = $root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.toObject(message.placeholders[j], options); + } + if (message.modelParameter != null && message.hasOwnProperty("modelParameter")) + object.modelParameter = $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.toObject(message.modelParameter, options); + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.toObject(message.llmModelSettings, options); + return object; + }; + + /** + * Converts this Generator to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @instance + * @returns {Object.} JSON object + */ + Generator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Generator + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Generator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Generator"; + }; + + Generator.Placeholder = (function() { + + /** + * Properties of a Placeholder. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @interface IPlaceholder + * @property {string|null} [id] Placeholder id + * @property {string|null} [name] Placeholder name + */ + + /** + * Constructs a new Placeholder. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @classdesc Represents a Placeholder. + * @implements IPlaceholder + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder=} [properties] Properties to set + */ + function Placeholder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Placeholder id. + * @member {string} id + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @instance + */ + Placeholder.prototype.id = ""; + + /** + * Placeholder name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @instance + */ + Placeholder.prototype.name = ""; + + /** + * Creates a new Placeholder instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder} Placeholder instance + */ + Placeholder.create = function create(properties) { + return new Placeholder(properties); + }; + + /** + * Encodes the specified Placeholder message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder} message Placeholder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Placeholder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified Placeholder message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IPlaceholder} message Placeholder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Placeholder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Placeholder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder} Placeholder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Placeholder.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Placeholder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder} Placeholder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Placeholder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Placeholder message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Placeholder.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Placeholder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder} Placeholder + */ + Placeholder.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Placeholder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder} message Placeholder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Placeholder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Placeholder to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @instance + * @returns {Object.} JSON object + */ + Placeholder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Placeholder + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Placeholder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder"; + }; + + return Placeholder; + })(); + + Generator.ModelParameter = (function() { + + /** + * Properties of a ModelParameter. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @interface IModelParameter + * @property {number|null} [temperature] ModelParameter temperature + * @property {number|null} [maxDecodeSteps] ModelParameter maxDecodeSteps + * @property {number|null} [topP] ModelParameter topP + * @property {number|null} [topK] ModelParameter topK + */ + + /** + * Constructs a new ModelParameter. + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator + * @classdesc Represents a ModelParameter. + * @implements IModelParameter + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter=} [properties] Properties to set + */ + function ModelParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelParameter temperature. + * @member {number|null|undefined} temperature + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.temperature = null; + + /** + * ModelParameter maxDecodeSteps. + * @member {number|null|undefined} maxDecodeSteps + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.maxDecodeSteps = null; + + /** + * ModelParameter topP. + * @member {number|null|undefined} topP + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.topP = null; + + /** + * ModelParameter topK. + * @member {number|null|undefined} topK + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @instance + */ + ModelParameter.prototype.topK = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_maxDecodeSteps", { + get: $util.oneOfGetter($oneOfFields = ["maxDecodeSteps"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelParameter.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelParameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter} ModelParameter instance + */ + ModelParameter.create = function create(properties) { + return new ModelParameter(properties); + }; + + /** + * Encodes the specified ModelParameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter} message ModelParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.temperature); + if (message.maxDecodeSteps != null && Object.hasOwnProperty.call(message, "maxDecodeSteps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDecodeSteps); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.topK); + return writer; + }; + + /** + * Encodes the specified ModelParameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.IModelParameter} message ModelParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter} ModelParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelParameter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.temperature = reader.float(); + break; + } + case 2: { + message.maxDecodeSteps = reader.int32(); + break; + } + case 3: { + message.topP = reader.float(); + break; + } + case 4: { + message.topK = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ModelParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter} ModelParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelParameter message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelParameter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.maxDecodeSteps != null && message.hasOwnProperty("maxDecodeSteps")) { + properties._maxDecodeSteps = 1; + if (!$util.isInteger(message.maxDecodeSteps)) + return "maxDecodeSteps: integer expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + return null; + }; + + /** + * Creates a ModelParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter} ModelParameter + */ + ModelParameter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter(); + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.maxDecodeSteps != null) + message.maxDecodeSteps = object.maxDecodeSteps | 0; + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + return message; + }; + + /** + * Creates a plain object from a ModelParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter} message ModelParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.maxDecodeSteps != null && message.hasOwnProperty("maxDecodeSteps")) { + object.maxDecodeSteps = message.maxDecodeSteps; + if (options.oneofs) + object._maxDecodeSteps = "maxDecodeSteps"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + return object; + }; + + /** + * Converts this ModelParameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @instance + * @returns {Object.} JSON object + */ + ModelParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelParameter + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Generator.ModelParameter"; + }; + + return ModelParameter; + })(); + + return Generator; + })(); + + v3beta1.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPhrase + * @property {string|null} [text] Phrase text + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase text. + * @member {string} text + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @instance + */ + Phrase.prototype.text = ""; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Phrase) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Phrase(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Phrase"; + }; + + return Phrase; + })(); + + v3beta1.ListGeneratorsRequest = (function() { + + /** + * Properties of a ListGeneratorsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListGeneratorsRequest + * @property {string|null} [parent] ListGeneratorsRequest parent + * @property {string|null} [languageCode] ListGeneratorsRequest languageCode + * @property {number|null} [pageSize] ListGeneratorsRequest pageSize + * @property {string|null} [pageToken] ListGeneratorsRequest pageToken + */ + + /** + * Constructs a new ListGeneratorsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListGeneratorsRequest. + * @implements IListGeneratorsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest=} [properties] Properties to set + */ + function ListGeneratorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGeneratorsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.parent = ""; + + /** + * ListGeneratorsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.languageCode = ""; + + /** + * ListGeneratorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.pageSize = 0; + + /** + * ListGeneratorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @instance + */ + ListGeneratorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListGeneratorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest} ListGeneratorsRequest instance + */ + ListGeneratorsRequest.create = function create(properties) { + return new ListGeneratorsRequest(properties); + }; + + /** + * Encodes the specified ListGeneratorsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest} message ListGeneratorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListGeneratorsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest} message ListGeneratorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest} ListGeneratorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListGeneratorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest} ListGeneratorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGeneratorsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGeneratorsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: 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"; + return null; + }; + + /** + * Creates a ListGeneratorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest} ListGeneratorsRequest + */ + ListGeneratorsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListGeneratorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest} message ListGeneratorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGeneratorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListGeneratorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGeneratorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGeneratorsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGeneratorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest"; + }; + + return ListGeneratorsRequest; + })(); + + v3beta1.ListGeneratorsResponse = (function() { + + /** + * Properties of a ListGeneratorsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListGeneratorsResponse + * @property {Array.|null} [generators] ListGeneratorsResponse generators + * @property {string|null} [nextPageToken] ListGeneratorsResponse nextPageToken + */ + + /** + * Constructs a new ListGeneratorsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListGeneratorsResponse. + * @implements IListGeneratorsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse=} [properties] Properties to set + */ + function ListGeneratorsResponse(properties) { + this.generators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGeneratorsResponse generators. + * @member {Array.} generators + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @instance + */ + ListGeneratorsResponse.prototype.generators = $util.emptyArray; + + /** + * ListGeneratorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @instance + */ + ListGeneratorsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGeneratorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse} ListGeneratorsResponse instance + */ + ListGeneratorsResponse.create = function create(properties) { + return new ListGeneratorsResponse(properties); + }; + + /** + * Encodes the specified ListGeneratorsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse} message ListGeneratorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generators != null && message.generators.length) + for (var i = 0; i < message.generators.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Generator.encode(message.generators[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 ListGeneratorsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse} message ListGeneratorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGeneratorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse} ListGeneratorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.generators && message.generators.length)) + message.generators = []; + message.generators.push($root.google.cloud.dialogflow.cx.v3beta1.Generator.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListGeneratorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse} ListGeneratorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGeneratorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGeneratorsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGeneratorsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generators != null && message.hasOwnProperty("generators")) { + if (!Array.isArray(message.generators)) + return "generators: array expected"; + for (var i = 0; i < message.generators.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Generator.verify(message.generators[i], long + 1); + if (error) + return "generators." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGeneratorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse} ListGeneratorsResponse + */ + ListGeneratorsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse(); + if (object.generators) { + if (!Array.isArray(object.generators)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse.generators: array expected"); + message.generators = []; + for (var i = 0; i < object.generators.length; ++i) { + if (typeof object.generators[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse.generators: object expected"); + message.generators[i] = $root.google.cloud.dialogflow.cx.v3beta1.Generator.fromObject(object.generators[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGeneratorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse} message ListGeneratorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGeneratorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.generators = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.generators && message.generators.length) { + object.generators = []; + for (var j = 0; j < message.generators.length; ++j) + object.generators[j] = $root.google.cloud.dialogflow.cx.v3beta1.Generator.toObject(message.generators[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGeneratorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGeneratorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGeneratorsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGeneratorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse"; + }; + + return ListGeneratorsResponse; + })(); + + v3beta1.GetGeneratorRequest = (function() { + + /** + * Properties of a GetGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetGeneratorRequest + * @property {string|null} [name] GetGeneratorRequest name + * @property {string|null} [languageCode] GetGeneratorRequest languageCode + */ + + /** + * Constructs a new GetGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetGeneratorRequest. + * @implements IGetGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest=} [properties] Properties to set + */ + function GetGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGeneratorRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @instance + */ + GetGeneratorRequest.prototype.name = ""; + + /** + * GetGeneratorRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @instance + */ + GetGeneratorRequest.prototype.languageCode = ""; + + /** + * Creates a new GetGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest} GetGeneratorRequest instance + */ + GetGeneratorRequest.create = function create(properties) { + return new GetGeneratorRequest(properties); + }; + + /** + * Encodes the specified GetGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest} message GetGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGeneratorRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest} message GetGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest} GetGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest} GetGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest} GetGeneratorRequest + */ + GetGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest} message GetGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + GetGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest"; + }; + + return GetGeneratorRequest; + })(); + + v3beta1.CreateGeneratorRequest = (function() { + + /** + * Properties of a CreateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateGeneratorRequest + * @property {string|null} [parent] CreateGeneratorRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IGenerator|null} [generator] CreateGeneratorRequest generator + * @property {string|null} [languageCode] CreateGeneratorRequest languageCode + */ + + /** + * Constructs a new CreateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateGeneratorRequest. + * @implements ICreateGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest=} [properties] Properties to set + */ + function CreateGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGeneratorRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @instance + */ + CreateGeneratorRequest.prototype.parent = ""; + + /** + * CreateGeneratorRequest generator. + * @member {google.cloud.dialogflow.cx.v3beta1.IGenerator|null|undefined} generator + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @instance + */ + CreateGeneratorRequest.prototype.generator = null; + + /** + * CreateGeneratorRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @instance + */ + CreateGeneratorRequest.prototype.languageCode = ""; + + /** + * Creates a new CreateGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest} CreateGeneratorRequest instance + */ + CreateGeneratorRequest.create = function create(properties) { + return new CreateGeneratorRequest(properties); + }; + + /** + * Encodes the specified CreateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest} message CreateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGeneratorRequest.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.generator != null && Object.hasOwnProperty.call(message, "generator")) + $root.google.cloud.dialogflow.cx.v3beta1.Generator.encode(message.generator, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest} message CreateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest} CreateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.generator = $root.google.cloud.dialogflow.cx.v3beta1.Generator.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest} CreateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.generator != null && message.hasOwnProperty("generator")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Generator.verify(message.generator, long + 1); + if (error) + return "generator." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CreateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest} CreateGeneratorRequest + */ + CreateGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.generator != null) { + if (typeof object.generator !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest.generator: object expected"); + message.generator = $root.google.cloud.dialogflow.cx.v3beta1.Generator.fromObject(object.generator, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CreateGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest} message CreateGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.generator = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.generator != null && message.hasOwnProperty("generator")) + object.generator = $root.google.cloud.dialogflow.cx.v3beta1.Generator.toObject(message.generator, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CreateGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest"; + }; + + return CreateGeneratorRequest; + })(); + + v3beta1.UpdateGeneratorRequest = (function() { + + /** + * Properties of an UpdateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateGeneratorRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IGenerator|null} [generator] UpdateGeneratorRequest generator + * @property {string|null} [languageCode] UpdateGeneratorRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGeneratorRequest updateMask + */ + + /** + * Constructs a new UpdateGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateGeneratorRequest. + * @implements IUpdateGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest=} [properties] Properties to set + */ + function UpdateGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGeneratorRequest generator. + * @member {google.cloud.dialogflow.cx.v3beta1.IGenerator|null|undefined} generator + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @instance + */ + UpdateGeneratorRequest.prototype.generator = null; + + /** + * UpdateGeneratorRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @instance + */ + UpdateGeneratorRequest.prototype.languageCode = ""; + + /** + * UpdateGeneratorRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @instance + */ + UpdateGeneratorRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest} UpdateGeneratorRequest instance + */ + UpdateGeneratorRequest.create = function create(properties) { + return new UpdateGeneratorRequest(properties); + }; + + /** + * Encodes the specified UpdateGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest} message UpdateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGeneratorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generator != null && Object.hasOwnProperty.call(message, "generator")) + $root.google.cloud.dialogflow.cx.v3beta1.Generator.encode(message.generator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest} message UpdateGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest} UpdateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generator = $root.google.cloud.dialogflow.cx.v3beta1.Generator.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest} UpdateGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.generator != null && message.hasOwnProperty("generator")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Generator.verify(message.generator, long + 1); + if (error) + return "generator." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest} UpdateGeneratorRequest + */ + UpdateGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest(); + if (object.generator != null) { + if (typeof object.generator !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.generator: object expected"); + message.generator = $root.google.cloud.dialogflow.cx.v3beta1.Generator.fromObject(object.generator, long + 1); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest} message UpdateGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.generator = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.generator != null && message.hasOwnProperty("generator")) + object.generator = $root.google.cloud.dialogflow.cx.v3beta1.Generator.toObject(message.generator, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest"; + }; + + return UpdateGeneratorRequest; + })(); + + v3beta1.DeleteGeneratorRequest = (function() { + + /** + * Properties of a DeleteGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteGeneratorRequest + * @property {string|null} [name] DeleteGeneratorRequest name + * @property {boolean|null} [force] DeleteGeneratorRequest force + */ + + /** + * Constructs a new DeleteGeneratorRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteGeneratorRequest. + * @implements IDeleteGeneratorRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest=} [properties] Properties to set + */ + function DeleteGeneratorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGeneratorRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @instance + */ + DeleteGeneratorRequest.prototype.name = ""; + + /** + * DeleteGeneratorRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @instance + */ + DeleteGeneratorRequest.prototype.force = false; + + /** + * Creates a new DeleteGeneratorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest} DeleteGeneratorRequest instance + */ + DeleteGeneratorRequest.create = function create(properties) { + return new DeleteGeneratorRequest(properties); + }; + + /** + * Encodes the specified DeleteGeneratorRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest} message DeleteGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGeneratorRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteGeneratorRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest} message DeleteGeneratorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGeneratorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest} DeleteGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGeneratorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGeneratorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest} DeleteGeneratorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGeneratorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGeneratorRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGeneratorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteGeneratorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest} DeleteGeneratorRequest + */ + DeleteGeneratorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteGeneratorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest} message DeleteGeneratorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGeneratorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteGeneratorRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGeneratorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGeneratorRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGeneratorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest"; + }; + + return DeleteGeneratorRequest; + })(); + + v3beta1.Playbooks = (function() { + + /** + * Constructs a new Playbooks service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Playbooks + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Playbooks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Playbooks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Playbooks; + + /** + * Creates new Playbooks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Playbooks} RPC service. Useful where requests and/or responses are streamed. + */ + Playbooks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|createPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef CreatePlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook} [response] Playbook + */ + + /** + * Calls CreatePlaybook. + * @function createPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest} request CreatePlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.CreatePlaybookCallback} callback Node-style callback called with the error, if any, and Playbook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.createPlaybook = function createPlaybook(request, callback) { + return this.rpcCall(createPlaybook, $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest, $root.google.cloud.dialogflow.cx.v3beta1.Playbook, request, callback); + }, "name", { value: "CreatePlaybook" }); + + /** + * Calls CreatePlaybook. + * @function createPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest} request CreatePlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|deletePlaybook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef DeletePlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePlaybook. + * @function deletePlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest} request DeletePlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.DeletePlaybookCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.deletePlaybook = function deletePlaybook(request, callback) { + return this.rpcCall(deletePlaybook, $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePlaybook" }); + + /** + * Calls DeletePlaybook. + * @function deletePlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest} request DeletePlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|listPlaybooks}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef ListPlaybooksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse} [response] ListPlaybooksResponse + */ + + /** + * Calls ListPlaybooks. + * @function listPlaybooks + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest} request ListPlaybooksRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybooksCallback} callback Node-style callback called with the error, if any, and ListPlaybooksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.listPlaybooks = function listPlaybooks(request, callback) { + return this.rpcCall(listPlaybooks, $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse, request, callback); + }, "name", { value: "ListPlaybooks" }); + + /** + * Calls ListPlaybooks. + * @function listPlaybooks + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest} request ListPlaybooksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|getPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef GetPlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook} [response] Playbook + */ + + /** + * Calls GetPlaybook. + * @function getPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest} request GetPlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.GetPlaybookCallback} callback Node-style callback called with the error, if any, and Playbook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.getPlaybook = function getPlaybook(request, callback) { + return this.rpcCall(getPlaybook, $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest, $root.google.cloud.dialogflow.cx.v3beta1.Playbook, request, callback); + }, "name", { value: "GetPlaybook" }); + + /** + * Calls GetPlaybook. + * @function getPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest} request GetPlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|exportPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef ExportPlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportPlaybook. + * @function exportPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest} request ExportPlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.ExportPlaybookCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.exportPlaybook = function exportPlaybook(request, callback) { + return this.rpcCall(exportPlaybook, $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportPlaybook" }); + + /** + * Calls ExportPlaybook. + * @function exportPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest} request ExportPlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|importPlaybook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef ImportPlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportPlaybook. + * @function importPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest} request ImportPlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.ImportPlaybookCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.importPlaybook = function importPlaybook(request, callback) { + return this.rpcCall(importPlaybook, $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportPlaybook" }); + + /** + * Calls ImportPlaybook. + * @function importPlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest} request ImportPlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|updatePlaybook}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef UpdatePlaybookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook} [response] Playbook + */ + + /** + * Calls UpdatePlaybook. + * @function updatePlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest} request UpdatePlaybookRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.UpdatePlaybookCallback} callback Node-style callback called with the error, if any, and Playbook + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.updatePlaybook = function updatePlaybook(request, callback) { + return this.rpcCall(updatePlaybook, $root.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest, $root.google.cloud.dialogflow.cx.v3beta1.Playbook, request, callback); + }, "name", { value: "UpdatePlaybook" }); + + /** + * Calls UpdatePlaybook. + * @function updatePlaybook + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest} request UpdatePlaybookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|createPlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef CreatePlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} [response] PlaybookVersion + */ + + /** + * Calls CreatePlaybookVersion. + * @function createPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest} request CreatePlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.CreatePlaybookVersionCallback} callback Node-style callback called with the error, if any, and PlaybookVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.createPlaybookVersion = function createPlaybookVersion(request, callback) { + return this.rpcCall(createPlaybookVersion, $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion, request, callback); + }, "name", { value: "CreatePlaybookVersion" }); + + /** + * Calls CreatePlaybookVersion. + * @function createPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest} request CreatePlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|getPlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef GetPlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} [response] PlaybookVersion + */ + + /** + * Calls GetPlaybookVersion. + * @function getPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest} request GetPlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.GetPlaybookVersionCallback} callback Node-style callback called with the error, if any, and PlaybookVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.getPlaybookVersion = function getPlaybookVersion(request, callback) { + return this.rpcCall(getPlaybookVersion, $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion, request, callback); + }, "name", { value: "GetPlaybookVersion" }); + + /** + * Calls GetPlaybookVersion. + * @function getPlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest} request GetPlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|restorePlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef RestorePlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse} [response] RestorePlaybookVersionResponse + */ + + /** + * Calls RestorePlaybookVersion. + * @function restorePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest} request RestorePlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.RestorePlaybookVersionCallback} callback Node-style callback called with the error, if any, and RestorePlaybookVersionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.restorePlaybookVersion = function restorePlaybookVersion(request, callback) { + return this.rpcCall(restorePlaybookVersion, $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse, request, callback); + }, "name", { value: "RestorePlaybookVersion" }); + + /** + * Calls RestorePlaybookVersion. + * @function restorePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest} request RestorePlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|listPlaybookVersions}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef ListPlaybookVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse} [response] ListPlaybookVersionsResponse + */ + + /** + * Calls ListPlaybookVersions. + * @function listPlaybookVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest} request ListPlaybookVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.ListPlaybookVersionsCallback} callback Node-style callback called with the error, if any, and ListPlaybookVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.listPlaybookVersions = function listPlaybookVersions(request, callback) { + return this.rpcCall(listPlaybookVersions, $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse, request, callback); + }, "name", { value: "ListPlaybookVersions" }); + + /** + * Calls ListPlaybookVersions. + * @function listPlaybookVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest} request ListPlaybookVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Playbooks|deletePlaybookVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @typedef DeletePlaybookVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePlaybookVersion. + * @function deletePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest} request DeletePlaybookVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Playbooks.DeletePlaybookVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Playbooks.prototype.deletePlaybookVersion = function deletePlaybookVersion(request, callback) { + return this.rpcCall(deletePlaybookVersion, $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePlaybookVersion" }); + + /** + * Calls DeletePlaybookVersion. + * @function deletePlaybookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbooks + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest} request DeletePlaybookVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Playbooks; + })(); + + v3beta1.CreatePlaybookRequest = (function() { + + /** + * Properties of a CreatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreatePlaybookRequest + * @property {string|null} [parent] CreatePlaybookRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null} [playbook] CreatePlaybookRequest playbook + */ + + /** + * Constructs a new CreatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreatePlaybookRequest. + * @implements ICreatePlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest=} [properties] Properties to set + */ + function CreatePlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePlaybookRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @instance + */ + CreatePlaybookRequest.prototype.parent = ""; + + /** + * CreatePlaybookRequest playbook. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @instance + */ + CreatePlaybookRequest.prototype.playbook = null; + + /** + * Creates a new CreatePlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest} CreatePlaybookRequest instance + */ + CreatePlaybookRequest.create = function create(properties) { + return new CreatePlaybookRequest(properties); + }; + + /** + * Encodes the specified CreatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest} message CreatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookRequest.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.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.encode(message.playbook, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest} message CreatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest} CreatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest} CreatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + return null; + }; + + /** + * Creates a CreatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest} CreatePlaybookRequest + */ + CreatePlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.fromObject(object.playbook, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreatePlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest} message CreatePlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.playbook = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.toObject(message.playbook, options); + return object; + }; + + /** + * Converts this CreatePlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest"; + }; + + return CreatePlaybookRequest; + })(); + + v3beta1.DeletePlaybookRequest = (function() { + + /** + * Properties of a DeletePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeletePlaybookRequest + * @property {string|null} [name] DeletePlaybookRequest name + */ + + /** + * Constructs a new DeletePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeletePlaybookRequest. + * @implements IDeletePlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest=} [properties] Properties to set + */ + function DeletePlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePlaybookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @instance + */ + DeletePlaybookRequest.prototype.name = ""; + + /** + * Creates a new DeletePlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest} DeletePlaybookRequest instance + */ + DeletePlaybookRequest.create = function create(properties) { + return new DeletePlaybookRequest(properties); + }; + + /** + * Encodes the specified DeletePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest} message DeletePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookRequest.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 DeletePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest} message DeletePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest} DeletePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest} DeletePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest} DeletePlaybookRequest + */ + DeletePlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest} message DeletePlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePlaybookRequest.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 DeletePlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest"; + }; + + return DeletePlaybookRequest; + })(); + + v3beta1.ListPlaybooksRequest = (function() { + + /** + * Properties of a ListPlaybooksRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListPlaybooksRequest + * @property {string|null} [parent] ListPlaybooksRequest parent + * @property {number|null} [pageSize] ListPlaybooksRequest pageSize + * @property {string|null} [pageToken] ListPlaybooksRequest pageToken + */ + + /** + * Constructs a new ListPlaybooksRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListPlaybooksRequest. + * @implements IListPlaybooksRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest=} [properties] Properties to set + */ + function ListPlaybooksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybooksRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @instance + */ + ListPlaybooksRequest.prototype.parent = ""; + + /** + * ListPlaybooksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @instance + */ + ListPlaybooksRequest.prototype.pageSize = 0; + + /** + * ListPlaybooksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @instance + */ + ListPlaybooksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPlaybooksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest} ListPlaybooksRequest instance + */ + ListPlaybooksRequest.create = function create(properties) { + return new ListPlaybooksRequest(properties); + }; + + /** + * Encodes the specified ListPlaybooksRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest} message ListPlaybooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksRequest.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); + return writer; + }; + + /** + * Encodes the specified ListPlaybooksRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest} message ListPlaybooksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest} ListPlaybooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybooksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest} ListPlaybooksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybooksRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybooksRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListPlaybooksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest} ListPlaybooksRequest + */ + ListPlaybooksRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListPlaybooksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest} message ListPlaybooksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybooksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListPlaybooksRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @instance + * @returns {Object.} JSON object + */ + ListPlaybooksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybooksRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybooksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest"; + }; + + return ListPlaybooksRequest; + })(); + + v3beta1.ListPlaybooksResponse = (function() { + + /** + * Properties of a ListPlaybooksResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListPlaybooksResponse + * @property {Array.|null} [playbooks] ListPlaybooksResponse playbooks + * @property {string|null} [nextPageToken] ListPlaybooksResponse nextPageToken + */ + + /** + * Constructs a new ListPlaybooksResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListPlaybooksResponse. + * @implements IListPlaybooksResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse=} [properties] Properties to set + */ + function ListPlaybooksResponse(properties) { + this.playbooks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybooksResponse playbooks. + * @member {Array.} playbooks + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @instance + */ + ListPlaybooksResponse.prototype.playbooks = $util.emptyArray; + + /** + * ListPlaybooksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @instance + */ + ListPlaybooksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPlaybooksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse} ListPlaybooksResponse instance + */ + ListPlaybooksResponse.create = function create(properties) { + return new ListPlaybooksResponse(properties); + }; + + /** + * Encodes the specified ListPlaybooksResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse} message ListPlaybooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbooks != null && message.playbooks.length) + for (var i = 0; i < message.playbooks.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.encode(message.playbooks[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 ListPlaybooksResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse} message ListPlaybooksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybooksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse} ListPlaybooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.playbooks && message.playbooks.length)) + message.playbooks = []; + message.playbooks.push($root.google.cloud.dialogflow.cx.v3beta1.Playbook.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybooksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse} ListPlaybooksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybooksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybooksResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybooksResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbooks != null && message.hasOwnProperty("playbooks")) { + if (!Array.isArray(message.playbooks)) + return "playbooks: array expected"; + for (var i = 0; i < message.playbooks.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.verify(message.playbooks[i], long + 1); + if (error) + return "playbooks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPlaybooksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse} ListPlaybooksResponse + */ + ListPlaybooksResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse(); + if (object.playbooks) { + if (!Array.isArray(object.playbooks)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse.playbooks: array expected"); + message.playbooks = []; + for (var i = 0; i < object.playbooks.length; ++i) { + if (typeof object.playbooks[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse.playbooks: object expected"); + message.playbooks[i] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.fromObject(object.playbooks[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPlaybooksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse} message ListPlaybooksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybooksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.playbooks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.playbooks && message.playbooks.length) { + object.playbooks = []; + for (var j = 0; j < message.playbooks.length; ++j) + object.playbooks[j] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.toObject(message.playbooks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPlaybooksResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @instance + * @returns {Object.} JSON object + */ + ListPlaybooksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybooksResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybooksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListPlaybooksResponse"; + }; + + return ListPlaybooksResponse; + })(); + + v3beta1.GetPlaybookRequest = (function() { + + /** + * Properties of a GetPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetPlaybookRequest + * @property {string|null} [name] GetPlaybookRequest name + */ + + /** + * Constructs a new GetPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetPlaybookRequest. + * @implements IGetPlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest=} [properties] Properties to set + */ + function GetPlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPlaybookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @instance + */ + GetPlaybookRequest.prototype.name = ""; + + /** + * Creates a new GetPlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest} GetPlaybookRequest instance + */ + GetPlaybookRequest.create = function create(properties) { + return new GetPlaybookRequest(properties); + }; + + /** + * Encodes the specified GetPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest} message GetPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookRequest.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 GetPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest} message GetPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest} GetPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest} GetPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest} GetPlaybookRequest + */ + GetPlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest} message GetPlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPlaybookRequest.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 GetPlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + GetPlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest"; + }; + + return GetPlaybookRequest; + })(); + + v3beta1.UpdatePlaybookRequest = (function() { + + /** + * Properties of an UpdatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdatePlaybookRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null} [playbook] UpdatePlaybookRequest playbook + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePlaybookRequest updateMask + */ + + /** + * Constructs a new UpdatePlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdatePlaybookRequest. + * @implements IUpdatePlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest=} [properties] Properties to set + */ + function UpdatePlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePlaybookRequest playbook. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @instance + */ + UpdatePlaybookRequest.prototype.playbook = null; + + /** + * UpdatePlaybookRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @instance + */ + UpdatePlaybookRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest} UpdatePlaybookRequest instance + */ + UpdatePlaybookRequest.create = function create(properties) { + return new UpdatePlaybookRequest(properties); + }; + + /** + * Encodes the specified UpdatePlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest} message UpdatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePlaybookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.encode(message.playbook, 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 UpdatePlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest} message UpdatePlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest} UpdatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest} UpdatePlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest} UpdatePlaybookRequest + */ + UpdatePlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest(); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.fromObject(object.playbook, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest} message UpdatePlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = null; + object.updateMask = null; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.toObject(message.playbook, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest"; + }; + + return UpdatePlaybookRequest; + })(); + + v3beta1.Playbook = (function() { + + /** + * Properties of a Playbook. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybook + * @property {string|null} [name] Playbook name + * @property {string|null} [displayName] Playbook displayName + * @property {string|null} [goal] Playbook goal + * @property {Array.|null} [inputParameterDefinitions] Playbook inputParameterDefinitions + * @property {Array.|null} [outputParameterDefinitions] Playbook outputParameterDefinitions + * @property {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null} [instruction] Playbook instruction + * @property {number|Long|null} [tokenCount] Playbook tokenCount + * @property {google.protobuf.ITimestamp|null} [createTime] Playbook createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Playbook updateTime + * @property {Array.|null} [referencedPlaybooks] Playbook referencedPlaybooks + * @property {Array.|null} [referencedFlows] Playbook referencedFlows + * @property {Array.|null} [referencedTools] Playbook referencedTools + * @property {Array.|null} [inlineActions] Playbook inlineActions + * @property {google.cloud.dialogflow.cx.v3beta1.ICodeBlock|null} [codeBlock] Playbook codeBlock + * @property {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null} [llmModelSettings] Playbook llmModelSettings + * @property {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null} [speechSettings] Playbook speechSettings + * @property {Array.|null} [handlers] Playbook handlers + * @property {google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType|null} [playbookType] Playbook playbookType + */ + + /** + * Constructs a new Playbook. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Playbook. + * @implements IPlaybook + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybook=} [properties] Properties to set + */ + function Playbook(properties) { + this.inputParameterDefinitions = []; + this.outputParameterDefinitions = []; + this.referencedPlaybooks = []; + this.referencedFlows = []; + this.referencedTools = []; + this.inlineActions = []; + this.handlers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Playbook name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.name = ""; + + /** + * Playbook displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.displayName = ""; + + /** + * Playbook goal. + * @member {string} goal + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.goal = ""; + + /** + * Playbook inputParameterDefinitions. + * @member {Array.} inputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.inputParameterDefinitions = $util.emptyArray; + + /** + * Playbook outputParameterDefinitions. + * @member {Array.} outputParameterDefinitions + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.outputParameterDefinitions = $util.emptyArray; + + /** + * Playbook instruction. + * @member {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null|undefined} instruction + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.instruction = null; + + /** + * Playbook tokenCount. + * @member {number|Long} tokenCount + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.tokenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Playbook createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.createTime = null; + + /** + * Playbook updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.updateTime = null; + + /** + * Playbook referencedPlaybooks. + * @member {Array.} referencedPlaybooks + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.referencedPlaybooks = $util.emptyArray; + + /** + * Playbook referencedFlows. + * @member {Array.} referencedFlows + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.referencedFlows = $util.emptyArray; + + /** + * Playbook referencedTools. + * @member {Array.} referencedTools + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.referencedTools = $util.emptyArray; + + /** + * Playbook inlineActions. + * @member {Array.} inlineActions + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.inlineActions = $util.emptyArray; + + /** + * Playbook codeBlock. + * @member {google.cloud.dialogflow.cx.v3beta1.ICodeBlock|null|undefined} codeBlock + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.codeBlock = null; + + /** + * Playbook llmModelSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ILlmModelSettings|null|undefined} llmModelSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.llmModelSettings = null; + + /** + * Playbook speechSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.ISpeechSettings|null|undefined} speechSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.speechSettings = null; + + /** + * Playbook handlers. + * @member {Array.} handlers + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.handlers = $util.emptyArray; + + /** + * Playbook playbookType. + * @member {google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType} playbookType + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + */ + Playbook.prototype.playbookType = 0; + + /** + * Creates a new Playbook instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybook=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook} Playbook instance + */ + Playbook.create = function create(properties) { + return new Playbook(properties); + }; + + /** + * Encodes the specified Playbook message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybook} message Playbook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Playbook.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.goal != null && Object.hasOwnProperty.call(message, "goal")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.goal); + if (message.inputParameterDefinitions != null && message.inputParameterDefinitions.length) + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.encode(message.inputParameterDefinitions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputParameterDefinitions != null && message.outputParameterDefinitions.length) + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.encode(message.outputParameterDefinitions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.tokenCount); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.referencedPlaybooks != null && message.referencedPlaybooks.length) + for (var i = 0; i < message.referencedPlaybooks.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencedPlaybooks[i]); + if (message.referencedFlows != null && message.referencedFlows.length) + for (var i = 0; i < message.referencedFlows.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.referencedFlows[i]); + if (message.referencedTools != null && message.referencedTools.length) + for (var i = 0; i < message.referencedTools.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.referencedTools[i]); + if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.handlers != null && message.handlers.length) + for (var i = 0; i < message.handlers.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Handler.encode(message.handlers[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.encode(message.instruction, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.playbookType != null && Object.hasOwnProperty.call(message, "playbookType")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.playbookType); + if (message.speechSettings != null && Object.hasOwnProperty.call(message, "speechSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.encode(message.speechSettings, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.codeBlock != null && Object.hasOwnProperty.call(message, "codeBlock")) + $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock.encode(message.codeBlock, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.inlineActions != null && message.inlineActions.length) + for (var i = 0; i < message.inlineActions.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.inlineActions[i]); + return writer; + }; + + /** + * Encodes the specified Playbook message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybook} message Playbook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Playbook.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Playbook message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook} Playbook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Playbook.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.goal = reader.string(); + break; + } + case 5: { + if (!(message.inputParameterDefinitions && message.inputParameterDefinitions.length)) + message.inputParameterDefinitions = []; + message.inputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.outputParameterDefinitions && message.outputParameterDefinitions.length)) + message.outputParameterDefinitions = []; + message.outputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 17: { + message.instruction = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.tokenCount = reader.int64(); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + if (!(message.referencedPlaybooks && message.referencedPlaybooks.length)) + message.referencedPlaybooks = []; + message.referencedPlaybooks.push(reader.string()); + break; + } + case 12: { + if (!(message.referencedFlows && message.referencedFlows.length)) + message.referencedFlows = []; + message.referencedFlows.push(reader.string()); + break; + } + case 13: { + if (!(message.referencedTools && message.referencedTools.length)) + message.referencedTools = []; + message.referencedTools.push(reader.string()); + break; + } + case 22: { + if (!(message.inlineActions && message.inlineActions.length)) + message.inlineActions = []; + message.inlineActions.push(reader.string()); + break; + } + case 21: { + message.codeBlock = $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.speechSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + if (!(message.handlers && message.handlers.length)) + message.handlers = []; + message.handlers.push($root.google.cloud.dialogflow.cx.v3beta1.Handler.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 19: { + message.playbookType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Playbook message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook} Playbook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Playbook.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Playbook message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Playbook.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.goal != null && message.hasOwnProperty("goal")) + if (!$util.isString(message.goal)) + return "goal: string expected"; + if (message.inputParameterDefinitions != null && message.hasOwnProperty("inputParameterDefinitions")) { + if (!Array.isArray(message.inputParameterDefinitions)) + return "inputParameterDefinitions: array expected"; + for (var i = 0; i < message.inputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify(message.inputParameterDefinitions[i], long + 1); + if (error) + return "inputParameterDefinitions." + error; + } + } + if (message.outputParameterDefinitions != null && message.hasOwnProperty("outputParameterDefinitions")) { + if (!Array.isArray(message.outputParameterDefinitions)) + return "outputParameterDefinitions: array expected"; + for (var i = 0; i < message.outputParameterDefinitions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.verify(message.outputParameterDefinitions[i], long + 1); + if (error) + return "outputParameterDefinitions." + error; + } + } + if (message.instruction != null && message.hasOwnProperty("instruction")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify(message.instruction, long + 1); + if (error) + return "instruction." + error; + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount) && !(message.tokenCount && $util.isInteger(message.tokenCount.low) && $util.isInteger(message.tokenCount.high))) + return "tokenCount: integer|Long expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.referencedPlaybooks != null && message.hasOwnProperty("referencedPlaybooks")) { + if (!Array.isArray(message.referencedPlaybooks)) + return "referencedPlaybooks: array expected"; + for (var i = 0; i < message.referencedPlaybooks.length; ++i) + if (!$util.isString(message.referencedPlaybooks[i])) + return "referencedPlaybooks: string[] expected"; + } + if (message.referencedFlows != null && message.hasOwnProperty("referencedFlows")) { + if (!Array.isArray(message.referencedFlows)) + return "referencedFlows: array expected"; + for (var i = 0; i < message.referencedFlows.length; ++i) + if (!$util.isString(message.referencedFlows[i])) + return "referencedFlows: string[] expected"; + } + if (message.referencedTools != null && message.hasOwnProperty("referencedTools")) { + if (!Array.isArray(message.referencedTools)) + return "referencedTools: array expected"; + for (var i = 0; i < message.referencedTools.length; ++i) + if (!$util.isString(message.referencedTools[i])) + return "referencedTools: string[] expected"; + } + if (message.inlineActions != null && message.hasOwnProperty("inlineActions")) { + if (!Array.isArray(message.inlineActions)) + return "inlineActions: array expected"; + for (var i = 0; i < message.inlineActions.length; ++i) + if (!$util.isString(message.inlineActions[i])) + return "inlineActions: string[] expected"; + } + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock.verify(message.codeBlock, long + 1); + if (error) + return "codeBlock." + error; + } + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.verify(message.llmModelSettings, long + 1); + if (error) + return "llmModelSettings." + error; + } + if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.verify(message.speechSettings, long + 1); + if (error) + return "speechSettings." + error; + } + if (message.handlers != null && message.hasOwnProperty("handlers")) { + if (!Array.isArray(message.handlers)) + return "handlers: array expected"; + for (var i = 0; i < message.handlers.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Handler.verify(message.handlers[i], long + 1); + if (error) + return "handlers." + error; + } + } + if (message.playbookType != null && message.hasOwnProperty("playbookType")) + switch (message.playbookType) { + default: + return "playbookType: enum value expected"; + case 0: + case 1: + case 3: + break; + } + return null; + }; + + /** + * Creates a Playbook message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook} Playbook + */ + Playbook.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Playbook) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.goal != null) + message.goal = String(object.goal); + if (object.inputParameterDefinitions) { + if (!Array.isArray(object.inputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.inputParameterDefinitions: array expected"); + message.inputParameterDefinitions = []; + for (var i = 0; i < object.inputParameterDefinitions.length; ++i) { + if (typeof object.inputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.inputParameterDefinitions: object expected"); + message.inputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.fromObject(object.inputParameterDefinitions[i], long + 1); + } + } + if (object.outputParameterDefinitions) { + if (!Array.isArray(object.outputParameterDefinitions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.outputParameterDefinitions: array expected"); + message.outputParameterDefinitions = []; + for (var i = 0; i < object.outputParameterDefinitions.length; ++i) { + if (typeof object.outputParameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.outputParameterDefinitions: object expected"); + message.outputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.fromObject(object.outputParameterDefinitions[i], long + 1); + } + } + if (object.instruction != null) { + if (typeof object.instruction !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.instruction: object expected"); + message.instruction = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.fromObject(object.instruction, long + 1); + } + if (object.tokenCount != null) + if ($util.Long) + (message.tokenCount = $util.Long.fromValue(object.tokenCount)).unsigned = false; + else if (typeof object.tokenCount === "string") + message.tokenCount = parseInt(object.tokenCount, 10); + else if (typeof object.tokenCount === "number") + message.tokenCount = object.tokenCount; + else if (typeof object.tokenCount === "object") + message.tokenCount = new $util.LongBits(object.tokenCount.low >>> 0, object.tokenCount.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.referencedPlaybooks) { + if (!Array.isArray(object.referencedPlaybooks)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.referencedPlaybooks: array expected"); + message.referencedPlaybooks = []; + for (var i = 0; i < object.referencedPlaybooks.length; ++i) + message.referencedPlaybooks[i] = String(object.referencedPlaybooks[i]); + } + if (object.referencedFlows) { + if (!Array.isArray(object.referencedFlows)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.referencedFlows: array expected"); + message.referencedFlows = []; + for (var i = 0; i < object.referencedFlows.length; ++i) + message.referencedFlows[i] = String(object.referencedFlows[i]); + } + if (object.referencedTools) { + if (!Array.isArray(object.referencedTools)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.referencedTools: array expected"); + message.referencedTools = []; + for (var i = 0; i < object.referencedTools.length; ++i) + message.referencedTools[i] = String(object.referencedTools[i]); + } + if (object.inlineActions) { + if (!Array.isArray(object.inlineActions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.inlineActions: array expected"); + message.inlineActions = []; + for (var i = 0; i < object.inlineActions.length; ++i) + message.inlineActions[i] = String(object.inlineActions[i]); + } + if (object.codeBlock != null) { + if (typeof object.codeBlock !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.codeBlock: object expected"); + message.codeBlock = $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock.fromObject(object.codeBlock, long + 1); + } + if (object.llmModelSettings != null) { + if (typeof object.llmModelSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.llmModelSettings: object expected"); + message.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.fromObject(object.llmModelSettings, long + 1); + } + if (object.speechSettings != null) { + if (typeof object.speechSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.speechSettings: object expected"); + message.speechSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.fromObject(object.speechSettings, long + 1); + } + if (object.handlers) { + if (!Array.isArray(object.handlers)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.handlers: array expected"); + message.handlers = []; + for (var i = 0; i < object.handlers.length; ++i) { + if (typeof object.handlers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.handlers: object expected"); + message.handlers[i] = $root.google.cloud.dialogflow.cx.v3beta1.Handler.fromObject(object.handlers[i], long + 1); + } + } + switch (object.playbookType) { + default: + if (typeof object.playbookType === "number") { + message.playbookType = object.playbookType; + break; + } + break; + case "PLAYBOOK_TYPE_UNSPECIFIED": + case 0: + message.playbookType = 0; + break; + case "TASK": + case 1: + message.playbookType = 1; + break; + case "ROUTINE": + case 3: + message.playbookType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Playbook message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook} message Playbook + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Playbook.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputParameterDefinitions = []; + object.outputParameterDefinitions = []; + object.referencedPlaybooks = []; + object.referencedFlows = []; + object.referencedTools = []; + object.handlers = []; + object.inlineActions = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.goal = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.tokenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tokenCount = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.llmModelSettings = null; + object.instruction = null; + object.playbookType = options.enums === String ? "PLAYBOOK_TYPE_UNSPECIFIED" : 0; + object.speechSettings = null; + object.codeBlock = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.goal != null && message.hasOwnProperty("goal")) + object.goal = message.goal; + if (message.inputParameterDefinitions && message.inputParameterDefinitions.length) { + object.inputParameterDefinitions = []; + for (var j = 0; j < message.inputParameterDefinitions.length; ++j) + object.inputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.toObject(message.inputParameterDefinitions[j], options); + } + if (message.outputParameterDefinitions && message.outputParameterDefinitions.length) { + object.outputParameterDefinitions = []; + for (var j = 0; j < message.outputParameterDefinitions.length; ++j) + object.outputParameterDefinitions[j] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.toObject(message.outputParameterDefinitions[j], options); + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (typeof message.tokenCount === "number") + object.tokenCount = options.longs === String ? String(message.tokenCount) : message.tokenCount; + else + object.tokenCount = options.longs === String ? $util.Long.prototype.toString.call(message.tokenCount) : options.longs === Number ? new $util.LongBits(message.tokenCount.low >>> 0, message.tokenCount.high >>> 0).toNumber() : message.tokenCount; + if (message.createTime != null && message.hasOwnProperty("createTime")) + 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.referencedPlaybooks && message.referencedPlaybooks.length) { + object.referencedPlaybooks = []; + for (var j = 0; j < message.referencedPlaybooks.length; ++j) + object.referencedPlaybooks[j] = message.referencedPlaybooks[j]; + } + if (message.referencedFlows && message.referencedFlows.length) { + object.referencedFlows = []; + for (var j = 0; j < message.referencedFlows.length; ++j) + object.referencedFlows[j] = message.referencedFlows[j]; + } + if (message.referencedTools && message.referencedTools.length) { + object.referencedTools = []; + for (var j = 0; j < message.referencedTools.length; ++j) + object.referencedTools[j] = message.referencedTools[j]; + } + if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) + object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.toObject(message.llmModelSettings, options); + if (message.handlers && message.handlers.length) { + object.handlers = []; + for (var j = 0; j < message.handlers.length; ++j) + object.handlers[j] = $root.google.cloud.dialogflow.cx.v3beta1.Handler.toObject(message.handlers[j], options); + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.toObject(message.instruction, options); + if (message.playbookType != null && message.hasOwnProperty("playbookType")) + object.playbookType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType[message.playbookType] === undefined ? message.playbookType : $root.google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType[message.playbookType] : message.playbookType; + if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) + object.speechSettings = $root.google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.SpeechSettings.toObject(message.speechSettings, options); + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) + object.codeBlock = $root.google.cloud.dialogflow.cx.v3beta1.CodeBlock.toObject(message.codeBlock, options); + if (message.inlineActions && message.inlineActions.length) { + object.inlineActions = []; + for (var j = 0; j < message.inlineActions.length; ++j) + object.inlineActions[j] = message.inlineActions[j]; + } + return object; + }; + + /** + * Converts this Playbook to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @instance + * @returns {Object.} JSON object + */ + Playbook.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Playbook + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Playbook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Playbook"; + }; + + Playbook.Step = (function() { + + /** + * Properties of a Step. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @interface IStep + * @property {string|null} [text] Step text + * @property {Array.|null} [steps] Step steps + */ + + /** + * Constructs a new Step. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @classdesc Represents a Step. + * @implements IStep + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IStep=} [properties] Properties to set + */ + function Step(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Step text. + * @member {string|null|undefined} text + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @instance + */ + Step.prototype.text = null; + + /** + * Step steps. + * @member {Array.} steps + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @instance + */ + Step.prototype.steps = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Step instruction. + * @member {"text"|undefined} instruction + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @instance + */ + Object.defineProperty(Step.prototype, "instruction", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Step instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IStep=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Step} Step instance + */ + Step.create = function create(properties) { + return new Step(properties); + }; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Step message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Step message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Step.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.instruction = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify(message.steps[i], long + 1); + if (error) + return "steps." + error; + } + } + return null; + }; + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Step} Step + */ + Step.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step(); + if (object.text != null) + message.text = String(object.text); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.Step.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.Step.steps: object expected"); + message.steps[i] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.fromObject(object.steps[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.Step} message Step + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Step.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.instruction = "text"; + } + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.toObject(message.steps[j], options); + } + return object; + }; + + /** + * Converts this Step to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @instance + * @returns {Object.} JSON object + */ + Step.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Step + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Step + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Step.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Playbook.Step"; + }; + + return Step; + })(); + + Playbook.Instruction = (function() { + + /** + * Properties of an Instruction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @interface IInstruction + * @property {string|null} [guidelines] Instruction guidelines + * @property {Array.|null} [steps] Instruction steps + */ + + /** + * Constructs a new Instruction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @classdesc Represents an Instruction. + * @implements IInstruction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction=} [properties] Properties to set + */ + function Instruction(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instruction guidelines. + * @member {string} guidelines + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @instance + */ + Instruction.prototype.guidelines = ""; + + /** + * Instruction steps. + * @member {Array.} steps + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @instance + */ + Instruction.prototype.steps = $util.emptyArray; + + /** + * Creates a new Instruction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction instance + */ + Instruction.create = function create(properties) { + return new Instruction(properties); + }; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guidelines != null && Object.hasOwnProperty.call(message, "guidelines")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.guidelines); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.guidelines = reader.string(); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instruction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instruction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.guidelines != null && message.hasOwnProperty("guidelines")) + if (!$util.isString(message.guidelines)) + return "guidelines: string expected"; + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify(message.steps[i], long + 1); + if (error) + return "steps." + error; + } + } + return null; + }; + + /** + * Creates an Instruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction + */ + Instruction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction(); + if (object.guidelines != null) + message.guidelines = String(object.guidelines); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.steps: object expected"); + message.steps[i] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.fromObject(object.steps[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} message Instruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (options.defaults) + object.guidelines = ""; + if (message.guidelines != null && message.hasOwnProperty("guidelines")) + object.guidelines = message.guidelines; + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.toObject(message.steps[j], options); + } + return object; + }; + + /** + * Converts this Instruction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @instance + * @returns {Object.} JSON object + */ + Instruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instruction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction"; + }; + + return Instruction; + })(); + + /** + * PlaybookType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Playbook.PlaybookType + * @enum {number} + * @property {number} PLAYBOOK_TYPE_UNSPECIFIED=0 PLAYBOOK_TYPE_UNSPECIFIED value + * @property {number} TASK=1 TASK value + * @property {number} ROUTINE=3 ROUTINE value + */ + Playbook.PlaybookType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PLAYBOOK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TASK"] = 1; + values[valuesById[3] = "ROUTINE"] = 3; + return values; + })(); + + return Playbook; + })(); + + v3beta1.CreatePlaybookVersionRequest = (function() { + + /** + * Properties of a CreatePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreatePlaybookVersionRequest + * @property {string|null} [parent] CreatePlaybookVersionRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion|null} [playbookVersion] CreatePlaybookVersionRequest playbookVersion + */ + + /** + * Constructs a new CreatePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreatePlaybookVersionRequest. + * @implements ICreatePlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest=} [properties] Properties to set + */ + function CreatePlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePlaybookVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @instance + */ + CreatePlaybookVersionRequest.prototype.parent = ""; + + /** + * CreatePlaybookVersionRequest playbookVersion. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion|null|undefined} playbookVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @instance + */ + CreatePlaybookVersionRequest.prototype.playbookVersion = null; + + /** + * Creates a new CreatePlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest instance + */ + CreatePlaybookVersionRequest.create = function create(properties) { + return new CreatePlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified CreatePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest} message CreatePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookVersionRequest.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.playbookVersion != null && Object.hasOwnProperty.call(message, "playbookVersion")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.encode(message.playbookVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest} message CreatePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.playbookVersion = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.playbookVersion != null && message.hasOwnProperty("playbookVersion")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.verify(message.playbookVersion, long + 1); + if (error) + return "playbookVersion." + error; + } + return null; + }; + + /** + * Creates a CreatePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest} CreatePlaybookVersionRequest + */ + CreatePlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.playbookVersion != null) { + if (typeof object.playbookVersion !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest.playbookVersion: object expected"); + message.playbookVersion = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.fromObject(object.playbookVersion, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreatePlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest} message CreatePlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePlaybookVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.playbookVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.playbookVersion != null && message.hasOwnProperty("playbookVersion")) + object.playbookVersion = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.toObject(message.playbookVersion, options); + return object; + }; + + /** + * Converts this CreatePlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest"; + }; + + return CreatePlaybookVersionRequest; + })(); + + v3beta1.PlaybookVersion = (function() { + + /** + * Properties of a PlaybookVersion. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybookVersion + * @property {string|null} [name] PlaybookVersion name + * @property {string|null} [description] PlaybookVersion description + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null} [playbook] PlaybookVersion playbook + * @property {Array.|null} [examples] PlaybookVersion examples + * @property {google.protobuf.ITimestamp|null} [updateTime] PlaybookVersion updateTime + */ + + /** + * Constructs a new PlaybookVersion. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PlaybookVersion. + * @implements IPlaybookVersion + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion=} [properties] Properties to set + */ + function PlaybookVersion(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookVersion name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.name = ""; + + /** + * PlaybookVersion description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.description = ""; + + /** + * PlaybookVersion playbook. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.playbook = null; + + /** + * PlaybookVersion examples. + * @member {Array.} examples + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.examples = $util.emptyArray; + + /** + * PlaybookVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @instance + */ + PlaybookVersion.prototype.updateTime = null; + + /** + * Creates a new PlaybookVersion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} PlaybookVersion instance + */ + PlaybookVersion.create = function create(properties) { + return new PlaybookVersion(properties); + }; + + /** + * Encodes the specified PlaybookVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion} message PlaybookVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookVersion.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.encode(message.playbook, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Example.encode(message.examples[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PlaybookVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion} message PlaybookVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} PlaybookVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookVersion.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.dialogflow.cx.v3beta1.Example.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} PlaybookVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookVersion message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookVersion.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Example.verify(message.examples[i], long + 1); + if (error) + return "examples." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a PlaybookVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} PlaybookVersion + */ + PlaybookVersion.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.fromObject(object.playbook, long + 1); + } + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.examples: object expected"); + message.examples[i] = $root.google.cloud.dialogflow.cx.v3beta1.Example.fromObject(object.examples[i], long + 1); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PlaybookVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} message PlaybookVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.playbook = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.toObject(message.playbook, options); + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.dialogflow.cx.v3beta1.Example.toObject(message.examples[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this PlaybookVersion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @instance + * @returns {Object.} JSON object + */ + PlaybookVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookVersion + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PlaybookVersion"; + }; + + return PlaybookVersion; + })(); + + v3beta1.GetPlaybookVersionRequest = (function() { + + /** + * Properties of a GetPlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetPlaybookVersionRequest + * @property {string|null} [name] GetPlaybookVersionRequest name + */ + + /** + * Constructs a new GetPlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetPlaybookVersionRequest. + * @implements IGetPlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest=} [properties] Properties to set + */ + function GetPlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPlaybookVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @instance + */ + GetPlaybookVersionRequest.prototype.name = ""; + + /** + * Creates a new GetPlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest} GetPlaybookVersionRequest instance + */ + GetPlaybookVersionRequest.create = function create(properties) { + return new GetPlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified GetPlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest} message GetPlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookVersionRequest.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 GetPlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest} message GetPlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest} GetPlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest} GetPlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest} GetPlaybookVersionRequest + */ + GetPlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest} message GetPlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPlaybookVersionRequest.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 GetPlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetPlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest"; + }; + + return GetPlaybookVersionRequest; + })(); + + v3beta1.RestorePlaybookVersionRequest = (function() { + + /** + * Properties of a RestorePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRestorePlaybookVersionRequest + * @property {string|null} [name] RestorePlaybookVersionRequest name + */ + + /** + * Constructs a new RestorePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RestorePlaybookVersionRequest. + * @implements IRestorePlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest=} [properties] Properties to set + */ + function RestorePlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestorePlaybookVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @instance + */ + RestorePlaybookVersionRequest.prototype.name = ""; + + /** + * Creates a new RestorePlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest instance + */ + RestorePlaybookVersionRequest.create = function create(properties) { + return new RestorePlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified RestorePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest} message RestorePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionRequest.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 RestorePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest} message RestorePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestorePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestorePlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestorePlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a RestorePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest} RestorePlaybookVersionRequest + */ + RestorePlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestorePlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest} message RestorePlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestorePlaybookVersionRequest.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 RestorePlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestorePlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestorePlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestorePlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest"; + }; + + return RestorePlaybookVersionRequest; + })(); + + v3beta1.RestorePlaybookVersionResponse = (function() { + + /** + * Properties of a RestorePlaybookVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRestorePlaybookVersionResponse + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null} [playbook] RestorePlaybookVersionResponse playbook + */ + + /** + * Constructs a new RestorePlaybookVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RestorePlaybookVersionResponse. + * @implements IRestorePlaybookVersionResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse=} [properties] Properties to set + */ + function RestorePlaybookVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestorePlaybookVersionResponse playbook. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybook|null|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @instance + */ + RestorePlaybookVersionResponse.prototype.playbook = null; + + /** + * Creates a new RestorePlaybookVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse instance + */ + RestorePlaybookVersionResponse.create = function create(properties) { + return new RestorePlaybookVersionResponse(properties); + }; + + /** + * Encodes the specified RestorePlaybookVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse} message RestorePlaybookVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.encode(message.playbook, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestorePlaybookVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse} message RestorePlaybookVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlaybookVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestorePlaybookVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlaybookVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestorePlaybookVersionResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestorePlaybookVersionResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.verify(message.playbook, long + 1); + if (error) + return "playbook." + error; + } + return null; + }; + + /** + * Creates a RestorePlaybookVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse} RestorePlaybookVersionResponse + */ + RestorePlaybookVersionResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse(); + if (object.playbook != null) { + if (typeof object.playbook !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse.playbook: object expected"); + message.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.fromObject(object.playbook, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RestorePlaybookVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse} message RestorePlaybookVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestorePlaybookVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.playbook = null; + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.toObject(message.playbook, options); + return object; + }; + + /** + * Converts this RestorePlaybookVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @instance + * @returns {Object.} JSON object + */ + RestorePlaybookVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestorePlaybookVersionResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestorePlaybookVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse"; + }; + + return RestorePlaybookVersionResponse; + })(); + + v3beta1.ListPlaybookVersionsRequest = (function() { + + /** + * Properties of a ListPlaybookVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListPlaybookVersionsRequest + * @property {string|null} [parent] ListPlaybookVersionsRequest parent + * @property {number|null} [pageSize] ListPlaybookVersionsRequest pageSize + * @property {string|null} [pageToken] ListPlaybookVersionsRequest pageToken + */ + + /** + * Constructs a new ListPlaybookVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListPlaybookVersionsRequest. + * @implements IListPlaybookVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest=} [properties] Properties to set + */ + function ListPlaybookVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybookVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @instance + */ + ListPlaybookVersionsRequest.prototype.parent = ""; + + /** + * ListPlaybookVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @instance + */ + ListPlaybookVersionsRequest.prototype.pageSize = 0; + + /** + * ListPlaybookVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @instance + */ + ListPlaybookVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPlaybookVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest instance + */ + ListPlaybookVersionsRequest.create = function create(properties) { + return new ListPlaybookVersionsRequest(properties); + }; + + /** + * Encodes the specified ListPlaybookVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest} message ListPlaybookVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListPlaybookVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest} message ListPlaybookVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybookVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybookVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybookVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListPlaybookVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest} ListPlaybookVersionsRequest + */ + ListPlaybookVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListPlaybookVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest} message ListPlaybookVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybookVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListPlaybookVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPlaybookVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybookVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybookVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest"; + }; + + return ListPlaybookVersionsRequest; + })(); + + v3beta1.ListPlaybookVersionsResponse = (function() { + + /** + * Properties of a ListPlaybookVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListPlaybookVersionsResponse + * @property {Array.|null} [playbookVersions] ListPlaybookVersionsResponse playbookVersions + * @property {string|null} [nextPageToken] ListPlaybookVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListPlaybookVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListPlaybookVersionsResponse. + * @implements IListPlaybookVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse=} [properties] Properties to set + */ + function ListPlaybookVersionsResponse(properties) { + this.playbookVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPlaybookVersionsResponse playbookVersions. + * @member {Array.} playbookVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @instance + */ + ListPlaybookVersionsResponse.prototype.playbookVersions = $util.emptyArray; + + /** + * ListPlaybookVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @instance + */ + ListPlaybookVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPlaybookVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse instance + */ + ListPlaybookVersionsResponse.create = function create(properties) { + return new ListPlaybookVersionsResponse(properties); + }; + + /** + * Encodes the specified ListPlaybookVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse} message ListPlaybookVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbookVersions != null && message.playbookVersions.length) + for (var i = 0; i < message.playbookVersions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.encode(message.playbookVersions[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 ListPlaybookVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse} message ListPlaybookVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPlaybookVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.playbookVersions && message.playbookVersions.length)) + message.playbookVersions = []; + message.playbookVersions.push($root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPlaybookVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPlaybookVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPlaybookVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPlaybookVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbookVersions != null && message.hasOwnProperty("playbookVersions")) { + if (!Array.isArray(message.playbookVersions)) + return "playbookVersions: array expected"; + for (var i = 0; i < message.playbookVersions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.verify(message.playbookVersions[i], long + 1); + if (error) + return "playbookVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPlaybookVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse} ListPlaybookVersionsResponse + */ + ListPlaybookVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse(); + if (object.playbookVersions) { + if (!Array.isArray(object.playbookVersions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse.playbookVersions: array expected"); + message.playbookVersions = []; + for (var i = 0; i < object.playbookVersions.length; ++i) { + if (typeof object.playbookVersions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse.playbookVersions: object expected"); + message.playbookVersions[i] = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.fromObject(object.playbookVersions[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPlaybookVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse} message ListPlaybookVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPlaybookVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.playbookVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.playbookVersions && message.playbookVersions.length) { + object.playbookVersions = []; + for (var j = 0; j < message.playbookVersions.length; ++j) + object.playbookVersions[j] = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion.toObject(message.playbookVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPlaybookVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPlaybookVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPlaybookVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPlaybookVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsResponse"; + }; + + return ListPlaybookVersionsResponse; + })(); + + v3beta1.DeletePlaybookVersionRequest = (function() { + + /** + * Properties of a DeletePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeletePlaybookVersionRequest + * @property {string|null} [name] DeletePlaybookVersionRequest name + */ + + /** + * Constructs a new DeletePlaybookVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeletePlaybookVersionRequest. + * @implements IDeletePlaybookVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest=} [properties] Properties to set + */ + function DeletePlaybookVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePlaybookVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @instance + */ + DeletePlaybookVersionRequest.prototype.name = ""; + + /** + * Creates a new DeletePlaybookVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest instance + */ + DeletePlaybookVersionRequest.create = function create(properties) { + return new DeletePlaybookVersionRequest(properties); + }; + + /** + * Encodes the specified DeletePlaybookVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest} message DeletePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookVersionRequest.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 DeletePlaybookVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest} message DeletePlaybookVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePlaybookVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePlaybookVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePlaybookVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePlaybookVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePlaybookVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePlaybookVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest} DeletePlaybookVersionRequest + */ + DeletePlaybookVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePlaybookVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest} message DeletePlaybookVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePlaybookVersionRequest.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 DeletePlaybookVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePlaybookVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePlaybookVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePlaybookVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest"; + }; + + return DeletePlaybookVersionRequest; + })(); + + v3beta1.ExportPlaybookRequest = (function() { + + /** + * Properties of an ExportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportPlaybookRequest + * @property {string|null} [name] ExportPlaybookRequest name + * @property {string|null} [playbookUri] ExportPlaybookRequest playbookUri + * @property {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat|null} [dataFormat] ExportPlaybookRequest dataFormat + */ + + /** + * Constructs a new ExportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportPlaybookRequest. + * @implements IExportPlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest=} [properties] Properties to set + */ + function ExportPlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportPlaybookRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @instance + */ + ExportPlaybookRequest.prototype.name = ""; + + /** + * ExportPlaybookRequest playbookUri. + * @member {string} playbookUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @instance + */ + ExportPlaybookRequest.prototype.playbookUri = ""; + + /** + * ExportPlaybookRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @instance + */ + ExportPlaybookRequest.prototype.dataFormat = 0; + + /** + * Creates a new ExportPlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest} ExportPlaybookRequest instance + */ + ExportPlaybookRequest.create = function create(properties) { + return new ExportPlaybookRequest(properties); + }; + + /** + * Encodes the specified ExportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest} message ExportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookRequest.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.playbookUri != null && Object.hasOwnProperty.call(message, "playbookUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.playbookUri); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified ExportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest} message ExportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest} ExportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.playbookUri = reader.string(); + break; + } + case 3: { + message.dataFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportPlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest} ExportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportPlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportPlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) + if (!$util.isString(message.playbookUri)) + return "playbookUri: string expected"; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ExportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest} ExportPlaybookRequest + */ + ExportPlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.playbookUri != null) + message.playbookUri = String(object.playbookUri); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + case "JSON": + case 2: + message.dataFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExportPlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest} message ExportPlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportPlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.playbookUri = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) + object.playbookUri = message.playbookUri; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this ExportPlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + ExportPlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportPlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + * @property {number} JSON=2 JSON value + */ + ExportPlaybookRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); + + return ExportPlaybookRequest; + })(); + + v3beta1.ImportPlaybookRequest = (function() { + + /** + * Properties of an ImportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportPlaybookRequest + * @property {string|null} [parent] ImportPlaybookRequest parent + * @property {string|null} [playbookUri] ImportPlaybookRequest playbookUri + * @property {Uint8Array|null} [playbookContent] ImportPlaybookRequest playbookContent + * @property {google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy|null} [importStrategy] ImportPlaybookRequest importStrategy + */ + + /** + * Constructs a new ImportPlaybookRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportPlaybookRequest. + * @implements IImportPlaybookRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest=} [properties] Properties to set + */ + function ImportPlaybookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportPlaybookRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.parent = ""; + + /** + * ImportPlaybookRequest playbookUri. + * @member {string|null|undefined} playbookUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.playbookUri = null; + + /** + * ImportPlaybookRequest playbookContent. + * @member {Uint8Array|null|undefined} playbookContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.playbookContent = null; + + /** + * ImportPlaybookRequest importStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy|null|undefined} importStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @instance + */ + ImportPlaybookRequest.prototype.importStrategy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportPlaybookRequest playbook. + * @member {"playbookUri"|"playbookContent"|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @instance + */ + Object.defineProperty(ImportPlaybookRequest.prototype, "playbook", { + get: $util.oneOfGetter($oneOfFields = ["playbookUri", "playbookContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportPlaybookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest} ImportPlaybookRequest instance + */ + ImportPlaybookRequest.create = function create(properties) { + return new ImportPlaybookRequest(properties); + }; + + /** + * Encodes the specified ImportPlaybookRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest} message ImportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookRequest.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.playbookUri != null && Object.hasOwnProperty.call(message, "playbookUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.playbookUri); + if (message.playbookContent != null && Object.hasOwnProperty.call(message, "playbookContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.playbookContent); + if (message.importStrategy != null && Object.hasOwnProperty.call(message, "importStrategy")) + $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.encode(message.importStrategy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportPlaybookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest} message ImportPlaybookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest} ImportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.playbookUri = reader.string(); + break; + } + case 3: { + message.playbookContent = reader.bytes(); + break; + } + case 4: { + message.importStrategy = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportPlaybookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest} ImportPlaybookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportPlaybookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportPlaybookRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + properties.playbook = 1; + if (!$util.isString(message.playbookUri)) + return "playbookUri: string expected"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + if (properties.playbook === 1) + return "playbook: multiple values"; + properties.playbook = 1; + if (!(message.playbookContent && typeof message.playbookContent.length === "number" || $util.isString(message.playbookContent))) + return "playbookContent: buffer expected"; + } + if (message.importStrategy != null && message.hasOwnProperty("importStrategy")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.verify(message.importStrategy, long + 1); + if (error) + return "importStrategy." + error; + } + return null; + }; + + /** + * Creates an ImportPlaybookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest} ImportPlaybookRequest + */ + ImportPlaybookRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.playbookUri != null) + message.playbookUri = String(object.playbookUri); + if (object.playbookContent != null) + if (typeof object.playbookContent === "string") + $util.base64.decode(object.playbookContent, message.playbookContent = $util.newBuffer($util.base64.length(object.playbookContent)), 0); + else if (object.playbookContent.length >= 0) + message.playbookContent = object.playbookContent; + if (object.importStrategy != null) { + if (typeof object.importStrategy !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest.importStrategy: object expected"); + message.importStrategy = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.fromObject(object.importStrategy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportPlaybookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest} message ImportPlaybookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportPlaybookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.importStrategy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + object.playbookUri = message.playbookUri; + if (options.oneofs) + object.playbook = "playbookUri"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + object.playbookContent = options.bytes === String ? $util.base64.encode(message.playbookContent, 0, message.playbookContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.playbookContent) : message.playbookContent; + if (options.oneofs) + object.playbook = "playbookContent"; + } + if (message.importStrategy != null && message.hasOwnProperty("importStrategy")) + object.importStrategy = $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.toObject(message.importStrategy, options); + return object; + }; + + /** + * Converts this ImportPlaybookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @instance + * @returns {Object.} JSON object + */ + ImportPlaybookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportPlaybookRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportPlaybookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest"; + }; + + return ImportPlaybookRequest; + })(); + + v3beta1.PlaybookImportStrategy = (function() { + + /** + * Properties of a PlaybookImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IPlaybookImportStrategy + * @property {google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null} [mainPlaybookImportStrategy] PlaybookImportStrategy mainPlaybookImportStrategy + * @property {google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null} [nestedResourceImportStrategy] PlaybookImportStrategy nestedResourceImportStrategy + * @property {google.cloud.dialogflow.cx.v3beta1.ImportStrategy|null} [toolImportStrategy] PlaybookImportStrategy toolImportStrategy + */ + + /** + * Constructs a new PlaybookImportStrategy. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a PlaybookImportStrategy. + * @implements IPlaybookImportStrategy + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy=} [properties] Properties to set + */ + function PlaybookImportStrategy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlaybookImportStrategy mainPlaybookImportStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportStrategy} mainPlaybookImportStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @instance + */ + PlaybookImportStrategy.prototype.mainPlaybookImportStrategy = 0; + + /** + * PlaybookImportStrategy nestedResourceImportStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportStrategy} nestedResourceImportStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @instance + */ + PlaybookImportStrategy.prototype.nestedResourceImportStrategy = 0; + + /** + * PlaybookImportStrategy toolImportStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportStrategy} toolImportStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @instance + */ + PlaybookImportStrategy.prototype.toolImportStrategy = 0; + + /** + * Creates a new PlaybookImportStrategy instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy} PlaybookImportStrategy instance + */ + PlaybookImportStrategy.create = function create(properties) { + return new PlaybookImportStrategy(properties); + }; + + /** + * Encodes the specified PlaybookImportStrategy message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy} message PlaybookImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookImportStrategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainPlaybookImportStrategy != null && Object.hasOwnProperty.call(message, "mainPlaybookImportStrategy")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mainPlaybookImportStrategy); + if (message.nestedResourceImportStrategy != null && Object.hasOwnProperty.call(message, "nestedResourceImportStrategy")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nestedResourceImportStrategy); + if (message.toolImportStrategy != null && Object.hasOwnProperty.call(message, "toolImportStrategy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.toolImportStrategy); + return writer; + }; + + /** + * Encodes the specified PlaybookImportStrategy message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookImportStrategy} message PlaybookImportStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlaybookImportStrategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy} PlaybookImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookImportStrategy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.mainPlaybookImportStrategy = reader.int32(); + break; + } + case 5: { + message.nestedResourceImportStrategy = reader.int32(); + break; + } + case 6: { + message.toolImportStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PlaybookImportStrategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy} PlaybookImportStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlaybookImportStrategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlaybookImportStrategy message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlaybookImportStrategy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.mainPlaybookImportStrategy != null && message.hasOwnProperty("mainPlaybookImportStrategy")) + switch (message.mainPlaybookImportStrategy) { + default: + return "mainPlaybookImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.nestedResourceImportStrategy != null && message.hasOwnProperty("nestedResourceImportStrategy")) + switch (message.nestedResourceImportStrategy) { + default: + return "nestedResourceImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.toolImportStrategy != null && message.hasOwnProperty("toolImportStrategy")) + switch (message.toolImportStrategy) { + default: + return "toolImportStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a PlaybookImportStrategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy} PlaybookImportStrategy + */ + PlaybookImportStrategy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy(); + switch (object.mainPlaybookImportStrategy) { + default: + if (typeof object.mainPlaybookImportStrategy === "number") { + message.mainPlaybookImportStrategy = object.mainPlaybookImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.mainPlaybookImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.mainPlaybookImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.mainPlaybookImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.mainPlaybookImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.mainPlaybookImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.mainPlaybookImportStrategy = 5; + break; + } + switch (object.nestedResourceImportStrategy) { + default: + if (typeof object.nestedResourceImportStrategy === "number") { + message.nestedResourceImportStrategy = object.nestedResourceImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.nestedResourceImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.nestedResourceImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.nestedResourceImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.nestedResourceImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.nestedResourceImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.nestedResourceImportStrategy = 5; + break; + } + switch (object.toolImportStrategy) { + default: + if (typeof object.toolImportStrategy === "number") { + message.toolImportStrategy = object.toolImportStrategy; + break; + } + break; + case "IMPORT_STRATEGY_UNSPECIFIED": + case 0: + message.toolImportStrategy = 0; + break; + case "IMPORT_STRATEGY_CREATE_NEW": + case 1: + message.toolImportStrategy = 1; + break; + case "IMPORT_STRATEGY_REPLACE": + case 2: + message.toolImportStrategy = 2; + break; + case "IMPORT_STRATEGY_KEEP": + case 3: + message.toolImportStrategy = 3; + break; + case "IMPORT_STRATEGY_MERGE": + case 4: + message.toolImportStrategy = 4; + break; + case "IMPORT_STRATEGY_THROW_ERROR": + case 5: + message.toolImportStrategy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a PlaybookImportStrategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy} message PlaybookImportStrategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlaybookImportStrategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mainPlaybookImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + object.nestedResourceImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + object.toolImportStrategy = options.enums === String ? "IMPORT_STRATEGY_UNSPECIFIED" : 0; + } + if (message.mainPlaybookImportStrategy != null && message.hasOwnProperty("mainPlaybookImportStrategy")) + object.mainPlaybookImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.mainPlaybookImportStrategy] === undefined ? message.mainPlaybookImportStrategy : $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.mainPlaybookImportStrategy] : message.mainPlaybookImportStrategy; + if (message.nestedResourceImportStrategy != null && message.hasOwnProperty("nestedResourceImportStrategy")) + object.nestedResourceImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.nestedResourceImportStrategy] === undefined ? message.nestedResourceImportStrategy : $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.nestedResourceImportStrategy] : message.nestedResourceImportStrategy; + if (message.toolImportStrategy != null && message.hasOwnProperty("toolImportStrategy")) + object.toolImportStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.toolImportStrategy] === undefined ? message.toolImportStrategy : $root.google.cloud.dialogflow.cx.v3beta1.ImportStrategy[message.toolImportStrategy] : message.toolImportStrategy; + return object; + }; + + /** + * Converts this PlaybookImportStrategy to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @instance + * @returns {Object.} JSON object + */ + PlaybookImportStrategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlaybookImportStrategy + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlaybookImportStrategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy"; + }; + + return PlaybookImportStrategy; + })(); + + v3beta1.ImportPlaybookResponse = (function() { + + /** + * Properties of an ImportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IImportPlaybookResponse + * @property {string|null} [playbook] ImportPlaybookResponse playbook + * @property {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources|null} [conflictingResources] ImportPlaybookResponse conflictingResources + */ + + /** + * Constructs a new ImportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ImportPlaybookResponse. + * @implements IImportPlaybookResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse=} [properties] Properties to set + */ + function ImportPlaybookResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportPlaybookResponse playbook. + * @member {string} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @instance + */ + ImportPlaybookResponse.prototype.playbook = ""; + + /** + * ImportPlaybookResponse conflictingResources. + * @member {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources|null|undefined} conflictingResources + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @instance + */ + ImportPlaybookResponse.prototype.conflictingResources = null; + + /** + * Creates a new ImportPlaybookResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse} ImportPlaybookResponse instance + */ + ImportPlaybookResponse.create = function create(properties) { + return new ImportPlaybookResponse(properties); + }; + + /** + * Encodes the specified ImportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse} message ImportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbook != null && Object.hasOwnProperty.call(message, "playbook")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbook); + if (message.conflictingResources != null && Object.hasOwnProperty.call(message, "conflictingResources")) + $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.encode(message.conflictingResources, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse} message ImportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportPlaybookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse} ImportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbook = reader.string(); + break; + } + case 2: { + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImportPlaybookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse} ImportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportPlaybookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportPlaybookResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportPlaybookResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.playbook != null && message.hasOwnProperty("playbook")) + if (!$util.isString(message.playbook)) + return "playbook: string expected"; + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.verify(message.conflictingResources, long + 1); + if (error) + return "conflictingResources." + error; + } + return null; + }; + + /** + * Creates an ImportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse} ImportPlaybookResponse + */ + ImportPlaybookResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse(); + if (object.playbook != null) + message.playbook = String(object.playbook); + if (object.conflictingResources != null) { + if (typeof object.conflictingResources !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.conflictingResources: object expected"); + message.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.fromObject(object.conflictingResources, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ImportPlaybookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse} message ImportPlaybookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportPlaybookResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.playbook = ""; + object.conflictingResources = null; + } + if (message.playbook != null && message.hasOwnProperty("playbook")) + object.playbook = message.playbook; + if (message.conflictingResources != null && message.hasOwnProperty("conflictingResources")) + object.conflictingResources = $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.toObject(message.conflictingResources, options); + return object; + }; + + /** + * Converts this ImportPlaybookResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @instance + * @returns {Object.} JSON object + */ + ImportPlaybookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportPlaybookResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportPlaybookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse"; + }; + + ImportPlaybookResponse.ConflictingResources = (function() { + + /** + * Properties of a ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @interface IConflictingResources + * @property {string|null} [mainPlaybookDisplayName] ConflictingResources mainPlaybookDisplayName + * @property {Array.|null} [nestedPlaybookDisplayNames] ConflictingResources nestedPlaybookDisplayNames + * @property {Array.|null} [toolDisplayNames] ConflictingResources toolDisplayNames + */ + + /** + * Constructs a new ConflictingResources. + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse + * @classdesc Represents a ConflictingResources. + * @implements IConflictingResources + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources=} [properties] Properties to set + */ + function ConflictingResources(properties) { + this.nestedPlaybookDisplayNames = []; + this.toolDisplayNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConflictingResources mainPlaybookDisplayName. + * @member {string} mainPlaybookDisplayName + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.mainPlaybookDisplayName = ""; + + /** + * ConflictingResources nestedPlaybookDisplayNames. + * @member {Array.} nestedPlaybookDisplayNames + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.nestedPlaybookDisplayNames = $util.emptyArray; + + /** + * ConflictingResources toolDisplayNames. + * @member {Array.} toolDisplayNames + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @instance + */ + ConflictingResources.prototype.toolDisplayNames = $util.emptyArray; + + /** + * Creates a new ConflictingResources instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources} ConflictingResources instance + */ + ConflictingResources.create = function create(properties) { + return new ConflictingResources(properties); + }; + + /** + * Encodes the specified ConflictingResources message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainPlaybookDisplayName != null && Object.hasOwnProperty.call(message, "mainPlaybookDisplayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainPlaybookDisplayName); + if (message.nestedPlaybookDisplayNames != null && message.nestedPlaybookDisplayNames.length) + for (var i = 0; i < message.nestedPlaybookDisplayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nestedPlaybookDisplayNames[i]); + if (message.toolDisplayNames != null && message.toolDisplayNames.length) + for (var i = 0; i < message.toolDisplayNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolDisplayNames[i]); + return writer; + }; + + /** + * Encodes the specified ConflictingResources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.IConflictingResources} message ConflictingResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConflictingResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainPlaybookDisplayName = reader.string(); + break; + } + case 2: { + if (!(message.nestedPlaybookDisplayNames && message.nestedPlaybookDisplayNames.length)) + message.nestedPlaybookDisplayNames = []; + message.nestedPlaybookDisplayNames.push(reader.string()); + break; + } + case 3: { + if (!(message.toolDisplayNames && message.toolDisplayNames.length)) + message.toolDisplayNames = []; + message.toolDisplayNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConflictingResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources} ConflictingResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConflictingResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConflictingResources message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConflictingResources.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.mainPlaybookDisplayName != null && message.hasOwnProperty("mainPlaybookDisplayName")) + if (!$util.isString(message.mainPlaybookDisplayName)) + return "mainPlaybookDisplayName: string expected"; + if (message.nestedPlaybookDisplayNames != null && message.hasOwnProperty("nestedPlaybookDisplayNames")) { + if (!Array.isArray(message.nestedPlaybookDisplayNames)) + return "nestedPlaybookDisplayNames: array expected"; + for (var i = 0; i < message.nestedPlaybookDisplayNames.length; ++i) + if (!$util.isString(message.nestedPlaybookDisplayNames[i])) + return "nestedPlaybookDisplayNames: string[] expected"; + } + if (message.toolDisplayNames != null && message.hasOwnProperty("toolDisplayNames")) { + if (!Array.isArray(message.toolDisplayNames)) + return "toolDisplayNames: array expected"; + for (var i = 0; i < message.toolDisplayNames.length; ++i) + if (!$util.isString(message.toolDisplayNames[i])) + return "toolDisplayNames: string[] expected"; + } + return null; + }; + + /** + * Creates a ConflictingResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources} ConflictingResources + */ + ConflictingResources.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources(); + if (object.mainPlaybookDisplayName != null) + message.mainPlaybookDisplayName = String(object.mainPlaybookDisplayName); + if (object.nestedPlaybookDisplayNames) { + if (!Array.isArray(object.nestedPlaybookDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.nestedPlaybookDisplayNames: array expected"); + message.nestedPlaybookDisplayNames = []; + for (var i = 0; i < object.nestedPlaybookDisplayNames.length; ++i) + message.nestedPlaybookDisplayNames[i] = String(object.nestedPlaybookDisplayNames[i]); + } + if (object.toolDisplayNames) { + if (!Array.isArray(object.toolDisplayNames)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources.toolDisplayNames: array expected"); + message.toolDisplayNames = []; + for (var i = 0; i < object.toolDisplayNames.length; ++i) + message.toolDisplayNames[i] = String(object.toolDisplayNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConflictingResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources} message ConflictingResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConflictingResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nestedPlaybookDisplayNames = []; + object.toolDisplayNames = []; + } + if (options.defaults) + object.mainPlaybookDisplayName = ""; + if (message.mainPlaybookDisplayName != null && message.hasOwnProperty("mainPlaybookDisplayName")) + object.mainPlaybookDisplayName = message.mainPlaybookDisplayName; + if (message.nestedPlaybookDisplayNames && message.nestedPlaybookDisplayNames.length) { + object.nestedPlaybookDisplayNames = []; + for (var j = 0; j < message.nestedPlaybookDisplayNames.length; ++j) + object.nestedPlaybookDisplayNames[j] = message.nestedPlaybookDisplayNames[j]; + } + if (message.toolDisplayNames && message.toolDisplayNames.length) { + object.toolDisplayNames = []; + for (var j = 0; j < message.toolDisplayNames.length; ++j) + object.toolDisplayNames[j] = message.toolDisplayNames[j]; + } + return object; + }; + + /** + * Converts this ConflictingResources to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @instance + * @returns {Object.} JSON object + */ + ConflictingResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConflictingResources + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConflictingResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse.ConflictingResources"; + }; + + return ConflictingResources; + })(); + + return ImportPlaybookResponse; + })(); + + v3beta1.ExportPlaybookResponse = (function() { + + /** + * Properties of an ExportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportPlaybookResponse + * @property {string|null} [playbookUri] ExportPlaybookResponse playbookUri + * @property {Uint8Array|null} [playbookContent] ExportPlaybookResponse playbookContent + */ + + /** + * Constructs a new ExportPlaybookResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportPlaybookResponse. + * @implements IExportPlaybookResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse=} [properties] Properties to set + */ + function ExportPlaybookResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportPlaybookResponse playbookUri. + * @member {string|null|undefined} playbookUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @instance + */ + ExportPlaybookResponse.prototype.playbookUri = null; + + /** + * ExportPlaybookResponse playbookContent. + * @member {Uint8Array|null|undefined} playbookContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @instance + */ + ExportPlaybookResponse.prototype.playbookContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportPlaybookResponse playbook. + * @member {"playbookUri"|"playbookContent"|undefined} playbook + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @instance + */ + Object.defineProperty(ExportPlaybookResponse.prototype, "playbook", { + get: $util.oneOfGetter($oneOfFields = ["playbookUri", "playbookContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportPlaybookResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse} ExportPlaybookResponse instance + */ + ExportPlaybookResponse.create = function create(properties) { + return new ExportPlaybookResponse(properties); + }; + + /** + * Encodes the specified ExportPlaybookResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse} message ExportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.playbookUri != null && Object.hasOwnProperty.call(message, "playbookUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.playbookUri); + if (message.playbookContent != null && Object.hasOwnProperty.call(message, "playbookContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.playbookContent); + return writer; + }; + + /** + * Encodes the specified ExportPlaybookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse} message ExportPlaybookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPlaybookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse} ExportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.playbookUri = reader.string(); + break; + } + case 2: { + message.playbookContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportPlaybookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse} ExportPlaybookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPlaybookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportPlaybookResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportPlaybookResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + properties.playbook = 1; + if (!$util.isString(message.playbookUri)) + return "playbookUri: string expected"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + if (properties.playbook === 1) + return "playbook: multiple values"; + properties.playbook = 1; + if (!(message.playbookContent && typeof message.playbookContent.length === "number" || $util.isString(message.playbookContent))) + return "playbookContent: buffer expected"; + } + return null; + }; + + /** + * Creates an ExportPlaybookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse} ExportPlaybookResponse + */ + ExportPlaybookResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse(); + if (object.playbookUri != null) + message.playbookUri = String(object.playbookUri); + if (object.playbookContent != null) + if (typeof object.playbookContent === "string") + $util.base64.decode(object.playbookContent, message.playbookContent = $util.newBuffer($util.base64.length(object.playbookContent)), 0); + else if (object.playbookContent.length >= 0) + message.playbookContent = object.playbookContent; + return message; + }; + + /** + * Creates a plain object from an ExportPlaybookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse} message ExportPlaybookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportPlaybookResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.playbookUri != null && message.hasOwnProperty("playbookUri")) { + object.playbookUri = message.playbookUri; + if (options.oneofs) + object.playbook = "playbookUri"; + } + if (message.playbookContent != null && message.hasOwnProperty("playbookContent")) { + object.playbookContent = options.bytes === String ? $util.base64.encode(message.playbookContent, 0, message.playbookContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.playbookContent) : message.playbookContent; + if (options.oneofs) + object.playbook = "playbookContent"; + } + return object; + }; + + /** + * Converts this ExportPlaybookResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @instance + * @returns {Object.} JSON object + */ + ExportPlaybookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportPlaybookResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPlaybookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse"; + }; + + return ExportPlaybookResponse; + })(); + + v3beta1.Handler = (function() { + + /** + * Properties of a Handler. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IHandler + * @property {google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler|null} [eventHandler] Handler eventHandler + * @property {google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler|null} [lifecycleHandler] Handler lifecycleHandler + */ + + /** + * Constructs a new Handler. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Handler. + * @implements IHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IHandler=} [properties] Properties to set + */ + function Handler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Handler eventHandler. + * @member {google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler|null|undefined} eventHandler + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @instance + */ + Handler.prototype.eventHandler = null; + + /** + * Handler lifecycleHandler. + * @member {google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler|null|undefined} lifecycleHandler + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @instance + */ + Handler.prototype.lifecycleHandler = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Handler handler. + * @member {"eventHandler"|"lifecycleHandler"|undefined} handler + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @instance + */ + Object.defineProperty(Handler.prototype, "handler", { + get: $util.oneOfGetter($oneOfFields = ["eventHandler", "lifecycleHandler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Handler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler} Handler instance + */ + Handler.create = function create(properties) { + return new Handler(properties); + }; + + /** + * Encodes the specified Handler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IHandler} message Handler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Handler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventHandler != null && Object.hasOwnProperty.call(message, "eventHandler")) + $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.encode(message.eventHandler, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lifecycleHandler != null && Object.hasOwnProperty.call(message, "lifecycleHandler")) + $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.encode(message.lifecycleHandler, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Handler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IHandler} message Handler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Handler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Handler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler} Handler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Handler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Handler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventHandler = $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.lifecycleHandler = $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Handler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler} Handler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Handler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Handler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Handler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + properties.handler = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.verify(message.eventHandler, long + 1); + if (error) + return "eventHandler." + error; + } + } + if (message.lifecycleHandler != null && message.hasOwnProperty("lifecycleHandler")) { + if (properties.handler === 1) + return "handler: multiple values"; + properties.handler = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.verify(message.lifecycleHandler, long + 1); + if (error) + return "lifecycleHandler." + error; + } + } + return null; + }; + + /** + * Creates a Handler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler} Handler + */ + Handler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Handler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Handler(); + if (object.eventHandler != null) { + if (typeof object.eventHandler !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Handler.eventHandler: object expected"); + message.eventHandler = $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.fromObject(object.eventHandler, long + 1); + } + if (object.lifecycleHandler != null) { + if (typeof object.lifecycleHandler !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Handler.lifecycleHandler: object expected"); + message.lifecycleHandler = $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.fromObject(object.lifecycleHandler, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Handler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler} message Handler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Handler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.eventHandler != null && message.hasOwnProperty("eventHandler")) { + object.eventHandler = $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.toObject(message.eventHandler, options); + if (options.oneofs) + object.handler = "eventHandler"; + } + if (message.lifecycleHandler != null && message.hasOwnProperty("lifecycleHandler")) { + object.lifecycleHandler = $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.toObject(message.lifecycleHandler, options); + if (options.oneofs) + object.handler = "lifecycleHandler"; + } + return object; + }; + + /** + * Converts this Handler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @instance + * @returns {Object.} JSON object + */ + Handler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Handler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Handler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Handler"; + }; + + Handler.EventHandler = (function() { + + /** + * Properties of an EventHandler. + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @interface IEventHandler + * @property {string|null} [event] EventHandler event + * @property {string|null} [condition] EventHandler condition + * @property {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null} [fulfillment] EventHandler fulfillment + */ + + /** + * Constructs a new EventHandler. + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @classdesc Represents an EventHandler. + * @implements IEventHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler=} [properties] Properties to set + */ + function EventHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventHandler event. + * @member {string} event + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @instance + */ + EventHandler.prototype.event = ""; + + /** + * EventHandler condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @instance + */ + EventHandler.prototype.condition = ""; + + /** + * EventHandler fulfillment. + * @member {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null|undefined} fulfillment + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @instance + */ + EventHandler.prototype.fulfillment = null; + + /** + * Creates a new EventHandler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler} EventHandler instance + */ + EventHandler.create = function create(properties) { + return new EventHandler(properties); + }; + + /** + * Encodes the specified EventHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + if (message.fulfillment != null && Object.hasOwnProperty.call(message, "fulfillment")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.encode(message.fulfillment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.condition); + return writer; + }; + + /** + * Encodes the specified EventHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.IEventHandler} message EventHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + case 3: { + message.condition = reader.string(); + break; + } + case 2: { + message.fulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler} EventHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventHandler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventHandler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify(message.fulfillment, long + 1); + if (error) + return "fulfillment." + error; + } + return null; + }; + + /** + * Creates an EventHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler} EventHandler + */ + EventHandler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler(); + if (object.event != null) + message.event = String(object.event); + if (object.condition != null) + message.condition = String(object.condition); + if (object.fulfillment != null) { + if (typeof object.fulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.fulfillment: object expected"); + message.fulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.fromObject(object.fulfillment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EventHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler} message EventHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.event = ""; + object.fulfillment = null; + object.condition = ""; + } + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) + object.fulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.toObject(message.fulfillment, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + return object; + }; + + /** + * Converts this EventHandler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @instance + * @returns {Object.} JSON object + */ + EventHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventHandler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler"; + }; + + return EventHandler; + })(); + + Handler.LifecycleHandler = (function() { + + /** + * Properties of a LifecycleHandler. + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @interface ILifecycleHandler + * @property {string|null} [lifecycleStage] LifecycleHandler lifecycleStage + * @property {string|null} [condition] LifecycleHandler condition + * @property {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null} [fulfillment] LifecycleHandler fulfillment + */ + + /** + * Constructs a new LifecycleHandler. + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler + * @classdesc Represents a LifecycleHandler. + * @implements ILifecycleHandler + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler=} [properties] Properties to set + */ + function LifecycleHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LifecycleHandler lifecycleStage. + * @member {string} lifecycleStage + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @instance + */ + LifecycleHandler.prototype.lifecycleStage = ""; + + /** + * LifecycleHandler condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @instance + */ + LifecycleHandler.prototype.condition = ""; + + /** + * LifecycleHandler fulfillment. + * @member {google.cloud.dialogflow.cx.v3beta1.IFulfillment|null|undefined} fulfillment + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @instance + */ + LifecycleHandler.prototype.fulfillment = null; + + /** + * Creates a new LifecycleHandler instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler} LifecycleHandler instance + */ + LifecycleHandler.create = function create(properties) { + return new LifecycleHandler(properties); + }; + + /** + * Encodes the specified LifecycleHandler message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler} message LifecycleHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecycleHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lifecycleStage != null && Object.hasOwnProperty.call(message, "lifecycleStage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.lifecycleStage); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.condition); + if (message.fulfillment != null && Object.hasOwnProperty.call(message, "fulfillment")) + $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.encode(message.fulfillment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LifecycleHandler message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.ILifecycleHandler} message LifecycleHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecycleHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler} LifecycleHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecycleHandler.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lifecycleStage = reader.string(); + break; + } + case 2: { + message.condition = reader.string(); + break; + } + case 3: { + message.fulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LifecycleHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler} LifecycleHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecycleHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LifecycleHandler message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LifecycleHandler.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.lifecycleStage != null && message.hasOwnProperty("lifecycleStage")) + if (!$util.isString(message.lifecycleStage)) + return "lifecycleStage: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.verify(message.fulfillment, long + 1); + if (error) + return "fulfillment." + error; + } + return null; + }; + + /** + * Creates a LifecycleHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler} LifecycleHandler + */ + LifecycleHandler.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler(); + if (object.lifecycleStage != null) + message.lifecycleStage = String(object.lifecycleStage); + if (object.condition != null) + message.condition = String(object.condition); + if (object.fulfillment != null) { + if (typeof object.fulfillment !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.fulfillment: object expected"); + message.fulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.fromObject(object.fulfillment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LifecycleHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler} message LifecycleHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LifecycleHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lifecycleStage = ""; + object.condition = ""; + object.fulfillment = null; + } + if (message.lifecycleStage != null && message.hasOwnProperty("lifecycleStage")) + object.lifecycleStage = message.lifecycleStage; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.fulfillment != null && message.hasOwnProperty("fulfillment")) + object.fulfillment = $root.google.cloud.dialogflow.cx.v3beta1.Fulfillment.toObject(message.fulfillment, options); + return object; + }; + + /** + * Converts this LifecycleHandler to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @instance + * @returns {Object.} JSON object + */ + LifecycleHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LifecycleHandler + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LifecycleHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler"; + }; + + return LifecycleHandler; + })(); + + return Handler; + })(); + + v3beta1.SecuritySettingsService = (function() { + + /** + * Constructs a new SecuritySettingsService service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SecuritySettingsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SecuritySettingsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecuritySettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecuritySettingsService; + + /** + * Creates new SecuritySettingsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SecuritySettingsService} RPC service. Useful where requests and/or responses are streamed. + */ + SecuritySettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|createSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef CreateSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls CreateSecuritySettings. + * @function createSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} request CreateSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.CreateSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.createSecuritySettings = function createSecuritySettings(request, callback) { + return this.rpcCall(createSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, request, callback); + }, "name", { value: "CreateSecuritySettings" }); + + /** + * Calls CreateSecuritySettings. + * @function createSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} request CreateSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|getSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef GetSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls GetSecuritySettings. + * @function getSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} request GetSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.getSecuritySettings = function getSecuritySettings(request, callback) { + return this.rpcCall(getSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, request, callback); + }, "name", { value: "GetSecuritySettings" }); + + /** + * Calls GetSecuritySettings. + * @function getSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} request GetSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|updateSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef UpdateSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls UpdateSecuritySettings. + * @function updateSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} request UpdateSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.updateSecuritySettings = function updateSecuritySettings(request, callback) { + return this.rpcCall(updateSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, request, callback); + }, "name", { value: "UpdateSecuritySettings" }); + + /** + * Calls UpdateSecuritySettings. + * @function updateSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} request UpdateSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|listSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef ListSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} [response] ListSecuritySettingsResponse + */ + + /** + * Calls ListSecuritySettings. + * @function listSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} request ListSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.ListSecuritySettingsCallback} callback Node-style callback called with the error, if any, and ListSecuritySettingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.listSecuritySettings = function listSecuritySettings(request, callback) { + return this.rpcCall(listSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse, request, callback); + }, "name", { value: "ListSecuritySettings" }); + + /** + * Calls ListSecuritySettings. + * @function listSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} request ListSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService|deleteSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef DeleteSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSecuritySettings. + * @function deleteSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} request DeleteSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.DeleteSecuritySettingsCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.deleteSecuritySettings = function deleteSecuritySettings(request, callback) { + return this.rpcCall(deleteSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSecuritySettings" }); + + /** + * Calls DeleteSecuritySettings. + * @function deleteSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} request DeleteSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecuritySettingsService; + })(); + + v3beta1.GetSecuritySettingsRequest = (function() { + + /** + * Properties of a GetSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetSecuritySettingsRequest + * @property {string|null} [name] GetSecuritySettingsRequest name + */ + + /** + * Constructs a new GetSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetSecuritySettingsRequest. + * @implements IGetSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest=} [properties] Properties to set + */ + function GetSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSecuritySettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @instance + */ + GetSecuritySettingsRequest.prototype.name = ""; + + /** + * Creates a new GetSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest instance + */ + GetSecuritySettingsRequest.create = function create(properties) { + return new GetSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified GetSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} message GetSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecuritySettingsRequest.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 GetSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} message GetSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest + */ + GetSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} message GetSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSecuritySettingsRequest.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 GetSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest"; + }; + + return GetSecuritySettingsRequest; + })(); + + v3beta1.UpdateSecuritySettingsRequest = (function() { + + /** + * Properties of an UpdateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateSecuritySettingsRequest + * @property {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null} [securitySettings] UpdateSecuritySettingsRequest securitySettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecuritySettingsRequest updateMask + */ + + /** + * Constructs a new UpdateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateSecuritySettingsRequest. + * @implements IUpdateSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest=} [properties] Properties to set + */ + function UpdateSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecuritySettingsRequest securitySettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @instance + */ + UpdateSecuritySettingsRequest.prototype.securitySettings = null; + + /** + * UpdateSecuritySettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @instance + */ + UpdateSecuritySettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest instance + */ + UpdateSecuritySettingsRequest.create = function create(properties) { + return new UpdateSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecuritySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.encode(message.securitySettings, 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 UpdateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify(message.securitySettings, long + 1); + if (error) + return "securitySettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + */ + UpdateSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.fromObject(object.securitySettings, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securitySettings = null; + object.updateMask = null; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.toObject(message.securitySettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest"; + }; + + return UpdateSecuritySettingsRequest; + })(); + + v3beta1.ListSecuritySettingsRequest = (function() { + + /** + * Properties of a ListSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListSecuritySettingsRequest + * @property {string|null} [parent] ListSecuritySettingsRequest parent + * @property {number|null} [pageSize] ListSecuritySettingsRequest pageSize + * @property {string|null} [pageToken] ListSecuritySettingsRequest pageToken + */ + + /** + * Constructs a new ListSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListSecuritySettingsRequest. + * @implements IListSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest=} [properties] Properties to set + */ + function ListSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecuritySettingsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.parent = ""; + + /** + * ListSecuritySettingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.pageSize = 0; + + /** + * ListSecuritySettingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest instance + */ + ListSecuritySettingsRequest.create = function create(properties) { + return new ListSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified ListSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} message ListSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} message ListSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest + */ + ListSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} message ListSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest"; + }; + + return ListSecuritySettingsRequest; + })(); + + v3beta1.ListSecuritySettingsResponse = (function() { + + /** + * Properties of a ListSecuritySettingsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListSecuritySettingsResponse + * @property {Array.|null} [securitySettings] ListSecuritySettingsResponse securitySettings + * @property {string|null} [nextPageToken] ListSecuritySettingsResponse nextPageToken + */ + + /** + * Constructs a new ListSecuritySettingsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListSecuritySettingsResponse. + * @implements IListSecuritySettingsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse=} [properties] Properties to set + */ + function ListSecuritySettingsResponse(properties) { + this.securitySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecuritySettingsResponse securitySettings. + * @member {Array.} securitySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @instance + */ + ListSecuritySettingsResponse.prototype.securitySettings = $util.emptyArray; + + /** + * ListSecuritySettingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @instance + */ + ListSecuritySettingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSecuritySettingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse instance + */ + ListSecuritySettingsResponse.create = function create(properties) { + return new ListSecuritySettingsResponse(properties); + }; + + /** + * Encodes the specified ListSecuritySettingsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse} message ListSecuritySettingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securitySettings != null && message.securitySettings.length) + for (var i = 0; i < message.securitySettings.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.encode(message.securitySettings[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 ListSecuritySettingsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse} message ListSecuritySettingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.securitySettings && message.securitySettings.length)) + message.securitySettings = []; + message.securitySettings.push($root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecuritySettingsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecuritySettingsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + if (!Array.isArray(message.securitySettings)) + return "securitySettings: array expected"; + for (var i = 0; i < message.securitySettings.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify(message.securitySettings[i], long + 1); + if (error) + return "securitySettings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSecuritySettingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse + */ + ListSecuritySettingsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse(); + if (object.securitySettings) { + if (!Array.isArray(object.securitySettings)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.securitySettings: array expected"); + message.securitySettings = []; + for (var i = 0; i < object.securitySettings.length; ++i) { + if (typeof object.securitySettings[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.securitySettings: object expected"); + message.securitySettings[i] = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.fromObject(object.securitySettings[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSecuritySettingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} message ListSecuritySettingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecuritySettingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.securitySettings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.securitySettings && message.securitySettings.length) { + object.securitySettings = []; + for (var j = 0; j < message.securitySettings.length; ++j) + object.securitySettings[j] = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.toObject(message.securitySettings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSecuritySettingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSecuritySettingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecuritySettingsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecuritySettingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse"; + }; + + return ListSecuritySettingsResponse; + })(); + + v3beta1.CreateSecuritySettingsRequest = (function() { + + /** + * Properties of a CreateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateSecuritySettingsRequest + * @property {string|null} [parent] CreateSecuritySettingsRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null} [securitySettings] CreateSecuritySettingsRequest securitySettings + */ + + /** + * Constructs a new CreateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateSecuritySettingsRequest. + * @implements ICreateSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest=} [properties] Properties to set + */ + function CreateSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecuritySettingsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @instance + */ + CreateSecuritySettingsRequest.prototype.parent = ""; + + /** + * CreateSecuritySettingsRequest securitySettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @instance + */ + CreateSecuritySettingsRequest.prototype.securitySettings = null; + + /** + * Creates a new CreateSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest instance + */ + CreateSecuritySettingsRequest.create = function create(properties) { + return new CreateSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified CreateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} message CreateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecuritySettingsRequest.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.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} message CreateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify(message.securitySettings, long + 1); + if (error) + return "securitySettings." + error; + } + return null; + }; + + /** + * Creates a CreateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + */ + CreateSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.fromObject(object.securitySettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} message CreateSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.securitySettings = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.toObject(message.securitySettings, options); + return object; + }; + + /** + * Converts this CreateSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest"; + }; + + return CreateSecuritySettingsRequest; + })(); + + v3beta1.DeleteSecuritySettingsRequest = (function() { + + /** + * Properties of a DeleteSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteSecuritySettingsRequest + * @property {string|null} [name] DeleteSecuritySettingsRequest name + */ + + /** + * Constructs a new DeleteSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteSecuritySettingsRequest. + * @implements IDeleteSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest=} [properties] Properties to set + */ + function DeleteSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSecuritySettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @instance + */ + DeleteSecuritySettingsRequest.prototype.name = ""; + + /** + * Creates a new DeleteSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest instance + */ + DeleteSecuritySettingsRequest.create = function create(properties) { + return new DeleteSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecuritySettingsRequest.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 DeleteSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecuritySettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecuritySettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + */ + DeleteSecuritySettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSecuritySettingsRequest.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 DeleteSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSecuritySettingsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSecuritySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest"; + }; + + return DeleteSecuritySettingsRequest; + })(); + + v3beta1.SecuritySettings = (function() { + + /** + * Properties of a SecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISecuritySettings + * @property {string|null} [name] SecuritySettings name + * @property {string|null} [displayName] SecuritySettings displayName + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|null} [redactionStrategy] SecuritySettings redactionStrategy + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|null} [redactionScope] SecuritySettings redactionScope + * @property {string|null} [inspectTemplate] SecuritySettings inspectTemplate + * @property {string|null} [deidentifyTemplate] SecuritySettings deidentifyTemplate + * @property {number|null} [retentionWindowDays] SecuritySettings retentionWindowDays + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy|null} [retentionStrategy] SecuritySettings retentionStrategy + * @property {Array.|null} [purgeDataTypes] SecuritySettings purgeDataTypes + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null} [audioExportSettings] SecuritySettings audioExportSettings + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null} [insightsExportSettings] SecuritySettings insightsExportSettings + */ + + /** + * Constructs a new SecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SecuritySettings. + * @implements ISecuritySettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings=} [properties] Properties to set + */ + function SecuritySettings(properties) { + this.purgeDataTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecuritySettings name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.name = ""; + + /** + * SecuritySettings displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.displayName = ""; + + /** + * SecuritySettings redactionStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy} redactionStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.redactionStrategy = 0; + + /** + * SecuritySettings redactionScope. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope} redactionScope + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.redactionScope = 0; + + /** + * SecuritySettings inspectTemplate. + * @member {string} inspectTemplate + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.inspectTemplate = ""; + + /** + * SecuritySettings deidentifyTemplate. + * @member {string} deidentifyTemplate + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.deidentifyTemplate = ""; + + /** + * SecuritySettings retentionWindowDays. + * @member {number|null|undefined} retentionWindowDays + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.retentionWindowDays = null; + + /** + * SecuritySettings retentionStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy|null|undefined} retentionStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.retentionStrategy = null; + + /** + * SecuritySettings purgeDataTypes. + * @member {Array.} purgeDataTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.purgeDataTypes = $util.emptyArray; + + /** + * SecuritySettings audioExportSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null|undefined} audioExportSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.audioExportSettings = null; + + /** + * SecuritySettings insightsExportSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null|undefined} insightsExportSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.insightsExportSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecuritySettings dataRetention. + * @member {"retentionWindowDays"|"retentionStrategy"|undefined} dataRetention + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + Object.defineProperty(SecuritySettings.prototype, "dataRetention", { + get: $util.oneOfGetter($oneOfFields = ["retentionWindowDays", "retentionStrategy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings instance + */ + SecuritySettings.create = function create(properties) { + return new SecuritySettings(properties); + }; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.redactionStrategy != null && Object.hasOwnProperty.call(message, "redactionStrategy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.redactionStrategy); + if (message.redactionScope != null && Object.hasOwnProperty.call(message, "redactionScope")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.redactionScope); + if (message.retentionWindowDays != null && Object.hasOwnProperty.call(message, "retentionWindowDays")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.retentionWindowDays); + if (message.retentionStrategy != null && Object.hasOwnProperty.call(message, "retentionStrategy")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.retentionStrategy); + if (message.purgeDataTypes != null && message.purgeDataTypes.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.purgeDataTypes.length; ++i) + writer.int32(message.purgeDataTypes[i]); + writer.ldelim(); + } + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.inspectTemplate); + if (message.audioExportSettings != null && Object.hasOwnProperty.call(message, "audioExportSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.encode(message.audioExportSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.insightsExportSettings != null && Object.hasOwnProperty.call(message, "insightsExportSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.encode(message.insightsExportSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.deidentifyTemplate); + return writer; + }; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.redactionStrategy = reader.int32(); + break; + } + case 4: { + message.redactionScope = reader.int32(); + break; + } + case 9: { + message.inspectTemplate = reader.string(); + break; + } + case 17: { + message.deidentifyTemplate = reader.string(); + break; + } + case 6: { + message.retentionWindowDays = reader.int32(); + break; + } + case 7: { + message.retentionStrategy = reader.int32(); + break; + } + case 8: { + if (!(message.purgeDataTypes && message.purgeDataTypes.length)) + message.purgeDataTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.purgeDataTypes.push(reader.int32()); + } else + message.purgeDataTypes.push(reader.int32()); + break; + } + case 12: { + message.audioExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecuritySettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecuritySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.redactionStrategy != null && message.hasOwnProperty("redactionStrategy")) + switch (message.redactionStrategy) { + default: + return "redactionStrategy: enum value expected"; + case 0: + case 1: + break; + } + if (message.redactionScope != null && message.hasOwnProperty("redactionScope")) + switch (message.redactionScope) { + default: + return "redactionScope: enum value expected"; + case 0: + case 2: + break; + } + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + if (!$util.isString(message.inspectTemplate)) + return "inspectTemplate: string expected"; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + if (!$util.isString(message.deidentifyTemplate)) + return "deidentifyTemplate: string expected"; + if (message.retentionWindowDays != null && message.hasOwnProperty("retentionWindowDays")) { + properties.dataRetention = 1; + if (!$util.isInteger(message.retentionWindowDays)) + return "retentionWindowDays: integer expected"; + } + if (message.retentionStrategy != null && message.hasOwnProperty("retentionStrategy")) { + if (properties.dataRetention === 1) + return "dataRetention: multiple values"; + properties.dataRetention = 1; + switch (message.retentionStrategy) { + default: + return "retentionStrategy: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.purgeDataTypes != null && message.hasOwnProperty("purgeDataTypes")) { + if (!Array.isArray(message.purgeDataTypes)) + return "purgeDataTypes: array expected"; + for (var i = 0; i < message.purgeDataTypes.length; ++i) + switch (message.purgeDataTypes[i]) { + default: + return "purgeDataTypes: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.audioExportSettings != null && message.hasOwnProperty("audioExportSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify(message.audioExportSettings, long + 1); + if (error) + return "audioExportSettings." + error; + } + if (message.insightsExportSettings != null && message.hasOwnProperty("insightsExportSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.verify(message.insightsExportSettings, long + 1); + if (error) + return "insightsExportSettings." + error; + } + return null; + }; + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings + */ + SecuritySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.redactionStrategy) { + default: + if (typeof object.redactionStrategy === "number") { + message.redactionStrategy = object.redactionStrategy; + break; + } + break; + case "REDACTION_STRATEGY_UNSPECIFIED": + case 0: + message.redactionStrategy = 0; + break; + case "REDACT_WITH_SERVICE": + case 1: + message.redactionStrategy = 1; + break; + } + switch (object.redactionScope) { + default: + if (typeof object.redactionScope === "number") { + message.redactionScope = object.redactionScope; + break; + } + break; + case "REDACTION_SCOPE_UNSPECIFIED": + case 0: + message.redactionScope = 0; + break; + case "REDACT_DISK_STORAGE": + case 2: + message.redactionScope = 2; + break; + } + if (object.inspectTemplate != null) + message.inspectTemplate = String(object.inspectTemplate); + if (object.deidentifyTemplate != null) + message.deidentifyTemplate = String(object.deidentifyTemplate); + if (object.retentionWindowDays != null) + message.retentionWindowDays = object.retentionWindowDays | 0; + switch (object.retentionStrategy) { + default: + if (typeof object.retentionStrategy === "number") { + message.retentionStrategy = object.retentionStrategy; + break; + } + break; + case "RETENTION_STRATEGY_UNSPECIFIED": + case 0: + message.retentionStrategy = 0; + break; + case "REMOVE_AFTER_CONVERSATION": + case 1: + message.retentionStrategy = 1; + break; + } + if (object.purgeDataTypes) { + if (!Array.isArray(object.purgeDataTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SecuritySettings.purgeDataTypes: array expected"); + message.purgeDataTypes = []; + for (var i = 0; i < object.purgeDataTypes.length; ++i) + switch (object.purgeDataTypes[i]) { + default: + if (typeof object.purgeDataTypes[i] === "number") { + message.purgeDataTypes[i] = object.purgeDataTypes[i]; + break; + } + case "PURGE_DATA_TYPE_UNSPECIFIED": + case 0: + message.purgeDataTypes[i] = 0; + break; + case "DIALOGFLOW_HISTORY": + case 1: + message.purgeDataTypes[i] = 1; + break; + } + } + if (object.audioExportSettings != null) { + if (typeof object.audioExportSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SecuritySettings.audioExportSettings: object expected"); + message.audioExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.fromObject(object.audioExportSettings, long + 1); + } + if (object.insightsExportSettings != null) { + if (typeof object.insightsExportSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SecuritySettings.insightsExportSettings: object expected"); + message.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.fromObject(object.insightsExportSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} message SecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purgeDataTypes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.redactionStrategy = options.enums === String ? "REDACTION_STRATEGY_UNSPECIFIED" : 0; + object.redactionScope = options.enums === String ? "REDACTION_SCOPE_UNSPECIFIED" : 0; + object.inspectTemplate = ""; + object.audioExportSettings = null; + object.insightsExportSettings = null; + object.deidentifyTemplate = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.redactionStrategy != null && message.hasOwnProperty("redactionStrategy")) + object.redactionStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy[message.redactionStrategy] === undefined ? message.redactionStrategy : $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy[message.redactionStrategy] : message.redactionStrategy; + if (message.redactionScope != null && message.hasOwnProperty("redactionScope")) + object.redactionScope = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope[message.redactionScope] === undefined ? message.redactionScope : $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope[message.redactionScope] : message.redactionScope; + if (message.retentionWindowDays != null && message.hasOwnProperty("retentionWindowDays")) { + object.retentionWindowDays = message.retentionWindowDays; + if (options.oneofs) + object.dataRetention = "retentionWindowDays"; + } + if (message.retentionStrategy != null && message.hasOwnProperty("retentionStrategy")) { + object.retentionStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy[message.retentionStrategy] === undefined ? message.retentionStrategy : $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy[message.retentionStrategy] : message.retentionStrategy; + if (options.oneofs) + object.dataRetention = "retentionStrategy"; + } + if (message.purgeDataTypes && message.purgeDataTypes.length) { + object.purgeDataTypes = []; + for (var j = 0; j < message.purgeDataTypes.length; ++j) + object.purgeDataTypes[j] = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[message.purgeDataTypes[j]] === undefined ? message.purgeDataTypes[j] : $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[message.purgeDataTypes[j]] : message.purgeDataTypes[j]; + } + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = message.inspectTemplate; + if (message.audioExportSettings != null && message.hasOwnProperty("audioExportSettings")) + object.audioExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.toObject(message.audioExportSettings, options); + if (message.insightsExportSettings != null && message.hasOwnProperty("insightsExportSettings")) + object.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.toObject(message.insightsExportSettings, options); + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + object.deidentifyTemplate = message.deidentifyTemplate; + return object; + }; + + /** + * Converts this SecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + * @returns {Object.} JSON object + */ + SecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecuritySettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SecuritySettings"; + }; + + /** + * RedactionStrategy enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy + * @enum {number} + * @property {number} REDACTION_STRATEGY_UNSPECIFIED=0 REDACTION_STRATEGY_UNSPECIFIED value + * @property {number} REDACT_WITH_SERVICE=1 REDACT_WITH_SERVICE value + */ + SecuritySettings.RedactionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDACTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REDACT_WITH_SERVICE"] = 1; + return values; + })(); + + /** + * RedactionScope enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope + * @enum {number} + * @property {number} REDACTION_SCOPE_UNSPECIFIED=0 REDACTION_SCOPE_UNSPECIFIED value + * @property {number} REDACT_DISK_STORAGE=2 REDACT_DISK_STORAGE value + */ + SecuritySettings.RedactionScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDACTION_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[2] = "REDACT_DISK_STORAGE"] = 2; + return values; + })(); + + /** + * RetentionStrategy enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RetentionStrategy + * @enum {number} + * @property {number} RETENTION_STRATEGY_UNSPECIFIED=0 RETENTION_STRATEGY_UNSPECIFIED value + * @property {number} REMOVE_AFTER_CONVERSATION=1 REMOVE_AFTER_CONVERSATION value + */ + SecuritySettings.RetentionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REMOVE_AFTER_CONVERSATION"] = 1; + return values; + })(); + + /** + * PurgeDataType enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType + * @enum {number} + * @property {number} PURGE_DATA_TYPE_UNSPECIFIED=0 PURGE_DATA_TYPE_UNSPECIFIED value + * @property {number} DIALOGFLOW_HISTORY=1 DIALOGFLOW_HISTORY value + */ + SecuritySettings.PurgeDataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PURGE_DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIALOGFLOW_HISTORY"] = 1; + return values; + })(); + + SecuritySettings.AudioExportSettings = (function() { + + /** + * Properties of an AudioExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @interface IAudioExportSettings + * @property {string|null} [gcsBucket] AudioExportSettings gcsBucket + * @property {string|null} [audioExportPattern] AudioExportSettings audioExportPattern + * @property {boolean|null} [enableAudioRedaction] AudioExportSettings enableAudioRedaction + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|null} [audioFormat] AudioExportSettings audioFormat + * @property {boolean|null} [storeTtsAudio] AudioExportSettings storeTtsAudio + */ + + /** + * Constructs a new AudioExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @classdesc Represents an AudioExportSettings. + * @implements IAudioExportSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings=} [properties] Properties to set + */ + function AudioExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioExportSettings gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.gcsBucket = ""; + + /** + * AudioExportSettings audioExportPattern. + * @member {string} audioExportPattern + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.audioExportPattern = ""; + + /** + * AudioExportSettings enableAudioRedaction. + * @member {boolean} enableAudioRedaction + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.enableAudioRedaction = false; + + /** + * AudioExportSettings audioFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat} audioFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.audioFormat = 0; + + /** + * AudioExportSettings storeTtsAudio. + * @member {boolean} storeTtsAudio + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.storeTtsAudio = false; + + /** + * Creates a new AudioExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings instance + */ + AudioExportSettings.create = function create(properties) { + return new AudioExportSettings(properties); + }; + + /** + * Encodes the specified AudioExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings} message AudioExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioExportSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); + if (message.audioExportPattern != null && Object.hasOwnProperty.call(message, "audioExportPattern")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audioExportPattern); + if (message.enableAudioRedaction != null && Object.hasOwnProperty.call(message, "enableAudioRedaction")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableAudioRedaction); + if (message.audioFormat != null && Object.hasOwnProperty.call(message, "audioFormat")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.audioFormat); + if (message.storeTtsAudio != null && Object.hasOwnProperty.call(message, "storeTtsAudio")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.storeTtsAudio); + return writer; + }; + + /** + * Encodes the specified AudioExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings} message AudioExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioExportSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsBucket = reader.string(); + break; + } + case 2: { + message.audioExportPattern = reader.string(); + break; + } + case 3: { + message.enableAudioRedaction = reader.bool(); + break; + } + case 4: { + message.audioFormat = reader.int32(); + break; + } + case 6: { + message.storeTtsAudio = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioExportSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioExportSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.audioExportPattern != null && message.hasOwnProperty("audioExportPattern")) + if (!$util.isString(message.audioExportPattern)) + return "audioExportPattern: string expected"; + if (message.enableAudioRedaction != null && message.hasOwnProperty("enableAudioRedaction")) + if (typeof message.enableAudioRedaction !== "boolean") + return "enableAudioRedaction: boolean expected"; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) + switch (message.audioFormat) { + default: + return "audioFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.storeTtsAudio != null && message.hasOwnProperty("storeTtsAudio")) + if (typeof message.storeTtsAudio !== "boolean") + return "storeTtsAudio: boolean expected"; + return null; + }; + + /** + * Creates an AudioExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings + */ + AudioExportSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings(); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.audioExportPattern != null) + message.audioExportPattern = String(object.audioExportPattern); + if (object.enableAudioRedaction != null) + message.enableAudioRedaction = Boolean(object.enableAudioRedaction); + switch (object.audioFormat) { + default: + if (typeof object.audioFormat === "number") { + message.audioFormat = object.audioFormat; + break; + } + break; + case "AUDIO_FORMAT_UNSPECIFIED": + case 0: + message.audioFormat = 0; + break; + case "MULAW": + case 1: + message.audioFormat = 1; + break; + case "MP3": + case 2: + message.audioFormat = 2; + break; + case "OGG": + case 3: + message.audioFormat = 3; + break; + } + if (object.storeTtsAudio != null) + message.storeTtsAudio = Boolean(object.storeTtsAudio); + return message; + }; + + /** + * Creates a plain object from an AudioExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} message AudioExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsBucket = ""; + object.audioExportPattern = ""; + object.enableAudioRedaction = false; + object.audioFormat = options.enums === String ? "AUDIO_FORMAT_UNSPECIFIED" : 0; + object.storeTtsAudio = false; + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.audioExportPattern != null && message.hasOwnProperty("audioExportPattern")) + object.audioExportPattern = message.audioExportPattern; + if (message.enableAudioRedaction != null && message.hasOwnProperty("enableAudioRedaction")) + object.enableAudioRedaction = message.enableAudioRedaction; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) + object.audioFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat[message.audioFormat] === undefined ? message.audioFormat : $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat[message.audioFormat] : message.audioFormat; + if (message.storeTtsAudio != null && message.hasOwnProperty("storeTtsAudio")) + object.storeTtsAudio = message.storeTtsAudio; + return object; + }; + + /** + * Converts this AudioExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + * @returns {Object.} JSON object + */ + AudioExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioExportSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings"; + }; + + /** + * AudioFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat + * @enum {number} + * @property {number} AUDIO_FORMAT_UNSPECIFIED=0 AUDIO_FORMAT_UNSPECIFIED value + * @property {number} MULAW=1 MULAW value + * @property {number} MP3=2 MP3 value + * @property {number} OGG=3 OGG value + */ + AudioExportSettings.AudioFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULAW"] = 1; + values[valuesById[2] = "MP3"] = 2; + values[valuesById[3] = "OGG"] = 3; + return values; + })(); + + return AudioExportSettings; + })(); + + SecuritySettings.InsightsExportSettings = (function() { + + /** + * Properties of an InsightsExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @interface IInsightsExportSettings + * @property {boolean|null} [enableInsightsExport] InsightsExportSettings enableInsightsExport + */ + + /** + * Constructs a new InsightsExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @classdesc Represents an InsightsExportSettings. + * @implements IInsightsExportSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings=} [properties] Properties to set + */ + function InsightsExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsightsExportSettings enableInsightsExport. + * @member {boolean} enableInsightsExport + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @instance + */ + InsightsExportSettings.prototype.enableInsightsExport = false; + + /** + * Creates a new InsightsExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings} InsightsExportSettings instance + */ + InsightsExportSettings.create = function create(properties) { + return new InsightsExportSettings(properties); + }; + + /** + * Encodes the specified InsightsExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings} message InsightsExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightsExportSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableInsightsExport != null && Object.hasOwnProperty.call(message, "enableInsightsExport")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableInsightsExport); + return writer; + }; + + /** + * Encodes the specified InsightsExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings} message InsightsExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightsExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings} InsightsExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightsExportSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableInsightsExport = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InsightsExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings} InsightsExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightsExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsightsExportSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsightsExportSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableInsightsExport != null && message.hasOwnProperty("enableInsightsExport")) + if (typeof message.enableInsightsExport !== "boolean") + return "enableInsightsExport: boolean expected"; + return null; + }; + + /** + * Creates an InsightsExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings} InsightsExportSettings + */ + InsightsExportSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings(); + if (object.enableInsightsExport != null) + message.enableInsightsExport = Boolean(object.enableInsightsExport); + return message; + }; + + /** + * Creates a plain object from an InsightsExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings} message InsightsExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsightsExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableInsightsExport = false; + if (message.enableInsightsExport != null && message.hasOwnProperty("enableInsightsExport")) + object.enableInsightsExport = message.enableInsightsExport; + return object; + }; + + /** + * Converts this InsightsExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @instance + * @returns {Object.} JSON object + */ + InsightsExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsightsExportSettings + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsightsExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings"; + }; + + return InsightsExportSettings; + })(); + + return SecuritySettings; + })(); + + v3beta1.Tools = (function() { + + /** + * Constructs a new Tools service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Tools + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Tools(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Tools.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Tools; + + /** + * Creates new Tools service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Tools} RPC service. Useful where requests and/or responses are streamed. + */ + Tools.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|createTool}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef CreateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Tool} [response] Tool + */ + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest} request CreateToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.CreateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.createTool = function createTool(request, callback) { + return this.rpcCall(createTool, $root.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest, $root.google.cloud.dialogflow.cx.v3beta1.Tool, request, callback); + }, "name", { value: "CreateTool" }); + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest} request CreateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|listTools}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef ListToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListToolsResponse} [response] ListToolsResponse + */ + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsRequest} request ListToolsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.ListToolsCallback} callback Node-style callback called with the error, if any, and ListToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.listTools = function listTools(request, callback) { + return this.rpcCall(listTools, $root.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListToolsResponse, request, callback); + }, "name", { value: "ListTools" }); + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsRequest} request ListToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|exportTools}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef ExportToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportTools. + * @function exportTools + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest} request ExportToolsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.ExportToolsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.exportTools = function exportTools(request, callback) { + return this.rpcCall(exportTools, $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportTools" }); + + /** + * Calls ExportTools. + * @function exportTools + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest} request ExportToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|getTool}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef GetToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Tool} [response] Tool + */ + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolRequest} request GetToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.GetToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.getTool = function getTool(request, callback) { + return this.rpcCall(getTool, $root.google.cloud.dialogflow.cx.v3beta1.GetToolRequest, $root.google.cloud.dialogflow.cx.v3beta1.Tool, request, callback); + }, "name", { value: "GetTool" }); + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolRequest} request GetToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|updateTool}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef UpdateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Tool} [response] Tool + */ + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.UpdateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.updateTool = function updateTool(request, callback) { + return this.rpcCall(updateTool, $root.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest, $root.google.cloud.dialogflow.cx.v3beta1.Tool, request, callback); + }, "name", { value: "UpdateTool" }); + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|deleteTool}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef DeleteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.DeleteToolCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.deleteTool = function deleteTool(request, callback) { + return this.rpcCall(deleteTool, $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTool" }); + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|listToolVersions}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef ListToolVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse} [response] ListToolVersionsResponse + */ + + /** + * Calls ListToolVersions. + * @function listToolVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest} request ListToolVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.ListToolVersionsCallback} callback Node-style callback called with the error, if any, and ListToolVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.listToolVersions = function listToolVersions(request, callback) { + return this.rpcCall(listToolVersions, $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse, request, callback); + }, "name", { value: "ListToolVersions" }); + + /** + * Calls ListToolVersions. + * @function listToolVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest} request ListToolVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|createToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef CreateToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ToolVersion} [response] ToolVersion + */ + + /** + * Calls CreateToolVersion. + * @function createToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest} request CreateToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.CreateToolVersionCallback} callback Node-style callback called with the error, if any, and ToolVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.createToolVersion = function createToolVersion(request, callback) { + return this.rpcCall(createToolVersion, $root.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion, request, callback); + }, "name", { value: "CreateToolVersion" }); + + /** + * Calls CreateToolVersion. + * @function createToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest} request CreateToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|getToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef GetToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ToolVersion} [response] ToolVersion + */ + + /** + * Calls GetToolVersion. + * @function getToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest} request GetToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.GetToolVersionCallback} callback Node-style callback called with the error, if any, and ToolVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.getToolVersion = function getToolVersion(request, callback) { + return this.rpcCall(getToolVersion, $root.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion, request, callback); + }, "name", { value: "GetToolVersion" }); + + /** + * Calls GetToolVersion. + * @function getToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest} request GetToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|deleteToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef DeleteToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteToolVersion. + * @function deleteToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest} request DeleteToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.DeleteToolVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.deleteToolVersion = function deleteToolVersion(request, callback) { + return this.rpcCall(deleteToolVersion, $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteToolVersion" }); + + /** + * Calls DeleteToolVersion. + * @function deleteToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest} request DeleteToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Tools|restoreToolVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @typedef RestoreToolVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse} [response] RestoreToolVersionResponse + */ + + /** + * Calls RestoreToolVersion. + * @function restoreToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest} request RestoreToolVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Tools.RestoreToolVersionCallback} callback Node-style callback called with the error, if any, and RestoreToolVersionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tools.prototype.restoreToolVersion = function restoreToolVersion(request, callback) { + return this.rpcCall(restoreToolVersion, $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse, request, callback); + }, "name", { value: "RestoreToolVersion" }); + + /** + * Calls RestoreToolVersion. + * @function restoreToolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Tools + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest} request RestoreToolVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Tools; + })(); + + v3beta1.CreateToolRequest = (function() { + + /** + * Properties of a CreateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateToolRequest + * @property {string|null} [parent] CreateToolRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.ITool|null} [tool] CreateToolRequest tool + */ + + /** + * Constructs a new CreateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateToolRequest. + * @implements ICreateToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest=} [properties] Properties to set + */ + function CreateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.parent = ""; + + /** + * CreateToolRequest tool. + * @member {google.cloud.dialogflow.cx.v3beta1.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.tool = null; + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolRequest} CreateToolRequest instance + */ + CreateToolRequest.create = function create(properties) { + return new CreateToolRequest(properties); + }; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.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.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.encode(message.tool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + return null; + }; + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolRequest} CreateToolRequest + */ + CreateToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.fromObject(object.tool, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateToolRequest} message CreateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tool = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.toObject(message.tool, options); + return object; + }; + + /** + * Converts this CreateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateToolRequest"; + }; + + return CreateToolRequest; + })(); + + v3beta1.ListToolsRequest = (function() { + + /** + * Properties of a ListToolsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListToolsRequest + * @property {string|null} [parent] ListToolsRequest parent + * @property {number|null} [pageSize] ListToolsRequest pageSize + * @property {string|null} [pageToken] ListToolsRequest pageToken + */ + + /** + * Constructs a new ListToolsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListToolsRequest. + * @implements IListToolsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsRequest=} [properties] Properties to set + */ + function ListToolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.parent = ""; + + /** + * ListToolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageSize = 0; + + /** + * ListToolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsRequest} ListToolsRequest instance + */ + ListToolsRequest.create = function create(properties) { + return new ListToolsRequest(properties); + }; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsRequest} ListToolsRequest + */ + ListToolsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListToolsRequest} message ListToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListToolsRequest"; + }; + + return ListToolsRequest; + })(); + + v3beta1.ListToolsResponse = (function() { + + /** + * Properties of a ListToolsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListToolsResponse + * @property {Array.|null} [tools] ListToolsResponse tools + * @property {string|null} [nextPageToken] ListToolsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListToolsResponse. + * @implements IListToolsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsResponse=} [properties] Properties to set + */ + function ListToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.tools = $util.emptyArray; + + /** + * ListToolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsResponse} ListToolsResponse instance + */ + ListToolsResponse.create = function create(properties) { + return new ListToolsResponse(properties); + }; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.encode(message.tools[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 ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.dialogflow.cx.v3beta1.Tool.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.verify(message.tools[i], long + 1); + if (error) + return "tools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolsResponse} ListToolsResponse + */ + ListToolsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListToolsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.dialogflow.cx.v3beta1.Tool.fromObject(object.tools[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListToolsResponse} message ListToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.dialogflow.cx.v3beta1.Tool.toObject(message.tools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListToolsResponse"; + }; + + return ListToolsResponse; + })(); + + v3beta1.GetToolRequest = (function() { + + /** + * Properties of a GetToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetToolRequest + * @property {string|null} [name] GetToolRequest name + */ + + /** + * Constructs a new GetToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetToolRequest. + * @implements IGetToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolRequest=} [properties] Properties to set + */ + function GetToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @instance + */ + GetToolRequest.prototype.name = ""; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolRequest} GetToolRequest instance + */ + GetToolRequest.create = function create(properties) { + return new GetToolRequest(properties); + }; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.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 GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolRequest} GetToolRequest + */ + GetToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetToolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetToolRequest} message GetToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolRequest.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 GetToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetToolRequest"; + }; + + return GetToolRequest; + })(); + + v3beta1.ExportToolsRequest = (function() { + + /** + * Properties of an ExportToolsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportToolsRequest + * @property {string|null} [parent] ExportToolsRequest parent + * @property {Array.|null} [tools] ExportToolsRequest tools + * @property {string|null} [toolsUri] ExportToolsRequest toolsUri + * @property {boolean|null} [toolsContentInline] ExportToolsRequest toolsContentInline + * @property {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat|null} [dataFormat] ExportToolsRequest dataFormat + */ + + /** + * Constructs a new ExportToolsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportToolsRequest. + * @implements IExportToolsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest=} [properties] Properties to set + */ + function ExportToolsRequest(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportToolsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @instance + */ + ExportToolsRequest.prototype.parent = ""; + + /** + * ExportToolsRequest tools. + * @member {Array.} tools + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @instance + */ + ExportToolsRequest.prototype.tools = $util.emptyArray; + + /** + * ExportToolsRequest toolsUri. + * @member {string|null|undefined} toolsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @instance + */ + ExportToolsRequest.prototype.toolsUri = null; + + /** + * ExportToolsRequest toolsContentInline. + * @member {boolean|null|undefined} toolsContentInline + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @instance + */ + ExportToolsRequest.prototype.toolsContentInline = null; + + /** + * ExportToolsRequest dataFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat} dataFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @instance + */ + ExportToolsRequest.prototype.dataFormat = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportToolsRequest destination. + * @member {"toolsUri"|"toolsContentInline"|undefined} destination + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @instance + */ + Object.defineProperty(ExportToolsRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["toolsUri", "toolsContentInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest} ExportToolsRequest instance + */ + ExportToolsRequest.create = function create(properties) { + return new ExportToolsRequest(properties); + }; + + /** + * Encodes the specified ExportToolsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest} message ExportToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToolsRequest.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.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tools[i]); + if (message.toolsUri != null && Object.hasOwnProperty.call(message, "toolsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolsUri); + if (message.toolsContentInline != null && Object.hasOwnProperty.call(message, "toolsContentInline")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.toolsContentInline); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified ExportToolsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest} message ExportToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest} ExportToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToolsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push(reader.string()); + break; + } + case 3: { + message.toolsUri = reader.string(); + break; + } + case 4: { + message.toolsContentInline = reader.bool(); + break; + } + case 5: { + message.dataFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest} ExportToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportToolsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportToolsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) + if (!$util.isString(message.tools[i])) + return "tools: string[] expected"; + } + if (message.toolsUri != null && message.hasOwnProperty("toolsUri")) { + properties.destination = 1; + if (!$util.isString(message.toolsUri)) + return "toolsUri: string expected"; + } + if (message.toolsContentInline != null && message.hasOwnProperty("toolsContentInline")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (typeof message.toolsContentInline !== "boolean") + return "toolsContentInline: boolean expected"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExportToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest} ExportToolsRequest + */ + ExportToolsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) + message.tools[i] = String(object.tools[i]); + } + if (object.toolsUri != null) + message.toolsUri = String(object.toolsUri); + if (object.toolsContentInline != null) + message.toolsContentInline = Boolean(object.toolsContentInline); + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "BLOB": + case 1: + message.dataFormat = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExportToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest} message ExportToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportToolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (options.defaults) { + object.parent = ""; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = message.tools[j]; + } + if (message.toolsUri != null && message.hasOwnProperty("toolsUri")) { + object.toolsUri = message.toolsUri; + if (options.oneofs) + object.destination = "toolsUri"; + } + if (message.toolsContentInline != null && message.hasOwnProperty("toolsContentInline")) { + object.toolsContentInline = message.toolsContentInline; + if (options.oneofs) + object.destination = "toolsContentInline"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this ExportToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportToolsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest"; + }; + + /** + * DataFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} BLOB=1 BLOB value + */ + ExportToolsRequest.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOB"] = 1; + return values; + })(); + + return ExportToolsRequest; + })(); + + v3beta1.ExportToolsResponse = (function() { + + /** + * Properties of an ExportToolsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportToolsResponse + * @property {string|null} [toolsUri] ExportToolsResponse toolsUri + * @property {google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null} [toolsContent] ExportToolsResponse toolsContent + */ + + /** + * Constructs a new ExportToolsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportToolsResponse. + * @implements IExportToolsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse=} [properties] Properties to set + */ + function ExportToolsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportToolsResponse toolsUri. + * @member {string|null|undefined} toolsUri + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @instance + */ + ExportToolsResponse.prototype.toolsUri = null; + + /** + * ExportToolsResponse toolsContent. + * @member {google.cloud.dialogflow.cx.v3beta1.IInlineDestination|null|undefined} toolsContent + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @instance + */ + ExportToolsResponse.prototype.toolsContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportToolsResponse tools. + * @member {"toolsUri"|"toolsContent"|undefined} tools + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @instance + */ + Object.defineProperty(ExportToolsResponse.prototype, "tools", { + get: $util.oneOfGetter($oneOfFields = ["toolsUri", "toolsContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse} ExportToolsResponse instance + */ + ExportToolsResponse.create = function create(properties) { + return new ExportToolsResponse(properties); + }; + + /** + * Encodes the specified ExportToolsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse} message ExportToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolsUri != null && Object.hasOwnProperty.call(message, "toolsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolsUri); + if (message.toolsContent != null && Object.hasOwnProperty.call(message, "toolsContent")) + $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.encode(message.toolsContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportToolsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse} message ExportToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse} ExportToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToolsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolsUri = reader.string(); + break; + } + case 2: { + message.toolsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse} ExportToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportToolsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportToolsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.toolsUri != null && message.hasOwnProperty("toolsUri")) { + properties.tools = 1; + if (!$util.isString(message.toolsUri)) + return "toolsUri: string expected"; + } + if (message.toolsContent != null && message.hasOwnProperty("toolsContent")) { + if (properties.tools === 1) + return "tools: multiple values"; + properties.tools = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.verify(message.toolsContent, long + 1); + if (error) + return "toolsContent." + error; + } + } + return null; + }; + + /** + * Creates an ExportToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse} ExportToolsResponse + */ + ExportToolsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse(); + if (object.toolsUri != null) + message.toolsUri = String(object.toolsUri); + if (object.toolsContent != null) { + if (typeof object.toolsContent !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse.toolsContent: object expected"); + message.toolsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.fromObject(object.toolsContent, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExportToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse} message ExportToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.toolsUri != null && message.hasOwnProperty("toolsUri")) { + object.toolsUri = message.toolsUri; + if (options.oneofs) + object.tools = "toolsUri"; + } + if (message.toolsContent != null && message.hasOwnProperty("toolsContent")) { + object.toolsContent = $root.google.cloud.dialogflow.cx.v3beta1.InlineDestination.toObject(message.toolsContent, options); + if (options.oneofs) + object.tools = "toolsContent"; + } + return object; + }; + + /** + * Converts this ExportToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportToolsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse"; + }; + + return ExportToolsResponse; + })(); + + v3beta1.UpdateToolRequest = (function() { + + /** + * Properties of an UpdateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateToolRequest + * @property {google.cloud.dialogflow.cx.v3beta1.ITool|null} [tool] UpdateToolRequest tool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolRequest updateMask + */ + + /** + * Constructs a new UpdateToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateToolRequest. + * @implements IUpdateToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest=} [properties] Properties to set + */ + function UpdateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolRequest tool. + * @member {google.cloud.dialogflow.cx.v3beta1.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.tool = null; + + /** + * UpdateToolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest} UpdateToolRequest instance + */ + UpdateToolRequest.create = function create(properties) { + return new UpdateToolRequest(properties); + }; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.encode(message.tool, 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 UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest} UpdateToolRequest + */ + UpdateToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest(); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.fromObject(object.tool, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest} message UpdateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = null; + object.updateMask = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.toObject(message.tool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest"; + }; + + return UpdateToolRequest; + })(); + + v3beta1.DeleteToolRequest = (function() { + + /** + * Properties of a DeleteToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteToolRequest + * @property {string|null} [name] DeleteToolRequest name + * @property {boolean|null} [force] DeleteToolRequest force + */ + + /** + * Constructs a new DeleteToolRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteToolRequest. + * @implements IDeleteToolRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest=} [properties] Properties to set + */ + function DeleteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.name = ""; + + /** + * DeleteToolRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.force = false; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest} DeleteToolRequest instance + */ + DeleteToolRequest.create = function create(properties) { + return new DeleteToolRequest(properties); + }; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest} DeleteToolRequest + */ + DeleteToolRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest} message DeleteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest"; + }; + + return DeleteToolRequest; + })(); + + v3beta1.Tool = (function() { + + /** + * Properties of a Tool. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ITool + * @property {string|null} [name] Tool name + * @property {string|null} [displayName] Tool displayName + * @property {string|null} [description] Tool description + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null} [openApiSpec] Tool openApiSpec + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool|null} [dataStoreSpec] Tool dataStoreSpec + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool|null} [extensionSpec] Tool extensionSpec + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool|null} [functionSpec] Tool functionSpec + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool|null} [connectorSpec] Tool connectorSpec + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.ToolType|null} [toolType] Tool toolType + */ + + /** + * Constructs a new Tool. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Tool. + * @implements ITool + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ITool=} [properties] Properties to set + */ + function Tool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tool name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.name = ""; + + /** + * Tool displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.displayName = ""; + + /** + * Tool description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.description = ""; + + /** + * Tool openApiSpec. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null|undefined} openApiSpec + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.openApiSpec = null; + + /** + * Tool dataStoreSpec. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool|null|undefined} dataStoreSpec + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.dataStoreSpec = null; + + /** + * Tool extensionSpec. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool|null|undefined} extensionSpec + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.extensionSpec = null; + + /** + * Tool functionSpec. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool|null|undefined} functionSpec + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.functionSpec = null; + + /** + * Tool connectorSpec. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool|null|undefined} connectorSpec + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.connectorSpec = null; + + /** + * Tool toolType. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.ToolType} toolType + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Tool.prototype.toolType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Tool specification. + * @member {"openApiSpec"|"dataStoreSpec"|"extensionSpec"|"functionSpec"|"connectorSpec"|undefined} specification + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + */ + Object.defineProperty(Tool.prototype, "specification", { + get: $util.oneOfGetter($oneOfFields = ["openApiSpec", "dataStoreSpec", "extensionSpec", "functionSpec", "connectorSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Tool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool} Tool instance + */ + Tool.create = function create(properties) { + return new Tool(properties); + }; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.openApiSpec != null && Object.hasOwnProperty.call(message, "openApiSpec")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.encode(message.openApiSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dataStoreSpec != null && Object.hasOwnProperty.call(message, "dataStoreSpec")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.encode(message.dataStoreSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.extensionSpec != null && Object.hasOwnProperty.call(message, "extensionSpec")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.encode(message.extensionSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.toolType != null && Object.hasOwnProperty.call(message, "toolType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.toolType); + if (message.functionSpec != null && Object.hasOwnProperty.call(message, "functionSpec")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.encode(message.functionSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.connectorSpec != null && Object.hasOwnProperty.call(message, "connectorSpec")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.encode(message.connectorSpec, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.openApiSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.dataStoreSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.extensionSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.functionSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.connectorSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.toolType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.openApiSpec != null && message.hasOwnProperty("openApiSpec")) { + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.verify(message.openApiSpec, long + 1); + if (error) + return "openApiSpec." + error; + } + } + if (message.dataStoreSpec != null && message.hasOwnProperty("dataStoreSpec")) { + if (properties.specification === 1) + return "specification: multiple values"; + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.verify(message.dataStoreSpec, long + 1); + if (error) + return "dataStoreSpec." + error; + } + } + if (message.extensionSpec != null && message.hasOwnProperty("extensionSpec")) { + if (properties.specification === 1) + return "specification: multiple values"; + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.verify(message.extensionSpec, long + 1); + if (error) + return "extensionSpec." + error; + } + } + if (message.functionSpec != null && message.hasOwnProperty("functionSpec")) { + if (properties.specification === 1) + return "specification: multiple values"; + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.verify(message.functionSpec, long + 1); + if (error) + return "functionSpec." + error; + } + } + if (message.connectorSpec != null && message.hasOwnProperty("connectorSpec")) { + if (properties.specification === 1) + return "specification: multiple values"; + properties.specification = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.verify(message.connectorSpec, long + 1); + if (error) + return "connectorSpec." + error; + } + } + if (message.toolType != null && message.hasOwnProperty("toolType")) + switch (message.toolType) { + default: + return "toolType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool} Tool + */ + Tool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.openApiSpec != null) { + if (typeof object.openApiSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.openApiSpec: object expected"); + message.openApiSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.fromObject(object.openApiSpec, long + 1); + } + if (object.dataStoreSpec != null) { + if (typeof object.dataStoreSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.dataStoreSpec: object expected"); + message.dataStoreSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.fromObject(object.dataStoreSpec, long + 1); + } + if (object.extensionSpec != null) { + if (typeof object.extensionSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.extensionSpec: object expected"); + message.extensionSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.fromObject(object.extensionSpec, long + 1); + } + if (object.functionSpec != null) { + if (typeof object.functionSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.functionSpec: object expected"); + message.functionSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.fromObject(object.functionSpec, long + 1); + } + if (object.connectorSpec != null) { + if (typeof object.connectorSpec !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.connectorSpec: object expected"); + message.connectorSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.fromObject(object.connectorSpec, long + 1); + } + switch (object.toolType) { + default: + if (typeof object.toolType === "number") { + message.toolType = object.toolType; + break; + } + break; + case "TOOL_TYPE_UNSPECIFIED": + case 0: + message.toolType = 0; + break; + case "CUSTOMIZED_TOOL": + case 1: + message.toolType = 1; + break; + case "BUILTIN_TOOL": + case 2: + message.toolType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool} message Tool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.toolType = options.enums === String ? "TOOL_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.openApiSpec != null && message.hasOwnProperty("openApiSpec")) { + object.openApiSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.toObject(message.openApiSpec, options); + if (options.oneofs) + object.specification = "openApiSpec"; + } + if (message.dataStoreSpec != null && message.hasOwnProperty("dataStoreSpec")) { + object.dataStoreSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.toObject(message.dataStoreSpec, options); + if (options.oneofs) + object.specification = "dataStoreSpec"; + } + if (message.extensionSpec != null && message.hasOwnProperty("extensionSpec")) { + object.extensionSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.toObject(message.extensionSpec, options); + if (options.oneofs) + object.specification = "extensionSpec"; + } + if (message.toolType != null && message.hasOwnProperty("toolType")) + object.toolType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Tool.ToolType[message.toolType] === undefined ? message.toolType : $root.google.cloud.dialogflow.cx.v3beta1.Tool.ToolType[message.toolType] : message.toolType; + if (message.functionSpec != null && message.hasOwnProperty("functionSpec")) { + object.functionSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.toObject(message.functionSpec, options); + if (options.oneofs) + object.specification = "functionSpec"; + } + if (message.connectorSpec != null && message.hasOwnProperty("connectorSpec")) { + object.connectorSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.toObject(message.connectorSpec, options); + if (options.oneofs) + object.specification = "connectorSpec"; + } + return object; + }; + + /** + * Converts this Tool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @instance + * @returns {Object.} JSON object + */ + Tool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool"; + }; + + Tool.OpenApiTool = (function() { + + /** + * Properties of an OpenApiTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IOpenApiTool + * @property {string|null} [textSchema] OpenApiTool textSchema + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication|null} [authentication] OpenApiTool authentication + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig|null} [tlsConfig] OpenApiTool tlsConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiTool serviceDirectoryConfig + */ + + /** + * Constructs a new OpenApiTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents an OpenApiTool. + * @implements IOpenApiTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool=} [properties] Properties to set + */ + function OpenApiTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiTool textSchema. + * @member {string|null|undefined} textSchema + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.textSchema = null; + + /** + * OpenApiTool authentication. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication|null|undefined} authentication + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.authentication = null; + + /** + * OpenApiTool tlsConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig|null|undefined} tlsConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.tlsConfig = null; + + /** + * OpenApiTool serviceDirectoryConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @instance + */ + OpenApiTool.prototype.serviceDirectoryConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OpenApiTool schema. + * @member {"textSchema"|undefined} schema + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @instance + */ + Object.defineProperty(OpenApiTool.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["textSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool} OpenApiTool instance + */ + OpenApiTool.create = function create(properties) { + return new OpenApiTool(properties); + }; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSchema != null && Object.hasOwnProperty.call(message, "textSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textSchema); + if (message.authentication != null && Object.hasOwnProperty.call(message, "authentication")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.encode(message.authentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.encode(message.tlsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textSchema = reader.string(); + break; + } + case 2: { + message.authentication = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.tlsConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.serviceDirectoryConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.textSchema != null && message.hasOwnProperty("textSchema")) { + properties.schema = 1; + if (!$util.isString(message.textSchema)) + return "textSchema: string expected"; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.verify(message.authentication, long + 1); + if (error) + return "authentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.verify(message.tlsConfig, long + 1); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig, long + 1); + if (error) + return "serviceDirectoryConfig." + error; + } + return null; + }; + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool} OpenApiTool + */ + OpenApiTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool(); + if (object.textSchema != null) + message.textSchema = String(object.textSchema); + if (object.authentication != null) { + if (typeof object.authentication !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.authentication: object expected"); + message.authentication = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.fromObject(object.authentication, long + 1); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.fromObject(object.tlsConfig, long + 1); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool} message OpenApiTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.authentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + } + if (message.textSchema != null && message.hasOwnProperty("textSchema")) { + object.textSchema = message.textSchema; + if (options.oneofs) + object.schema = "textSchema"; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) + object.authentication = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.toObject(message.authentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + return object; + }; + + /** + * Converts this OpenApiTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @instance + * @returns {Object.} JSON object + */ + OpenApiTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool"; + }; + + return OpenApiTool; + })(); + + Tool.DataStoreTool = (function() { + + /** + * Properties of a DataStoreTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IDataStoreTool + * @property {Array.|null} [dataStoreConnections] DataStoreTool dataStoreConnections + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt|null} [fallbackPrompt] DataStoreTool fallbackPrompt + */ + + /** + * Constructs a new DataStoreTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents a DataStoreTool. + * @implements IDataStoreTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool=} [properties] Properties to set + */ + function DataStoreTool(properties) { + this.dataStoreConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreTool dataStoreConnections. + * @member {Array.} dataStoreConnections + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @instance + */ + DataStoreTool.prototype.dataStoreConnections = $util.emptyArray; + + /** + * DataStoreTool fallbackPrompt. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt|null|undefined} fallbackPrompt + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @instance + */ + DataStoreTool.prototype.fallbackPrompt = null; + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool} DataStoreTool instance + */ + DataStoreTool.create = function create(properties) { + return new DataStoreTool(properties); + }; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStoreConnections != null && message.dataStoreConnections.length) + for (var i = 0; i < message.dataStoreConnections.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.encode(message.dataStoreConnections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fallbackPrompt != null && Object.hasOwnProperty.call(message, "fallbackPrompt")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.encode(message.fallbackPrompt, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStoreConnections && message.dataStoreConnections.length)) + message.dataStoreConnections = []; + message.dataStoreConnections.push($root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.fallbackPrompt = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataStoreConnections != null && message.hasOwnProperty("dataStoreConnections")) { + if (!Array.isArray(message.dataStoreConnections)) + return "dataStoreConnections: array expected"; + for (var i = 0; i < message.dataStoreConnections.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.verify(message.dataStoreConnections[i], long + 1); + if (error) + return "dataStoreConnections." + error; + } + } + if (message.fallbackPrompt != null && message.hasOwnProperty("fallbackPrompt")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.verify(message.fallbackPrompt, long + 1); + if (error) + return "fallbackPrompt." + error; + } + return null; + }; + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool} DataStoreTool + */ + DataStoreTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool(); + if (object.dataStoreConnections) { + if (!Array.isArray(object.dataStoreConnections)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.dataStoreConnections: array expected"); + message.dataStoreConnections = []; + for (var i = 0; i < object.dataStoreConnections.length; ++i) { + if (typeof object.dataStoreConnections[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.dataStoreConnections: object expected"); + message.dataStoreConnections[i] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.fromObject(object.dataStoreConnections[i], long + 1); + } + } + if (object.fallbackPrompt != null) { + if (typeof object.fallbackPrompt !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.fallbackPrompt: object expected"); + message.fallbackPrompt = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.fromObject(object.fallbackPrompt, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool} message DataStoreTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStoreConnections = []; + if (options.defaults) + object.fallbackPrompt = null; + if (message.dataStoreConnections && message.dataStoreConnections.length) { + object.dataStoreConnections = []; + for (var j = 0; j < message.dataStoreConnections.length; ++j) + object.dataStoreConnections[j] = $root.google.cloud.dialogflow.cx.v3beta1.DataStoreConnection.toObject(message.dataStoreConnections[j], options); + } + if (message.fallbackPrompt != null && message.hasOwnProperty("fallbackPrompt")) + object.fallbackPrompt = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.toObject(message.fallbackPrompt, options); + return object; + }; + + /** + * Converts this DataStoreTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @instance + * @returns {Object.} JSON object + */ + DataStoreTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool"; + }; + + DataStoreTool.FallbackPrompt = (function() { + + /** + * Properties of a FallbackPrompt. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @interface IFallbackPrompt + */ + + /** + * Constructs a new FallbackPrompt. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool + * @classdesc Represents a FallbackPrompt. + * @implements IFallbackPrompt + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt=} [properties] Properties to set + */ + function FallbackPrompt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new FallbackPrompt instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt instance + */ + FallbackPrompt.create = function create(properties) { + return new FallbackPrompt(properties); + }; + + /** + * Encodes the specified FallbackPrompt message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt} message FallbackPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackPrompt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified FallbackPrompt message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.IFallbackPrompt} message FallbackPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackPrompt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackPrompt.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FallbackPrompt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackPrompt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FallbackPrompt message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FallbackPrompt.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a FallbackPrompt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt} FallbackPrompt + */ + FallbackPrompt.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt(); + }; + + /** + * Creates a plain object from a FallbackPrompt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt} message FallbackPrompt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FallbackPrompt.toObject = function toObject() { + return {}; + }; + + /** + * Converts this FallbackPrompt to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @instance + * @returns {Object.} JSON object + */ + FallbackPrompt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FallbackPrompt + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FallbackPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.FallbackPrompt"; + }; + + return FallbackPrompt; + })(); + + return DataStoreTool; + })(); + + Tool.ExtensionTool = (function() { + + /** + * Properties of an ExtensionTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IExtensionTool + * @property {string|null} [name] ExtensionTool name + */ + + /** + * Constructs a new ExtensionTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents an ExtensionTool. + * @implements IExtensionTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool=} [properties] Properties to set + */ + function ExtensionTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionTool name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @instance + */ + ExtensionTool.prototype.name = ""; + + /** + * Creates a new ExtensionTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool} ExtensionTool instance + */ + ExtensionTool.create = function create(properties) { + return new ExtensionTool(properties); + }; + + /** + * Encodes the specified ExtensionTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool} message ExtensionTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionTool.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 ExtensionTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool} message ExtensionTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool} ExtensionTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool} ExtensionTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an ExtensionTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool} ExtensionTool + */ + ExtensionTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an ExtensionTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool} message ExtensionTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionTool.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 ExtensionTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @instance + * @returns {Object.} JSON object + */ + ExtensionTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.ExtensionTool"; + }; + + return ExtensionTool; + })(); + + Tool.FunctionTool = (function() { + + /** + * Properties of a FunctionTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IFunctionTool + * @property {google.protobuf.IStruct|null} [inputSchema] FunctionTool inputSchema + * @property {google.protobuf.IStruct|null} [outputSchema] FunctionTool outputSchema + */ + + /** + * Constructs a new FunctionTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents a FunctionTool. + * @implements IFunctionTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool=} [properties] Properties to set + */ + function FunctionTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionTool inputSchema. + * @member {google.protobuf.IStruct|null|undefined} inputSchema + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @instance + */ + FunctionTool.prototype.inputSchema = null; + + /** + * FunctionTool outputSchema. + * @member {google.protobuf.IStruct|null|undefined} outputSchema + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @instance + */ + FunctionTool.prototype.outputSchema = null; + + /** + * Creates a new FunctionTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool} FunctionTool instance + */ + FunctionTool.create = function create(properties) { + return new FunctionTool(properties); + }; + + /** + * Encodes the specified FunctionTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool} message FunctionTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.protobuf.Struct.encode(message.inputSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.protobuf.Struct.encode(message.outputSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunctionTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IFunctionTool} message FunctionTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool} FunctionTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputSchema = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.outputSchema = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool} FunctionTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.protobuf.Struct.verify(message.inputSchema, long + 1); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.protobuf.Struct.verify(message.outputSchema, long + 1); + if (error) + return "outputSchema." + error; + } + return null; + }; + + /** + * Creates a FunctionTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool} FunctionTool + */ + FunctionTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool(); + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.inputSchema: object expected"); + message.inputSchema = $root.google.protobuf.Struct.fromObject(object.inputSchema, long + 1); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool.outputSchema: object expected"); + message.outputSchema = $root.google.protobuf.Struct.fromObject(object.outputSchema, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FunctionTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool} message FunctionTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputSchema = null; + object.outputSchema = null; + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.protobuf.Struct.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.protobuf.Struct.toObject(message.outputSchema, options); + return object; + }; + + /** + * Converts this FunctionTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @instance + * @returns {Object.} JSON object + */ + FunctionTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.FunctionTool"; + }; + + return FunctionTool; + })(); + + Tool.ConnectorTool = (function() { + + /** + * Properties of a ConnectorTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IConnectorTool + * @property {string|null} [name] ConnectorTool name + * @property {Array.|null} [actions] ConnectorTool actions + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig|null} [endUserAuthConfig] ConnectorTool endUserAuthConfig + */ + + /** + * Constructs a new ConnectorTool. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents a ConnectorTool. + * @implements IConnectorTool + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool=} [properties] Properties to set + */ + function ConnectorTool(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorTool name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @instance + */ + ConnectorTool.prototype.name = ""; + + /** + * ConnectorTool actions. + * @member {Array.} actions + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @instance + */ + ConnectorTool.prototype.actions = $util.emptyArray; + + /** + * ConnectorTool endUserAuthConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig|null|undefined} endUserAuthConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @instance + */ + ConnectorTool.prototype.endUserAuthConfig = null; + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool} ConnectorTool instance + */ + ConnectorTool.create = function create(properties) { + return new ConnectorTool(properties); + }; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.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.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.encode(message.actions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endUserAuthConfig != null && Object.hasOwnProperty.call(message, "endUserAuthConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.encode(message.endUserAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.endUserAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorTool message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorTool.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.verify(message.actions[i], long + 1); + if (error) + return "actions." + error; + } + } + if (message.endUserAuthConfig != null && message.hasOwnProperty("endUserAuthConfig")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.verify(message.endUserAuthConfig, long + 1); + if (error) + return "endUserAuthConfig." + error; + } + return null; + }; + + /** + * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool} ConnectorTool + */ + ConnectorTool.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool(); + if (object.name != null) + message.name = String(object.name); + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.actions: object expected"); + message.actions[i] = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.fromObject(object.actions[i], long + 1); + } + } + if (object.endUserAuthConfig != null) { + if (typeof object.endUserAuthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.endUserAuthConfig: object expected"); + message.endUserAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.fromObject(object.endUserAuthConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool} message ConnectorTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.name = ""; + object.endUserAuthConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.toObject(message.actions[j], options); + } + if (message.endUserAuthConfig != null && message.hasOwnProperty("endUserAuthConfig")) + object.endUserAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.toObject(message.endUserAuthConfig, options); + return object; + }; + + /** + * Converts this ConnectorTool to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @instance + * @returns {Object.} JSON object + */ + ConnectorTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorTool + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool"; + }; + + ConnectorTool.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @interface IAction + * @property {string|null} [connectionActionId] Action connectionActionId + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation|null} [entityOperation] Action entityOperation + * @property {Array.|null} [inputFields] Action inputFields + * @property {Array.|null} [outputFields] Action outputFields + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction=} [properties] Properties to set + */ + function Action(properties) { + this.inputFields = []; + this.outputFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action connectionActionId. + * @member {string|null|undefined} connectionActionId + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @instance + */ + Action.prototype.connectionActionId = null; + + /** + * Action entityOperation. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation|null|undefined} entityOperation + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @instance + */ + Action.prototype.entityOperation = null; + + /** + * Action inputFields. + * @member {Array.} inputFields + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @instance + */ + Action.prototype.inputFields = $util.emptyArray; + + /** + * Action outputFields. + * @member {Array.} outputFields + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @instance + */ + Action.prototype.outputFields = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action actionSpec. + * @member {"connectionActionId"|"entityOperation"|undefined} actionSpec + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @instance + */ + Object.defineProperty(Action.prototype, "actionSpec", { + get: $util.oneOfGetter($oneOfFields = ["connectionActionId", "entityOperation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputFields != null && message.inputFields.length) + for (var i = 0; i < message.inputFields.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputFields[i]); + if (message.outputFields != null && message.outputFields.length) + for (var i = 0; i < message.outputFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputFields[i]); + if (message.connectionActionId != null && Object.hasOwnProperty.call(message, "connectionActionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionActionId); + if (message.entityOperation != null && Object.hasOwnProperty.call(message, "entityOperation")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.encode(message.entityOperation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.connectionActionId = reader.string(); + break; + } + case 5: { + message.entityOperation = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.inputFields && message.inputFields.length)) + message.inputFields = []; + message.inputFields.push(reader.string()); + break; + } + case 3: { + if (!(message.outputFields && message.outputFields.length)) + message.outputFields = []; + message.outputFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + properties.actionSpec = 1; + if (!$util.isString(message.connectionActionId)) + return "connectionActionId: string expected"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + if (properties.actionSpec === 1) + return "actionSpec: multiple values"; + properties.actionSpec = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.verify(message.entityOperation, long + 1); + if (error) + return "entityOperation." + error; + } + } + if (message.inputFields != null && message.hasOwnProperty("inputFields")) { + if (!Array.isArray(message.inputFields)) + return "inputFields: array expected"; + for (var i = 0; i < message.inputFields.length; ++i) + if (!$util.isString(message.inputFields[i])) + return "inputFields: string[] expected"; + } + if (message.outputFields != null && message.hasOwnProperty("outputFields")) { + if (!Array.isArray(message.outputFields)) + return "outputFields: array expected"; + for (var i = 0; i < message.outputFields.length; ++i) + if (!$util.isString(message.outputFields[i])) + return "outputFields: string[] expected"; + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action} Action + */ + Action.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action(); + if (object.connectionActionId != null) + message.connectionActionId = String(object.connectionActionId); + if (object.entityOperation != null) { + if (typeof object.entityOperation !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.entityOperation: object expected"); + message.entityOperation = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.fromObject(object.entityOperation, long + 1); + } + if (object.inputFields) { + if (!Array.isArray(object.inputFields)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.inputFields: array expected"); + message.inputFields = []; + for (var i = 0; i < object.inputFields.length; ++i) + message.inputFields[i] = String(object.inputFields[i]); + } + if (object.outputFields) { + if (!Array.isArray(object.outputFields)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.outputFields: array expected"); + message.outputFields = []; + for (var i = 0; i < object.outputFields.length; ++i) + message.outputFields[i] = String(object.outputFields[i]); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputFields = []; + object.outputFields = []; + } + if (message.inputFields && message.inputFields.length) { + object.inputFields = []; + for (var j = 0; j < message.inputFields.length; ++j) + object.inputFields[j] = message.inputFields[j]; + } + if (message.outputFields && message.outputFields.length) { + object.outputFields = []; + for (var j = 0; j < message.outputFields.length; ++j) + object.outputFields[j] = message.outputFields[j]; + } + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + object.connectionActionId = message.connectionActionId; + if (options.oneofs) + object.actionSpec = "connectionActionId"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + object.entityOperation = $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.toObject(message.entityOperation, options); + if (options.oneofs) + object.actionSpec = "entityOperation"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action"; + }; + + Action.EntityOperation = (function() { + + /** + * Properties of an EntityOperation. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @interface IEntityOperation + * @property {string|null} [entityId] EntityOperation entityId + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType|null} [operation] EntityOperation operation + */ + + /** + * Constructs a new EntityOperation. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action + * @classdesc Represents an EntityOperation. + * @implements IEntityOperation + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation=} [properties] Properties to set + */ + function EntityOperation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityOperation entityId. + * @member {string} entityId + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.entityId = ""; + + /** + * EntityOperation operation. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType} operation + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.operation = 0; + + /** + * Creates a new EntityOperation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation} EntityOperation instance + */ + EntityOperation.create = function create(properties) { + return new EntityOperation(properties); + }; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operation); + return writer; + }; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.operation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityOperation message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityOperation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation} EntityOperation + */ + EntityOperation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation(); + if (object.entityId != null) + message.entityId = String(object.entityId); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "LIST": + case 1: + message.operation = 1; + break; + case "GET": + case 2: + message.operation = 2; + break; + case "CREATE": + case 3: + message.operation = 3; + break; + case "UPDATE": + case 4: + message.operation = 4; + break; + case "DELETE": + case 5: + message.operation = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation} message EntityOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.operation = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType[message.operation] === undefined ? message.operation : $root.google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType[message.operation] : message.operation; + return object; + }; + + /** + * Converts this EntityOperation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @instance + * @returns {Object.} JSON object + */ + EntityOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityOperation + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation"; + }; + + /** + * OperationType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Tool.ConnectorTool.Action.EntityOperation.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} LIST=1 LIST value + * @property {number} GET=2 GET value + * @property {number} CREATE=3 CREATE value + * @property {number} UPDATE=4 UPDATE value + * @property {number} DELETE=5 DELETE value + */ + EntityOperation.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "CREATE"] = 3; + values[valuesById[4] = "UPDATE"] = 4; + values[valuesById[5] = "DELETE"] = 5; + return values; + })(); + + return EntityOperation; + })(); + + return Action; + })(); + + return ConnectorTool; + })(); + + Tool.Authentication = (function() { + + /** + * Properties of an Authentication. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IAuthentication + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig|null} [apiKeyConfig] Authentication apiKeyConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig|null} [oauthConfig] Authentication oauthConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig|null} [serviceAgentAuthConfig] Authentication serviceAgentAuthConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig|null} [bearerTokenConfig] Authentication bearerTokenConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] Authentication serviceAccountAuthConfig + */ + + /** + * Constructs a new Authentication. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents an Authentication. + * @implements IAuthentication + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication=} [properties] Properties to set + */ + function Authentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Authentication apiKeyConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @instance + */ + Authentication.prototype.apiKeyConfig = null; + + /** + * Authentication oauthConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig|null|undefined} oauthConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @instance + */ + Authentication.prototype.oauthConfig = null; + + /** + * Authentication serviceAgentAuthConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig|null|undefined} serviceAgentAuthConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @instance + */ + Authentication.prototype.serviceAgentAuthConfig = null; + + /** + * Authentication bearerTokenConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig|null|undefined} bearerTokenConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @instance + */ + Authentication.prototype.bearerTokenConfig = null; + + /** + * Authentication serviceAccountAuthConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @instance + */ + Authentication.prototype.serviceAccountAuthConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Authentication authConfig. + * @member {"apiKeyConfig"|"oauthConfig"|"serviceAgentAuthConfig"|"bearerTokenConfig"|"serviceAccountAuthConfig"|undefined} authConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @instance + */ + Object.defineProperty(Authentication.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig", "oauthConfig", "serviceAgentAuthConfig", "bearerTokenConfig", "serviceAccountAuthConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Authentication instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication} Authentication instance + */ + Authentication.create = function create(properties) { + return new Authentication(properties); + }; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceAgentAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAgentAuthConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.encode(message.serviceAgentAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bearerTokenConfig != null && Object.hasOwnProperty.call(message, "bearerTokenConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.encode(message.bearerTokenConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.apiKeyConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.serviceAgentAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.bearerTokenConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Authentication message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Authentication.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.verify(message.apiKeyConfig, long + 1); + if (error) + return "apiKeyConfig." + error; + } + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.verify(message.oauthConfig, long + 1); + if (error) + return "oauthConfig." + error; + } + } + if (message.serviceAgentAuthConfig != null && message.hasOwnProperty("serviceAgentAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.verify(message.serviceAgentAuthConfig, long + 1); + if (error) + return "serviceAgentAuthConfig." + error; + } + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.verify(message.bearerTokenConfig, long + 1); + if (error) + return "bearerTokenConfig." + error; + } + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig, long + 1); + if (error) + return "serviceAccountAuthConfig." + error; + } + } + return null; + }; + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication} Authentication + */ + Authentication.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication(); + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.fromObject(object.apiKeyConfig, long + 1); + } + if (object.oauthConfig != null) { + if (typeof object.oauthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.oauthConfig: object expected"); + message.oauthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.fromObject(object.oauthConfig, long + 1); + } + if (object.serviceAgentAuthConfig != null) { + if (typeof object.serviceAgentAuthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.serviceAgentAuthConfig: object expected"); + message.serviceAgentAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.fromObject(object.serviceAgentAuthConfig, long + 1); + } + if (object.bearerTokenConfig != null) { + if (typeof object.bearerTokenConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.bearerTokenConfig: object expected"); + message.bearerTokenConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.fromObject(object.bearerTokenConfig, long + 1); + } + if (object.serviceAccountAuthConfig != null) { + if (typeof object.serviceAccountAuthConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.serviceAccountAuthConfig: object expected"); + message.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication} message Authentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Authentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + object.apiKeyConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.toObject(message.apiKeyConfig, options); + if (options.oneofs) + object.authConfig = "apiKeyConfig"; + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + object.oauthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.toObject(message.oauthConfig, options); + if (options.oneofs) + object.authConfig = "oauthConfig"; + } + if (message.serviceAgentAuthConfig != null && message.hasOwnProperty("serviceAgentAuthConfig")) { + object.serviceAgentAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.toObject(message.serviceAgentAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAgentAuthConfig"; + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + object.bearerTokenConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.toObject(message.bearerTokenConfig, options); + if (options.oneofs) + object.authConfig = "bearerTokenConfig"; + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + object.serviceAccountAuthConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAccountAuthConfig"; + } + return object; + }; + + /** + * Converts this Authentication to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @instance + * @returns {Object.} JSON object + */ + Authentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Authentication + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Authentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.Authentication"; + }; + + Authentication.ApiKeyConfig = (function() { + + /** + * Properties of an ApiKeyConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @interface IApiKeyConfig + * @property {string|null} [keyName] ApiKeyConfig keyName + * @property {string|null} [apiKey] ApiKeyConfig apiKey + * @property {string|null} [secretVersionForApiKey] ApiKeyConfig secretVersionForApiKey + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation|null} [requestLocation] ApiKeyConfig requestLocation + */ + + /** + * Constructs a new ApiKeyConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @classdesc Represents an ApiKeyConfig. + * @implements IApiKeyConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig=} [properties] Properties to set + */ + function ApiKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiKeyConfig keyName. + * @member {string} keyName + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.keyName = ""; + + /** + * ApiKeyConfig apiKey. + * @member {string} apiKey + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.apiKey = ""; + + /** + * ApiKeyConfig secretVersionForApiKey. + * @member {string} secretVersionForApiKey + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.secretVersionForApiKey = ""; + + /** + * ApiKeyConfig requestLocation. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation} requestLocation + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.requestLocation = 0; + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig} ApiKeyConfig instance + */ + ApiKeyConfig.create = function create(properties) { + return new ApiKeyConfig(properties); + }; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.apiKey != null && Object.hasOwnProperty.call(message, "apiKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiKey); + if (message.requestLocation != null && Object.hasOwnProperty.call(message, "requestLocation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestLocation); + if (message.secretVersionForApiKey != null && Object.hasOwnProperty.call(message, "secretVersionForApiKey")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.secretVersionForApiKey); + return writer; + }; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.apiKey = reader.string(); + break; + } + case 4: { + message.secretVersionForApiKey = reader.string(); + break; + } + case 3: { + message.requestLocation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiKeyConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiKeyConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.apiKey != null && message.hasOwnProperty("apiKey")) + if (!$util.isString(message.apiKey)) + return "apiKey: string expected"; + if (message.secretVersionForApiKey != null && message.hasOwnProperty("secretVersionForApiKey")) + if (!$util.isString(message.secretVersionForApiKey)) + return "secretVersionForApiKey: string expected"; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + switch (message.requestLocation) { + default: + return "requestLocation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig} ApiKeyConfig + */ + ApiKeyConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.apiKey != null) + message.apiKey = String(object.apiKey); + if (object.secretVersionForApiKey != null) + message.secretVersionForApiKey = String(object.secretVersionForApiKey); + switch (object.requestLocation) { + default: + if (typeof object.requestLocation === "number") { + message.requestLocation = object.requestLocation; + break; + } + break; + case "REQUEST_LOCATION_UNSPECIFIED": + case 0: + message.requestLocation = 0; + break; + case "HEADER": + case 1: + message.requestLocation = 1; + break; + case "QUERY_STRING": + case 2: + message.requestLocation = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig} message ApiKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.apiKey = ""; + object.requestLocation = options.enums === String ? "REQUEST_LOCATION_UNSPECIFIED" : 0; + object.secretVersionForApiKey = ""; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.apiKey != null && message.hasOwnProperty("apiKey")) + object.apiKey = message.apiKey; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + object.requestLocation = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation[message.requestLocation] === undefined ? message.requestLocation : $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation[message.requestLocation] : message.requestLocation; + if (message.secretVersionForApiKey != null && message.hasOwnProperty("secretVersionForApiKey")) + object.secretVersionForApiKey = message.secretVersionForApiKey; + return object; + }; + + /** + * Converts this ApiKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @instance + * @returns {Object.} JSON object + */ + ApiKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiKeyConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ApiKeyConfig"; + }; + + return ApiKeyConfig; + })(); + + /** + * RequestLocation enum. + * @name google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.RequestLocation + * @enum {number} + * @property {number} REQUEST_LOCATION_UNSPECIFIED=0 REQUEST_LOCATION_UNSPECIFIED value + * @property {number} HEADER=1 HEADER value + * @property {number} QUERY_STRING=2 QUERY_STRING value + */ + Authentication.RequestLocation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_LOCATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HEADER"] = 1; + values[valuesById[2] = "QUERY_STRING"] = 2; + return values; + })(); + + Authentication.OAuthConfig = (function() { + + /** + * Properties of a OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @interface IOAuthConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType|null} [oauthGrantType] OAuthConfig oauthGrantType + * @property {string|null} [clientId] OAuthConfig clientId + * @property {string|null} [clientSecret] OAuthConfig clientSecret + * @property {string|null} [secretVersionForClientSecret] OAuthConfig secretVersionForClientSecret + * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint + * @property {Array.|null} [scopes] OAuthConfig scopes + */ + + /** + * Constructs a new OAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @classdesc Represents a OAuthConfig. + * @implements IOAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig=} [properties] Properties to set + */ + function OAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthConfig oauthGrantType. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType} oauthGrantType + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.oauthGrantType = 0; + + /** + * OAuthConfig clientId. + * @member {string} clientId + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientId = ""; + + /** + * OAuthConfig clientSecret. + * @member {string} clientSecret + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientSecret = ""; + + /** + * OAuthConfig secretVersionForClientSecret. + * @member {string} secretVersionForClientSecret + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.secretVersionForClientSecret = ""; + + /** + * OAuthConfig tokenEndpoint. + * @member {string} tokenEndpoint + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.tokenEndpoint = ""; + + /** + * OAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @instance + */ + OAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig} OAuthConfig instance + */ + OAuthConfig.create = function create(properties) { + return new OAuthConfig(properties); + }; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthGrantType != null && Object.hasOwnProperty.call(message, "oauthGrantType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.oauthGrantType); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.clientSecret != null && Object.hasOwnProperty.call(message, "clientSecret")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientSecret); + if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tokenEndpoint); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.scopes[i]); + if (message.secretVersionForClientSecret != null && Object.hasOwnProperty.call(message, "secretVersionForClientSecret")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.secretVersionForClientSecret); + return writer; + }; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthGrantType = reader.int32(); + break; + } + case 2: { + message.clientId = reader.string(); + break; + } + case 3: { + message.clientSecret = reader.string(); + break; + } + case 6: { + message.secretVersionForClientSecret = reader.string(); + break; + } + case 4: { + message.tokenEndpoint = reader.string(); + break; + } + case 5: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + switch (message.oauthGrantType) { + default: + return "oauthGrantType: enum value expected"; + case 0: + case 1: + break; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + if (!$util.isString(message.clientSecret)) + return "clientSecret: string expected"; + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + if (!$util.isString(message.secretVersionForClientSecret)) + return "secretVersionForClientSecret: string expected"; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + if (!$util.isString(message.tokenEndpoint)) + return "tokenEndpoint: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig} OAuthConfig + */ + OAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig(); + switch (object.oauthGrantType) { + default: + if (typeof object.oauthGrantType === "number") { + message.oauthGrantType = object.oauthGrantType; + break; + } + break; + case "OAUTH_GRANT_TYPE_UNSPECIFIED": + case 0: + message.oauthGrantType = 0; + break; + case "CLIENT_CREDENTIAL": + case 1: + message.oauthGrantType = 1; + break; + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecret != null) + message.clientSecret = String(object.clientSecret); + if (object.secretVersionForClientSecret != null) + message.secretVersionForClientSecret = String(object.secretVersionForClientSecret); + if (object.tokenEndpoint != null) + message.tokenEndpoint = String(object.tokenEndpoint); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig} message OAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.oauthGrantType = options.enums === String ? "OAUTH_GRANT_TYPE_UNSPECIFIED" : 0; + object.clientId = ""; + object.clientSecret = ""; + object.tokenEndpoint = ""; + object.secretVersionForClientSecret = ""; + } + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + object.oauthGrantType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType[message.oauthGrantType] === undefined ? message.oauthGrantType : $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType[message.oauthGrantType] : message.oauthGrantType; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + object.clientSecret = message.clientSecret; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + object.tokenEndpoint = message.tokenEndpoint; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.secretVersionForClientSecret != null && message.hasOwnProperty("secretVersionForClientSecret")) + object.secretVersionForClientSecret = message.secretVersionForClientSecret; + return object; + }; + + /** + * Converts this OAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @instance + * @returns {Object.} JSON object + */ + OAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig"; + }; + + /** + * OauthGrantType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.OAuthConfig.OauthGrantType + * @enum {number} + * @property {number} OAUTH_GRANT_TYPE_UNSPECIFIED=0 OAUTH_GRANT_TYPE_UNSPECIFIED value + * @property {number} CLIENT_CREDENTIAL=1 CLIENT_CREDENTIAL value + */ + OAuthConfig.OauthGrantType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OAUTH_GRANT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLIENT_CREDENTIAL"] = 1; + return values; + })(); + + return OAuthConfig; + })(); + + Authentication.ServiceAgentAuthConfig = (function() { + + /** + * Properties of a ServiceAgentAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @interface IServiceAgentAuthConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth|null} [serviceAgentAuth] ServiceAgentAuthConfig serviceAgentAuth + */ + + /** + * Constructs a new ServiceAgentAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @classdesc Represents a ServiceAgentAuthConfig. + * @implements IServiceAgentAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig=} [properties] Properties to set + */ + function ServiceAgentAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAgentAuthConfig serviceAgentAuth. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth} serviceAgentAuth + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @instance + */ + ServiceAgentAuthConfig.prototype.serviceAgentAuth = 0; + + /** + * Creates a new ServiceAgentAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig instance + */ + ServiceAgentAuthConfig.create = function create(properties) { + return new ServiceAgentAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAgentAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig} message ServiceAgentAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAgentAuth != null && Object.hasOwnProperty.call(message, "serviceAgentAuth")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.serviceAgentAuth); + return writer; + }; + + /** + * Encodes the specified ServiceAgentAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAgentAuthConfig} message ServiceAgentAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAgentAuth = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAgentAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAgentAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAgentAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + switch (message.serviceAgentAuth) { + default: + return "serviceAgentAuth: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ServiceAgentAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig} ServiceAgentAuthConfig + */ + ServiceAgentAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig(); + switch (object.serviceAgentAuth) { + default: + if (typeof object.serviceAgentAuth === "number") { + message.serviceAgentAuth = object.serviceAgentAuth; + break; + } + break; + case "SERVICE_AGENT_AUTH_UNSPECIFIED": + case 0: + message.serviceAgentAuth = 0; + break; + case "ID_TOKEN": + case 1: + message.serviceAgentAuth = 1; + break; + case "ACCESS_TOKEN": + case 2: + message.serviceAgentAuth = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ServiceAgentAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig} message ServiceAgentAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAgentAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceAgentAuth = options.enums === String ? "SERVICE_AGENT_AUTH_UNSPECIFIED" : 0; + if (message.serviceAgentAuth != null && message.hasOwnProperty("serviceAgentAuth")) + object.serviceAgentAuth = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth[message.serviceAgentAuth] === undefined ? message.serviceAgentAuth : $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth[message.serviceAgentAuth] : message.serviceAgentAuth; + return object; + }; + + /** + * Converts this ServiceAgentAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAgentAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAgentAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAgentAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig"; + }; + + /** + * ServiceAgentAuth enum. + * @name google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth + * @enum {number} + * @property {number} SERVICE_AGENT_AUTH_UNSPECIFIED=0 SERVICE_AGENT_AUTH_UNSPECIFIED value + * @property {number} ID_TOKEN=1 ID_TOKEN value + * @property {number} ACCESS_TOKEN=2 ACCESS_TOKEN value + */ + ServiceAgentAuthConfig.ServiceAgentAuth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_AGENT_AUTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "ID_TOKEN"] = 1; + values[valuesById[2] = "ACCESS_TOKEN"] = 2; + return values; + })(); + + return ServiceAgentAuthConfig; + })(); + + Authentication.BearerTokenConfig = (function() { + + /** + * Properties of a BearerTokenConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @interface IBearerTokenConfig + * @property {string|null} [token] BearerTokenConfig token + * @property {string|null} [secretVersionForToken] BearerTokenConfig secretVersionForToken + */ + + /** + * Constructs a new BearerTokenConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @classdesc Represents a BearerTokenConfig. + * @implements IBearerTokenConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig=} [properties] Properties to set + */ + function BearerTokenConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BearerTokenConfig token. + * @member {string} token + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @instance + */ + BearerTokenConfig.prototype.token = ""; + + /** + * BearerTokenConfig secretVersionForToken. + * @member {string} secretVersionForToken + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @instance + */ + BearerTokenConfig.prototype.secretVersionForToken = ""; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig} BearerTokenConfig instance + */ + BearerTokenConfig.create = function create(properties) { + return new BearerTokenConfig(properties); + }; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.secretVersionForToken != null && Object.hasOwnProperty.call(message, "secretVersionForToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretVersionForToken); + return writer; + }; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + case 2: { + message.secretVersionForToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BearerTokenConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BearerTokenConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.secretVersionForToken != null && message.hasOwnProperty("secretVersionForToken")) + if (!$util.isString(message.secretVersionForToken)) + return "secretVersionForToken: string expected"; + return null; + }; + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig} BearerTokenConfig + */ + BearerTokenConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig(); + if (object.token != null) + message.token = String(object.token); + if (object.secretVersionForToken != null) + message.secretVersionForToken = String(object.secretVersionForToken); + return message; + }; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig} message BearerTokenConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BearerTokenConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.token = ""; + object.secretVersionForToken = ""; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.secretVersionForToken != null && message.hasOwnProperty("secretVersionForToken")) + object.secretVersionForToken = message.secretVersionForToken; + return object; + }; + + /** + * Converts this BearerTokenConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @instance + * @returns {Object.} JSON object + */ + BearerTokenConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BearerTokenConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BearerTokenConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.BearerTokenConfig"; + }; + + return BearerTokenConfig; + })(); + + Authentication.ServiceAccountAuthConfig = (function() { + + /** + * Properties of a ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @interface IServiceAccountAuthConfig + * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount + */ + + /** + * Constructs a new ServiceAccountAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication + * @classdesc Represents a ServiceAccountAuthConfig. + * @implements IServiceAccountAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig=} [properties] Properties to set + */ + function ServiceAccountAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountAuthConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.serviceAccount = ""; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance + */ + ServiceAccountAuthConfig.create = function create(properties) { + return new ServiceAccountAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig} ServiceAccountAuthConfig + */ + ServiceAccountAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig} message ServiceAccountAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceAccount = ""; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.Authentication.ServiceAccountAuthConfig"; + }; + + return ServiceAccountAuthConfig; + })(); + + return Authentication; + })(); + + Tool.TLSConfig = (function() { + + /** + * Properties of a TLSConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface ITLSConfig + * @property {Array.|null} [caCerts] TLSConfig caCerts + */ + + /** + * Constructs a new TLSConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents a TLSConfig. + * @implements ITLSConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig=} [properties] Properties to set + */ + function TLSConfig(properties) { + this.caCerts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TLSConfig caCerts. + * @member {Array.} caCerts + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @instance + */ + TLSConfig.prototype.caCerts = $util.emptyArray; + + /** + * Creates a new TLSConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig} TLSConfig instance + */ + TLSConfig.create = function create(properties) { + return new TLSConfig(properties); + }; + + /** + * Encodes the specified TLSConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig} message TLSConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TLSConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCerts != null && message.caCerts.length) + for (var i = 0; i < message.caCerts.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TLSConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ITLSConfig} message TLSConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TLSConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TLSConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig} TLSConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TLSConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caCerts && message.caCerts.length)) + message.caCerts = []; + message.caCerts.push($root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TLSConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig} TLSConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TLSConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TLSConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TLSConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (!Array.isArray(message.caCerts)) + return "caCerts: array expected"; + for (var i = 0; i < message.caCerts.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.verify(message.caCerts[i], long + 1); + if (error) + return "caCerts." + error; + } + } + return null; + }; + + /** + * Creates a TLSConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig} TLSConfig + */ + TLSConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig(); + if (object.caCerts) { + if (!Array.isArray(object.caCerts)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.caCerts: array expected"); + message.caCerts = []; + for (var i = 0; i < object.caCerts.length; ++i) { + if (typeof object.caCerts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.caCerts: object expected"); + message.caCerts[i] = $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.fromObject(object.caCerts[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TLSConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig} message TLSConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TLSConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caCerts = []; + if (message.caCerts && message.caCerts.length) { + object.caCerts = []; + for (var j = 0; j < message.caCerts.length; ++j) + object.caCerts[j] = $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.toObject(message.caCerts[j], options); + } + return object; + }; + + /** + * Converts this TLSConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @instance + * @returns {Object.} JSON object + */ + TLSConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TLSConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TLSConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig"; + }; + + TLSConfig.CACert = (function() { + + /** + * Properties of a CACert. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @interface ICACert + * @property {string|null} [displayName] CACert displayName + * @property {Uint8Array|null} [cert] CACert cert + */ + + /** + * Constructs a new CACert. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig + * @classdesc Represents a CACert. + * @implements ICACert + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert=} [properties] Properties to set + */ + function CACert(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CACert displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @instance + */ + CACert.prototype.displayName = ""; + + /** + * CACert cert. + * @member {Uint8Array} cert + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @instance + */ + CACert.prototype.cert = $util.newBuffer([]); + + /** + * Creates a new CACert instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert} CACert instance + */ + CACert.create = function create(properties) { + return new CACert(properties); + }; + + /** + * Encodes the specified CACert message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert} message CACert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CACert.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cert); + return writer; + }; + + /** + * Encodes the specified CACert message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.ICACert} message CACert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CACert.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CACert message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert} CACert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CACert.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.cert = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CACert message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert} CACert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CACert.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CACert message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CACert.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cert != null && message.hasOwnProperty("cert")) + if (!(message.cert && typeof message.cert.length === "number" || $util.isString(message.cert))) + return "cert: buffer expected"; + return null; + }; + + /** + * Creates a CACert message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert} CACert + */ + CACert.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cert != null) + if (typeof object.cert === "string") + $util.base64.decode(object.cert, message.cert = $util.newBuffer($util.base64.length(object.cert)), 0); + else if (object.cert.length >= 0) + message.cert = object.cert; + return message; + }; + + /** + * Creates a plain object from a CACert message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert} message CACert + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CACert.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + if (options.bytes === String) + object.cert = ""; + else { + object.cert = []; + if (options.bytes !== Array) + object.cert = $util.newBuffer(object.cert); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cert != null && message.hasOwnProperty("cert")) + object.cert = options.bytes === String ? $util.base64.encode(message.cert, 0, message.cert.length) : options.bytes === Array ? Array.prototype.slice.call(message.cert) : message.cert; + return object; + }; + + /** + * Converts this CACert to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @instance + * @returns {Object.} JSON object + */ + CACert.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CACert + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CACert.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.TLSConfig.CACert"; + }; + + return CACert; + })(); + + return TLSConfig; + })(); + + Tool.ServiceDirectoryConfig = (function() { + + /** + * Properties of a ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IServiceDirectoryConfig + * @property {string|null} [service] ServiceDirectoryConfig service + */ + + /** + * Constructs a new ServiceDirectoryConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents a ServiceDirectoryConfig. + * @implements IServiceDirectoryConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig=} [properties] Properties to set + */ + function ServiceDirectoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDirectoryConfig service. + * @member {string} service + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.service = ""; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig instance + */ + ServiceDirectoryConfig.create = function create(properties) { + return new ServiceDirectoryConfig(properties); + }; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDirectoryConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDirectoryConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig} ServiceDirectoryConfig + */ + ServiceDirectoryConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig} message ServiceDirectoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDirectoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceDirectoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.ServiceDirectoryConfig"; + }; + + return ServiceDirectoryConfig; + })(); + + Tool.EndUserAuthConfig = (function() { + + /** + * Properties of an EndUserAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @interface IEndUserAuthConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig|null} [oauth2AuthCodeConfig] EndUserAuthConfig oauth2AuthCodeConfig + * @property {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig|null} [oauth2JwtBearerConfig] EndUserAuthConfig oauth2JwtBearerConfig + */ + + /** + * Constructs a new EndUserAuthConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool + * @classdesc Represents an EndUserAuthConfig. + * @implements IEndUserAuthConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig=} [properties] Properties to set + */ + function EndUserAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndUserAuthConfig oauth2AuthCodeConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig|null|undefined} oauth2AuthCodeConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2AuthCodeConfig = null; + + /** + * EndUserAuthConfig oauth2JwtBearerConfig. + * @member {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig|null|undefined} oauth2JwtBearerConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2JwtBearerConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EndUserAuthConfig endUserAuthConfig. + * @member {"oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"|undefined} endUserAuthConfig + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @instance + */ + Object.defineProperty(EndUserAuthConfig.prototype, "endUserAuthConfig", { + get: $util.oneOfGetter($oneOfFields = ["oauth2AuthCodeConfig", "oauth2JwtBearerConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig} EndUserAuthConfig instance + */ + EndUserAuthConfig.create = function create(properties) { + return new EndUserAuthConfig(properties); + }; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauth2AuthCodeConfig != null && Object.hasOwnProperty.call(message, "oauth2AuthCodeConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.encode(message.oauth2AuthCodeConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oauth2JwtBearerConfig != null && Object.hasOwnProperty.call(message, "oauth2JwtBearerConfig")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.encode(message.oauth2JwtBearerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.oauth2AuthCodeConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.oauth2JwtBearerConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndUserAuthConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndUserAuthConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + properties.endUserAuthConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.verify(message.oauth2AuthCodeConfig, long + 1); + if (error) + return "oauth2AuthCodeConfig." + error; + } + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + if (properties.endUserAuthConfig === 1) + return "endUserAuthConfig: multiple values"; + properties.endUserAuthConfig = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.verify(message.oauth2JwtBearerConfig, long + 1); + if (error) + return "oauth2JwtBearerConfig." + error; + } + } + return null; + }; + + /** + * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig} EndUserAuthConfig + */ + EndUserAuthConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig(); + if (object.oauth2AuthCodeConfig != null) { + if (typeof object.oauth2AuthCodeConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.oauth2AuthCodeConfig: object expected"); + message.oauth2AuthCodeConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.fromObject(object.oauth2AuthCodeConfig, long + 1); + } + if (object.oauth2JwtBearerConfig != null) { + if (typeof object.oauth2JwtBearerConfig !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.oauth2JwtBearerConfig: object expected"); + message.oauth2JwtBearerConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.fromObject(object.oauth2JwtBearerConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig} message EndUserAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndUserAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + object.oauth2AuthCodeConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.toObject(message.oauth2AuthCodeConfig, options); + if (options.oneofs) + object.endUserAuthConfig = "oauth2AuthCodeConfig"; + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + object.oauth2JwtBearerConfig = $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.toObject(message.oauth2JwtBearerConfig, options); + if (options.oneofs) + object.endUserAuthConfig = "oauth2JwtBearerConfig"; + } + return object; + }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @instance + * @returns {Object.} JSON object + */ + EndUserAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndUserAuthConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndUserAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig"; + }; + + EndUserAuthConfig.Oauth2AuthCodeConfig = (function() { + + /** + * Properties of an Oauth2AuthCodeConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @interface IOauth2AuthCodeConfig + * @property {string|null} [oauthToken] Oauth2AuthCodeConfig oauthToken + */ + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @classdesc Represents an Oauth2AuthCodeConfig. + * @implements IOauth2AuthCodeConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + */ + function Oauth2AuthCodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2AuthCodeConfig oauthToken. + * @member {string} oauthToken + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + */ + Oauth2AuthCodeConfig.prototype.oauthToken = ""; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig instance + */ + Oauth2AuthCodeConfig.create = function create(properties) { + return new Oauth2AuthCodeConfig(properties); + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.oauthToken); + return writer; + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2AuthCodeConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2AuthCodeConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + if (!$util.isString(message.oauthToken)) + return "oauthToken: string expected"; + return null; + }; + + /** + * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + */ + Oauth2AuthCodeConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig(); + if (object.oauthToken != null) + message.oauthToken = String(object.oauthToken); + return message; + }; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig} message Oauth2AuthCodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2AuthCodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.oauthToken = ""; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + object.oauthToken = message.oauthToken; + return object; + }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2AuthCodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2AuthCodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2AuthCodeConfig"; + }; + + return Oauth2AuthCodeConfig; + })(); + + EndUserAuthConfig.Oauth2JwtBearerConfig = (function() { + + /** + * Properties of an Oauth2JwtBearerConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @interface IOauth2JwtBearerConfig + * @property {string|null} [issuer] Oauth2JwtBearerConfig issuer + * @property {string|null} [subject] Oauth2JwtBearerConfig subject + * @property {string|null} [clientKey] Oauth2JwtBearerConfig clientKey + */ + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig + * @classdesc Represents an Oauth2JwtBearerConfig. + * @implements IOauth2JwtBearerConfig + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + */ + function Oauth2JwtBearerConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2JwtBearerConfig issuer. + * @member {string} issuer + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.issuer = ""; + + /** + * Oauth2JwtBearerConfig subject. + * @member {string} subject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.subject = ""; + + /** + * Oauth2JwtBearerConfig clientKey. + * @member {string} clientKey + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.clientKey = ""; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig instance + */ + Oauth2JwtBearerConfig.create = function create(properties) { + return new Oauth2JwtBearerConfig(properties); + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientKey); + return writer; + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.issuer = reader.string(); + break; + } + case 2: { + message.subject = reader.string(); + break; + } + case 3: { + message.clientKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2JwtBearerConfig message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2JwtBearerConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (!$util.isString(message.clientKey)) + return "clientKey: string expected"; + return null; + }; + + /** + * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + */ + Oauth2JwtBearerConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig(); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.subject != null) + message.subject = String(object.subject); + if (object.clientKey != null) + message.clientKey = String(object.clientKey); + return message; + }; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig} message Oauth2JwtBearerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2JwtBearerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.issuer = ""; + object.subject = ""; + object.clientKey = ""; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = message.clientKey; + return object; + }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2JwtBearerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2JwtBearerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Tool.EndUserAuthConfig.Oauth2JwtBearerConfig"; + }; + + return Oauth2JwtBearerConfig; + })(); + + return EndUserAuthConfig; + })(); + + /** + * ToolType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Tool.ToolType + * @enum {number} + * @property {number} TOOL_TYPE_UNSPECIFIED=0 TOOL_TYPE_UNSPECIFIED value + * @property {number} CUSTOMIZED_TOOL=1 CUSTOMIZED_TOOL value + * @property {number} BUILTIN_TOOL=2 BUILTIN_TOOL value + */ + Tool.ToolType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOOL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUSTOMIZED_TOOL"] = 1; + values[valuesById[2] = "BUILTIN_TOOL"] = 2; + return values; + })(); + + return Tool; + })(); + + v3beta1.ListToolVersionsRequest = (function() { + + /** + * Properties of a ListToolVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListToolVersionsRequest + * @property {string|null} [parent] ListToolVersionsRequest parent + * @property {number|null} [pageSize] ListToolVersionsRequest pageSize + * @property {string|null} [pageToken] ListToolVersionsRequest pageToken + */ + + /** + * Constructs a new ListToolVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListToolVersionsRequest. + * @implements IListToolVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest=} [properties] Properties to set + */ + function ListToolVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @instance + */ + ListToolVersionsRequest.prototype.parent = ""; + + /** + * ListToolVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @instance + */ + ListToolVersionsRequest.prototype.pageSize = 0; + + /** + * ListToolVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @instance + */ + ListToolVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListToolVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest} ListToolVersionsRequest instance + */ + ListToolVersionsRequest.create = function create(properties) { + return new ListToolVersionsRequest(properties); + }; + + /** + * Encodes the specified ListToolVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest} message ListToolVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListToolVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest} message ListToolVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest} ListToolVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest} ListToolVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListToolVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest} ListToolVersionsRequest + */ + ListToolVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListToolVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest} message ListToolVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListToolVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest"; + }; + + return ListToolVersionsRequest; + })(); + + v3beta1.ListToolVersionsResponse = (function() { + + /** + * Properties of a ListToolVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListToolVersionsResponse + * @property {Array.|null} [toolVersions] ListToolVersionsResponse toolVersions + * @property {string|null} [nextPageToken] ListToolVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListToolVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListToolVersionsResponse. + * @implements IListToolVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse=} [properties] Properties to set + */ + function ListToolVersionsResponse(properties) { + this.toolVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolVersionsResponse toolVersions. + * @member {Array.} toolVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @instance + */ + ListToolVersionsResponse.prototype.toolVersions = $util.emptyArray; + + /** + * ListToolVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @instance + */ + ListToolVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse} ListToolVersionsResponse instance + */ + ListToolVersionsResponse.create = function create(properties) { + return new ListToolVersionsResponse(properties); + }; + + /** + * Encodes the specified ListToolVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse} message ListToolVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolVersions != null && message.toolVersions.length) + for (var i = 0; i < message.toolVersions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.encode(message.toolVersions[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 ListToolVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse} message ListToolVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse} ListToolVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolVersions && message.toolVersions.length)) + message.toolVersions = []; + message.toolVersions.push($root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse} ListToolVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.toolVersions != null && message.hasOwnProperty("toolVersions")) { + if (!Array.isArray(message.toolVersions)) + return "toolVersions: array expected"; + for (var i = 0; i < message.toolVersions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.verify(message.toolVersions[i], long + 1); + if (error) + return "toolVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse} ListToolVersionsResponse + */ + ListToolVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse(); + if (object.toolVersions) { + if (!Array.isArray(object.toolVersions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse.toolVersions: array expected"); + message.toolVersions = []; + for (var i = 0; i < object.toolVersions.length; ++i) { + if (typeof object.toolVersions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse.toolVersions: object expected"); + message.toolVersions[i] = $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.fromObject(object.toolVersions[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse} message ListToolVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.toolVersions && message.toolVersions.length) { + object.toolVersions = []; + for (var j = 0; j < message.toolVersions.length; ++j) + object.toolVersions[j] = $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.toObject(message.toolVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListToolVersionsResponse"; + }; + + return ListToolVersionsResponse; + })(); + + v3beta1.CreateToolVersionRequest = (function() { + + /** + * Properties of a CreateToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateToolVersionRequest + * @property {string|null} [parent] CreateToolVersionRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IToolVersion|null} [toolVersion] CreateToolVersionRequest toolVersion + */ + + /** + * Constructs a new CreateToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateToolVersionRequest. + * @implements ICreateToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest=} [properties] Properties to set + */ + function CreateToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @instance + */ + CreateToolVersionRequest.prototype.parent = ""; + + /** + * CreateToolVersionRequest toolVersion. + * @member {google.cloud.dialogflow.cx.v3beta1.IToolVersion|null|undefined} toolVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @instance + */ + CreateToolVersionRequest.prototype.toolVersion = null; + + /** + * Creates a new CreateToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest} CreateToolVersionRequest instance + */ + CreateToolVersionRequest.create = function create(properties) { + return new CreateToolVersionRequest(properties); + }; + + /** + * Encodes the specified CreateToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest} message CreateToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolVersionRequest.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.toolVersion != null && Object.hasOwnProperty.call(message, "toolVersion")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.encode(message.toolVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest} message CreateToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest} CreateToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolVersion = $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest} CreateToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.toolVersion != null && message.hasOwnProperty("toolVersion")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.verify(message.toolVersion, long + 1); + if (error) + return "toolVersion." + error; + } + return null; + }; + + /** + * Creates a CreateToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest} CreateToolVersionRequest + */ + CreateToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolVersion != null) { + if (typeof object.toolVersion !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest.toolVersion: object expected"); + message.toolVersion = $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.fromObject(object.toolVersion, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest} message CreateToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolVersion != null && message.hasOwnProperty("toolVersion")) + object.toolVersion = $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion.toObject(message.toolVersion, options); + return object; + }; + + /** + * Converts this CreateToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest"; + }; + + return CreateToolVersionRequest; + })(); + + v3beta1.GetToolVersionRequest = (function() { + + /** + * Properties of a GetToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetToolVersionRequest + * @property {string|null} [name] GetToolVersionRequest name + */ + + /** + * Constructs a new GetToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetToolVersionRequest. + * @implements IGetToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest=} [properties] Properties to set + */ + function GetToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @instance + */ + GetToolVersionRequest.prototype.name = ""; + + /** + * Creates a new GetToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest} GetToolVersionRequest instance + */ + GetToolVersionRequest.create = function create(properties) { + return new GetToolVersionRequest(properties); + }; + + /** + * Encodes the specified GetToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest} message GetToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolVersionRequest.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 GetToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest} message GetToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest} GetToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest} GetToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest} GetToolVersionRequest + */ + GetToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest} message GetToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolVersionRequest.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 GetToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest"; + }; + + return GetToolVersionRequest; + })(); + + v3beta1.DeleteToolVersionRequest = (function() { + + /** + * Properties of a DeleteToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteToolVersionRequest + * @property {string|null} [name] DeleteToolVersionRequest name + * @property {boolean|null} [force] DeleteToolVersionRequest force + */ + + /** + * Constructs a new DeleteToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteToolVersionRequest. + * @implements IDeleteToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest=} [properties] Properties to set + */ + function DeleteToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @instance + */ + DeleteToolVersionRequest.prototype.name = ""; + + /** + * DeleteToolVersionRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @instance + */ + DeleteToolVersionRequest.prototype.force = false; + + /** + * Creates a new DeleteToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest} DeleteToolVersionRequest instance + */ + DeleteToolVersionRequest.create = function create(properties) { + return new DeleteToolVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest} message DeleteToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolVersionRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest} message DeleteToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest} DeleteToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest} DeleteToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest} DeleteToolVersionRequest + */ + DeleteToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest} message DeleteToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest"; + }; + + return DeleteToolVersionRequest; + })(); + + v3beta1.RestoreToolVersionRequest = (function() { + + /** + * Properties of a RestoreToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRestoreToolVersionRequest + * @property {string|null} [name] RestoreToolVersionRequest name + */ + + /** + * Constructs a new RestoreToolVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RestoreToolVersionRequest. + * @implements IRestoreToolVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest=} [properties] Properties to set + */ + function RestoreToolVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreToolVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @instance + */ + RestoreToolVersionRequest.prototype.name = ""; + + /** + * Creates a new RestoreToolVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest} RestoreToolVersionRequest instance + */ + RestoreToolVersionRequest.create = function create(properties) { + return new RestoreToolVersionRequest(properties); + }; + + /** + * Encodes the specified RestoreToolVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest} message RestoreToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionRequest.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 RestoreToolVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest} message RestoreToolVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest} RestoreToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreToolVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest} RestoreToolVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreToolVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreToolVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a RestoreToolVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest} RestoreToolVersionRequest + */ + RestoreToolVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestoreToolVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest} message RestoreToolVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreToolVersionRequest.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 RestoreToolVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreToolVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreToolVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreToolVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest"; + }; + + return RestoreToolVersionRequest; + })(); + + v3beta1.RestoreToolVersionResponse = (function() { + + /** + * Properties of a RestoreToolVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IRestoreToolVersionResponse + * @property {google.cloud.dialogflow.cx.v3beta1.ITool|null} [tool] RestoreToolVersionResponse tool + */ + + /** + * Constructs a new RestoreToolVersionResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a RestoreToolVersionResponse. + * @implements IRestoreToolVersionResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse=} [properties] Properties to set + */ + function RestoreToolVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreToolVersionResponse tool. + * @member {google.cloud.dialogflow.cx.v3beta1.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @instance + */ + RestoreToolVersionResponse.prototype.tool = null; + + /** + * Creates a new RestoreToolVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse} RestoreToolVersionResponse instance + */ + RestoreToolVersionResponse.create = function create(properties) { + return new RestoreToolVersionResponse(properties); + }; + + /** + * Encodes the specified RestoreToolVersionResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse} message RestoreToolVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.encode(message.tool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreToolVersionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse} message RestoreToolVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreToolVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse} RestoreToolVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreToolVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse} RestoreToolVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreToolVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreToolVersionResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreToolVersionResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + return null; + }; + + /** + * Creates a RestoreToolVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse} RestoreToolVersionResponse + */ + RestoreToolVersionResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse(); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.fromObject(object.tool, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RestoreToolVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse} message RestoreToolVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreToolVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tool = null; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.toObject(message.tool, options); + return object; + }; + + /** + * Converts this RestoreToolVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreToolVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreToolVersionResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreToolVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse"; + }; + + return RestoreToolVersionResponse; + })(); + + v3beta1.ToolVersion = (function() { + + /** + * Properties of a ToolVersion. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IToolVersion + * @property {string|null} [name] ToolVersion name + * @property {string|null} [displayName] ToolVersion displayName + * @property {google.cloud.dialogflow.cx.v3beta1.ITool|null} [tool] ToolVersion tool + * @property {google.protobuf.ITimestamp|null} [createTime] ToolVersion createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ToolVersion updateTime + */ + + /** + * Constructs a new ToolVersion. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ToolVersion. + * @implements IToolVersion + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IToolVersion=} [properties] Properties to set + */ + function ToolVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolVersion name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @instance + */ + ToolVersion.prototype.name = ""; + + /** + * ToolVersion displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @instance + */ + ToolVersion.prototype.displayName = ""; + + /** + * ToolVersion tool. + * @member {google.cloud.dialogflow.cx.v3beta1.ITool|null|undefined} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @instance + */ + ToolVersion.prototype.tool = null; + + /** + * ToolVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @instance + */ + ToolVersion.prototype.createTime = null; + + /** + * ToolVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @instance + */ + ToolVersion.prototype.updateTime = null; + + /** + * Creates a new ToolVersion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolVersion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolVersion} ToolVersion instance + */ + ToolVersion.create = function create(properties) { + return new ToolVersion(properties); + }; + + /** + * Encodes the specified ToolVersion message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolVersion} message ToolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolVersion.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.dialogflow.cx.v3beta1.Tool.encode(message.tool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolVersion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolVersion} message ToolVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolVersion} ToolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolVersion.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ToolVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolVersion} ToolVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolVersion message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolVersion.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Tool.verify(message.tool, long + 1); + if (error) + return "tool." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a ToolVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolVersion} ToolVersion + */ + ToolVersion.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolVersion.tool: object expected"); + message.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.fromObject(object.tool, long + 1); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ToolVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolVersion} message ToolVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.tool = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.dialogflow.cx.v3beta1.Tool.toObject(message.tool, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + 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); + return object; + }; + + /** + * Converts this ToolVersion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @instance + * @returns {Object.} JSON object + */ + ToolVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolVersion + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolVersion"; + }; + + return ToolVersion; + })(); + + v3beta1.ExportToolsMetadata = (function() { + + /** + * Properties of an ExportToolsMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IExportToolsMetadata + */ + + /** + * Constructs a new ExportToolsMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an ExportToolsMetadata. + * @implements IExportToolsMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata=} [properties] Properties to set + */ + function ExportToolsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportToolsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata} ExportToolsMetadata instance + */ + ExportToolsMetadata.create = function create(properties) { + return new ExportToolsMetadata(properties); + }; + + /** + * Encodes the specified ExportToolsMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata} message ExportToolsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToolsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportToolsMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata} message ExportToolsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToolsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportToolsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata} ExportToolsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToolsMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportToolsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata} ExportToolsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToolsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportToolsMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportToolsMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportToolsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata} ExportToolsMetadata + */ + ExportToolsMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata(); + }; + + /** + * Creates a plain object from an ExportToolsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata} message ExportToolsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportToolsMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportToolsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportToolsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportToolsMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportToolsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata"; + }; + + return ExportToolsMetadata; + })(); + + v3beta1.Versions = (function() { + + /** + * Constructs a new Versions service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Versions + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Versions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Versions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Versions; + + /** + * Creates new Versions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Versions} RPC service. Useful where requests and/or responses are streamed. + */ + Versions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|listVersions}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @typedef ListVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} [response] ListVersionsResponse + */ + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Versions.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.listVersions = function listVersions(request, callback) { + return this.rpcCall(listVersions, $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse, request, callback); + }, "name", { value: "ListVersions" }); + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|getVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @typedef GetVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Version} [response] Version + */ + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest} request GetVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Versions.GetVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.getVersion = function getVersion(request, callback) { + return this.rpcCall(getVersion, $root.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.Version, request, callback); + }, "name", { value: "GetVersion" }); + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest} request GetVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|createVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @typedef CreateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.createVersion = function createVersion(request, callback) { + return this.rpcCall(createVersion, $root.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateVersion" }); + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|updateVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @typedef UpdateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.Version} [response] Version + */ + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.updateVersion = function updateVersion(request, callback) { + return this.rpcCall(updateVersion, $root.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest, $root.google.cloud.dialogflow.cx.v3beta1.Version, request, callback); + }, "name", { value: "UpdateVersion" }); + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|deleteVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @typedef DeleteVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.deleteVersion = function deleteVersion(request, callback) { + return this.rpcCall(deleteVersion, $root.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteVersion" }); + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|loadVersion}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @typedef LoadVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LoadVersion. + * @function loadVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest} request LoadVersionRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.loadVersion = function loadVersion(request, callback) { + return this.rpcCall(loadVersion, $root.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LoadVersion" }); + + /** + * Calls LoadVersion. + * @function loadVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest} request LoadVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.Versions|compareVersions}. + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @typedef CompareVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse} [response] CompareVersionsResponse + */ + + /** + * Calls CompareVersions. + * @function compareVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest} request CompareVersionsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersionsCallback} callback Node-style callback called with the error, if any, and CompareVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.compareVersions = function compareVersions(request, callback) { + return this.rpcCall(compareVersions, $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest, $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse, request, callback); + }, "name", { value: "CompareVersions" }); + + /** + * Calls CompareVersions. + * @function compareVersions + * @memberof google.cloud.dialogflow.cx.v3beta1.Versions + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest} request CompareVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Versions; + })(); + + v3beta1.CreateVersionOperationMetadata = (function() { + + /** + * Properties of a CreateVersionOperationMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateVersionOperationMetadata + * @property {string|null} [version] CreateVersionOperationMetadata version + */ + + /** + * Constructs a new CreateVersionOperationMetadata. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateVersionOperationMetadata. + * @implements ICreateVersionOperationMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata=} [properties] Properties to set + */ + function CreateVersionOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVersionOperationMetadata version. + * @member {string} version + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @instance + */ + CreateVersionOperationMetadata.prototype.version = ""; + + /** + * Creates a new CreateVersionOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata} CreateVersionOperationMetadata instance + */ + CreateVersionOperationMetadata.create = function create(properties) { + return new CreateVersionOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateVersionOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata} message CreateVersionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + return writer; + }; + + /** + * Encodes the specified CreateVersionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata} message CreateVersionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata} CreateVersionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionOperationMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata} CreateVersionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionOperationMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionOperationMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a CreateVersionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata} CreateVersionOperationMetadata + */ + CreateVersionOperationMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata(); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a CreateVersionOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata} message CreateVersionOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.version = ""; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this CreateVersionOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateVersionOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata"; + }; + + return CreateVersionOperationMetadata; + })(); + + v3beta1.Version = (function() { + + /** + * Properties of a Version. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IVersion + * @property {string|null} [name] Version name + * @property {string|null} [displayName] Version displayName + * @property {string|null} [description] Version description + * @property {google.cloud.dialogflow.cx.v3beta1.INluSettings|null} [nluSettings] Version nluSettings + * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime + * @property {google.cloud.dialogflow.cx.v3beta1.Version.State|null} [state] Version state + */ + + /** + * Constructs a new Version. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @instance + */ + Version.prototype.name = ""; + + /** + * Version displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @instance + */ + Version.prototype.displayName = ""; + + /** + * Version description. + * @member {string} description + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @instance + */ + Version.prototype.description = ""; + + /** + * Version nluSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.INluSettings|null|undefined} nluSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @instance + */ + Version.prototype.nluSettings = null; + + /** + * Version createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @instance + */ + Version.prototype.createTime = null; + + /** + * Version state. + * @member {google.cloud.dialogflow.cx.v3beta1.Version.State} state + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @instance + */ + Version.prototype.state = 0; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVersion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Version.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.nluSettings != null && Object.hasOwnProperty.call(message, "nluSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.encode(message.nluSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.nluSettings = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.verify(message.nluSettings, long + 1); + if (error) + return "nluSettings." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Version} Version + */ + Version.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Version) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Version(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.nluSettings != null) { + if (typeof object.nluSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Version.nluSettings: object expected"); + message.nluSettings = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.fromObject(object.nluSettings, long + 1); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Version.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.nluSettings = null; + object.createTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.nluSettings != null && message.hasOwnProperty("nluSettings")) + object.nluSettings = $root.google.cloud.dialogflow.cx.v3beta1.NluSettings.toObject(message.nluSettings, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Version.State[message.state] === undefined ? message.state : $root.google.cloud.dialogflow.cx.v3beta1.Version.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Version + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Version + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Version"; + }; + + /** + * State enum. + * @name google.cloud.dialogflow.cx.v3beta1.Version.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + Version.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return Version; + })(); + + v3beta1.ListVersionsRequest = (function() { + + /** + * Properties of a ListVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListVersionsRequest + * @property {string|null} [parent] ListVersionsRequest parent + * @property {number|null} [pageSize] ListVersionsRequest pageSize + * @property {string|null} [pageToken] ListVersionsRequest pageToken + */ + + /** + * Constructs a new ListVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListVersionsRequest. + * @implements IListVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest=} [properties] Properties to set + */ + function ListVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.parent = ""; + + /** + * ListVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageSize = 0; + + /** + * ListVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest} ListVersionsRequest instance + */ + ListVersionsRequest.create = function create(properties) { + return new ListVersionsRequest(properties); + }; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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"; + return null; + }; + + /** + * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest} ListVersionsRequest + */ + ListVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest} message ListVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest"; + }; + + return ListVersionsRequest; + })(); + + v3beta1.ListVersionsResponse = (function() { + + /** + * Properties of a ListVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListVersionsResponse + * @property {Array.|null} [versions] ListVersionsResponse versions + * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListVersionsResponse. + * @implements IListVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse=} [properties] Properties to set + */ + function ListVersionsResponse(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsResponse versions. + * @member {Array.} versions + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.versions = $util.emptyArray; + + /** + * ListVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} ListVersionsResponse instance + */ + ListVersionsResponse.create = function create(properties) { + return new ListVersionsResponse(properties); + }; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Version.encode(message.versions[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 ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.cloud.dialogflow.cx.v3beta1.Version.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Version.verify(message.versions[i], long + 1); + if (error) + return "versions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} ListVersionsResponse + */ + ListVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.versions: object expected"); + message.versions[i] = $root.google.cloud.dialogflow.cx.v3beta1.Version.fromObject(object.versions[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} message ListVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.cloud.dialogflow.cx.v3beta1.Version.toObject(message.versions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse"; + }; + + return ListVersionsResponse; + })(); + + v3beta1.GetVersionRequest = (function() { + + /** + * Properties of a GetVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetVersionRequest + * @property {string|null} [name] GetVersionRequest name + */ + + /** + * Constructs a new GetVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetVersionRequest. + * @implements IGetVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest=} [properties] Properties to set + */ + function GetVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @instance + */ + GetVersionRequest.prototype.name = ""; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetVersionRequest} GetVersionRequest instance + */ + GetVersionRequest.create = function create(properties) { + return new GetVersionRequest(properties); + }; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.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 GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetVersionRequest} GetVersionRequest + */ + GetVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetVersionRequest} message GetVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVersionRequest.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 GetVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.GetVersionRequest"; + }; + + return GetVersionRequest; + })(); + + v3beta1.CreateVersionRequest = (function() { + + /** + * Properties of a CreateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateVersionRequest + * @property {string|null} [parent] CreateVersionRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.IVersion|null} [version] CreateVersionRequest version + */ + + /** + * Constructs a new CreateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateVersionRequest. + * @implements ICreateVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest=} [properties] Properties to set + */ + function CreateVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.parent = ""; + + /** + * CreateVersionRequest version. + * @member {google.cloud.dialogflow.cx.v3beta1.IVersion|null|undefined} version + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.version = null; + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest} CreateVersionRequest instance + */ + CreateVersionRequest.create = function create(properties) { + return new CreateVersionRequest(properties); + }; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.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.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.dialogflow.cx.v3beta1.Version.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.version = $root.google.cloud.dialogflow.cx.v3beta1.Version.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Version.verify(message.version, long + 1); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest} CreateVersionRequest + */ + CreateVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.version: object expected"); + message.version = $root.google.cloud.dialogflow.cx.v3beta1.Version.fromObject(object.version, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest} message CreateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.version = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.dialogflow.cx.v3beta1.Version.toObject(message.version, options); + return object; + }; + + /** + * Converts this CreateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest"; + }; + + return CreateVersionRequest; + })(); + + v3beta1.UpdateVersionRequest = (function() { + + /** + * Properties of an UpdateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateVersionRequest + * @property {google.cloud.dialogflow.cx.v3beta1.IVersion|null} [version] UpdateVersionRequest version + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVersionRequest updateMask + */ + + /** + * Constructs a new UpdateVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateVersionRequest. + * @implements IUpdateVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest=} [properties] Properties to set + */ + function UpdateVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateVersionRequest version. + * @member {google.cloud.dialogflow.cx.v3beta1.IVersion|null|undefined} version + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.version = null; + + /** + * UpdateVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest} UpdateVersionRequest instance + */ + UpdateVersionRequest.create = function create(properties) { + return new UpdateVersionRequest(properties); + }; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.dialogflow.cx.v3beta1.Version.encode(message.version, 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 UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = $root.google.cloud.dialogflow.cx.v3beta1.Version.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Version.verify(message.version, long + 1); + if (error) + return "version." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest} UpdateVersionRequest + */ + UpdateVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.version: object expected"); + message.version = $root.google.cloud.dialogflow.cx.v3beta1.Version.fromObject(object.version, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest} message UpdateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.updateMask = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.dialogflow.cx.v3beta1.Version.toObject(message.version, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest"; + }; + + return UpdateVersionRequest; + })(); + + v3beta1.DeleteVersionRequest = (function() { + + /** + * Properties of a DeleteVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteVersionRequest + * @property {string|null} [name] DeleteVersionRequest name + */ + + /** + * Constructs a new DeleteVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteVersionRequest. + * @implements IDeleteVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest=} [properties] Properties to set + */ + function DeleteVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @instance + */ + DeleteVersionRequest.prototype.name = ""; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest} DeleteVersionRequest instance + */ + DeleteVersionRequest.create = function create(properties) { + return new DeleteVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.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 DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest} DeleteVersionRequest + */ + DeleteVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest} message DeleteVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVersionRequest.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 DeleteVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest"; + }; + + return DeleteVersionRequest; + })(); + + v3beta1.LoadVersionRequest = (function() { + + /** + * Properties of a LoadVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ILoadVersionRequest + * @property {string|null} [name] LoadVersionRequest name + * @property {boolean|null} [allowOverrideAgentResources] LoadVersionRequest allowOverrideAgentResources + */ + + /** + * Constructs a new LoadVersionRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a LoadVersionRequest. + * @implements ILoadVersionRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest=} [properties] Properties to set + */ + function LoadVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoadVersionRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @instance + */ + LoadVersionRequest.prototype.name = ""; + + /** + * LoadVersionRequest allowOverrideAgentResources. + * @member {boolean} allowOverrideAgentResources + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @instance + */ + LoadVersionRequest.prototype.allowOverrideAgentResources = false; + + /** + * Creates a new LoadVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest} LoadVersionRequest instance + */ + LoadVersionRequest.create = function create(properties) { + return new LoadVersionRequest(properties); + }; + + /** + * Encodes the specified LoadVersionRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest} message LoadVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadVersionRequest.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.allowOverrideAgentResources != null && Object.hasOwnProperty.call(message, "allowOverrideAgentResources")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowOverrideAgentResources); + return writer; + }; + + /** + * Encodes the specified LoadVersionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest} message LoadVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest} LoadVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadVersionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.allowOverrideAgentResources = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LoadVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest} LoadVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadVersionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadVersionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.allowOverrideAgentResources != null && message.hasOwnProperty("allowOverrideAgentResources")) + if (typeof message.allowOverrideAgentResources !== "boolean") + return "allowOverrideAgentResources: boolean expected"; + return null; + }; + + /** + * Creates a LoadVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest} LoadVersionRequest + */ + LoadVersionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.allowOverrideAgentResources != null) + message.allowOverrideAgentResources = Boolean(object.allowOverrideAgentResources); + return message; + }; + + /** + * Creates a plain object from a LoadVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest} message LoadVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.allowOverrideAgentResources = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.allowOverrideAgentResources != null && message.hasOwnProperty("allowOverrideAgentResources")) + object.allowOverrideAgentResources = message.allowOverrideAgentResources; + return object; + }; + + /** + * Converts this LoadVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @instance + * @returns {Object.} JSON object + */ + LoadVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadVersionRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest"; + }; + + return LoadVersionRequest; + })(); + + v3beta1.CompareVersionsRequest = (function() { + + /** + * Properties of a CompareVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICompareVersionsRequest + * @property {string|null} [baseVersion] CompareVersionsRequest baseVersion + * @property {string|null} [targetVersion] CompareVersionsRequest targetVersion + * @property {string|null} [languageCode] CompareVersionsRequest languageCode + */ + + /** + * Constructs a new CompareVersionsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CompareVersionsRequest. + * @implements ICompareVersionsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest=} [properties] Properties to set + */ + function CompareVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompareVersionsRequest baseVersion. + * @member {string} baseVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @instance + */ + CompareVersionsRequest.prototype.baseVersion = ""; + + /** + * CompareVersionsRequest targetVersion. + * @member {string} targetVersion + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @instance + */ + CompareVersionsRequest.prototype.targetVersion = ""; + + /** + * CompareVersionsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @instance + */ + CompareVersionsRequest.prototype.languageCode = ""; + + /** + * Creates a new CompareVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest} CompareVersionsRequest instance + */ + CompareVersionsRequest.create = function create(properties) { + return new CompareVersionsRequest(properties); + }; + + /** + * Encodes the specified CompareVersionsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest} message CompareVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseVersion != null && Object.hasOwnProperty.call(message, "baseVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseVersion); + if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetVersion); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CompareVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest} message CompareVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest} CompareVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseVersion = reader.string(); + break; + } + case 2: { + message.targetVersion = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CompareVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest} CompareVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompareVersionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompareVersionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) + if (!$util.isString(message.baseVersion)) + return "baseVersion: string expected"; + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + if (!$util.isString(message.targetVersion)) + return "targetVersion: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a CompareVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest} CompareVersionsRequest + */ + CompareVersionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest(); + if (object.baseVersion != null) + message.baseVersion = String(object.baseVersion); + if (object.targetVersion != null) + message.targetVersion = String(object.targetVersion); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a CompareVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest} message CompareVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompareVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseVersion = ""; + object.targetVersion = ""; + object.languageCode = ""; + } + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) + object.baseVersion = message.baseVersion; + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + object.targetVersion = message.targetVersion; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this CompareVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + CompareVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompareVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompareVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest"; + }; + + return CompareVersionsRequest; + })(); + + v3beta1.CompareVersionsResponse = (function() { + + /** + * Properties of a CompareVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICompareVersionsResponse + * @property {string|null} [baseVersionContentJson] CompareVersionsResponse baseVersionContentJson + * @property {string|null} [targetVersionContentJson] CompareVersionsResponse targetVersionContentJson + * @property {google.protobuf.ITimestamp|null} [compareTime] CompareVersionsResponse compareTime + */ + + /** + * Constructs a new CompareVersionsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CompareVersionsResponse. + * @implements ICompareVersionsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse=} [properties] Properties to set + */ + function CompareVersionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompareVersionsResponse baseVersionContentJson. + * @member {string} baseVersionContentJson + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @instance + */ + CompareVersionsResponse.prototype.baseVersionContentJson = ""; + + /** + * CompareVersionsResponse targetVersionContentJson. + * @member {string} targetVersionContentJson + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @instance + */ + CompareVersionsResponse.prototype.targetVersionContentJson = ""; + + /** + * CompareVersionsResponse compareTime. + * @member {google.protobuf.ITimestamp|null|undefined} compareTime + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @instance + */ + CompareVersionsResponse.prototype.compareTime = null; + + /** + * Creates a new CompareVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse} CompareVersionsResponse instance + */ + CompareVersionsResponse.create = function create(properties) { + return new CompareVersionsResponse(properties); + }; + + /** + * Encodes the specified CompareVersionsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse} message CompareVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseVersionContentJson != null && Object.hasOwnProperty.call(message, "baseVersionContentJson")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseVersionContentJson); + if (message.targetVersionContentJson != null && Object.hasOwnProperty.call(message, "targetVersionContentJson")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetVersionContentJson); + if (message.compareTime != null && Object.hasOwnProperty.call(message, "compareTime")) + $root.google.protobuf.Timestamp.encode(message.compareTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompareVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse} message CompareVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompareVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse} CompareVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseVersionContentJson = reader.string(); + break; + } + case 2: { + message.targetVersionContentJson = reader.string(); + break; + } + case 3: { + message.compareTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CompareVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse} CompareVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompareVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompareVersionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompareVersionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.baseVersionContentJson != null && message.hasOwnProperty("baseVersionContentJson")) + if (!$util.isString(message.baseVersionContentJson)) + return "baseVersionContentJson: string expected"; + if (message.targetVersionContentJson != null && message.hasOwnProperty("targetVersionContentJson")) + if (!$util.isString(message.targetVersionContentJson)) + return "targetVersionContentJson: string expected"; + if (message.compareTime != null && message.hasOwnProperty("compareTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.compareTime, long + 1); + if (error) + return "compareTime." + error; + } + return null; + }; + + /** + * Creates a CompareVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse} CompareVersionsResponse + */ + CompareVersionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse(); + if (object.baseVersionContentJson != null) + message.baseVersionContentJson = String(object.baseVersionContentJson); + if (object.targetVersionContentJson != null) + message.targetVersionContentJson = String(object.targetVersionContentJson); + if (object.compareTime != null) { + if (typeof object.compareTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse.compareTime: object expected"); + message.compareTime = $root.google.protobuf.Timestamp.fromObject(object.compareTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CompareVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse} message CompareVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompareVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseVersionContentJson = ""; + object.targetVersionContentJson = ""; + object.compareTime = null; + } + if (message.baseVersionContentJson != null && message.hasOwnProperty("baseVersionContentJson")) + object.baseVersionContentJson = message.baseVersionContentJson; + if (message.targetVersionContentJson != null && message.hasOwnProperty("targetVersionContentJson")) + object.targetVersionContentJson = message.targetVersionContentJson; + if (message.compareTime != null && message.hasOwnProperty("compareTime")) + object.compareTime = $root.google.protobuf.Timestamp.toObject(message.compareTime, options); + return object; + }; + + /** + * Converts this CompareVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + CompareVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompareVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompareVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse"; + }; + + return CompareVersionsResponse; + })(); + + return v3beta1; + })(); + + return cx; + })(); + + return dialogflow; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i], long + 1); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.Http) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i], long + 1); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom, long + 1); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i], long + 1); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.HttpRule) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom, long + 1); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration, long + 1); + if (error) + return "selectiveGapicGeneration." + error; + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings, long + 1); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings, long + 1); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings, long + 1); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings, long + 1); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings, long + 1); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings, long + 1); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings, long + 1); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings, long + 1); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings, long + 1); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings, long + 1); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings, long + 1); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings, long + 1); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings, long + 1); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings, long + 1); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings, long + 1); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i], long + 1); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i], long + 1); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.Publishing) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i], long + 1); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i], long + 1); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.serviceClassNames, key); + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.JavaSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.serviceClassNames, keys[i]); + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.serviceClassNames, keys2[j]); + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CppSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PhpSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures, long + 1); + if (error) + return "experimentalFeatures." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PythonSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.experimentalFeatures = null; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.NodeSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedServices, key); + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedResources, key); + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedServices, keys[i]); + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedResources, keys[i]); + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedServices, keys2[j]); + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedResources, keys2[j]); + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.RubySettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + this.renamedServices = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedServices, key); + message.renamedServices[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.GoSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedServices, keys[i]); + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedServices, keys2[j]); + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning, long + 1); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.MethodSettings) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning, long + 1); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay, long + 1); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay, long + 1); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout, long + 1); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay, long + 1); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay, long + 1); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ResourceReference) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i], long + 1); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.optionDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.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["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i], long + 1); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i], long + 1); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i], long + 1); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i], long + 1); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo, long + 1); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i], long + 1); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i], long + 1); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options, long + 1); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo, long + 1); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + object.optionDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.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.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 11: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i], long + 1); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i], long + 1); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i], long + 1); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i], long + 1); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i], long + 1); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i], long + 1); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i], long + 1); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i], long + 1); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i], long + 1); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i], long + 1); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i], long + 1); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options, long + 1); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i], long + 1); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i], long + 1); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i], long + 1); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.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.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options, long + 1); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.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.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.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.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 6: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i], long + 1); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i], long + 1); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i], long + 1); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options, long + 1); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i], long + 1); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.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.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.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.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i], long + 1); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i], long + 1); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.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.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options, long + 1); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i], long + 1); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"], long + 1); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i], long + 1); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"], long + 1); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i], long + 1); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object.featureSupport = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + object.featureSupport = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"], long + 1); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"], long + 1); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"], long + 1); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i], long + 1); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i], long + 1); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i], long + 1); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i], long + 1); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures, long + 1); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures, long + 1); + if (error) + return "fixedFeatures." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures, long + 1); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; + } + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i], long + 1); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i], long + 1); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Duration) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.fields, key); + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]], long + 1); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Struct) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.fields, keys[i]); + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.fields, keys2[j]); + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue, long + 1); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue, long + 1); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Value) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue, long + 1); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i], long + 1); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Empty) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Any) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error, long + 1); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response, long + 1); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.Operation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata, long + 1); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + 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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i], long + 1); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.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 CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.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 DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout, long + 1); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i], long + 1); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.rpc.Status) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.type.LatLng) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LatLng + * @static + * @param {google.type.LatLng} message LatLng + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLng.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this LatLng to JSON. + * @function toJSON + * @memberof google.type.LatLng + * @instance + * @returns {Object.} JSON object + */ + LatLng.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatLng + * @function getTypeUrl + * @memberof google.type.LatLng + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.LatLng"; + }; + + return LatLng; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.json b/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.json new file mode 100644 index 000000000000..3716f94123a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/protos/protos.json @@ -0,0 +1,29152 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "dialogflow": { + "nested": { + "cx": { + "nested": { + "v3": { + "options": { + "csharp_namespace": "Google.Cloud.Dialogflow.Cx.V3", + "go_package": "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb", + "java_multiple_files": true, + "java_outer_classname": "VersionProto", + "java_package": "com.google.cloud.dialogflow.cx.v3", + "objc_class_prefix": "DF", + "ruby_package": "Google::Cloud::Dialogflow::CX::V3", + "(google.api.resource_definition).type": "dlp.googleapis.com/DeidentifyTemplate", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" + }, + "nested": { + "AdvancedSettings": { + "fields": { + "audioExportGcsDestination": { + "type": "GcsDestination", + "id": 2 + }, + "speechSettings": { + "type": "SpeechSettings", + "id": 3 + }, + "dtmfSettings": { + "type": "DtmfSettings", + "id": 5 + }, + "loggingSettings": { + "type": "LoggingSettings", + "id": 6 + } + }, + "nested": { + "SpeechSettings": { + "fields": { + "endpointerSensitivity": { + "type": "int32", + "id": 1 + }, + "noSpeechTimeout": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "useTimeoutBasedEndpointing": { + "type": "bool", + "id": 3 + }, + "models": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "DtmfSettings": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "maxDigits": { + "type": "int32", + "id": 2 + }, + "finishDigit": { + "type": "string", + "id": 3 + }, + "interdigitTimeoutDuration": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "endpointingTimeoutDuration": { + "type": "google.protobuf.Duration", + "id": 7 + } + } + }, + "LoggingSettings": { + "fields": { + "enableStackdriverLogging": { + "type": "bool", + "id": 2 + }, + "enableInteractionLogging": { + "type": "bool", + "id": 3 + }, + "enableConsentBasedRedaction": { + "type": "bool", + "id": 4 + } + } + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Agents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListAgents": { + "requestType": "ListAgentsRequest", + "responseType": "ListAgentsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*}/agents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*}/agents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAgent": { + "requestType": "GetAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAgent": { + "requestType": "CreateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}/agents", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "parent,agent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}/agents", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "parent,agent" + } + ] + }, + "UpdateAgent": { + "requestType": "UpdateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).patch": "/v3/{agent.name=projects/*/locations/*/agents/*}", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "agent,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{agent.name=projects/*/locations/*/agents/*}", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "agent,update_mask" + } + ] + }, + "DeleteAgent": { + "requestType": "DeleteAgentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ExportAgent": { + "requestType": "ExportAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*}:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportAgentResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*}:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportAgentResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "RestoreAgent": { + "requestType": "RestoreAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*}:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*}:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ValidateAgent": { + "requestType": "ValidateAgentRequest", + "responseType": "AgentValidationResult", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*}:validate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*}:validate", + "body": "*" + } + } + ] + }, + "GetAgentValidationResult": { + "requestType": "GetAgentValidationResultRequest", + "responseType": "AgentValidationResult", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/validationResult}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/validationResult}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetGenerativeSettings": { + "requestType": "GetGenerativeSettingsRequest", + "responseType": "GenerativeSettings", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/generativeSettings}", + "(google.api.method_signature)": "name,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/generativeSettings}" + } + }, + { + "(google.api.method_signature)": "name,language_code" + } + ] + }, + "UpdateGenerativeSettings": { + "requestType": "UpdateGenerativeSettingsRequest", + "responseType": "GenerativeSettings", + "options": { + "(google.api.http).patch": "/v3/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}", + "(google.api.http).body": "generative_settings", + "(google.api.method_signature)": "generative_settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}", + "body": "generative_settings" + } + }, + { + "(google.api.method_signature)": "generative_settings,update_mask" + } + ] + } + } + }, + "SpeechToTextSettings": { + "fields": { + "enableSpeechAdaptation": { + "type": "bool", + "id": 1 + } + } + }, + "Agent": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Agent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}" + }, + "oneofs": { + "sessionEntryResource": { + "oneof": [ + "startFlow", + "startPlaybook" + ] + }, + "_genAppBuilderSettings": { + "oneof": [ + "genAppBuilderSettings" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_satisfiesPzi": { + "oneof": [ + "satisfiesPzi" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "defaultLanguageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "supportedLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 6 + }, + "avatarUri": { + "type": "string", + "id": 7 + }, + "speechToTextSettings": { + "type": "SpeechToTextSettings", + "id": 13 + }, + "startFlow": { + "type": "string", + "id": 16, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "startPlaybook": { + "type": "string", + "id": 39, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "securitySettings": { + "type": "string", + "id": 17, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "enableStackdriverLogging": { + "type": "bool", + "id": 18, + "options": { + "deprecated": true + } + }, + "enableSpellCorrection": { + "type": "bool", + "id": 20 + }, + "enableMultiLanguageTraining": { + "type": "bool", + "id": 40, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locked": { + "type": "bool", + "id": 27 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 22 + }, + "gitIntegrationSettings": { + "type": "GitIntegrationSettings", + "id": 30 + }, + "textToSpeechSettings": { + "type": "TextToSpeechSettings", + "id": 31 + }, + "genAppBuilderSettings": { + "type": "GenAppBuilderSettings", + "id": 33, + "options": { + "proto3_optional": true + } + }, + "answerFeedbackSettings": { + "type": "AnswerFeedbackSettings", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "personalizationSettings": { + "type": "PersonalizationSettings", + "id": 42, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientCertificateSettings": { + "type": "ClientCertificateSettings", + "id": 43, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + }, + "nested": { + "GitIntegrationSettings": { + "oneofs": { + "gitSettings": { + "oneof": [ + "githubSettings" + ] + } + }, + "fields": { + "githubSettings": { + "type": "GithubSettings", + "id": 1 + } + }, + "nested": { + "GithubSettings": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "repositoryUri": { + "type": "string", + "id": 2 + }, + "trackingBranch": { + "type": "string", + "id": 3 + }, + "accessToken": { + "type": "string", + "id": 4 + }, + "branches": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + } + } + }, + "GenAppBuilderSettings": { + "fields": { + "engine": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnswerFeedbackSettings": { + "fields": { + "enableAnswerFeedback": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PersonalizationSettings": { + "fields": { + "defaultEndUserMetadata": { + "type": "google.protobuf.Struct", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClientCertificateSettings": { + "fields": { + "sslCertificate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "passphrase": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + } + } + }, + "ListAgentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAgentsResponse": { + "fields": { + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "CreateAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "agent": { + "type": "Agent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAgentRequest": { + "fields": { + "agent": { + "type": "Agent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "ExportAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "agentUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environment": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "gitDestination": { + "type": "GitDestination", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeBigqueryExportSettings": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON_PACKAGE": 4 + } + }, + "GitDestination": { + "fields": { + "trackingBranch": { + "type": "string", + "id": 1 + }, + "commitMessage": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ExportAgentResponse": { + "oneofs": { + "agent": { + "oneof": [ + "agentUri", + "agentContent", + "commitSha" + ] + } + }, + "fields": { + "agentUri": { + "type": "string", + "id": 1 + }, + "agentContent": { + "type": "bytes", + "id": 2 + }, + "commitSha": { + "type": "string", + "id": 3 + } + } + }, + "RestoreAgentRequest": { + "oneofs": { + "agent": { + "oneof": [ + "agentUri", + "agentContent", + "gitSource" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "agentUri": { + "type": "string", + "id": 2 + }, + "agentContent": { + "type": "bytes", + "id": 3 + }, + "gitSource": { + "type": "GitSource", + "id": 6 + }, + "restoreOption": { + "type": "RestoreOption", + "id": 5 + } + }, + "nested": { + "GitSource": { + "fields": { + "trackingBranch": { + "type": "string", + "id": 1 + } + } + }, + "RestoreOption": { + "values": { + "RESTORE_OPTION_UNSPECIFIED": 0, + "KEEP": 1, + "FALLBACK": 2 + } + } + } + }, + "ValidateAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "GetAgentValidationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/AgentValidationResult" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "AgentValidationResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/AgentValidationResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/validationResult" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "flowValidationResults": { + "rule": "repeated", + "type": "FlowValidationResult", + "id": 2 + } + } + }, + "GetGenerativeSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/AgentGenerativeSettings" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGenerativeSettingsRequest": { + "fields": { + "generativeSettings": { + "type": "GenerativeSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "AUDIO_ENCODING_LINEAR_16": 1, + "AUDIO_ENCODING_FLAC": 2, + "AUDIO_ENCODING_MULAW": 3, + "AUDIO_ENCODING_AMR": 4, + "AUDIO_ENCODING_AMR_WB": 5, + "AUDIO_ENCODING_OGG_OPUS": 6, + "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7, + "AUDIO_ENCODING_ALAW": 8 + } + }, + "SpeechModelVariant": { + "values": { + "SPEECH_MODEL_VARIANT_UNSPECIFIED": 0, + "USE_BEST_AVAILABLE": 1, + "USE_STANDARD": 2, + "USE_ENHANCED": 3 + } + }, + "SpeechWordInfo": { + "fields": { + "word": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "BargeInConfig": { + "fields": { + "noBargeInDuration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "totalDuration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "InputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "enableWordInfo": { + "type": "bool", + "id": 13 + }, + "phraseHints": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "model": { + "type": "string", + "id": 7 + }, + "modelVariant": { + "type": "SpeechModelVariant", + "id": 10 + }, + "singleUtterance": { + "type": "bool", + "id": 8 + }, + "bargeInConfig": { + "type": "BargeInConfig", + "id": 15 + }, + "optOutConformerModelMigration": { + "type": "bool", + "id": 26 + } + } + }, + "SsmlVoiceGender": { + "values": { + "SSML_VOICE_GENDER_UNSPECIFIED": 0, + "SSML_VOICE_GENDER_MALE": 1, + "SSML_VOICE_GENDER_FEMALE": 2, + "SSML_VOICE_GENDER_NEUTRAL": 3 + } + }, + "VoiceSelectionParams": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ssmlGender": { + "type": "SsmlVoiceGender", + "id": 2 + } + } + }, + "SynthesizeSpeechConfig": { + "fields": { + "speakingRate": { + "type": "double", + "id": 1 + }, + "pitch": { + "type": "double", + "id": 2 + }, + "volumeGainDb": { + "type": "double", + "id": 3 + }, + "effectsProfileId": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "voice": { + "type": "VoiceSelectionParams", + "id": 4 + } + } + }, + "OutputAudioEncoding": { + "valuesOptions": { + "OUTPUT_AUDIO_ENCODING_MP3": { + "deprecated": true + } + }, + "values": { + "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": 0, + "OUTPUT_AUDIO_ENCODING_LINEAR_16": 1, + "OUTPUT_AUDIO_ENCODING_MP3": 2, + "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS": 4, + "OUTPUT_AUDIO_ENCODING_OGG_OPUS": 3, + "OUTPUT_AUDIO_ENCODING_MULAW": 5, + "OUTPUT_AUDIO_ENCODING_ALAW": 6 + } + }, + "OutputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "OutputAudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "synthesizeSpeechConfig": { + "type": "SynthesizeSpeechConfig", + "id": 3 + } + } + }, + "TextToSpeechSettings": { + "fields": { + "synthesizeSpeechConfigs": { + "keyType": "string", + "type": "SynthesizeSpeechConfig", + "id": 1 + } + } + }, + "Flows": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateFlow": { + "requestType": "CreateFlowRequest", + "responseType": "Flow", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/flows", + "(google.api.http).body": "flow", + "(google.api.method_signature)": "parent,flow" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/flows", + "body": "flow" + } + }, + { + "(google.api.method_signature)": "parent,flow" + } + ] + }, + "DeleteFlow": { + "requestType": "DeleteFlowRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFlows": { + "requestType": "ListFlowsRequest", + "responseType": "ListFlowsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/flows", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/flows" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFlow": { + "requestType": "GetFlowRequest", + "responseType": "Flow", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/flows/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/flows/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateFlow": { + "requestType": "UpdateFlowRequest", + "responseType": "Flow", + "options": { + "(google.api.http).patch": "/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}", + "(google.api.http).body": "flow", + "(google.api.method_signature)": "flow,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}", + "body": "flow" + } + }, + { + "(google.api.method_signature)": "flow,update_mask" + } + ] + }, + "TrainFlow": { + "requestType": "TrainFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/flows/*}:train", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/flows/*}:train", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ValidateFlow": { + "requestType": "ValidateFlowRequest", + "responseType": "FlowValidationResult", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate", + "body": "*" + } + } + ] + }, + "GetFlowValidationResult": { + "requestType": "GetFlowValidationResultRequest", + "responseType": "FlowValidationResult", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportFlow": { + "requestType": "ImportFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/flows:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportFlowResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/flows:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportFlowResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ExportFlow": { + "requestType": "ExportFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/flows/*}:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportFlowResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/flows/*}:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportFlowResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + } + } + }, + "NluSettings": { + "fields": { + "modelType": { + "type": "ModelType", + "id": 1 + }, + "classificationThreshold": { + "type": "float", + "id": 3 + }, + "modelTrainingMode": { + "type": "ModelTrainingMode", + "id": 4 + } + }, + "nested": { + "ModelType": { + "values": { + "MODEL_TYPE_UNSPECIFIED": 0, + "MODEL_TYPE_STANDARD": 1, + "MODEL_TYPE_ADVANCED": 3 + } + }, + "ModelTrainingMode": { + "values": { + "MODEL_TRAINING_MODE_UNSPECIFIED": 0, + "MODEL_TRAINING_MODE_AUTOMATIC": 1, + "MODEL_TRAINING_MODE_MANUAL": 2 + } + } + } + }, + "Flow": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Flow", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "transitionRoutes": { + "rule": "repeated", + "type": "TransitionRoute", + "id": 4 + }, + "eventHandlers": { + "rule": "repeated", + "type": "EventHandler", + "id": 10 + }, + "transitionRouteGroups": { + "rule": "repeated", + "type": "string", + "id": 15, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "nluSettings": { + "type": "NluSettings", + "id": 11 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 14 + }, + "knowledgeConnectorSettings": { + "type": "KnowledgeConnectorSettings", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "multiLanguageSettings": { + "type": "MultiLanguageSettings", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locked": { + "type": "bool", + "id": 30 + } + }, + "nested": { + "MultiLanguageSettings": { + "fields": { + "enableMultiLanguageDetection": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "supportedResponseLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CreateFlowRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Flow" + } + }, + "flow": { + "type": "Flow", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "DeleteFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "ListFlowsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Flow" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4 + } + } + }, + "ListFlowsResponse": { + "fields": { + "flows": { + "rule": "repeated", + "type": "Flow", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "UpdateFlowRequest": { + "fields": { + "flow": { + "type": "Flow", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "TrainFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + } + }, + "ValidateFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "GetFlowValidationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/FlowValidationResult" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "FlowValidationResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/FlowValidationResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "validationMessages": { + "rule": "repeated", + "type": "ValidationMessage", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ImportFlowRequest": { + "oneofs": { + "flow": { + "oneof": [ + "flowUri", + "flowContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Flow" + } + }, + "flowUri": { + "type": "string", + "id": 2 + }, + "flowContent": { + "type": "bytes", + "id": 3 + }, + "importOption": { + "type": "ImportOption", + "id": 4 + }, + "flowImportStrategy": { + "type": "FlowImportStrategy", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ImportOption": { + "values": { + "IMPORT_OPTION_UNSPECIFIED": 0, + "KEEP": 1, + "FALLBACK": 2 + } + } + } + }, + "FlowImportStrategy": { + "fields": { + "globalImportStrategy": { + "type": "ImportStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportFlowResponse": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + } + }, + "ExportFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "flowUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeReferencedFlows": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExportFlowResponse": { + "oneofs": { + "flow": { + "oneof": [ + "flowUri", + "flowContent" + ] + } + }, + "fields": { + "flowUri": { + "type": "string", + "id": 1 + }, + "flowContent": { + "type": "bytes", + "id": 2 + } + } + }, + "ImportStrategy": { + "values": { + "IMPORT_STRATEGY_UNSPECIFIED": 0, + "IMPORT_STRATEGY_CREATE_NEW": 1, + "IMPORT_STRATEGY_REPLACE": 2, + "IMPORT_STRATEGY_KEEP": 3, + "IMPORT_STRATEGY_MERGE": 4, + "IMPORT_STRATEGY_THROW_ERROR": 5 + } + }, + "Pages": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListPages": { + "requestType": "ListPagesRequest", + "responseType": "ListPagesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPage": { + "requestType": "GetPageRequest", + "responseType": "Page", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreatePage": { + "requestType": "CreatePageRequest", + "responseType": "Page", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages", + "(google.api.http).body": "page", + "(google.api.method_signature)": "parent,page" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages", + "body": "page" + } + }, + { + "(google.api.method_signature)": "parent,page" + } + ] + }, + "UpdatePage": { + "requestType": "UpdatePageRequest", + "responseType": "Page", + "options": { + "(google.api.http).patch": "/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "(google.api.http).body": "page", + "(google.api.method_signature)": "page,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "body": "page" + } + }, + { + "(google.api.method_signature)": "page,update_mask" + } + ] + }, + "DeletePage": { + "requestType": "DeletePageRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Page": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Page", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 19 + }, + "entryFulfillment": { + "type": "Fulfillment", + "id": 7 + }, + "form": { + "type": "Form", + "id": 4 + }, + "transitionRouteGroups": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "transitionRoutes": { + "rule": "repeated", + "type": "TransitionRoute", + "id": 9 + }, + "eventHandlers": { + "rule": "repeated", + "type": "EventHandler", + "id": 10 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 13 + }, + "knowledgeConnectorSettings": { + "type": "KnowledgeConnectorSettings", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Form": { + "fields": { + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 1 + } + }, + "nested": { + "Parameter": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "required": { + "type": "bool", + "id": 2 + }, + "entityType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "isList": { + "type": "bool", + "id": 4 + }, + "fillBehavior": { + "type": "FillBehavior", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "defaultValue": { + "type": "google.protobuf.Value", + "id": 9 + }, + "redact": { + "type": "bool", + "id": 11 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 12 + } + }, + "nested": { + "FillBehavior": { + "fields": { + "initialPromptFulfillment": { + "type": "Fulfillment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "repromptEventHandlers": { + "rule": "repeated", + "type": "EventHandler", + "id": 5 + } + } + } + } + } + } + }, + "EventHandler": { + "oneofs": { + "target": { + "oneof": [ + "targetPage", + "targetFlow", + "targetPlaybook" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "event": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "triggerFulfillment": { + "type": "Fulfillment", + "id": 5 + }, + "targetPage": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "targetPlaybook": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + } + } + }, + "TransitionRoute": { + "oneofs": { + "target": { + "oneof": [ + "targetPage", + "targetFlow" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "condition": { + "type": "string", + "id": 2 + }, + "triggerFulfillment": { + "type": "Fulfillment", + "id": 3 + }, + "targetPage": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + } + }, + "ListPagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Page" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListPagesResponse": { + "fields": { + "pages": { + "rule": "repeated", + "type": "Page", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetPageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreatePageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Page" + } + }, + "page": { + "type": "Page", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdatePageRequest": { + "fields": { + "page": { + "type": "Page", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeletePageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "KnowledgeConnectorSettings": { + "oneofs": { + "target": { + "oneof": [ + "targetPage", + "targetFlow" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "triggerFulfillment": { + "type": "Fulfillment", + "id": 3 + }, + "targetPage": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "dataStoreConnections": { + "rule": "repeated", + "type": "DataStoreConnection", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreConnection": { + "fields": { + "dataStoreType": { + "type": "DataStoreType", + "id": 1 + }, + "dataStore": { + "type": "string", + "id": 2 + }, + "documentProcessingMode": { + "type": "DocumentProcessingMode", + "id": 4 + } + } + }, + "DataStoreType": { + "values": { + "DATA_STORE_TYPE_UNSPECIFIED": 0, + "PUBLIC_WEB": 1, + "UNSTRUCTURED": 2, + "STRUCTURED": 3 + } + }, + "DataStoreConnectionSignals": { + "fields": { + "rewriterModelCallSignals": { + "type": "RewriterModelCallSignals", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rewrittenQuery": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "searchSnippets": { + "rule": "repeated", + "type": "SearchSnippet", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "answerGenerationModelCallSignals": { + "type": "AnswerGenerationModelCallSignals", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "answer": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "answerParts": { + "rule": "repeated", + "type": "AnswerPart", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "citedSnippets": { + "rule": "repeated", + "type": "CitedSnippet", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "groundingSignals": { + "type": "GroundingSignals", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "safetySignals": { + "type": "SafetySignals", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RewriterModelCallSignals": { + "fields": { + "renderedPrompt": { + "type": "string", + "id": 1 + }, + "modelOutput": { + "type": "string", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "SearchSnippet": { + "fields": { + "documentTitle": { + "type": "string", + "id": 1 + }, + "documentUri": { + "type": "string", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + }, + "metadata": { + "type": "google.protobuf.Struct", + "id": 5 + } + } + }, + "AnswerGenerationModelCallSignals": { + "fields": { + "renderedPrompt": { + "type": "string", + "id": 1 + }, + "modelOutput": { + "type": "string", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "AnswerPart": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "supportingIndices": { + "rule": "repeated", + "type": "int32", + "id": 2 + } + } + }, + "CitedSnippet": { + "fields": { + "searchSnippet": { + "type": "SearchSnippet", + "id": 1 + }, + "snippetIndex": { + "type": "int32", + "id": 2 + } + } + }, + "GroundingSignals": { + "fields": { + "decision": { + "type": "GroundingDecision", + "id": 1 + }, + "score": { + "type": "GroundingScoreBucket", + "id": 2 + } + }, + "nested": { + "GroundingDecision": { + "values": { + "GROUNDING_DECISION_UNSPECIFIED": 0, + "ACCEPTED_BY_GROUNDING": 1, + "REJECTED_BY_GROUNDING": 2 + } + }, + "GroundingScoreBucket": { + "values": { + "GROUNDING_SCORE_BUCKET_UNSPECIFIED": 0, + "VERY_LOW": 1, + "LOW": 3, + "MEDIUM": 4, + "HIGH": 5, + "VERY_HIGH": 6 + } + } + } + }, + "SafetySignals": { + "fields": { + "decision": { + "type": "SafetyDecision", + "id": 1 + }, + "bannedPhraseMatch": { + "type": "BannedPhraseMatch", + "id": 2 + }, + "matchedBannedPhrase": { + "type": "string", + "id": 3 + } + }, + "nested": { + "SafetyDecision": { + "values": { + "SAFETY_DECISION_UNSPECIFIED": 0, + "ACCEPTED_BY_SAFETY_CHECK": 1, + "REJECTED_BY_SAFETY_CHECK": 2 + } + }, + "BannedPhraseMatch": { + "values": { + "BANNED_PHRASE_MATCH_UNSPECIFIED": 0, + "BANNED_PHRASE_MATCH_NONE": 1, + "BANNED_PHRASE_MATCH_QUERY": 2, + "BANNED_PHRASE_MATCH_RESPONSE": 3 + } + } + } + } + } + }, + "DocumentProcessingMode": { + "values": { + "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": 0, + "DOCUMENTS": 1, + "CHUNKS": 2 + } + }, + "Fulfillment": { + "fields": { + "messages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 1 + }, + "webhook": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Webhook" + } + }, + "returnPartialResponses": { + "type": "bool", + "id": 8 + }, + "tag": { + "type": "string", + "id": 3 + }, + "setParameterActions": { + "rule": "repeated", + "type": "SetParameterAction", + "id": 4 + }, + "conditionalCases": { + "rule": "repeated", + "type": "ConditionalCases", + "id": 5 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 7 + }, + "enableGenerativeFallback": { + "type": "bool", + "id": 12 + }, + "generators": { + "rule": "repeated", + "type": "GeneratorSettings", + "id": 13 + } + }, + "nested": { + "SetParameterAction": { + "fields": { + "parameter": { + "type": "string", + "id": 1 + }, + "value": { + "type": "google.protobuf.Value", + "id": 2 + } + } + }, + "ConditionalCases": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + } + }, + "nested": { + "Case": { + "fields": { + "condition": { + "type": "string", + "id": 1 + }, + "caseContent": { + "rule": "repeated", + "type": "CaseContent", + "id": 2 + } + }, + "nested": { + "CaseContent": { + "oneofs": { + "casesOrMessage": { + "oneof": [ + "message", + "additionalCases" + ] + } + }, + "fields": { + "message": { + "type": "ResponseMessage", + "id": 1 + }, + "additionalCases": { + "type": "ConditionalCases", + "id": 2 + } + } + } + } + } + } + }, + "GeneratorSettings": { + "fields": { + "generator": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Generator" + } + }, + "inputParameters": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "outputParameter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ResponseMessage": { + "oneofs": { + "message": { + "oneof": [ + "text", + "payload", + "conversationSuccess", + "outputAudioText", + "liveAgentHandoff", + "endInteraction", + "playAudio", + "mixedAudio", + "telephonyTransferCall", + "knowledgeInfoCard", + "toolCall" + ] + } + }, + "fields": { + "text": { + "type": "Text", + "id": 1 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "conversationSuccess": { + "type": "ConversationSuccess", + "id": 9 + }, + "outputAudioText": { + "type": "OutputAudioText", + "id": 8 + }, + "liveAgentHandoff": { + "type": "LiveAgentHandoff", + "id": 10 + }, + "endInteraction": { + "type": "EndInteraction", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "playAudio": { + "type": "PlayAudio", + "id": 12 + }, + "mixedAudio": { + "type": "MixedAudio", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "telephonyTransferCall": { + "type": "TelephonyTransferCall", + "id": 18 + }, + "knowledgeInfoCard": { + "type": "KnowledgeInfoCard", + "id": 20 + }, + "toolCall": { + "type": "ToolCall", + "id": 22 + }, + "responseType": { + "type": "ResponseType", + "id": 4 + }, + "channel": { + "type": "string", + "id": 19 + } + }, + "nested": { + "Text": { + "fields": { + "text": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LiveAgentHandoff": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1 + } + } + }, + "ConversationSuccess": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1 + } + } + }, + "OutputAudioText": { + "oneofs": { + "source": { + "oneof": [ + "text", + "ssml" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "ssml": { + "type": "string", + "id": 2 + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EndInteraction": { + "fields": {} + }, + "PlayAudio": { + "fields": { + "audioUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MixedAudio": { + "fields": { + "segments": { + "rule": "repeated", + "type": "Segment", + "id": 1 + } + }, + "nested": { + "Segment": { + "oneofs": { + "content": { + "oneof": [ + "audio", + "uri" + ] + } + }, + "fields": { + "audio": { + "type": "bytes", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "TelephonyTransferCall": { + "oneofs": { + "endpoint": { + "oneof": [ + "phoneNumber" + ] + } + }, + "fields": { + "phoneNumber": { + "type": "string", + "id": 1 + } + } + }, + "KnowledgeInfoCard": { + "fields": {} + }, + "ResponseType": { + "values": { + "RESPONSE_TYPE_UNSPECIFIED": 0, + "ENTRY_PROMPT": 1, + "PARAMETER_PROMPT": 2, + "HANDLER_PROMPT": 3 + } + } + } + }, + "ToolCall": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputParameters": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolCallResult": { + "oneofs": { + "result": { + "oneof": [ + "error", + "outputParameters" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "error": { + "type": "Error", + "id": 3 + }, + "outputParameters": { + "type": "google.protobuf.Struct", + "id": 4 + } + }, + "nested": { + "Error": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ParameterDefinition": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "ParameterType", + "id": 2, + "options": { + "deprecated": true + } + }, + "typeSchema": { + "type": "TypeSchema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ParameterType": { + "values": { + "PARAMETER_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "NUMBER": 2, + "BOOLEAN": 3, + "NULL": 4, + "OBJECT": 5, + "LIST": 6 + } + } + } + }, + "TypeSchema": { + "oneofs": { + "schema": { + "oneof": [ + "inlineSchema", + "schemaReference" + ] + } + }, + "fields": { + "inlineSchema": { + "type": "InlineSchema", + "id": 1 + }, + "schemaReference": { + "type": "SchemaReference", + "id": 2 + } + }, + "nested": { + "SchemaReference": { + "fields": { + "tool": { + "type": "string", + "id": 1 + }, + "schema": { + "type": "string", + "id": 2 + } + } + } + } + }, + "InlineSchema": { + "fields": { + "type": { + "type": "DataType", + "id": 1 + }, + "items": { + "type": "TypeSchema", + "id": 2 + } + } + }, + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "NUMBER": 2, + "BOOLEAN": 3, + "ARRAY": 6 + } + }, + "ValidationMessage": { + "fields": { + "resourceType": { + "type": "ResourceType", + "id": 1 + }, + "resources": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "resourceNames": { + "rule": "repeated", + "type": "ResourceName", + "id": 6 + }, + "severity": { + "type": "Severity", + "id": 3 + }, + "detail": { + "type": "string", + "id": 4 + } + }, + "nested": { + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "AGENT": 1, + "INTENT": 2, + "INTENT_TRAINING_PHRASE": 8, + "INTENT_PARAMETER": 9, + "INTENTS": 10, + "INTENT_TRAINING_PHRASES": 11, + "ENTITY_TYPE": 3, + "ENTITY_TYPES": 12, + "WEBHOOK": 4, + "FLOW": 5, + "PAGE": 6, + "PAGES": 13, + "TRANSITION_ROUTE_GROUP": 7, + "AGENT_TRANSITION_ROUTE_GROUP": 14 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "INFO": 1, + "WARNING": 2, + "ERROR": 3 + } + } + } + }, + "ResourceName": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "GenerativeSettings": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/AgentGenerativeSettings", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/generativeSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 5 + }, + "fallbackSettings": { + "type": "FallbackSettings", + "id": 1 + }, + "generativeSafetySettings": { + "type": "SafetySettings", + "id": 3 + }, + "knowledgeConnectorSettings": { + "type": "KnowledgeConnectorSettings", + "id": 7 + }, + "languageCode": { + "type": "string", + "id": 4 + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 8 + } + }, + "nested": { + "FallbackSettings": { + "fields": { + "selectedPrompt": { + "type": "string", + "id": 3 + }, + "promptTemplates": { + "rule": "repeated", + "type": "PromptTemplate", + "id": 4 + } + }, + "nested": { + "PromptTemplate": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "promptText": { + "type": "string", + "id": 2 + }, + "frozen": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "KnowledgeConnectorSettings": { + "fields": { + "business": { + "type": "string", + "id": 1 + }, + "agent": { + "type": "string", + "id": 2 + }, + "agentIdentity": { + "type": "string", + "id": 3 + }, + "businessDescription": { + "type": "string", + "id": 4 + }, + "agentScope": { + "type": "string", + "id": 5 + }, + "disableDataStoreFallback": { + "type": "bool", + "id": 8 + } + } + } + } + }, + "LlmModelSettings": { + "fields": { + "model": { + "type": "string", + "id": 1 + }, + "promptText": { + "type": "string", + "id": 2 + } + } + }, + "SafetySettings": { + "fields": { + "defaultBannedPhraseMatchStrategy": { + "type": "PhraseMatchStrategy", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedPhrases": { + "rule": "repeated", + "type": "Phrase", + "id": 1 + }, + "raiSettings": { + "type": "RaiSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultRaiSettings": { + "type": "RaiSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "promptSecuritySettings": { + "type": "PromptSecuritySettings", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Phrase": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PhraseMatchStrategy": { + "values": { + "PHRASE_MATCH_STRATEGY_UNSPECIFIED": 0, + "PARTIAL_MATCH": 1, + "WORD_MATCH": 2 + } + }, + "RaiSettings": { + "fields": { + "categoryFilters": { + "rule": "repeated", + "type": "CategoryFilter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SafetyFilterLevel": { + "values": { + "SAFETY_FILTER_LEVEL_UNSPECIFIED": 0, + "BLOCK_NONE": 1, + "BLOCK_FEW": 2, + "BLOCK_SOME": 3, + "BLOCK_MOST": 4 + } + }, + "SafetyCategory": { + "values": { + "SAFETY_CATEGORY_UNSPECIFIED": 0, + "DANGEROUS_CONTENT": 1, + "HATE_SPEECH": 2, + "HARASSMENT": 3, + "SEXUALLY_EXPLICIT_CONTENT": 4 + } + }, + "CategoryFilter": { + "fields": { + "category": { + "type": "SafetyCategory", + "id": 1 + }, + "filterLevel": { + "type": "SafetyFilterLevel", + "id": 2 + } + } + } + } + }, + "PromptSecuritySettings": { + "fields": { + "enablePromptSecurity": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "Changelogs": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListChangelogs": { + "requestType": "ListChangelogsRequest", + "responseType": "ListChangelogsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/changelogs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/changelogs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetChangelog": { + "requestType": "GetChangelogRequest", + "responseType": "Changelog", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/changelogs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/changelogs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListChangelogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Changelog" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListChangelogsResponse": { + "fields": { + "changelogs": { + "rule": "repeated", + "type": "Changelog", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetChangelogRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Changelog" + } + } + } + }, + "Changelog": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Changelog", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "userEmail": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 7 + }, + "action": { + "type": "string", + "id": 11 + }, + "type": { + "type": "string", + "id": 8 + }, + "resource": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 14 + } + } + }, + "CodeBlock": { + "fields": { + "code": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Deployments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListDeployments": { + "requestType": "ListDeploymentsRequest", + "responseType": "ListDeploymentsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeployment": { + "requestType": "GetDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Deployment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Deployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "flowVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "state": { + "type": "State", + "id": 3 + }, + "result": { + "type": "Result", + "id": 4 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + }, + "Result": { + "fields": { + "deploymentTestResults": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCaseResult" + } + }, + "experiment": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + } + } + }, + "ListDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Deployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDeploymentsResponse": { + "fields": { + "deployments": { + "rule": "repeated", + "type": "Deployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Deployment" + } + } + } + }, + "EntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "GetEntityType": { + "requestType": "GetEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEntityType": { + "requestType": "CreateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes", + "(google.api.http).body": "entity_type", + "(google.api.method_signature)": "parent,entity_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes", + "body": "entity_type" + } + }, + { + "(google.api.method_signature)": "parent,entity_type" + } + ] + }, + "UpdateEntityType": { + "requestType": "UpdateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).patch": "/v3/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}", + "(google.api.http).body": "entity_type", + "(google.api.method_signature)": "entity_type,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}", + "body": "entity_type" + } + }, + { + "(google.api.method_signature)": "entity_type,update_mask" + } + ] + }, + "DeleteEntityType": { + "requestType": "DeleteEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEntityTypes": { + "requestType": "ListEntityTypesRequest", + "responseType": "ListEntityTypesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ExportEntityTypes": { + "requestType": "ExportEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportEntityTypesResponse", + "(google.longrunning.operation_info).metadata_type": "ExportEntityTypesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportEntityTypesResponse", + "metadata_type": "ExportEntityTypesMetadata" + } + } + ] + }, + "ImportEntityTypes": { + "requestType": "ImportEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportEntityTypesResponse", + "(google.longrunning.operation_info).metadata_type": "ImportEntityTypesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportEntityTypesResponse", + "metadata_type": "ImportEntityTypesMetadata" + } + } + ] + } + } + }, + "EntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/EntityType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kind": { + "type": "Kind", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoExpansionMode": { + "type": "AutoExpansionMode", + "id": 4 + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 5 + }, + "excludedPhrases": { + "rule": "repeated", + "type": "ExcludedPhrase", + "id": 6 + }, + "enableFuzzyExtraction": { + "type": "bool", + "id": 7 + }, + "redact": { + "type": "bool", + "id": 9 + } + }, + "nested": { + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "KIND_MAP": 1, + "KIND_LIST": 2, + "KIND_REGEXP": 3 + } + }, + "AutoExpansionMode": { + "values": { + "AUTO_EXPANSION_MODE_UNSPECIFIED": 0, + "AUTO_EXPANSION_MODE_DEFAULT": 1 + } + }, + "Entity": { + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "synonyms": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExcludedPhrase": { + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ExportEntityTypesRequest": { + "oneofs": { + "destination": { + "oneof": [ + "entityTypesUri", + "entityTypesContentInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entityTypesUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entityTypesContentInline": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON_PACKAGE": 5 + } + } + } + }, + "ExportEntityTypesResponse": { + "oneofs": { + "exportedEntityTypes": { + "oneof": [ + "entityTypesUri", + "entityTypesContent" + ] + } + }, + "fields": { + "entityTypesUri": { + "type": "string", + "id": 1 + }, + "entityTypesContent": { + "type": "InlineDestination", + "id": 2 + } + } + }, + "ExportEntityTypesMetadata": { + "fields": {} + }, + "ImportEntityTypesRequest": { + "oneofs": { + "entityTypes": { + "oneof": [ + "entityTypesUri", + "entityTypesContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypesUri": { + "type": "string", + "id": 2 + }, + "entityTypesContent": { + "type": "InlineSource", + "id": 3 + }, + "mergeOption": { + "type": "MergeOption", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetEntityType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + } + }, + "nested": { + "MergeOption": { + "values": { + "MERGE_OPTION_UNSPECIFIED": 0, + "REPLACE": 1, + "MERGE": 2, + "RENAME": 3, + "REPORT_CONFLICT": 4, + "KEEP": 5 + } + } + } + }, + "ImportEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "conflictingResources": { + "type": "ConflictingResources", + "id": 2 + } + }, + "nested": { + "ConflictingResources": { + "fields": { + "entityTypeDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "entityDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "ImportEntityTypesMetadata": { + "fields": {} + }, + "ListEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityType": { + "type": "EntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateEntityTypeRequest": { + "fields": { + "entityType": { + "type": "EntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "InlineDestination": { + "fields": { + "content": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "InlineSource": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + } + } + }, + "Environments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListEnvironments": { + "requestType": "ListEnvironmentsRequest", + "responseType": "ListEnvironmentsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/environments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/environments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEnvironment": { + "requestType": "GetEnvironmentRequest", + "responseType": "Environment", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/environments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEnvironment": { + "requestType": "CreateEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/environments", + "(google.api.http).body": "environment", + "(google.api.method_signature)": "parent,environment", + "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/environments", + "body": "environment" + } + }, + { + "(google.api.method_signature)": "parent,environment" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Environment", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "UpdateEnvironment": { + "requestType": "UpdateEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v3/{environment.name=projects/*/locations/*/agents/*/environments/*}", + "(google.api.http).body": "environment", + "(google.api.method_signature)": "environment,update_mask", + "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{environment.name=projects/*/locations/*/agents/*/environments/*}", + "body": "environment" + } + }, + { + "(google.api.method_signature)": "environment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Environment", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "DeleteEnvironment": { + "requestType": "DeleteEnvironmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/environments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LookupEnvironmentHistory": { + "requestType": "LookupEnvironmentHistoryRequest", + "responseType": "LookupEnvironmentHistoryResponse", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RunContinuousTest": { + "requestType": "RunContinuousTestRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "RunContinuousTestResponse", + "(google.longrunning.operation_info).metadata_type": "RunContinuousTestMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunContinuousTestResponse", + "metadata_type": "RunContinuousTestMetadata" + } + } + ] + }, + "ListContinuousTestResults": { + "requestType": "ListContinuousTestResultsRequest", + "responseType": "ListContinuousTestResultsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeployFlow": { + "requestType": "DeployFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "DeployFlowResponse", + "(google.longrunning.operation_info).metadata_type": "DeployFlowMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployFlowResponse", + "metadata_type": "DeployFlowMetadata" + } + } + ] + } + } + }, + "Environment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Environment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "versionConfigs": { + "rule": "repeated", + "type": "VersionConfig", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "testCasesConfig": { + "type": "TestCasesConfig", + "id": 7 + }, + "webhookConfig": { + "type": "WebhookConfig", + "id": 10 + } + }, + "nested": { + "VersionConfig": { + "fields": { + "version": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "TestCasesConfig": { + "fields": { + "testCases": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + }, + "enableContinuousRun": { + "type": "bool", + "id": 2 + }, + "enablePredeploymentRun": { + "type": "bool", + "id": 3 + } + } + }, + "WebhookConfig": { + "fields": { + "webhookOverrides": { + "rule": "repeated", + "type": "Webhook", + "id": 1 + } + } + } + } + }, + "ListEnvironmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListEnvironmentsResponse": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "CreateEnvironmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" + } + }, + "environment": { + "type": "Environment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEnvironmentRequest": { + "fields": { + "environment": { + "type": "Environment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "LookupEnvironmentHistoryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "LookupEnvironmentHistoryResponse": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ContinuousTestResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/ContinuousTestResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "result": { + "type": "AggregatedTestResult", + "id": 2 + }, + "testCaseResults": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCaseResult" + } + }, + "runTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "AggregatedTestResult": { + "values": { + "AGGREGATED_TEST_RESULT_UNSPECIFIED": 0, + "PASSED": 1, + "FAILED": 2 + } + } + } + }, + "RunContinuousTestRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "RunContinuousTestResponse": { + "fields": { + "continuousTestResult": { + "type": "ContinuousTestResult", + "id": 1 + } + } + }, + "RunContinuousTestMetadata": { + "fields": { + "errors": { + "rule": "repeated", + "type": "TestError", + "id": 1 + } + } + }, + "ListContinuousTestResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ContinuousTestResult" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListContinuousTestResultsResponse": { + "fields": { + "continuousTestResults": { + "rule": "repeated", + "type": "ContinuousTestResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeployFlowRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "flowVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "DeployFlowResponse": { + "fields": { + "environment": { + "type": "Environment", + "id": 1 + }, + "deployment": { + "type": "string", + "id": 2 + } + } + }, + "DeployFlowMetadata": { + "fields": { + "testErrors": { + "rule": "repeated", + "type": "TestError", + "id": 1 + } + } + }, + "TestCases": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListTestCases": { + "requestType": "ListTestCasesRequest", + "responseType": "ListTestCasesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/testCases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/testCases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "BatchDeleteTestCases": { + "requestType": "BatchDeleteTestCasesRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTestCase": { + "requestType": "GetTestCaseRequest", + "responseType": "TestCase", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/testCases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/testCases/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTestCase": { + "requestType": "CreateTestCaseRequest", + "responseType": "TestCase", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases", + "(google.api.http).body": "test_case", + "(google.api.method_signature)": "parent,test_case" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases", + "body": "test_case" + } + }, + { + "(google.api.method_signature)": "parent,test_case" + } + ] + }, + "UpdateTestCase": { + "requestType": "UpdateTestCaseRequest", + "responseType": "TestCase", + "options": { + "(google.api.http).patch": "/v3/{test_case.name=projects/*/locations/*/agents/*/testCases/*}", + "(google.api.http).body": "test_case", + "(google.api.method_signature)": "test_case,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{test_case.name=projects/*/locations/*/agents/*/testCases/*}", + "body": "test_case" + } + }, + { + "(google.api.method_signature)": "test_case,update_mask" + } + ] + }, + "RunTestCase": { + "requestType": "RunTestCaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/testCases/*}:run", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "RunTestCaseResponse", + "(google.longrunning.operation_info).metadata_type": "RunTestCaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/testCases/*}:run", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunTestCaseResponse", + "metadata_type": "RunTestCaseMetadata" + } + } + ] + }, + "BatchRunTestCases": { + "requestType": "BatchRunTestCasesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchRun", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "BatchRunTestCasesResponse", + "(google.longrunning.operation_info).metadata_type": "BatchRunTestCasesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchRun", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchRunTestCasesResponse", + "metadata_type": "BatchRunTestCasesMetadata" + } + } + ] + }, + "CalculateCoverage": { + "requestType": "CalculateCoverageRequest", + "responseType": "CalculateCoverageResponse", + "options": { + "(google.api.http).get": "/v3/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage" + } + } + ] + }, + "ImportTestCases": { + "requestType": "ImportTestCasesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportTestCasesResponse", + "(google.longrunning.operation_info).metadata_type": "ImportTestCasesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportTestCasesResponse", + "metadata_type": "ImportTestCasesMetadata" + } + } + ] + }, + "ExportTestCases": { + "requestType": "ExportTestCasesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportTestCasesResponse", + "(google.longrunning.operation_info).metadata_type": "ExportTestCasesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/testCases:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportTestCasesResponse", + "metadata_type": "ExportTestCasesMetadata" + } + } + ] + }, + "ListTestCaseResults": { + "requestType": "ListTestCaseResultsRequest", + "responseType": "ListTestCaseResultsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/testCases/*}/results", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/testCases/*}/results" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTestCaseResult": { + "requestType": "GetTestCaseResultRequest", + "responseType": "TestCaseResult", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/testCases/*/results/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/testCases/*/results/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "TestCase": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/TestCase", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notes": { + "type": "string", + "id": 4 + }, + "testConfig": { + "type": "TestConfig", + "id": 13 + }, + "testCaseConversationTurns": { + "rule": "repeated", + "type": "ConversationTurn", + "id": 5 + }, + "creationTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastTestResult": { + "type": "TestCaseResult", + "id": 12 + } + } + }, + "TestCaseResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/TestCaseResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "environment": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "conversationTurns": { + "rule": "repeated", + "type": "ConversationTurn", + "id": 3 + }, + "testResult": { + "type": "TestResult", + "id": 4 + }, + "testTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "TestConfig": { + "fields": { + "trackingParameters": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "flow": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "page": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + } + } + }, + "ConversationTurn": { + "fields": { + "userInput": { + "type": "UserInput", + "id": 1 + }, + "virtualAgentOutput": { + "type": "VirtualAgentOutput", + "id": 2 + } + }, + "nested": { + "UserInput": { + "fields": { + "input": { + "type": "QueryInput", + "id": 5 + }, + "injectedParameters": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "isWebhookEnabled": { + "type": "bool", + "id": 3 + }, + "enableSentimentAnalysis": { + "type": "bool", + "id": 7 + } + } + }, + "VirtualAgentOutput": { + "fields": { + "sessionParameters": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "differences": { + "rule": "repeated", + "type": "TestRunDifference", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "diagnosticInfo": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "triggeredIntent": { + "type": "Intent", + "id": 7 + }, + "currentPage": { + "type": "Page", + "id": 8 + }, + "textResponses": { + "rule": "repeated", + "type": "ResponseMessage.Text", + "id": 9 + }, + "status": { + "type": "google.rpc.Status", + "id": 10 + } + } + } + } + }, + "TestRunDifference": { + "fields": { + "type": { + "type": "DiffType", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DiffType": { + "values": { + "DIFF_TYPE_UNSPECIFIED": 0, + "INTENT": 1, + "PAGE": 2, + "PARAMETERS": 3, + "UTTERANCE": 4, + "FLOW": 5 + } + } + } + }, + "TransitionCoverage": { + "fields": { + "transitions": { + "rule": "repeated", + "type": "Transition", + "id": 1 + }, + "coverageScore": { + "type": "float", + "id": 2 + } + }, + "nested": { + "TransitionNode": { + "oneofs": { + "kind": { + "oneof": [ + "page", + "flow" + ] + } + }, + "fields": { + "page": { + "type": "Page", + "id": 1 + }, + "flow": { + "type": "Flow", + "id": 2 + } + } + }, + "Transition": { + "oneofs": { + "detail": { + "oneof": [ + "transitionRoute", + "eventHandler" + ] + } + }, + "fields": { + "source": { + "type": "TransitionNode", + "id": 1 + }, + "index": { + "type": "int32", + "id": 4 + }, + "target": { + "type": "TransitionNode", + "id": 2 + }, + "covered": { + "type": "bool", + "id": 3 + }, + "transitionRoute": { + "type": "TransitionRoute", + "id": 5 + }, + "eventHandler": { + "type": "EventHandler", + "id": 6 + } + } + } + } + }, + "TransitionRouteGroupCoverage": { + "fields": { + "coverages": { + "rule": "repeated", + "type": "Coverage", + "id": 1 + }, + "coverageScore": { + "type": "float", + "id": 2 + } + }, + "nested": { + "Coverage": { + "fields": { + "routeGroup": { + "type": "TransitionRouteGroup", + "id": 1 + }, + "transitions": { + "rule": "repeated", + "type": "Transition", + "id": 2 + }, + "coverageScore": { + "type": "float", + "id": 3 + } + }, + "nested": { + "Transition": { + "fields": { + "transitionRoute": { + "type": "TransitionRoute", + "id": 1 + }, + "covered": { + "type": "bool", + "id": 2 + } + } + } + } + } + } + }, + "IntentCoverage": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + }, + "coverageScore": { + "type": "float", + "id": 2 + } + }, + "nested": { + "Intent": { + "fields": { + "intent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "covered": { + "type": "bool", + "id": 2 + } + } + } + } + }, + "CalculateCoverageRequest": { + "fields": { + "agent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "type": { + "type": "CoverageType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CoverageType": { + "values": { + "COVERAGE_TYPE_UNSPECIFIED": 0, + "INTENT": 1, + "PAGE_TRANSITION": 2, + "TRANSITION_ROUTE_GROUP": 3 + } + } + } + }, + "CalculateCoverageResponse": { + "oneofs": { + "coverageType": { + "oneof": [ + "intentCoverage", + "transitionCoverage", + "routeGroupCoverage" + ] + } + }, + "fields": { + "agent": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "intentCoverage": { + "type": "IntentCoverage", + "id": 2 + }, + "transitionCoverage": { + "type": "TransitionCoverage", + "id": 4 + }, + "routeGroupCoverage": { + "type": "TransitionRouteGroupCoverage", + "id": 6 + } + } + }, + "ListTestCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "view": { + "type": "TestCaseView", + "id": 4 + } + }, + "nested": { + "TestCaseView": { + "values": { + "TEST_CASE_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + } + } + }, + "ListTestCasesResponse": { + "fields": { + "testCases": { + "rule": "repeated", + "type": "TestCase", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "BatchDeleteTestCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "names": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "CreateTestCaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "testCase": { + "type": "TestCase", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateTestCaseRequest": { + "fields": { + "testCase": { + "type": "TestCase", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTestCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "RunTestCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + }, + "environment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "RunTestCaseResponse": { + "fields": { + "result": { + "type": "TestCaseResult", + "id": 2 + } + } + }, + "RunTestCaseMetadata": { + "fields": {} + }, + "BatchRunTestCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "environment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "testCases": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "BatchRunTestCasesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "TestCaseResult", + "id": 1 + } + } + }, + "BatchRunTestCasesMetadata": { + "fields": { + "errors": { + "rule": "repeated", + "type": "TestError", + "id": 1 + } + } + }, + "TestError": { + "fields": { + "testCase": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "testTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ImportTestCasesRequest": { + "oneofs": { + "source": { + "oneof": [ + "gcsUri", + "content" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "gcsUri": { + "type": "string", + "id": 2 + }, + "content": { + "type": "bytes", + "id": 3 + } + } + }, + "ImportTestCasesResponse": { + "fields": { + "names": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "ImportTestCasesMetadata": { + "fields": { + "errors": { + "rule": "repeated", + "type": "TestCaseError", + "id": 1 + } + } + }, + "TestCaseError": { + "fields": { + "testCase": { + "type": "TestCase", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "ExportTestCasesRequest": { + "oneofs": { + "destination": { + "oneof": [ + "gcsUri" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "gcsUri": { + "type": "string", + "id": 2 + }, + "dataFormat": { + "type": "DataFormat", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON": 2 + } + } + } + }, + "ExportTestCasesResponse": { + "oneofs": { + "destination": { + "oneof": [ + "gcsUri", + "content" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + }, + "content": { + "type": "bytes", + "id": 2 + } + } + }, + "ExportTestCasesMetadata": { + "fields": {} + }, + "ListTestCaseResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCaseResult" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListTestCaseResultsResponse": { + "fields": { + "testCaseResults": { + "rule": "repeated", + "type": "TestCaseResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTestCaseResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCaseResult" + } + } + } + }, + "TestResult": { + "values": { + "TEST_RESULT_UNSPECIFIED": 0, + "PASSED": 1, + "FAILED": 2 + } + }, + "Intents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListIntents": { + "requestType": "ListIntentsRequest", + "responseType": "ListIntentsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/intents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/intents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetIntent": { + "requestType": "GetIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/intents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/intents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateIntent": { + "requestType": "CreateIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/intents", + "(google.api.http).body": "intent", + "(google.api.method_signature)": "parent,intent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/intents", + "body": "intent" + } + }, + { + "(google.api.method_signature)": "parent,intent" + } + ] + }, + "UpdateIntent": { + "requestType": "UpdateIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).patch": "/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}", + "(google.api.http).body": "intent", + "(google.api.method_signature)": "intent,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}", + "body": "intent" + } + }, + { + "(google.api.method_signature)": "intent,update_mask" + } + ] + }, + "DeleteIntent": { + "requestType": "DeleteIntentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/intents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/intents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportIntents": { + "requestType": "ImportIntentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/intents:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportIntentsResponse", + "(google.longrunning.operation_info).metadata_type": "ImportIntentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/intents:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportIntentsResponse", + "metadata_type": "ImportIntentsMetadata" + } + } + ] + }, + "ExportIntents": { + "requestType": "ExportIntentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/intents:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportIntentsResponse", + "(google.longrunning.operation_info).metadata_type": "ExportIntentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/intents:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportIntentsResponse", + "metadata_type": "ExportIntentsMetadata" + } + } + ] + } + } + }, + "Intent": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Intent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trainingPhrases": { + "rule": "repeated", + "type": "TrainingPhrase", + "id": 3 + }, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 4 + }, + "priority": { + "type": "int32", + "id": 5 + }, + "isFallback": { + "type": "bool", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "description": { + "type": "string", + "id": 8 + }, + "dtmfPattern": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TrainingPhrase": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parts": { + "rule": "repeated", + "type": "Part", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "repeatCount": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "Part": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameterId": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Parameter": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entityType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "isList": { + "type": "bool", + "id": 3 + }, + "redact": { + "type": "bool", + "id": 4 + } + } + } + } + }, + "ListIntentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "intentView": { + "type": "IntentView", + "id": 5 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListIntentsResponse": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateIntentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intent": { + "type": "Intent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateIntentRequest": { + "fields": { + "intent": { + "type": "Intent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + } + } + }, + "IntentView": { + "values": { + "INTENT_VIEW_UNSPECIFIED": 0, + "INTENT_VIEW_PARTIAL": 1, + "INTENT_VIEW_FULL": 2 + } + }, + "ImportIntentsRequest": { + "oneofs": { + "intents": { + "oneof": [ + "intentsUri", + "intentsContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intentsUri": { + "type": "string", + "id": 2 + }, + "intentsContent": { + "type": "InlineSource", + "id": 3 + }, + "mergeOption": { + "type": "MergeOption", + "id": 4 + } + }, + "nested": { + "MergeOption": { + "valuesOptions": { + "REJECT": { + "deprecated": true + } + }, + "values": { + "MERGE_OPTION_UNSPECIFIED": 0, + "REJECT": 1, + "REPLACE": 2, + "MERGE": 3, + "RENAME": 4, + "REPORT_CONFLICT": 5, + "KEEP": 6 + } + } + } + }, + "ImportIntentsResponse": { + "fields": { + "intents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "conflictingResources": { + "type": "ConflictingResources", + "id": 2 + } + }, + "nested": { + "ConflictingResources": { + "fields": { + "intentDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "entityDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "ImportIntentsMetadata": { + "fields": {} + }, + "ExportIntentsRequest": { + "oneofs": { + "destination": { + "oneof": [ + "intentsUri", + "intentsContentInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intents": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "intentsUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentsContentInline": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON": 2, + "CSV": 3 + } + } + } + }, + "ExportIntentsResponse": { + "oneofs": { + "intents": { + "oneof": [ + "intentsUri", + "intentsContent" + ] + } + }, + "fields": { + "intentsUri": { + "type": "string", + "id": 1 + }, + "intentsContent": { + "type": "InlineDestination", + "id": 2 + } + } + }, + "ExportIntentsMetadata": { + "fields": {} + }, + "Sessions": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "DetectIntent": { + "requestType": "DetectIntentRequest", + "responseType": "DetectIntentResponse", + "options": { + "(google.api.http).post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent", + "body": "*", + "additional_bindings": { + "post": "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent", + "body": "*" + } + } + } + ] + }, + "ServerStreamingDetectIntent": { + "requestType": "DetectIntentRequest", + "responseType": "DetectIntentResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent", + "body": "*", + "additional_bindings": { + "post": "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent", + "body": "*" + } + } + } + ] + }, + "StreamingDetectIntent": { + "requestType": "StreamingDetectIntentRequest", + "requestStream": true, + "responseType": "StreamingDetectIntentResponse", + "responseStream": true + }, + "MatchIntent": { + "requestType": "MatchIntentRequest", + "responseType": "MatchIntentResponse", + "options": { + "(google.api.http).post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent", + "body": "*", + "additional_bindings": { + "post": "/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent", + "body": "*" + } + } + } + ] + }, + "FulfillIntent": { + "requestType": "FulfillIntentRequest", + "responseType": "FulfillIntentResponse", + "options": { + "(google.api.http).post": "/v3/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent", + "body": "*", + "additional_bindings": { + "post": "/v3/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent", + "body": "*" + } + } + } + ] + }, + "SubmitAnswerFeedback": { + "requestType": "SubmitAnswerFeedbackRequest", + "responseType": "AnswerFeedback", + "options": { + "(google.api.http).post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback", + "body": "*" + } + } + ] + } + } + }, + "AnswerFeedback": { + "fields": { + "rating": { + "type": "Rating", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ratingReason": { + "type": "RatingReason", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customRating": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Rating": { + "values": { + "RATING_UNSPECIFIED": 0, + "THUMBS_UP": 1, + "THUMBS_DOWN": 2 + } + }, + "RatingReason": { + "fields": { + "reasonLabels": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "feedback": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "SubmitAnswerFeedbackRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "responseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "answerFeedback": { + "type": "AnswerFeedback", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DetectIntentRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "queryParams": { + "type": "QueryParameters", + "id": 2 + }, + "queryInput": { + "type": "QueryInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + }, + "responseView": { + "type": "DetectIntentResponseView", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DetectIntentResponse": { + "fields": { + "responseId": { + "type": "string", + "id": 1 + }, + "queryResult": { + "type": "QueryResult", + "id": 2 + }, + "outputAudio": { + "type": "bytes", + "id": 4 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 5 + }, + "responseType": { + "type": "ResponseType", + "id": 6 + }, + "allowCancellation": { + "type": "bool", + "id": 7 + } + }, + "nested": { + "ResponseType": { + "values": { + "RESPONSE_TYPE_UNSPECIFIED": 0, + "PARTIAL": 1, + "FINAL": 2 + } + } + } + }, + "StreamingDetectIntentRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "queryParams": { + "type": "QueryParameters", + "id": 2 + }, + "queryInput": { + "type": "QueryInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + }, + "enablePartialResponse": { + "type": "bool", + "id": 5 + }, + "enableDebuggingInfo": { + "type": "bool", + "id": 8 + }, + "responseView": { + "type": "DetectIntentResponseView", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CloudConversationDebuggingInfo": { + "fields": { + "audioDataChunks": { + "type": "int32", + "id": 1 + }, + "resultEndTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "firstAudioDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "singleUtterance": { + "type": "bool", + "id": 5 + }, + "speechPartialResultsEndTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 6 + }, + "speechFinalResultsEndTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 7 + }, + "partialResponses": { + "type": "int32", + "id": 8 + }, + "speakerIdPassiveLatencyMsOffset": { + "type": "int32", + "id": 9 + }, + "bargeinEventTriggered": { + "type": "bool", + "id": 10 + }, + "speechSingleUtterance": { + "type": "bool", + "id": 11 + }, + "dtmfPartialResultsTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 12 + }, + "dtmfFinalResultsTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 13 + }, + "singleUtteranceEndTimeOffset": { + "type": "google.protobuf.Duration", + "id": 14 + }, + "noSpeechTimeout": { + "type": "google.protobuf.Duration", + "id": 15 + }, + "endpointingTimeout": { + "type": "google.protobuf.Duration", + "id": 19 + }, + "isInputText": { + "type": "bool", + "id": 16 + }, + "clientHalfCloseTimeOffset": { + "type": "google.protobuf.Duration", + "id": 17 + }, + "clientHalfCloseStreamingTimeOffset": { + "type": "google.protobuf.Duration", + "id": 18 + } + } + }, + "StreamingDetectIntentResponse": { + "oneofs": { + "response": { + "oneof": [ + "recognitionResult", + "detectIntentResponse" + ] + } + }, + "fields": { + "recognitionResult": { + "type": "StreamingRecognitionResult", + "id": 1 + }, + "detectIntentResponse": { + "type": "DetectIntentResponse", + "id": 2 + }, + "debuggingInfo": { + "type": "CloudConversationDebuggingInfo", + "id": 4 + } + } + }, + "StreamingRecognitionResult": { + "fields": { + "messageType": { + "type": "MessageType", + "id": 1 + }, + "transcript": { + "type": "string", + "id": 2 + }, + "isFinal": { + "type": "bool", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "stability": { + "type": "float", + "id": 6 + }, + "speechWordInfo": { + "rule": "repeated", + "type": "SpeechWordInfo", + "id": 7 + }, + "speechEndOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "languageCode": { + "type": "string", + "id": 10 + } + }, + "nested": { + "MessageType": { + "values": { + "MESSAGE_TYPE_UNSPECIFIED": 0, + "TRANSCRIPT": 1, + "END_OF_SINGLE_UTTERANCE": 2 + } + } + } + }, + "QueryParameters": { + "fields": { + "timeZone": { + "type": "string", + "id": 1 + }, + "geoLocation": { + "type": "google.type.LatLng", + "id": 2 + }, + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 3 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 5 + }, + "parameterScope": { + "type": "string", + "id": 12 + }, + "currentPage": { + "type": "string", + "id": 6, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "disableWebhook": { + "type": "bool", + "id": 7 + }, + "analyzeQueryTextSentiment": { + "type": "bool", + "id": 8 + }, + "webhookHeaders": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "flowVersions": { + "rule": "repeated", + "type": "string", + "id": 14, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "currentPlaybook": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "channel": { + "type": "string", + "id": 15 + }, + "sessionTtl": { + "type": "google.protobuf.Duration", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endUserMetadata": { + "type": "google.protobuf.Struct", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "searchConfig": { + "type": "SearchConfig", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "populateDataStoreConnectionSignals": { + "type": "bool", + "id": 25, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchConfig": { + "fields": { + "boostSpecs": { + "rule": "repeated", + "type": "BoostSpecs", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterSpecs": { + "rule": "repeated", + "type": "FilterSpecs", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BoostSpec": { + "fields": { + "conditionBoostSpecs": { + "rule": "repeated", + "type": "ConditionBoostSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConditionBoostSpec": { + "fields": { + "condition": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boost": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostControlSpec": { + "type": "BoostControlSpec", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostControlSpec": { + "fields": { + "fieldName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributeType": { + "type": "AttributeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interpolationType": { + "type": "InterpolationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "controlPoints": { + "rule": "repeated", + "type": "ControlPoint", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "NUMERICAL": 1, + "FRESHNESS": 2 + } + }, + "InterpolationType": { + "values": { + "INTERPOLATION_TYPE_UNSPECIFIED": 0, + "LINEAR": 1 + } + }, + "ControlPoint": { + "fields": { + "attributeValue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostAmount": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + } + } + }, + "BoostSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "spec": { + "rule": "repeated", + "type": "BoostSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FilterSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryInput": { + "oneofs": { + "input": { + "oneof": [ + "text", + "intent", + "audio", + "event", + "dtmf", + "toolCallResult" + ] + } + }, + "fields": { + "text": { + "type": "TextInput", + "id": 2 + }, + "intent": { + "type": "IntentInput", + "id": 3 + }, + "audio": { + "type": "AudioInput", + "id": 5 + }, + "event": { + "type": "EventInput", + "id": 6 + }, + "dtmf": { + "type": "DtmfInput", + "id": 7 + }, + "toolCallResult": { + "type": "ToolCallResult", + "id": 11 + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "QueryResult": { + "oneofs": { + "query": { + "oneof": [ + "text", + "triggerIntent", + "transcript", + "triggerEvent", + "dtmf" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "triggerIntent": { + "type": "string", + "id": 11, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "transcript": { + "type": "string", + "id": 12 + }, + "triggerEvent": { + "type": "string", + "id": 14 + }, + "dtmf": { + "type": "DtmfInput", + "id": 23 + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 3 + }, + "responseMessages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 4 + }, + "webhookStatuses": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 13 + }, + "webhookPayloads": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 6 + }, + "currentPage": { + "type": "Page", + "id": 7 + }, + "currentFlow": { + "type": "Flow", + "id": 31 + }, + "intent": { + "type": "Intent", + "id": 8, + "options": { + "deprecated": true + } + }, + "intentDetectionConfidence": { + "type": "float", + "id": 9, + "options": { + "deprecated": true + } + }, + "match": { + "type": "Match", + "id": 15 + }, + "diagnosticInfo": { + "type": "google.protobuf.Struct", + "id": 10 + }, + "sentimentAnalysisResult": { + "type": "SentimentAnalysisResult", + "id": 17 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 21 + }, + "allowAnswerFeedback": { + "type": "bool", + "id": 32 + }, + "dataStoreConnectionSignals": { + "type": "DataStoreConnectionSignals", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "traceBlocks": { + "rule": "repeated", + "type": "TraceBlock", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TextInput": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IntentInput": { + "fields": { + "intent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + } + } + }, + "AudioInput": { + "fields": { + "config": { + "type": "InputAudioConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "bytes", + "id": 2 + } + } + }, + "EventInput": { + "fields": { + "event": { + "type": "string", + "id": 1 + } + } + }, + "DtmfInput": { + "fields": { + "digits": { + "type": "string", + "id": 1 + }, + "finishDigit": { + "type": "string", + "id": 2 + } + } + }, + "Match": { + "fields": { + "intent": { + "type": "Intent", + "id": 1 + }, + "event": { + "type": "string", + "id": 6 + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "resolvedInput": { + "type": "string", + "id": 3 + }, + "matchType": { + "type": "MatchType", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "MatchType": { + "values": { + "MATCH_TYPE_UNSPECIFIED": 0, + "INTENT": 1, + "DIRECT_INTENT": 2, + "PARAMETER_FILLING": 3, + "NO_MATCH": 4, + "NO_INPUT": 5, + "EVENT": 6, + "KNOWLEDGE_CONNECTOR": 8, + "PLAYBOOK": 9 + } + } + } + }, + "MatchIntentRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "queryParams": { + "type": "QueryParameters", + "id": 2 + }, + "queryInput": { + "type": "QueryInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "persistParameterChanges": { + "type": "bool", + "id": 5 + } + } + }, + "MatchIntentResponse": { + "oneofs": { + "query": { + "oneof": [ + "text", + "triggerIntent", + "transcript", + "triggerEvent" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "triggerIntent": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "transcript": { + "type": "string", + "id": 3 + }, + "triggerEvent": { + "type": "string", + "id": 6 + }, + "matches": { + "rule": "repeated", + "type": "Match", + "id": 4 + }, + "currentPage": { + "type": "Page", + "id": 5 + } + } + }, + "FulfillIntentRequest": { + "fields": { + "matchIntentRequest": { + "type": "MatchIntentRequest", + "id": 1 + }, + "match": { + "type": "Match", + "id": 2 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 3 + } + } + }, + "FulfillIntentResponse": { + "fields": { + "responseId": { + "type": "string", + "id": 1 + }, + "queryResult": { + "type": "QueryResult", + "id": 2 + }, + "outputAudio": { + "type": "bytes", + "id": 3 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + } + } + }, + "SentimentAnalysisResult": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "magnitude": { + "type": "float", + "id": 2 + } + } + }, + "DetectIntentResponseView": { + "values": { + "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED": 0, + "DETECT_INTENT_RESPONSE_VIEW_FULL": 1, + "DETECT_INTENT_RESPONSE_VIEW_BASIC": 2, + "DETECT_INTENT_RESPONSE_VIEW_DEFAULT": 3 + } + }, + "SessionEntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListSessionEntityTypes": { + "requestType": "ListSessionEntityTypesRequest", + "responseType": "ListSessionEntityTypesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "additional_bindings": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSessionEntityType": { + "requestType": "GetSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.get": "/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "additional_bindings": { + "get": "/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSessionEntityType": { + "requestType": "CreateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.post": "/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "parent,session_entity_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "body": "session_entity_type", + "additional_bindings": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes", + "body": "session_entity_type" + } + } + }, + { + "(google.api.method_signature)": "parent,session_entity_type" + } + ] + }, + "UpdateSessionEntityType": { + "requestType": "UpdateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).patch": "/v3/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.patch": "/v3/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "session_entity_type,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "body": "session_entity_type", + "additional_bindings": { + "patch": "/v3/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "body": "session_entity_type" + } + } + }, + { + "(google.api.method_signature)": "session_entity_type,update_mask" + } + ] + }, + "DeleteSessionEntityType": { + "requestType": "DeleteSessionEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.delete": "/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "additional_bindings": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "SessionEntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/SessionEntityType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entityOverrideMode": { + "type": "EntityOverrideMode", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "EntityOverrideMode": { + "values": { + "ENTITY_OVERRIDE_MODE_UNSPECIFIED": 0, + "ENTITY_OVERRIDE_MODE_OVERRIDE": 1, + "ENTITY_OVERRIDE_MODE_SUPPLEMENT": 2 + } + } + } + }, + "ListSessionEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSessionEntityTypesResponse": { + "fields": { + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "CreateSessionEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "sessionEntityType": { + "type": "SessionEntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSessionEntityTypeRequest": { + "fields": { + "sessionEntityType": { + "type": "SessionEntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "TraceBlock": { + "oneofs": { + "traceMetadata": { + "oneof": [ + "playbookTraceMetadata", + "flowTraceMetadata", + "speechProcessingMetadata" + ] + } + }, + "fields": { + "playbookTraceMetadata": { + "type": "PlaybookTraceMetadata", + "id": 1 + }, + "flowTraceMetadata": { + "type": "FlowTraceMetadata", + "id": 2 + }, + "speechProcessingMetadata": { + "type": "SpeechProcessingMetadata", + "id": 8 + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputParameters": { + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputParameters": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endState": { + "type": "OutputState", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechProcessingMetadata": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PlaybookTraceMetadata": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "FlowTraceMetadata": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PlaybookInput": { + "fields": { + "precedingConversationSummary": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PlaybookOutput": { + "fields": { + "executionSummary": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Action": { + "oneofs": { + "action": { + "oneof": [ + "userUtterance", + "agentUtterance", + "toolUse", + "playbookInvocation", + "flowInvocation", + "playbookTransition", + "flowTransition" + ] + } + }, + "fields": { + "userUtterance": { + "type": "UserUtterance", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentUtterance": { + "type": "AgentUtterance", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolUse": { + "type": "ToolUse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookInvocation": { + "type": "PlaybookInvocation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flowInvocation": { + "type": "FlowInvocation", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookTransition": { + "type": "PlaybookTransition", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flowTransition": { + "type": "FlowTransition", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UserUtterance": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AgentUtterance": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolUse": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "displayName": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputActionParameters": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputActionParameters": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PlaybookInvocation": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "playbookInput": { + "type": "PlaybookInput", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookOutput": { + "type": "PlaybookOutput", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookState": { + "type": "OutputState", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FlowInvocation": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "displayName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "flowState": { + "type": "OutputState", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PlaybookTransition": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "FlowTransition": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OutputState": { + "values": { + "OUTPUT_STATE_UNSPECIFIED": 0, + "OUTPUT_STATE_OK": 1, + "OUTPUT_STATE_CANCELLED": 2, + "OUTPUT_STATE_FAILED": 3, + "OUTPUT_STATE_ESCALATED": 4, + "OUTPUT_STATE_PENDING": 5 + } + }, + "TransitionRouteGroups": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListTransitionRouteGroups": { + "requestType": "ListTransitionRouteGroupsRequest", + "responseType": "ListTransitionRouteGroupsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "(google.api.http).additional_bindings.get": "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "additional_bindings": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTransitionRouteGroup": { + "requestType": "GetTransitionRouteGroupRequest", + "responseType": "TransitionRouteGroup", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "(google.api.http).additional_bindings.get": "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "additional_bindings": { + "get": "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTransitionRouteGroup": { + "requestType": "CreateTransitionRouteGroupRequest", + "responseType": "TransitionRouteGroup", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "(google.api.http).body": "transition_route_group", + "(google.api.http).additional_bindings.post": "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "(google.api.http).additional_bindings.body": "transition_route_group", + "(google.api.method_signature)": "parent,transition_route_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "body": "transition_route_group", + "additional_bindings": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "body": "transition_route_group" + } + } + }, + { + "(google.api.method_signature)": "parent,transition_route_group" + } + ] + }, + "UpdateTransitionRouteGroup": { + "requestType": "UpdateTransitionRouteGroupRequest", + "responseType": "TransitionRouteGroup", + "options": { + "(google.api.http).patch": "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "(google.api.http).body": "transition_route_group", + "(google.api.http).additional_bindings.patch": "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "(google.api.http).additional_bindings.body": "transition_route_group", + "(google.api.method_signature)": "transition_route_group,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "body": "transition_route_group", + "additional_bindings": { + "patch": "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "body": "transition_route_group" + } + } + }, + { + "(google.api.method_signature)": "transition_route_group,update_mask" + } + ] + }, + "DeleteTransitionRouteGroup": { + "requestType": "DeleteTransitionRouteGroupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "(google.api.http).additional_bindings.delete": "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "additional_bindings": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "TransitionRouteGroup": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/TransitionRouteGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}", + "(google.api.resource).plural": "transitionRouteGroups", + "(google.api.resource).singular": "transitionRouteGroup" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "transitionRoutes": { + "rule": "repeated", + "type": "TransitionRoute", + "id": 5 + } + } + }, + "ListTransitionRouteGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4 + } + } + }, + "ListTransitionRouteGroupsResponse": { + "fields": { + "transitionRouteGroups": { + "rule": "repeated", + "type": "TransitionRouteGroup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTransitionRouteGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateTransitionRouteGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "transitionRouteGroup": { + "type": "TransitionRouteGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateTransitionRouteGroupRequest": { + "fields": { + "transitionRouteGroup": { + "type": "TransitionRouteGroup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "DeleteTransitionRouteGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "Webhooks": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListWebhooks": { + "requestType": "ListWebhooksRequest", + "responseType": "ListWebhooksResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/webhooks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/webhooks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetWebhook": { + "requestType": "GetWebhookRequest", + "responseType": "Webhook", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/webhooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/webhooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateWebhook": { + "requestType": "CreateWebhookRequest", + "responseType": "Webhook", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/webhooks", + "(google.api.http).body": "webhook", + "(google.api.method_signature)": "parent,webhook" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/webhooks", + "body": "webhook" + } + }, + { + "(google.api.method_signature)": "parent,webhook" + } + ] + }, + "UpdateWebhook": { + "requestType": "UpdateWebhookRequest", + "responseType": "Webhook", + "options": { + "(google.api.http).patch": "/v3/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}", + "(google.api.http).body": "webhook", + "(google.api.method_signature)": "webhook,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}", + "body": "webhook" + } + }, + { + "(google.api.method_signature)": "webhook,update_mask" + } + ] + }, + "DeleteWebhook": { + "requestType": "DeleteWebhookRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/webhooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/webhooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Webhook": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Webhook", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}" + }, + "oneofs": { + "webhook": { + "oneof": [ + "genericWebService", + "serviceDirectory" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "genericWebService": { + "type": "GenericWebService", + "id": 4 + }, + "serviceDirectory": { + "type": "ServiceDirectoryConfig", + "id": 7 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "disabled": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "GenericWebService": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "username": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "password": { + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + }, + "secretVersionForUsernamePassword": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "requestHeaders": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "secretVersionsForRequestHeaders": { + "keyType": "string", + "type": "SecretVersionHeaderValue", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedCaCerts": { + "rule": "repeated", + "type": "bytes", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauthConfig": { + "type": "OAuthConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAgentAuth": { + "type": "ServiceAgentAuth", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountAuthConfig": { + "type": "ServiceAccountAuthConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webhookType": { + "type": "WebhookType", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpMethod": { + "type": "HttpMethod", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestBody": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameterMapping": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SecretVersionHeaderValue": { + "fields": { + "secretVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "OAuthConfig": { + "fields": { + "clientId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientSecret": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForClientSecret": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "tokenEndpoint": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ServiceAgentAuth": { + "values": { + "SERVICE_AGENT_AUTH_UNSPECIFIED": 0, + "NONE": 1, + "ID_TOKEN": 2, + "ACCESS_TOKEN": 3 + } + }, + "ServiceAccountAuthConfig": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WebhookType": { + "values": { + "WEBHOOK_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "FLEXIBLE": 2 + } + }, + "HttpMethod": { + "values": { + "HTTP_METHOD_UNSPECIFIED": 0, + "POST": 1, + "GET": 2, + "HEAD": 3, + "PUT": 4, + "DELETE": 5, + "PATCH": 6, + "OPTIONS": 7 + } + } + } + }, + "ServiceDirectoryConfig": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" + } + }, + "genericWebService": { + "type": "GenericWebService", + "id": 2 + } + } + } + } + }, + "ListWebhooksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Webhook" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListWebhooksResponse": { + "fields": { + "webhooks": { + "rule": "repeated", + "type": "Webhook", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetWebhookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Webhook" + } + } + } + }, + "CreateWebhookRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Webhook" + } + }, + "webhook": { + "type": "Webhook", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateWebhookRequest": { + "fields": { + "webhook": { + "type": "Webhook", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteWebhookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Webhook" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "WebhookRequest": { + "oneofs": { + "query": { + "oneof": [ + "text", + "triggerIntent", + "transcript", + "triggerEvent", + "dtmfDigits" + ] + } + }, + "fields": { + "detectIntentResponseId": { + "type": "string", + "id": 1 + }, + "text": { + "type": "string", + "id": 10 + }, + "triggerIntent": { + "type": "string", + "id": 11, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "transcript": { + "type": "string", + "id": 12 + }, + "triggerEvent": { + "type": "string", + "id": 14 + }, + "dtmfDigits": { + "type": "string", + "id": 17 + }, + "languageCode": { + "type": "string", + "id": 15 + }, + "fulfillmentInfo": { + "type": "FulfillmentInfo", + "id": 6 + }, + "intentInfo": { + "type": "IntentInfo", + "id": 3 + }, + "pageInfo": { + "type": "PageInfo", + "id": 4 + }, + "sessionInfo": { + "type": "SessionInfo", + "id": 5 + }, + "messages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 7 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 8 + }, + "sentimentAnalysisResult": { + "type": "SentimentAnalysisResult", + "id": 9 + }, + "languageInfo": { + "type": "LanguageInfo", + "id": 18 + } + }, + "nested": { + "FulfillmentInfo": { + "fields": { + "tag": { + "type": "string", + "id": 1 + } + } + }, + "IntentInfo": { + "fields": { + "lastMatchedIntent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "parameters": { + "keyType": "string", + "type": "IntentParameterValue", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 4 + } + }, + "nested": { + "IntentParameterValue": { + "fields": { + "originalValue": { + "type": "string", + "id": 1 + }, + "resolvedValue": { + "type": "google.protobuf.Value", + "id": 2 + } + } + } + } + }, + "SentimentAnalysisResult": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "magnitude": { + "type": "float", + "id": 2 + } + } + } + } + }, + "WebhookResponse": { + "oneofs": { + "transition": { + "oneof": [ + "targetPage", + "targetFlow" + ] + } + }, + "fields": { + "fulfillmentResponse": { + "type": "FulfillmentResponse", + "id": 1 + }, + "pageInfo": { + "type": "PageInfo", + "id": 2 + }, + "sessionInfo": { + "type": "SessionInfo", + "id": 3 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "targetPage": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 6, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + }, + "nested": { + "FulfillmentResponse": { + "fields": { + "messages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 1 + }, + "mergeBehavior": { + "type": "MergeBehavior", + "id": 2 + } + }, + "nested": { + "MergeBehavior": { + "values": { + "MERGE_BEHAVIOR_UNSPECIFIED": 0, + "APPEND": 1, + "REPLACE": 2 + } + } + } + } + } + }, + "PageInfo": { + "fields": { + "currentPage": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "displayName": { + "type": "string", + "id": 4 + }, + "formInfo": { + "type": "FormInfo", + "id": 3 + } + }, + "nested": { + "FormInfo": { + "fields": { + "parameterInfo": { + "rule": "repeated", + "type": "ParameterInfo", + "id": 2 + } + }, + "nested": { + "ParameterInfo": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "required": { + "type": "bool", + "id": 2 + }, + "state": { + "type": "ParameterState", + "id": 3 + }, + "value": { + "type": "google.protobuf.Value", + "id": 4 + }, + "justCollected": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "ParameterState": { + "values": { + "PARAMETER_STATE_UNSPECIFIED": 0, + "EMPTY": 1, + "INVALID": 2, + "FILLED": 3 + } + } + } + } + } + } + } + }, + "SessionInfo": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "parameters": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 2 + } + } + }, + "LanguageInfo": { + "fields": { + "inputLanguageCode": { + "type": "string", + "id": 1 + }, + "resolvedLanguageCode": { + "type": "string", + "id": 2 + }, + "confidenceScore": { + "type": "float", + "id": 3 + } + } + }, + "Examples": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateExample": { + "requestType": "CreateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples", + "(google.api.http).body": "example", + "(google.api.method_signature)": "parent,example" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples", + "body": "example" + } + }, + { + "(google.api.method_signature)": "parent,example" + } + ] + }, + "DeleteExample": { + "requestType": "DeleteExampleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExamples": { + "requestType": "ListExamplesRequest", + "responseType": "ListExamplesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExample": { + "requestType": "GetExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateExample": { + "requestType": "UpdateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).patch": "/v3/{example.name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "(google.api.http).body": "example", + "(google.api.method_signature)": "example,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{example.name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "body": "example" + } + }, + { + "(google.api.method_signature)": "example,update_mask" + } + ] + } + } + }, + "CreateExampleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Example" + } + }, + "example": { + "type": "Example", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Example" + } + } + } + }, + "ListExamplesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Example" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExamplesResponse": { + "fields": { + "examples": { + "rule": "repeated", + "type": "Example", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Example" + } + } + } + }, + "UpdateExampleRequest": { + "fields": { + "example": { + "type": "Example", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Example": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Example", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}", + "(google.api.resource).plural": "examples", + "(google.api.resource).singular": "example" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "playbookInput": { + "type": "PlaybookInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookOutput": { + "type": "PlaybookOutput", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tokenCount": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conversationState": { + "type": "OutputState", + "id": 12, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Experiments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListExperiments": { + "requestType": "ListExperimentsRequest", + "responseType": "ListExperimentsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExperiment": { + "requestType": "GetExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateExperiment": { + "requestType": "CreateExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments", + "(google.api.http).body": "experiment", + "(google.api.method_signature)": "parent,experiment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments", + "body": "experiment" + } + }, + { + "(google.api.method_signature)": "parent,experiment" + } + ] + }, + "UpdateExperiment": { + "requestType": "UpdateExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).patch": "/v3/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "(google.api.http).body": "experiment", + "(google.api.method_signature)": "experiment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "body": "experiment" + } + }, + { + "(google.api.method_signature)": "experiment,update_mask" + } + ] + }, + "DeleteExperiment": { + "requestType": "DeleteExperimentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "StartExperiment": { + "requestType": "StartExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "StopExperiment": { + "requestType": "StopExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Experiment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Experiment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "definition": { + "type": "Definition", + "id": 5 + }, + "rolloutConfig": { + "type": "RolloutConfig", + "id": 14 + }, + "rolloutState": { + "type": "RolloutState", + "id": 15 + }, + "rolloutFailureReason": { + "type": "string", + "id": 16 + }, + "result": { + "type": "Result", + "id": 6 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "experimentLength": { + "type": "google.protobuf.Duration", + "id": 11 + }, + "variantsHistory": { + "rule": "repeated", + "type": "VariantsHistory", + "id": 12 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "DRAFT": 1, + "RUNNING": 2, + "DONE": 3, + "ROLLOUT_FAILED": 4 + } + }, + "Definition": { + "oneofs": { + "variants": { + "oneof": [ + "versionVariants" + ] + } + }, + "fields": { + "condition": { + "type": "string", + "id": 1 + }, + "versionVariants": { + "type": "VersionVariants", + "id": 2 + } + } + }, + "Result": { + "fields": { + "versionMetrics": { + "rule": "repeated", + "type": "VersionMetrics", + "id": 1 + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + }, + "nested": { + "MetricType": { + "values": { + "METRIC_UNSPECIFIED": 0, + "CONTAINED_SESSION_NO_CALLBACK_RATE": 1, + "LIVE_AGENT_HANDOFF_RATE": 2, + "CALLBACK_SESSION_RATE": 3, + "ABANDONED_SESSION_RATE": 4, + "SESSION_END_RATE": 5 + } + }, + "CountType": { + "values": { + "COUNT_TYPE_UNSPECIFIED": 0, + "TOTAL_NO_MATCH_COUNT": 1, + "TOTAL_TURN_COUNT": 2, + "AVERAGE_TURN_COUNT": 3 + } + }, + "ConfidenceInterval": { + "fields": { + "confidenceLevel": { + "type": "double", + "id": 1 + }, + "ratio": { + "type": "double", + "id": 2 + }, + "lowerBound": { + "type": "double", + "id": 3 + }, + "upperBound": { + "type": "double", + "id": 4 + } + } + }, + "Metric": { + "oneofs": { + "value": { + "oneof": [ + "ratio", + "count" + ] + } + }, + "fields": { + "type": { + "type": "MetricType", + "id": 1 + }, + "countType": { + "type": "CountType", + "id": 5 + }, + "ratio": { + "type": "double", + "id": 2 + }, + "count": { + "type": "double", + "id": 4 + }, + "confidenceInterval": { + "type": "ConfidenceInterval", + "id": 3 + } + } + }, + "VersionMetrics": { + "fields": { + "version": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 2 + }, + "sessionCount": { + "type": "int32", + "id": 3 + } + } + } + } + } + } + }, + "VersionVariants": { + "fields": { + "variants": { + "rule": "repeated", + "type": "Variant", + "id": 1 + } + }, + "nested": { + "Variant": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "trafficAllocation": { + "type": "float", + "id": 2 + }, + "isControlGroup": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "VariantsHistory": { + "oneofs": { + "variants": { + "oneof": [ + "versionVariants" + ] + } + }, + "fields": { + "versionVariants": { + "type": "VersionVariants", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "RolloutConfig": { + "fields": { + "rolloutSteps": { + "rule": "repeated", + "type": "RolloutStep", + "id": 1 + }, + "rolloutCondition": { + "type": "string", + "id": 2 + }, + "failureCondition": { + "type": "string", + "id": 3 + } + }, + "nested": { + "RolloutStep": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "trafficPercent": { + "type": "int32", + "id": 2 + }, + "minDuration": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + } + } + }, + "RolloutState": { + "fields": { + "step": { + "type": "string", + "id": 1 + }, + "stepIndex": { + "type": "int32", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "ListExperimentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Experiment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListExperimentsResponse": { + "fields": { + "experiments": { + "rule": "repeated", + "type": "Experiment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "CreateExperimentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Experiment" + } + }, + "experiment": { + "type": "Experiment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateExperimentRequest": { + "fields": { + "experiment": { + "type": "Experiment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "StartExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "StopExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "Generators": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListGenerators": { + "requestType": "ListGeneratorsRequest", + "responseType": "ListGeneratorsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/generators", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/generators" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGenerator": { + "requestType": "GetGeneratorRequest", + "responseType": "Generator", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/generators/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/generators/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGenerator": { + "requestType": "CreateGeneratorRequest", + "responseType": "Generator", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/generators", + "(google.api.http).body": "generator", + "(google.api.method_signature)": "parent,generator" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/generators", + "body": "generator" + } + }, + { + "(google.api.method_signature)": "parent,generator" + } + ] + }, + "UpdateGenerator": { + "requestType": "UpdateGeneratorRequest", + "responseType": "Generator", + "options": { + "(google.api.http).patch": "/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}", + "(google.api.http).body": "generator", + "(google.api.method_signature)": "generator,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}", + "body": "generator" + } + }, + { + "(google.api.method_signature)": "generator,update_mask" + } + ] + }, + "DeleteGenerator": { + "requestType": "DeleteGeneratorRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/generators/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/generators/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Generator": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Generator", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/generators/{generator}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "promptText": { + "type": "Phrase", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "placeholders": { + "rule": "repeated", + "type": "Placeholder", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 9 + }, + "modelParameter": { + "type": "ModelParameter", + "id": 8 + } + }, + "nested": { + "Placeholder": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "ModelParameter": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_maxDecodeSteps": { + "oneof": [ + "maxDecodeSteps" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "temperature": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "maxDecodeSteps": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "Phrase": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListGeneratorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Generator" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListGeneratorsResponse": { + "fields": { + "generators": { + "rule": "repeated", + "type": "Generator", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetGeneratorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Generator" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateGeneratorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Generator" + } + }, + "generator": { + "type": "Generator", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateGeneratorRequest": { + "fields": { + "generator": { + "type": "Generator", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteGeneratorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Generator" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "Playbooks": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreatePlaybook": { + "requestType": "CreatePlaybookRequest", + "responseType": "Playbook", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/playbooks", + "(google.api.http).body": "playbook", + "(google.api.method_signature)": "parent,playbook" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/playbooks", + "body": "playbook" + } + }, + { + "(google.api.method_signature)": "parent,playbook" + } + ] + }, + "DeletePlaybook": { + "requestType": "DeletePlaybookRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPlaybooks": { + "requestType": "ListPlaybooksRequest", + "responseType": "ListPlaybooksResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/playbooks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/playbooks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPlaybook": { + "requestType": "GetPlaybookRequest", + "responseType": "Playbook", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ExportPlaybook": { + "requestType": "ExportPlaybookRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportPlaybookResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*}:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportPlaybookResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ImportPlaybook": { + "requestType": "ImportPlaybookRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/playbooks:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportPlaybookResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/playbooks:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportPlaybookResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "UpdatePlaybook": { + "requestType": "UpdatePlaybookRequest", + "responseType": "Playbook", + "options": { + "(google.api.http).patch": "/v3/{playbook.name=projects/*/locations/*/agents/*/playbooks/*}", + "(google.api.http).body": "playbook", + "(google.api.method_signature)": "playbook,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{playbook.name=projects/*/locations/*/agents/*/playbooks/*}", + "body": "playbook" + } + }, + { + "(google.api.method_signature)": "playbook,update_mask" + } + ] + }, + "CreatePlaybookVersion": { + "requestType": "CreatePlaybookVersionRequest", + "responseType": "PlaybookVersion", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions", + "(google.api.http).body": "playbook_version", + "(google.api.method_signature)": "parent,playbook_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions", + "body": "playbook_version" + } + }, + { + "(google.api.method_signature)": "parent,playbook_version" + } + ] + }, + "GetPlaybookVersion": { + "requestType": "GetPlaybookVersionRequest", + "responseType": "PlaybookVersion", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestorePlaybookVersion": { + "requestType": "RestorePlaybookVersionRequest", + "responseType": "RestorePlaybookVersionResponse", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPlaybookVersions": { + "requestType": "ListPlaybookVersionsRequest", + "responseType": "ListPlaybookVersionsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeletePlaybookVersion": { + "requestType": "DeletePlaybookVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreatePlaybookRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Playbook" + } + }, + "playbook": { + "type": "Playbook", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeletePlaybookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + } + } + }, + "ListPlaybooksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Playbook" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListPlaybooksResponse": { + "fields": { + "playbooks": { + "rule": "repeated", + "type": "Playbook", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetPlaybookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + } + } + }, + "UpdatePlaybookRequest": { + "fields": { + "playbook": { + "type": "Playbook", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "Playbook": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Playbook", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "goal": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instruction": { + "type": "Instruction", + "id": 17 + }, + "tokenCount": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencedPlaybooks": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "referencedFlows": { + "rule": "repeated", + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "referencedTools": { + "rule": "repeated", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "inlineActions": { + "rule": "repeated", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "codeBlock": { + "type": "CodeBlock", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "handlers": { + "rule": "repeated", + "type": "Handler", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookType": { + "type": "PlaybookType", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Step": { + "oneofs": { + "instruction": { + "oneof": [ + "text" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "Step", + "id": 2 + } + } + }, + "Instruction": { + "fields": { + "guidelines": { + "type": "string", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "Step", + "id": 2 + } + } + }, + "PlaybookType": { + "values": { + "PLAYBOOK_TYPE_UNSPECIFIED": 0, + "TASK": 1, + "ROUTINE": 3 + } + } + } + }, + "CreatePlaybookVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/PlaybookVersion" + } + }, + "playbookVersion": { + "type": "PlaybookVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PlaybookVersion": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/PlaybookVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}", + "(google.api.resource).plural": "playbookVersions", + "(google.api.resource).singular": "playbookVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbook": { + "type": "Playbook", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "examples": { + "rule": "repeated", + "type": "Example", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetPlaybookVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/PlaybookVersion" + } + } + } + }, + "RestorePlaybookVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/PlaybookVersion" + } + } + } + }, + "RestorePlaybookVersionResponse": { + "fields": { + "playbook": { + "type": "Playbook", + "id": 2 + } + } + }, + "ListPlaybookVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/PlaybookVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPlaybookVersionsResponse": { + "fields": { + "playbookVersions": { + "rule": "repeated", + "type": "PlaybookVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeletePlaybookVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/PlaybookVersion" + } + } + } + }, + "ExportPlaybookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "playbookUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON": 2 + } + } + } + }, + "ImportPlaybookRequest": { + "oneofs": { + "playbook": { + "oneof": [ + "playbookUri", + "playbookContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Playbook" + } + }, + "playbookUri": { + "type": "string", + "id": 2 + }, + "playbookContent": { + "type": "bytes", + "id": 3 + }, + "importStrategy": { + "type": "PlaybookImportStrategy", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PlaybookImportStrategy": { + "fields": { + "mainPlaybookImportStrategy": { + "type": "ImportStrategy", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nestedResourceImportStrategy": { + "type": "ImportStrategy", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolImportStrategy": { + "type": "ImportStrategy", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportPlaybookResponse": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "conflictingResources": { + "type": "ConflictingResources", + "id": 2 + } + }, + "nested": { + "ConflictingResources": { + "fields": { + "mainPlaybookDisplayName": { + "type": "string", + "id": 1 + }, + "nestedPlaybookDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "toolDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + }, + "ExportPlaybookResponse": { + "oneofs": { + "playbook": { + "oneof": [ + "playbookUri", + "playbookContent" + ] + } + }, + "fields": { + "playbookUri": { + "type": "string", + "id": 1 + }, + "playbookContent": { + "type": "bytes", + "id": 2 + } + } + }, + "Handler": { + "oneofs": { + "handler": { + "oneof": [ + "eventHandler", + "lifecycleHandler" + ] + } + }, + "fields": { + "eventHandler": { + "type": "EventHandler", + "id": 1 + }, + "lifecycleHandler": { + "type": "LifecycleHandler", + "id": 3 + } + }, + "nested": { + "EventHandler": { + "fields": { + "event": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "condition": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fulfillment": { + "type": "Fulfillment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LifecycleHandler": { + "fields": { + "lifecycleStage": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "condition": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fulfillment": { + "type": "Fulfillment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "SecuritySettingsService": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateSecuritySettings": { + "requestType": "CreateSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}/securitySettings", + "(google.api.http).body": "security_settings", + "(google.api.method_signature)": "parent,security_settings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}/securitySettings", + "body": "security_settings" + } + }, + { + "(google.api.method_signature)": "parent,security_settings" + } + ] + }, + "GetSecuritySettings": { + "requestType": "GetSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/securitySettings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/securitySettings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSecuritySettings": { + "requestType": "UpdateSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).patch": "/v3/{security_settings.name=projects/*/locations/*/securitySettings/*}", + "(google.api.http).body": "security_settings", + "(google.api.method_signature)": "security_settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{security_settings.name=projects/*/locations/*/securitySettings/*}", + "body": "security_settings" + } + }, + { + "(google.api.method_signature)": "security_settings,update_mask" + } + ] + }, + "ListSecuritySettings": { + "requestType": "ListSecuritySettingsRequest", + "responseType": "ListSecuritySettingsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*}/securitySettings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*}/securitySettings" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSecuritySettings": { + "requestType": "DeleteSecuritySettingsRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/securitySettings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/securitySettings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetSecuritySettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + } + } + }, + "UpdateSecuritySettingsRequest": { + "fields": { + "securitySettings": { + "type": "SecuritySettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSecuritySettingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSecuritySettingsResponse": { + "fields": { + "securitySettings": { + "rule": "repeated", + "type": "SecuritySettings", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateSecuritySettingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "securitySettings": { + "type": "SecuritySettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSecuritySettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + } + } + }, + "SecuritySettings": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/SecuritySettings", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/securitySettings/{security_settings}" + }, + "oneofs": { + "dataRetention": { + "oneof": [ + "retentionWindowDays", + "retentionStrategy" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "redactionStrategy": { + "type": "RedactionStrategy", + "id": 3 + }, + "redactionScope": { + "type": "RedactionScope", + "id": 4 + }, + "inspectTemplate": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + }, + "deidentifyTemplate": { + "type": "string", + "id": 17, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + }, + "retentionWindowDays": { + "type": "int32", + "id": 6 + }, + "retentionStrategy": { + "type": "RetentionStrategy", + "id": 7 + }, + "purgeDataTypes": { + "rule": "repeated", + "type": "PurgeDataType", + "id": 8 + }, + "audioExportSettings": { + "type": "AudioExportSettings", + "id": 12 + }, + "insightsExportSettings": { + "type": "InsightsExportSettings", + "id": 13 + } + }, + "nested": { + "RedactionStrategy": { + "values": { + "REDACTION_STRATEGY_UNSPECIFIED": 0, + "REDACT_WITH_SERVICE": 1 + } + }, + "RedactionScope": { + "values": { + "REDACTION_SCOPE_UNSPECIFIED": 0, + "REDACT_DISK_STORAGE": 2 + } + }, + "RetentionStrategy": { + "values": { + "RETENTION_STRATEGY_UNSPECIFIED": 0, + "REMOVE_AFTER_CONVERSATION": 1 + } + }, + "PurgeDataType": { + "values": { + "PURGE_DATA_TYPE_UNSPECIFIED": 0, + "DIALOGFLOW_HISTORY": 1 + } + }, + "AudioExportSettings": { + "fields": { + "gcsBucket": { + "type": "string", + "id": 1 + }, + "audioExportPattern": { + "type": "string", + "id": 2 + }, + "enableAudioRedaction": { + "type": "bool", + "id": 3 + }, + "audioFormat": { + "type": "AudioFormat", + "id": 4 + }, + "storeTtsAudio": { + "type": "bool", + "id": 6 + } + }, + "nested": { + "AudioFormat": { + "values": { + "AUDIO_FORMAT_UNSPECIFIED": 0, + "MULAW": 1, + "MP3": 2, + "OGG": 3 + } + } + } + }, + "InsightsExportSettings": { + "fields": { + "enableInsightsExport": { + "type": "bool", + "id": 1 + } + } + } + } + }, + "Tools": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateTool": { + "requestType": "CreateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*}/tools", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "parent,tool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*}/tools", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "parent,tool" + } + ] + }, + "ListTools": { + "requestType": "ListToolsRequest", + "responseType": "ListToolsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*}/tools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*}/tools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTool": { + "requestType": "GetToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTool": { + "requestType": "UpdateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).patch": "/v3/{tool.name=projects/*/locations/*/agents/*/tools/*}", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "tool,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{tool.name=projects/*/locations/*/agents/*/tools/*}", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "tool,update_mask" + } + ] + }, + "DeleteTool": { + "requestType": "DeleteToolRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListToolVersions": { + "requestType": "ListToolVersionsRequest", + "responseType": "ListToolVersionsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateToolVersion": { + "requestType": "CreateToolVersionRequest", + "responseType": "ToolVersion", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions", + "(google.api.http).body": "tool_version", + "(google.api.method_signature)": "parent,tool_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions", + "body": "tool_version" + } + }, + { + "(google.api.method_signature)": "parent,tool_version" + } + ] + }, + "GetToolVersion": { + "requestType": "GetToolVersionRequest", + "responseType": "ToolVersion", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteToolVersion": { + "requestType": "DeleteToolVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestoreToolVersion": { + "requestType": "RestoreToolVersionRequest", + "responseType": "RestoreToolVersionResponse", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateToolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Tool" + } + }, + "tool": { + "type": "Tool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListToolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Tool" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + } + } + }, + "UpdateToolRequest": { + "fields": { + "tool": { + "type": "Tool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "Tool": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Tool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}" + }, + "oneofs": { + "specification": { + "oneof": [ + "openApiSpec", + "dataStoreSpec", + "functionSpec" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "openApiSpec": { + "type": "OpenApiTool", + "id": 4 + }, + "dataStoreSpec": { + "type": "DataStoreTool", + "id": 8 + }, + "functionSpec": { + "type": "FunctionTool", + "id": 13 + }, + "toolType": { + "type": "ToolType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OpenApiTool": { + "oneofs": { + "schema": { + "oneof": [ + "textSchema" + ] + } + }, + "fields": { + "textSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authentication": { + "type": "Authentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TLSConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreTool": { + "fields": { + "dataStoreConnections": { + "rule": "repeated", + "type": "DataStoreConnection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fallbackPrompt": { + "type": "FallbackPrompt", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "FallbackPrompt": { + "fields": {} + } + } + }, + "FunctionTool": { + "fields": { + "inputSchema": { + "type": "google.protobuf.Struct", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputSchema": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Authentication": { + "oneofs": { + "authConfig": { + "oneof": [ + "apiKeyConfig", + "oauthConfig", + "serviceAgentAuthConfig", + "bearerTokenConfig", + "serviceAccountAuthConfig" + ] + } + }, + "fields": { + "apiKeyConfig": { + "type": "ApiKeyConfig", + "id": 1 + }, + "oauthConfig": { + "type": "OAuthConfig", + "id": 2 + }, + "serviceAgentAuthConfig": { + "type": "ServiceAgentAuthConfig", + "id": 3 + }, + "bearerTokenConfig": { + "type": "BearerTokenConfig", + "id": 4 + }, + "serviceAccountAuthConfig": { + "type": "ServiceAccountAuthConfig", + "id": 5 + } + }, + "nested": { + "ApiKeyConfig": { + "fields": { + "keyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForApiKey": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "requestLocation": { + "type": "RequestLocation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RequestLocation": { + "values": { + "REQUEST_LOCATION_UNSPECIFIED": 0, + "HEADER": 1, + "QUERY_STRING": 2 + } + }, + "OAuthConfig": { + "fields": { + "oauthGrantType": { + "type": "OauthGrantType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientSecret": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForClientSecret": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "tokenEndpoint": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OauthGrantType": { + "values": { + "OAUTH_GRANT_TYPE_UNSPECIFIED": 0, + "CLIENT_CREDENTIAL": 1 + } + } + } + }, + "ServiceAgentAuthConfig": { + "fields": { + "serviceAgentAuth": { + "type": "ServiceAgentAuth", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ServiceAgentAuth": { + "values": { + "SERVICE_AGENT_AUTH_UNSPECIFIED": 0, + "ID_TOKEN": 1, + "ACCESS_TOKEN": 2 + } + } + } + }, + "BearerTokenConfig": { + "fields": { + "token": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "ServiceAccountAuthConfig": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "TLSConfig": { + "fields": { + "caCerts": { + "rule": "repeated", + "type": "CACert", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CACert": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cert": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ServiceDirectoryConfig": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" + } + } + } + }, + "ToolType": { + "values": { + "TOOL_TYPE_UNSPECIFIED": 0, + "CUSTOMIZED_TOOL": 1, + "BUILTIN_TOOL": 2 + } + } + } + }, + "ListToolVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ToolVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolVersionsResponse": { + "fields": { + "toolVersions": { + "rule": "repeated", + "type": "ToolVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateToolVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ToolVersion" + } + }, + "toolVersion": { + "type": "ToolVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetToolVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ToolVersion" + } + } + } + }, + "DeleteToolVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ToolVersion" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreToolVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ToolVersion" + } + } + } + }, + "RestoreToolVersionResponse": { + "fields": { + "tool": { + "type": "Tool", + "id": 2 + } + } + }, + "ToolVersion": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/ToolVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}", + "(google.api.resource).plural": "toolVersions", + "(google.api.resource).singular": "toolVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tool": { + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Versions": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListVersions": { + "requestType": "ListVersionsRequest", + "responseType": "ListVersionsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetVersion": { + "requestType": "GetVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateVersion": { + "requestType": "CreateVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions", + "(google.api.http).body": "version", + "(google.api.method_signature)": "parent,version", + "(google.longrunning.operation_info).response_type": "Version", + "(google.longrunning.operation_info).metadata_type": "CreateVersionOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions", + "body": "version" + } + }, + { + "(google.api.method_signature)": "parent,version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Version", + "metadata_type": "CreateVersionOperationMetadata" + } + } + ] + }, + "UpdateVersion": { + "requestType": "UpdateVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).patch": "/v3/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "(google.api.http).body": "version", + "(google.api.method_signature)": "version,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "body": "version" + } + }, + { + "(google.api.method_signature)": "version,update_mask" + } + ] + }, + "DeleteVersion": { + "requestType": "DeleteVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LoadVersion": { + "requestType": "LoadVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "CompareVersions": { + "requestType": "CompareVersionsRequest", + "responseType": "CompareVersionsResponse", + "options": { + "(google.api.http).post": "/v3/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "base_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "base_version" + } + ] + } + } + }, + "CreateVersionOperationMetadata": { + "fields": { + "version": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "Version": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Version", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "nluSettings": { + "type": "NluSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + } + } + }, + "ListVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Version" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListVersionsResponse": { + "fields": { + "versions": { + "rule": "repeated", + "type": "Version", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "CreateVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Version" + } + }, + "version": { + "type": "Version", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateVersionRequest": { + "fields": { + "version": { + "type": "Version", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "LoadVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "allowOverrideAgentResources": { + "type": "bool", + "id": 2 + } + } + }, + "CompareVersionsRequest": { + "fields": { + "baseVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "targetVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "CompareVersionsResponse": { + "fields": { + "baseVersionContentJson": { + "type": "string", + "id": 1 + }, + "targetVersionContentJson": { + "type": "string", + "id": 2 + }, + "compareTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + }, + "v3beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Dialogflow.Cx.V3Beta1", + "go_package": "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb", + "java_multiple_files": true, + "java_outer_classname": "VersionProto", + "java_package": "com.google.cloud.dialogflow.cx.v3beta1", + "objc_class_prefix": "DF", + "ruby_package": "Google::Cloud::Dialogflow::CX::V3beta1", + "(google.api.resource_definition).type": "dlp.googleapis.com/DeidentifyTemplate", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}", + "cc_enable_arenas": true + }, + "nested": { + "AdvancedSettings": { + "fields": { + "audioExportGcsDestination": { + "type": "GcsDestination", + "id": 2 + }, + "speechSettings": { + "type": "SpeechSettings", + "id": 3 + }, + "dtmfSettings": { + "type": "DtmfSettings", + "id": 5 + }, + "loggingSettings": { + "type": "LoggingSettings", + "id": 6 + } + }, + "nested": { + "SpeechSettings": { + "fields": { + "endpointerSensitivity": { + "type": "int32", + "id": 1 + }, + "noSpeechTimeout": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "useTimeoutBasedEndpointing": { + "type": "bool", + "id": 3 + }, + "models": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "DtmfSettings": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "maxDigits": { + "type": "int32", + "id": 2 + }, + "finishDigit": { + "type": "string", + "id": 3 + }, + "interdigitTimeoutDuration": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "endpointingTimeoutDuration": { + "type": "google.protobuf.Duration", + "id": 7 + } + } + }, + "LoggingSettings": { + "fields": { + "enableStackdriverLogging": { + "type": "bool", + "id": 2 + }, + "enableInteractionLogging": { + "type": "bool", + "id": 3 + }, + "enableConsentBasedRedaction": { + "type": "bool", + "id": 4 + } + } + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Agents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListAgents": { + "requestType": "ListAgentsRequest", + "responseType": "ListAgentsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/agents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*}/agents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAgent": { + "requestType": "GetAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAgent": { + "requestType": "CreateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}/agents", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "parent,agent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}/agents", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "parent,agent" + } + ] + }, + "UpdateAgent": { + "requestType": "UpdateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).patch": "/v3beta1/{agent.name=projects/*/locations/*/agents/*}", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "agent,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{agent.name=projects/*/locations/*/agents/*}", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "agent,update_mask" + } + ] + }, + "DeleteAgent": { + "requestType": "DeleteAgentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ExportAgent": { + "requestType": "ExportAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*}:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportAgentResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*}:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportAgentResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "RestoreAgent": { + "requestType": "RestoreAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*}:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*}:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ValidateAgent": { + "requestType": "ValidateAgentRequest", + "responseType": "AgentValidationResult", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*}:validate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*}:validate", + "body": "*" + } + } + ] + }, + "GetAgentValidationResult": { + "requestType": "GetAgentValidationResultRequest", + "responseType": "AgentValidationResult", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/validationResult}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/validationResult}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetGenerativeSettings": { + "requestType": "GetGenerativeSettingsRequest", + "responseType": "GenerativeSettings", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/generativeSettings}", + "(google.api.method_signature)": "name,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/generativeSettings}" + } + }, + { + "(google.api.method_signature)": "name,language_code" + } + ] + }, + "UpdateGenerativeSettings": { + "requestType": "UpdateGenerativeSettingsRequest", + "responseType": "GenerativeSettings", + "options": { + "(google.api.http).patch": "/v3beta1/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}", + "(google.api.http).body": "generative_settings", + "(google.api.method_signature)": "generative_settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}", + "body": "generative_settings" + } + }, + { + "(google.api.method_signature)": "generative_settings,update_mask" + } + ] + } + } + }, + "SpeechToTextSettings": { + "fields": { + "enableSpeechAdaptation": { + "type": "bool", + "id": 1 + } + } + }, + "Agent": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Agent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}" + }, + "oneofs": { + "sessionEntryResource": { + "oneof": [ + "startFlow", + "startPlaybook" + ] + }, + "_genAppBuilderSettings": { + "oneof": [ + "genAppBuilderSettings" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_satisfiesPzi": { + "oneof": [ + "satisfiesPzi" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "defaultLanguageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "supportedLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 6 + }, + "avatarUri": { + "type": "string", + "id": 7 + }, + "speechToTextSettings": { + "type": "SpeechToTextSettings", + "id": 13 + }, + "startFlow": { + "type": "string", + "id": 16, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "startPlaybook": { + "type": "string", + "id": 39, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "securitySettings": { + "type": "string", + "id": 17, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "enableStackdriverLogging": { + "type": "bool", + "id": 18, + "options": { + "deprecated": true + } + }, + "enableSpellCorrection": { + "type": "bool", + "id": 20 + }, + "enableMultiLanguageTraining": { + "type": "bool", + "id": 40, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locked": { + "type": "bool", + "id": 27 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 22 + }, + "gitIntegrationSettings": { + "type": "GitIntegrationSettings", + "id": 30 + }, + "bigqueryExportSettings": { + "type": "BigQueryExportSettings", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "textToSpeechSettings": { + "type": "TextToSpeechSettings", + "id": 31 + }, + "genAppBuilderSettings": { + "type": "GenAppBuilderSettings", + "id": 33, + "options": { + "proto3_optional": true + } + }, + "answerFeedbackSettings": { + "type": "AnswerFeedbackSettings", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "personalizationSettings": { + "type": "PersonalizationSettings", + "id": 42, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientCertificateSettings": { + "type": "ClientCertificateSettings", + "id": 43, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + }, + "nested": { + "GitIntegrationSettings": { + "oneofs": { + "gitSettings": { + "oneof": [ + "githubSettings", + "gitConnectionSettings" + ] + } + }, + "fields": { + "githubSettings": { + "type": "GithubSettings", + "id": 1 + }, + "gitConnectionSettings": { + "type": "GitConnectionSettings", + "id": 2 + } + }, + "nested": { + "GithubSettings": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "repositoryUri": { + "type": "string", + "id": 2 + }, + "trackingBranch": { + "type": "string", + "id": 3 + }, + "accessToken": { + "type": "string", + "id": 4 + }, + "branches": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "GitConnectionSettings": { + "oneofs": { + "gitAuthentication": { + "oneof": [ + "accessTokenSecret" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "repositoryUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trackingBranch": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "branches": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessTokenSecret": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + } + } + }, + "GenAppBuilderSettings": { + "fields": { + "engine": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnswerFeedbackSettings": { + "fields": { + "enableAnswerFeedback": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PersonalizationSettings": { + "fields": { + "defaultEndUserMetadata": { + "type": "google.protobuf.Struct", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClientCertificateSettings": { + "fields": { + "sslCertificate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "passphrase": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + } + } + }, + "ListAgentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAgentsResponse": { + "fields": { + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "CreateAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "agent": { + "type": "Agent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAgentRequest": { + "fields": { + "agent": { + "type": "Agent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "ExportAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "agentUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environment": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "gitDestination": { + "type": "GitDestination", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeBigqueryExportSettings": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON_PACKAGE": 4 + } + }, + "GitDestination": { + "fields": { + "trackingBranch": { + "type": "string", + "id": 1 + }, + "commitMessage": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ExportAgentResponse": { + "oneofs": { + "agent": { + "oneof": [ + "agentUri", + "agentContent", + "commitSha" + ] + } + }, + "fields": { + "agentUri": { + "type": "string", + "id": 1 + }, + "agentContent": { + "type": "bytes", + "id": 2 + }, + "commitSha": { + "type": "string", + "id": 3 + } + } + }, + "RestoreAgentRequest": { + "oneofs": { + "agent": { + "oneof": [ + "agentUri", + "agentContent", + "gitSource" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "agentUri": { + "type": "string", + "id": 2 + }, + "agentContent": { + "type": "bytes", + "id": 3 + }, + "gitSource": { + "type": "GitSource", + "id": 6 + }, + "restoreOption": { + "type": "RestoreOption", + "id": 5 + } + }, + "nested": { + "GitSource": { + "fields": { + "trackingBranch": { + "type": "string", + "id": 1 + } + } + }, + "RestoreOption": { + "values": { + "RESTORE_OPTION_UNSPECIFIED": 0, + "KEEP": 1, + "FALLBACK": 2 + } + } + } + }, + "ValidateAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "GetAgentValidationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/AgentValidationResult" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "AgentValidationResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/AgentValidationResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/validationResult" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "flowValidationResults": { + "rule": "repeated", + "type": "FlowValidationResult", + "id": 2 + } + } + }, + "GetGenerativeSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/AgentGenerativeSettings" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGenerativeSettingsRequest": { + "fields": { + "generativeSettings": { + "type": "GenerativeSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "AUDIO_ENCODING_LINEAR_16": 1, + "AUDIO_ENCODING_FLAC": 2, + "AUDIO_ENCODING_MULAW": 3, + "AUDIO_ENCODING_AMR": 4, + "AUDIO_ENCODING_AMR_WB": 5, + "AUDIO_ENCODING_OGG_OPUS": 6, + "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7, + "AUDIO_ENCODING_ALAW": 8 + } + }, + "SpeechModelVariant": { + "values": { + "SPEECH_MODEL_VARIANT_UNSPECIFIED": 0, + "USE_BEST_AVAILABLE": 1, + "USE_STANDARD": 2, + "USE_ENHANCED": 3 + } + }, + "SpeechWordInfo": { + "fields": { + "word": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "BargeInConfig": { + "fields": { + "noBargeInDuration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "totalDuration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "InputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "enableWordInfo": { + "type": "bool", + "id": 13 + }, + "phraseHints": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "model": { + "type": "string", + "id": 7 + }, + "modelVariant": { + "type": "SpeechModelVariant", + "id": 10 + }, + "singleUtterance": { + "type": "bool", + "id": 8 + }, + "bargeInConfig": { + "type": "BargeInConfig", + "id": 15 + }, + "optOutConformerModelMigration": { + "type": "bool", + "id": 26 + } + } + }, + "SsmlVoiceGender": { + "values": { + "SSML_VOICE_GENDER_UNSPECIFIED": 0, + "SSML_VOICE_GENDER_MALE": 1, + "SSML_VOICE_GENDER_FEMALE": 2, + "SSML_VOICE_GENDER_NEUTRAL": 3 + } + }, + "VoiceSelectionParams": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ssmlGender": { + "type": "SsmlVoiceGender", + "id": 2 + } + } + }, + "SynthesizeSpeechConfig": { + "fields": { + "speakingRate": { + "type": "double", + "id": 1 + }, + "pitch": { + "type": "double", + "id": 2 + }, + "volumeGainDb": { + "type": "double", + "id": 3 + }, + "effectsProfileId": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "voice": { + "type": "VoiceSelectionParams", + "id": 4 + } + } + }, + "OutputAudioEncoding": { + "valuesOptions": { + "OUTPUT_AUDIO_ENCODING_MP3": { + "deprecated": true + } + }, + "values": { + "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": 0, + "OUTPUT_AUDIO_ENCODING_LINEAR_16": 1, + "OUTPUT_AUDIO_ENCODING_MP3": 2, + "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS": 4, + "OUTPUT_AUDIO_ENCODING_OGG_OPUS": 3, + "OUTPUT_AUDIO_ENCODING_MULAW": 5, + "OUTPUT_AUDIO_ENCODING_ALAW": 6 + } + }, + "OutputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "OutputAudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "synthesizeSpeechConfig": { + "type": "SynthesizeSpeechConfig", + "id": 3 + } + } + }, + "TextToSpeechSettings": { + "fields": { + "synthesizeSpeechConfigs": { + "keyType": "string", + "type": "SynthesizeSpeechConfig", + "id": 1 + } + } + }, + "BigQueryExportSettings": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "bigqueryTable": { + "type": "string", + "id": 2 + } + } + }, + "Flows": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateFlow": { + "requestType": "CreateFlowRequest", + "responseType": "Flow", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows", + "(google.api.http).body": "flow", + "(google.api.method_signature)": "parent,flow" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows", + "body": "flow" + } + }, + { + "(google.api.method_signature)": "parent,flow" + } + ] + }, + "DeleteFlow": { + "requestType": "DeleteFlowRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFlows": { + "requestType": "ListFlowsRequest", + "responseType": "ListFlowsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFlow": { + "requestType": "GetFlowRequest", + "responseType": "Flow", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateFlow": { + "requestType": "UpdateFlowRequest", + "responseType": "Flow", + "options": { + "(google.api.http).patch": "/v3beta1/{flow.name=projects/*/locations/*/agents/*/flows/*}", + "(google.api.http).body": "flow", + "(google.api.method_signature)": "flow,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{flow.name=projects/*/locations/*/agents/*/flows/*}", + "body": "flow" + } + }, + { + "(google.api.method_signature)": "flow,update_mask" + } + ] + }, + "TrainFlow": { + "requestType": "TrainFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:train", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:train", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ValidateFlow": { + "requestType": "ValidateFlowRequest", + "responseType": "FlowValidationResult", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:validate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:validate", + "body": "*" + } + } + ] + }, + "GetFlowValidationResult": { + "requestType": "GetFlowValidationResultRequest", + "responseType": "FlowValidationResult", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/validationResult}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/validationResult}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportFlow": { + "requestType": "ImportFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportFlowResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportFlowResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ExportFlow": { + "requestType": "ExportFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportFlowResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportFlowResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + } + } + }, + "NluSettings": { + "fields": { + "modelType": { + "type": "ModelType", + "id": 1 + }, + "classificationThreshold": { + "type": "float", + "id": 3 + }, + "modelTrainingMode": { + "type": "ModelTrainingMode", + "id": 4 + } + }, + "nested": { + "ModelType": { + "values": { + "MODEL_TYPE_UNSPECIFIED": 0, + "MODEL_TYPE_STANDARD": 1, + "MODEL_TYPE_ADVANCED": 3 + } + }, + "ModelTrainingMode": { + "values": { + "MODEL_TRAINING_MODE_UNSPECIFIED": 0, + "MODEL_TRAINING_MODE_AUTOMATIC": 1, + "MODEL_TRAINING_MODE_MANUAL": 2 + } + } + } + }, + "Flow": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Flow", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "transitionRoutes": { + "rule": "repeated", + "type": "TransitionRoute", + "id": 4 + }, + "eventHandlers": { + "rule": "repeated", + "type": "EventHandler", + "id": 10 + }, + "transitionRouteGroups": { + "rule": "repeated", + "type": "string", + "id": 15, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "nluSettings": { + "type": "NluSettings", + "id": 11 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 14 + }, + "knowledgeConnectorSettings": { + "type": "KnowledgeConnectorSettings", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "multiLanguageSettings": { + "type": "MultiLanguageSettings", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locked": { + "type": "bool", + "id": 30 + } + }, + "nested": { + "MultiLanguageSettings": { + "fields": { + "enableMultiLanguageDetection": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "supportedResponseLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CreateFlowRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Flow" + } + }, + "flow": { + "type": "Flow", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "DeleteFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "ListFlowsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Flow" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4 + } + } + }, + "ListFlowsResponse": { + "fields": { + "flows": { + "rule": "repeated", + "type": "Flow", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "UpdateFlowRequest": { + "fields": { + "flow": { + "type": "Flow", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "TrainFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + } + }, + "ValidateFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "GetFlowValidationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/FlowValidationResult" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "FlowValidationResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/FlowValidationResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "validationMessages": { + "rule": "repeated", + "type": "ValidationMessage", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ImportFlowRequest": { + "oneofs": { + "flow": { + "oneof": [ + "flowUri", + "flowContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Flow" + } + }, + "flowUri": { + "type": "string", + "id": 2 + }, + "flowContent": { + "type": "bytes", + "id": 3 + }, + "importOption": { + "type": "ImportOption", + "id": 4 + }, + "flowImportStrategy": { + "type": "FlowImportStrategy", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ImportOption": { + "values": { + "IMPORT_OPTION_UNSPECIFIED": 0, + "KEEP": 1, + "FALLBACK": 2 + } + } + } + }, + "FlowImportStrategy": { + "fields": { + "globalImportStrategy": { + "type": "ImportStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportFlowResponse": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + } + }, + "ExportFlowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "flowUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeReferencedFlows": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExportFlowResponse": { + "oneofs": { + "flow": { + "oneof": [ + "flowUri", + "flowContent" + ] + } + }, + "fields": { + "flowUri": { + "type": "string", + "id": 1 + }, + "flowContent": { + "type": "bytes", + "id": 2 + } + } + }, + "ImportStrategy": { + "values": { + "IMPORT_STRATEGY_UNSPECIFIED": 0, + "IMPORT_STRATEGY_CREATE_NEW": 1, + "IMPORT_STRATEGY_REPLACE": 2, + "IMPORT_STRATEGY_KEEP": 3, + "IMPORT_STRATEGY_MERGE": 4, + "IMPORT_STRATEGY_THROW_ERROR": 5 + } + }, + "Pages": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListPages": { + "requestType": "ListPagesRequest", + "responseType": "ListPagesResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPage": { + "requestType": "GetPageRequest", + "responseType": "Page", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreatePage": { + "requestType": "CreatePageRequest", + "responseType": "Page", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages", + "(google.api.http).body": "page", + "(google.api.method_signature)": "parent,page" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages", + "body": "page" + } + }, + { + "(google.api.method_signature)": "parent,page" + } + ] + }, + "UpdatePage": { + "requestType": "UpdatePageRequest", + "responseType": "Page", + "options": { + "(google.api.http).patch": "/v3beta1/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "(google.api.http).body": "page", + "(google.api.method_signature)": "page,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "body": "page" + } + }, + { + "(google.api.method_signature)": "page,update_mask" + } + ] + }, + "DeletePage": { + "requestType": "DeletePageRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Page": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Page", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 19 + }, + "entryFulfillment": { + "type": "Fulfillment", + "id": 7 + }, + "form": { + "type": "Form", + "id": 4 + }, + "transitionRouteGroups": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "transitionRoutes": { + "rule": "repeated", + "type": "TransitionRoute", + "id": 9 + }, + "eventHandlers": { + "rule": "repeated", + "type": "EventHandler", + "id": 10 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 13 + }, + "knowledgeConnectorSettings": { + "type": "KnowledgeConnectorSettings", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Form": { + "fields": { + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 1 + } + }, + "nested": { + "Parameter": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "required": { + "type": "bool", + "id": 2 + }, + "entityType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "isList": { + "type": "bool", + "id": 4 + }, + "fillBehavior": { + "type": "FillBehavior", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "defaultValue": { + "type": "google.protobuf.Value", + "id": 9 + }, + "redact": { + "type": "bool", + "id": 11 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 12 + } + }, + "nested": { + "FillBehavior": { + "fields": { + "initialPromptFulfillment": { + "type": "Fulfillment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "repromptEventHandlers": { + "rule": "repeated", + "type": "EventHandler", + "id": 5 + } + } + } + } + } + } + }, + "EventHandler": { + "oneofs": { + "target": { + "oneof": [ + "targetPage", + "targetFlow", + "targetPlaybook" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "event": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "triggerFulfillment": { + "type": "Fulfillment", + "id": 5 + }, + "targetPage": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "targetPlaybook": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + } + } + }, + "TransitionRoute": { + "oneofs": { + "target": { + "oneof": [ + "targetPage", + "targetFlow" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "condition": { + "type": "string", + "id": 2 + }, + "triggerFulfillment": { + "type": "Fulfillment", + "id": 3 + }, + "targetPage": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + } + }, + "ListPagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Page" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListPagesResponse": { + "fields": { + "pages": { + "rule": "repeated", + "type": "Page", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetPageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreatePageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Page" + } + }, + "page": { + "type": "Page", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdatePageRequest": { + "fields": { + "page": { + "type": "Page", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeletePageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "KnowledgeConnectorSettings": { + "oneofs": { + "target": { + "oneof": [ + "targetPage", + "targetFlow" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "triggerFulfillment": { + "type": "Fulfillment", + "id": 3 + }, + "targetPage": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "dataStoreConnections": { + "rule": "repeated", + "type": "DataStoreConnection", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreConnection": { + "fields": { + "dataStoreType": { + "type": "DataStoreType", + "id": 1 + }, + "dataStore": { + "type": "string", + "id": 2 + }, + "documentProcessingMode": { + "type": "DocumentProcessingMode", + "id": 4 + } + } + }, + "DataStoreConnectionSignals": { + "fields": { + "rewriterModelCallSignals": { + "type": "RewriterModelCallSignals", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rewrittenQuery": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "searchSnippets": { + "rule": "repeated", + "type": "SearchSnippet", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "answerGenerationModelCallSignals": { + "type": "AnswerGenerationModelCallSignals", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "answer": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "answerParts": { + "rule": "repeated", + "type": "AnswerPart", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "citedSnippets": { + "rule": "repeated", + "type": "CitedSnippet", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "groundingSignals": { + "type": "GroundingSignals", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "safetySignals": { + "type": "SafetySignals", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RewriterModelCallSignals": { + "fields": { + "renderedPrompt": { + "type": "string", + "id": 1 + }, + "modelOutput": { + "type": "string", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "SearchSnippet": { + "fields": { + "documentTitle": { + "type": "string", + "id": 1 + }, + "documentUri": { + "type": "string", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + }, + "metadata": { + "type": "google.protobuf.Struct", + "id": 5 + } + } + }, + "AnswerGenerationModelCallSignals": { + "fields": { + "renderedPrompt": { + "type": "string", + "id": 1 + }, + "modelOutput": { + "type": "string", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "AnswerPart": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "supportingIndices": { + "rule": "repeated", + "type": "int32", + "id": 2 + } + } + }, + "CitedSnippet": { + "fields": { + "searchSnippet": { + "type": "SearchSnippet", + "id": 1 + }, + "snippetIndex": { + "type": "int32", + "id": 2 + } + } + }, + "GroundingSignals": { + "fields": { + "decision": { + "type": "GroundingDecision", + "id": 1 + }, + "score": { + "type": "GroundingScoreBucket", + "id": 2 + } + }, + "nested": { + "GroundingDecision": { + "values": { + "GROUNDING_DECISION_UNSPECIFIED": 0, + "ACCEPTED_BY_GROUNDING": 1, + "REJECTED_BY_GROUNDING": 2 + } + }, + "GroundingScoreBucket": { + "values": { + "GROUNDING_SCORE_BUCKET_UNSPECIFIED": 0, + "VERY_LOW": 1, + "LOW": 3, + "MEDIUM": 4, + "HIGH": 5, + "VERY_HIGH": 6 + } + } + } + }, + "SafetySignals": { + "fields": { + "decision": { + "type": "SafetyDecision", + "id": 1 + }, + "bannedPhraseMatch": { + "type": "BannedPhraseMatch", + "id": 2 + }, + "matchedBannedPhrase": { + "type": "string", + "id": 3 + } + }, + "nested": { + "SafetyDecision": { + "values": { + "SAFETY_DECISION_UNSPECIFIED": 0, + "ACCEPTED_BY_SAFETY_CHECK": 1, + "REJECTED_BY_SAFETY_CHECK": 2 + } + }, + "BannedPhraseMatch": { + "values": { + "BANNED_PHRASE_MATCH_UNSPECIFIED": 0, + "BANNED_PHRASE_MATCH_NONE": 1, + "BANNED_PHRASE_MATCH_QUERY": 2, + "BANNED_PHRASE_MATCH_RESPONSE": 3 + } + } + } + } + } + }, + "DataStoreType": { + "values": { + "DATA_STORE_TYPE_UNSPECIFIED": 0, + "PUBLIC_WEB": 1, + "UNSTRUCTURED": 2, + "STRUCTURED": 3 + } + }, + "DocumentProcessingMode": { + "values": { + "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": 0, + "DOCUMENTS": 1, + "CHUNKS": 2 + } + }, + "Fulfillment": { + "fields": { + "messages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 1 + }, + "webhook": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Webhook" + } + }, + "returnPartialResponses": { + "type": "bool", + "id": 8 + }, + "tag": { + "type": "string", + "id": 3 + }, + "setParameterActions": { + "rule": "repeated", + "type": "SetParameterAction", + "id": 4 + }, + "conditionalCases": { + "rule": "repeated", + "type": "ConditionalCases", + "id": 5 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 7 + }, + "enableGenerativeFallback": { + "type": "bool", + "id": 12 + }, + "generators": { + "rule": "repeated", + "type": "GeneratorSettings", + "id": 13 + } + }, + "nested": { + "SetParameterAction": { + "fields": { + "parameter": { + "type": "string", + "id": 1 + }, + "value": { + "type": "google.protobuf.Value", + "id": 2 + } + } + }, + "ConditionalCases": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + } + }, + "nested": { + "Case": { + "fields": { + "condition": { + "type": "string", + "id": 1 + }, + "caseContent": { + "rule": "repeated", + "type": "CaseContent", + "id": 2 + } + }, + "nested": { + "CaseContent": { + "oneofs": { + "casesOrMessage": { + "oneof": [ + "message", + "additionalCases" + ] + } + }, + "fields": { + "message": { + "type": "ResponseMessage", + "id": 1 + }, + "additionalCases": { + "type": "ConditionalCases", + "id": 2 + } + } + } + } + } + } + }, + "GeneratorSettings": { + "fields": { + "generator": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Generator" + } + }, + "inputParameters": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "outputParameter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ResponseMessage": { + "oneofs": { + "message": { + "oneof": [ + "text", + "payload", + "conversationSuccess", + "outputAudioText", + "liveAgentHandoff", + "endInteraction", + "playAudio", + "mixedAudio", + "telephonyTransferCall", + "knowledgeInfoCard", + "toolCall" + ] + } + }, + "fields": { + "text": { + "type": "Text", + "id": 1 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "conversationSuccess": { + "type": "ConversationSuccess", + "id": 9 + }, + "outputAudioText": { + "type": "OutputAudioText", + "id": 8 + }, + "liveAgentHandoff": { + "type": "LiveAgentHandoff", + "id": 10 + }, + "endInteraction": { + "type": "EndInteraction", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "playAudio": { + "type": "PlayAudio", + "id": 12 + }, + "mixedAudio": { + "type": "MixedAudio", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "telephonyTransferCall": { + "type": "TelephonyTransferCall", + "id": 18 + }, + "knowledgeInfoCard": { + "type": "KnowledgeInfoCard", + "id": 20 + }, + "toolCall": { + "type": "google.cloud.dialogflow.cx.v3beta1.ToolCall", + "id": 22 + }, + "channel": { + "type": "string", + "id": 19 + } + }, + "nested": { + "Text": { + "fields": { + "text": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LiveAgentHandoff": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1 + } + } + }, + "ConversationSuccess": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1 + } + } + }, + "OutputAudioText": { + "oneofs": { + "source": { + "oneof": [ + "text", + "ssml" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "ssml": { + "type": "string", + "id": 2 + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EndInteraction": { + "fields": {} + }, + "PlayAudio": { + "fields": { + "audioUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MixedAudio": { + "fields": { + "segments": { + "rule": "repeated", + "type": "Segment", + "id": 1 + } + }, + "nested": { + "Segment": { + "oneofs": { + "content": { + "oneof": [ + "audio", + "uri" + ] + } + }, + "fields": { + "audio": { + "type": "bytes", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "allowPlaybackInterruption": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "TelephonyTransferCall": { + "oneofs": { + "endpoint": { + "oneof": [ + "phoneNumber" + ] + } + }, + "fields": { + "phoneNumber": { + "type": "string", + "id": 1 + } + } + }, + "KnowledgeInfoCard": { + "fields": {} + } + } + }, + "ToolCall": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputParameters": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolCallResult": { + "oneofs": { + "result": { + "oneof": [ + "error", + "outputParameters" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "error": { + "type": "Error", + "id": 3 + }, + "outputParameters": { + "type": "google.protobuf.Struct", + "id": 4 + } + }, + "nested": { + "Error": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ParameterDefinition": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "ParameterType", + "id": 2, + "options": { + "deprecated": true + } + }, + "typeSchema": { + "type": "TypeSchema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ParameterType": { + "values": { + "PARAMETER_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "NUMBER": 2, + "BOOLEAN": 3, + "NULL": 4, + "OBJECT": 5, + "LIST": 6 + } + } + } + }, + "TypeSchema": { + "oneofs": { + "schema": { + "oneof": [ + "inlineSchema", + "schemaReference" + ] + } + }, + "fields": { + "inlineSchema": { + "type": "InlineSchema", + "id": 1 + }, + "schemaReference": { + "type": "SchemaReference", + "id": 2 + } + }, + "nested": { + "SchemaReference": { + "fields": { + "tool": { + "type": "string", + "id": 1 + }, + "schema": { + "type": "string", + "id": 2 + } + } + } + } + }, + "InlineSchema": { + "fields": { + "type": { + "type": "DataType", + "id": 1 + }, + "items": { + "type": "TypeSchema", + "id": 2 + } + } + }, + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "NUMBER": 2, + "BOOLEAN": 3, + "ARRAY": 6 + } + }, + "ValidationMessage": { + "fields": { + "resourceType": { + "type": "ResourceType", + "id": 1 + }, + "resources": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "resourceNames": { + "rule": "repeated", + "type": "ResourceName", + "id": 6 + }, + "severity": { + "type": "Severity", + "id": 3 + }, + "detail": { + "type": "string", + "id": 4 + } + }, + "nested": { + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "AGENT": 1, + "INTENT": 2, + "INTENT_TRAINING_PHRASE": 8, + "INTENT_PARAMETER": 9, + "INTENTS": 10, + "INTENT_TRAINING_PHRASES": 11, + "ENTITY_TYPE": 3, + "ENTITY_TYPES": 12, + "WEBHOOK": 4, + "FLOW": 5, + "PAGE": 6, + "PAGES": 13, + "TRANSITION_ROUTE_GROUP": 7, + "AGENT_TRANSITION_ROUTE_GROUP": 14 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "INFO": 1, + "WARNING": 2, + "ERROR": 3 + } + } + } + }, + "ResourceName": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "GenerativeSettings": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/AgentGenerativeSettings", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/generativeSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 5 + }, + "fallbackSettings": { + "type": "FallbackSettings", + "id": 1 + }, + "generativeSafetySettings": { + "type": "SafetySettings", + "id": 3 + }, + "knowledgeConnectorSettings": { + "type": "KnowledgeConnectorSettings", + "id": 7 + }, + "languageCode": { + "type": "string", + "id": 4 + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 8 + } + }, + "nested": { + "FallbackSettings": { + "fields": { + "selectedPrompt": { + "type": "string", + "id": 3 + }, + "promptTemplates": { + "rule": "repeated", + "type": "PromptTemplate", + "id": 4 + } + }, + "nested": { + "PromptTemplate": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "promptText": { + "type": "string", + "id": 2 + }, + "frozen": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "KnowledgeConnectorSettings": { + "fields": { + "business": { + "type": "string", + "id": 1 + }, + "agent": { + "type": "string", + "id": 2 + }, + "agentIdentity": { + "type": "string", + "id": 3 + }, + "businessDescription": { + "type": "string", + "id": 4 + }, + "agentScope": { + "type": "string", + "id": 5 + }, + "disableDataStoreFallback": { + "type": "bool", + "id": 8 + } + } + } + } + }, + "LlmModelSettings": { + "fields": { + "model": { + "type": "string", + "id": 1 + }, + "promptText": { + "type": "string", + "id": 2 + }, + "parameters": { + "type": "Parameters", + "id": 4 + } + }, + "nested": { + "Parameters": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_inputTokenLimit": { + "oneof": [ + "inputTokenLimit" + ] + }, + "_outputTokenLimit": { + "oneof": [ + "outputTokenLimit" + ] + } + }, + "fields": { + "temperature": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "inputTokenLimit": { + "type": "InputTokenLimit", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "outputTokenLimit": { + "type": "OutputTokenLimit", + "id": 3, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "InputTokenLimit": { + "values": { + "INPUT_TOKEN_LIMIT_UNSPECIFIED": 0, + "INPUT_TOKEN_LIMIT_SHORT": 1, + "INPUT_TOKEN_LIMIT_MEDIUM": 2, + "INPUT_TOKEN_LIMIT_LONG": 3 + } + }, + "OutputTokenLimit": { + "values": { + "OUTPUT_TOKEN_LIMIT_UNSPECIFIED": 0, + "OUTPUT_TOKEN_LIMIT_SHORT": 1, + "OUTPUT_TOKEN_LIMIT_MEDIUM": 2, + "OUTPUT_TOKEN_LIMIT_LONG": 3 + } + } + } + } + } + }, + "SafetySettings": { + "fields": { + "defaultBannedPhraseMatchStrategy": { + "type": "PhraseMatchStrategy", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedPhrases": { + "rule": "repeated", + "type": "Phrase", + "id": 1 + }, + "raiSettings": { + "type": "RaiSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultRaiSettings": { + "type": "RaiSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "promptSecuritySettings": { + "type": "PromptSecuritySettings", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Phrase": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PhraseMatchStrategy": { + "values": { + "PHRASE_MATCH_STRATEGY_UNSPECIFIED": 0, + "PARTIAL_MATCH": 1, + "WORD_MATCH": 2 + } + }, + "RaiSettings": { + "fields": { + "categoryFilters": { + "rule": "repeated", + "type": "CategoryFilter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SafetyFilterLevel": { + "values": { + "SAFETY_FILTER_LEVEL_UNSPECIFIED": 0, + "BLOCK_NONE": 1, + "BLOCK_FEW": 2, + "BLOCK_SOME": 3, + "BLOCK_MOST": 4 + } + }, + "SafetyCategory": { + "values": { + "SAFETY_CATEGORY_UNSPECIFIED": 0, + "DANGEROUS_CONTENT": 1, + "HATE_SPEECH": 2, + "HARASSMENT": 3, + "SEXUALLY_EXPLICIT_CONTENT": 4 + } + }, + "CategoryFilter": { + "fields": { + "category": { + "type": "SafetyCategory", + "id": 1 + }, + "filterLevel": { + "type": "SafetyFilterLevel", + "id": 2 + } + } + } + } + }, + "PromptSecuritySettings": { + "fields": { + "enablePromptSecurity": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "Changelogs": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListChangelogs": { + "requestType": "ListChangelogsRequest", + "responseType": "ListChangelogsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/changelogs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/changelogs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetChangelog": { + "requestType": "GetChangelogRequest", + "responseType": "Changelog", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/changelogs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/changelogs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListChangelogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Changelog" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListChangelogsResponse": { + "fields": { + "changelogs": { + "rule": "repeated", + "type": "Changelog", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetChangelogRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Changelog" + } + } + } + }, + "Changelog": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Changelog", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "userEmail": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 7 + }, + "action": { + "type": "string", + "id": 11 + }, + "type": { + "type": "string", + "id": 8 + }, + "resource": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 14 + } + } + }, + "CodeBlock": { + "fields": { + "code": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConversationHistory": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListConversations": { + "requestType": "ListConversationsRequest", + "responseType": "ListConversationsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/conversations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/conversations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConversation": { + "requestType": "GetConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteConversation": { + "requestType": "DeleteConversationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" + } + } + } + }, + "DeleteConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" + } + } + } + }, + "ListConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Conversation" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsResponse": { + "fields": { + "conversations": { + "rule": "repeated", + "type": "Conversation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Conversation": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Conversation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}", + "(google.api.resource).plural": "conversations", + "(google.api.resource).singular": "conversation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "type": { + "type": "Type", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "metrics": { + "type": "Metrics", + "id": 6 + }, + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 7 + }, + "flows": { + "rule": "repeated", + "type": "Flow", + "id": 8 + }, + "pages": { + "rule": "repeated", + "type": "Page", + "id": 9 + }, + "interactions": { + "rule": "repeated", + "type": "Interaction", + "id": 10 + }, + "environment": { + "type": "Environment", + "id": 11 + }, + "flowVersions": { + "keyType": "string", + "type": "int64", + "id": 12 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "AUDIO": 1, + "TEXT": 2, + "UNDETERMINED": 3 + } + }, + "Metrics": { + "fields": { + "interactionCount": { + "type": "int32", + "id": 1 + }, + "inputAudioDuration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "outputAudioDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "maxWebhookLatency": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "hasEndInteraction": { + "type": "bool", + "id": 5 + }, + "hasLiveAgentHandoff": { + "type": "bool", + "id": 6 + }, + "averageMatchConfidence": { + "type": "float", + "id": 7 + }, + "queryInputCount": { + "type": "QueryInputCount", + "id": 8 + }, + "matchTypeCount": { + "type": "MatchTypeCount", + "id": 9 + } + }, + "nested": { + "QueryInputCount": { + "fields": { + "textCount": { + "type": "int32", + "id": 1 + }, + "intentCount": { + "type": "int32", + "id": 2 + }, + "audioCount": { + "type": "int32", + "id": 3 + }, + "eventCount": { + "type": "int32", + "id": 4 + }, + "dtmfCount": { + "type": "int32", + "id": 5 + } + } + }, + "MatchTypeCount": { + "fields": { + "unspecifiedCount": { + "type": "int32", + "id": 1 + }, + "intentCount": { + "type": "int32", + "id": 2 + }, + "directIntentCount": { + "type": "int32", + "id": 3 + }, + "parameterFillingCount": { + "type": "int32", + "id": 4 + }, + "noMatchCount": { + "type": "int32", + "id": 5 + }, + "noInputCount": { + "type": "int32", + "id": 6 + }, + "eventCount": { + "type": "int32", + "id": 7 + } + } + } + } + }, + "Interaction": { + "fields": { + "request": { + "type": "DetectIntentRequest", + "id": 1 + }, + "response": { + "type": "DetectIntentResponse", + "id": 2 + }, + "partialResponses": { + "rule": "repeated", + "type": "DetectIntentResponse", + "id": 3 + }, + "requestUtterances": { + "type": "string", + "id": 4 + }, + "responseUtterances": { + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "answerFeedback": { + "type": "AnswerFeedback", + "id": 7 + }, + "missingTransition": { + "type": "MissingTransition", + "id": 8 + }, + "stepMetrics": { + "rule": "repeated", + "type": "StepMetrics", + "id": 9 + } + }, + "nested": { + "MissingTransition": { + "fields": { + "intentDisplayName": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "StepMetrics": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "latency": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + } + } + }, + "Environments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListEnvironments": { + "requestType": "ListEnvironmentsRequest", + "responseType": "ListEnvironmentsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEnvironment": { + "requestType": "GetEnvironmentRequest", + "responseType": "Environment", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEnvironment": { + "requestType": "CreateEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments", + "(google.api.http).body": "environment", + "(google.api.method_signature)": "parent,environment", + "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments", + "body": "environment" + } + }, + { + "(google.api.method_signature)": "parent,environment" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Environment", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "UpdateEnvironment": { + "requestType": "UpdateEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v3beta1/{environment.name=projects/*/locations/*/agents/*/environments/*}", + "(google.api.http).body": "environment", + "(google.api.method_signature)": "environment,update_mask", + "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{environment.name=projects/*/locations/*/agents/*/environments/*}", + "body": "environment" + } + }, + { + "(google.api.method_signature)": "environment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Environment", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "DeleteEnvironment": { + "requestType": "DeleteEnvironmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LookupEnvironmentHistory": { + "requestType": "LookupEnvironmentHistoryRequest", + "responseType": "LookupEnvironmentHistoryResponse", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RunContinuousTest": { + "requestType": "RunContinuousTestRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "RunContinuousTestResponse", + "(google.longrunning.operation_info).metadata_type": "RunContinuousTestMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunContinuousTestResponse", + "metadata_type": "RunContinuousTestMetadata" + } + } + ] + }, + "ListContinuousTestResults": { + "requestType": "ListContinuousTestResultsRequest", + "responseType": "ListContinuousTestResultsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeployFlow": { + "requestType": "DeployFlowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "DeployFlowResponse", + "(google.longrunning.operation_info).metadata_type": "DeployFlowMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployFlowResponse", + "metadata_type": "DeployFlowMetadata" + } + } + ] + } + } + }, + "Environment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Environment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "versionConfigs": { + "rule": "repeated", + "type": "VersionConfig", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "testCasesConfig": { + "type": "TestCasesConfig", + "id": 7 + }, + "webhookConfig": { + "type": "WebhookConfig", + "id": 10 + } + }, + "nested": { + "VersionConfig": { + "fields": { + "version": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "TestCasesConfig": { + "fields": { + "testCases": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + }, + "enableContinuousRun": { + "type": "bool", + "id": 2 + }, + "enablePredeploymentRun": { + "type": "bool", + "id": 3 + } + } + }, + "WebhookConfig": { + "fields": { + "webhookOverrides": { + "rule": "repeated", + "type": "Webhook", + "id": 1 + } + } + } + } + }, + "ListEnvironmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListEnvironmentsResponse": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "CreateEnvironmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" + } + }, + "environment": { + "type": "Environment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEnvironmentRequest": { + "fields": { + "environment": { + "type": "Environment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "LookupEnvironmentHistoryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "LookupEnvironmentHistoryResponse": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ContinuousTestResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/ContinuousTestResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "result": { + "type": "AggregatedTestResult", + "id": 2 + }, + "testCaseResults": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCaseResult" + } + }, + "runTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "AggregatedTestResult": { + "values": { + "AGGREGATED_TEST_RESULT_UNSPECIFIED": 0, + "PASSED": 1, + "FAILED": 2 + } + } + } + }, + "RunContinuousTestRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "RunContinuousTestResponse": { + "fields": { + "continuousTestResult": { + "type": "ContinuousTestResult", + "id": 1 + } + } + }, + "RunContinuousTestMetadata": { + "fields": { + "errors": { + "rule": "repeated", + "type": "TestError", + "id": 1 + } + } + }, + "ListContinuousTestResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ContinuousTestResult" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListContinuousTestResultsResponse": { + "fields": { + "continuousTestResults": { + "rule": "repeated", + "type": "ContinuousTestResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeployFlowRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "flowVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "DeployFlowResponse": { + "fields": { + "environment": { + "type": "Environment", + "id": 1 + }, + "deployment": { + "type": "string", + "id": 2 + } + } + }, + "DeployFlowMetadata": { + "fields": { + "testErrors": { + "rule": "repeated", + "type": "TestError", + "id": 1 + } + } + }, + "TestCases": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListTestCases": { + "requestType": "ListTestCasesRequest", + "responseType": "ListTestCasesResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "BatchDeleteTestCases": { + "requestType": "BatchDeleteTestCasesRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTestCase": { + "requestType": "GetTestCaseRequest", + "responseType": "TestCase", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTestCase": { + "requestType": "CreateTestCaseRequest", + "responseType": "TestCase", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases", + "(google.api.http).body": "test_case", + "(google.api.method_signature)": "parent,test_case" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases", + "body": "test_case" + } + }, + { + "(google.api.method_signature)": "parent,test_case" + } + ] + }, + "UpdateTestCase": { + "requestType": "UpdateTestCaseRequest", + "responseType": "TestCase", + "options": { + "(google.api.http).patch": "/v3beta1/{test_case.name=projects/*/locations/*/agents/*/testCases/*}", + "(google.api.http).body": "test_case", + "(google.api.method_signature)": "test_case,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{test_case.name=projects/*/locations/*/agents/*/testCases/*}", + "body": "test_case" + } + }, + { + "(google.api.method_signature)": "test_case,update_mask" + } + ] + }, + "RunTestCase": { + "requestType": "RunTestCaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*}:run", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "RunTestCaseResponse", + "(google.longrunning.operation_info).metadata_type": "RunTestCaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*}:run", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunTestCaseResponse", + "metadata_type": "RunTestCaseMetadata" + } + } + ] + }, + "BatchRunTestCases": { + "requestType": "BatchRunTestCasesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:batchRun", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "BatchRunTestCasesResponse", + "(google.longrunning.operation_info).metadata_type": "BatchRunTestCasesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:batchRun", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchRunTestCasesResponse", + "metadata_type": "BatchRunTestCasesMetadata" + } + } + ] + }, + "CalculateCoverage": { + "requestType": "CalculateCoverageRequest", + "responseType": "CalculateCoverageResponse", + "options": { + "(google.api.http).get": "/v3beta1/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage" + } + } + ] + }, + "ImportTestCases": { + "requestType": "ImportTestCasesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportTestCasesResponse", + "(google.longrunning.operation_info).metadata_type": "ImportTestCasesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportTestCasesResponse", + "metadata_type": "ImportTestCasesMetadata" + } + } + ] + }, + "ExportTestCases": { + "requestType": "ExportTestCasesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportTestCasesResponse", + "(google.longrunning.operation_info).metadata_type": "ExportTestCasesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportTestCasesResponse", + "metadata_type": "ExportTestCasesMetadata" + } + } + ] + }, + "ListTestCaseResults": { + "requestType": "ListTestCaseResultsRequest", + "responseType": "ListTestCaseResultsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/testCases/*}/results", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/testCases/*}/results" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTestCaseResult": { + "requestType": "GetTestCaseResultRequest", + "responseType": "TestCaseResult", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*/results/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/testCases/*/results/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "TestCase": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/TestCase", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notes": { + "type": "string", + "id": 4 + }, + "testConfig": { + "type": "TestConfig", + "id": 13 + }, + "testCaseConversationTurns": { + "rule": "repeated", + "type": "ConversationTurn", + "id": 5 + }, + "creationTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastTestResult": { + "type": "TestCaseResult", + "id": 12 + } + } + }, + "TestCaseResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/TestCaseResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "environment": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "conversationTurns": { + "rule": "repeated", + "type": "ConversationTurn", + "id": 3 + }, + "testResult": { + "type": "TestResult", + "id": 4 + }, + "testTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "TestConfig": { + "fields": { + "trackingParameters": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "flow": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "page": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + } + } + }, + "ConversationTurn": { + "fields": { + "userInput": { + "type": "UserInput", + "id": 1 + }, + "virtualAgentOutput": { + "type": "VirtualAgentOutput", + "id": 2 + } + }, + "nested": { + "UserInput": { + "fields": { + "input": { + "type": "QueryInput", + "id": 5 + }, + "injectedParameters": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "isWebhookEnabled": { + "type": "bool", + "id": 3 + }, + "enableSentimentAnalysis": { + "type": "bool", + "id": 7 + } + } + }, + "VirtualAgentOutput": { + "fields": { + "sessionParameters": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "differences": { + "rule": "repeated", + "type": "TestRunDifference", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "diagnosticInfo": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "triggeredIntent": { + "type": "Intent", + "id": 7 + }, + "currentPage": { + "type": "Page", + "id": 8 + }, + "textResponses": { + "rule": "repeated", + "type": "ResponseMessage.Text", + "id": 9 + }, + "status": { + "type": "google.rpc.Status", + "id": 10 + } + } + } + } + }, + "TestRunDifference": { + "fields": { + "type": { + "type": "DiffType", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DiffType": { + "values": { + "DIFF_TYPE_UNSPECIFIED": 0, + "INTENT": 1, + "PAGE": 2, + "PARAMETERS": 3, + "UTTERANCE": 4, + "FLOW": 5 + } + } + } + }, + "TransitionCoverage": { + "fields": { + "transitions": { + "rule": "repeated", + "type": "Transition", + "id": 1 + }, + "coverageScore": { + "type": "float", + "id": 2 + } + }, + "nested": { + "TransitionNode": { + "oneofs": { + "kind": { + "oneof": [ + "page", + "flow" + ] + } + }, + "fields": { + "page": { + "type": "Page", + "id": 1 + }, + "flow": { + "type": "Flow", + "id": 2 + } + } + }, + "Transition": { + "oneofs": { + "detail": { + "oneof": [ + "transitionRoute", + "eventHandler" + ] + } + }, + "fields": { + "source": { + "type": "TransitionNode", + "id": 1 + }, + "index": { + "type": "int32", + "id": 4 + }, + "target": { + "type": "TransitionNode", + "id": 2 + }, + "covered": { + "type": "bool", + "id": 3 + }, + "transitionRoute": { + "type": "TransitionRoute", + "id": 5 + }, + "eventHandler": { + "type": "EventHandler", + "id": 6 + } + } + } + } + }, + "TransitionRouteGroupCoverage": { + "fields": { + "coverages": { + "rule": "repeated", + "type": "Coverage", + "id": 1 + }, + "coverageScore": { + "type": "float", + "id": 2 + } + }, + "nested": { + "Coverage": { + "fields": { + "routeGroup": { + "type": "TransitionRouteGroup", + "id": 1 + }, + "transitions": { + "rule": "repeated", + "type": "Transition", + "id": 2 + }, + "coverageScore": { + "type": "float", + "id": 3 + } + }, + "nested": { + "Transition": { + "fields": { + "transitionRoute": { + "type": "TransitionRoute", + "id": 1 + }, + "covered": { + "type": "bool", + "id": 2 + } + } + } + } + } + } + }, + "IntentCoverage": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + }, + "coverageScore": { + "type": "float", + "id": 2 + } + }, + "nested": { + "Intent": { + "fields": { + "intent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "covered": { + "type": "bool", + "id": 2 + } + } + } + } + }, + "CalculateCoverageRequest": { + "fields": { + "agent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "type": { + "type": "CoverageType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CoverageType": { + "values": { + "COVERAGE_TYPE_UNSPECIFIED": 0, + "INTENT": 1, + "PAGE_TRANSITION": 2, + "TRANSITION_ROUTE_GROUP": 3 + } + } + } + }, + "CalculateCoverageResponse": { + "oneofs": { + "coverageType": { + "oneof": [ + "intentCoverage", + "transitionCoverage", + "routeGroupCoverage" + ] + } + }, + "fields": { + "agent": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + }, + "intentCoverage": { + "type": "IntentCoverage", + "id": 2 + }, + "transitionCoverage": { + "type": "TransitionCoverage", + "id": 4 + }, + "routeGroupCoverage": { + "type": "TransitionRouteGroupCoverage", + "id": 6 + } + } + }, + "ListTestCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "view": { + "type": "TestCaseView", + "id": 4 + } + }, + "nested": { + "TestCaseView": { + "values": { + "TEST_CASE_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + } + } + }, + "ListTestCasesResponse": { + "fields": { + "testCases": { + "rule": "repeated", + "type": "TestCase", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "BatchDeleteTestCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "names": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "CreateTestCaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "testCase": { + "type": "TestCase", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateTestCaseRequest": { + "fields": { + "testCase": { + "type": "TestCase", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTestCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "RunTestCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + }, + "environment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "RunTestCaseResponse": { + "fields": { + "result": { + "type": "TestCaseResult", + "id": 2 + } + } + }, + "RunTestCaseMetadata": { + "fields": {} + }, + "BatchRunTestCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "environment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + }, + "testCases": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "BatchRunTestCasesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "TestCaseResult", + "id": 1 + } + } + }, + "BatchRunTestCasesMetadata": { + "fields": { + "errors": { + "rule": "repeated", + "type": "TestError", + "id": 1 + } + } + }, + "TestError": { + "fields": { + "testCase": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "testTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ImportTestCasesRequest": { + "oneofs": { + "source": { + "oneof": [ + "gcsUri", + "content" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "gcsUri": { + "type": "string", + "id": 2 + }, + "content": { + "type": "bytes", + "id": 3 + } + } + }, + "ImportTestCasesResponse": { + "fields": { + "names": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCase" + } + } + } + }, + "ImportTestCasesMetadata": { + "fields": { + "errors": { + "rule": "repeated", + "type": "TestCaseError", + "id": 1 + } + } + }, + "TestCaseError": { + "fields": { + "testCase": { + "type": "TestCase", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "ExportTestCasesRequest": { + "oneofs": { + "destination": { + "oneof": [ + "gcsUri" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCase" + } + }, + "gcsUri": { + "type": "string", + "id": 2 + }, + "dataFormat": { + "type": "DataFormat", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON": 2 + } + } + } + }, + "ExportTestCasesResponse": { + "oneofs": { + "destination": { + "oneof": [ + "gcsUri", + "content" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + }, + "content": { + "type": "bytes", + "id": 2 + } + } + }, + "ExportTestCasesMetadata": { + "fields": {} + }, + "ListTestCaseResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TestCaseResult" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListTestCaseResultsResponse": { + "fields": { + "testCaseResults": { + "rule": "repeated", + "type": "TestCaseResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTestCaseResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCaseResult" + } + } + } + }, + "TestResult": { + "values": { + "TEST_RESULT_UNSPECIFIED": 0, + "PASSED": 1, + "FAILED": 2 + } + }, + "Intents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListIntents": { + "requestType": "ListIntentsRequest", + "responseType": "ListIntentsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetIntent": { + "requestType": "GetIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateIntent": { + "requestType": "CreateIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents", + "(google.api.http).body": "intent", + "(google.api.method_signature)": "parent,intent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents", + "body": "intent" + } + }, + { + "(google.api.method_signature)": "parent,intent" + } + ] + }, + "UpdateIntent": { + "requestType": "UpdateIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).patch": "/v3beta1/{intent.name=projects/*/locations/*/agents/*/intents/*}", + "(google.api.http).body": "intent", + "(google.api.method_signature)": "intent,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{intent.name=projects/*/locations/*/agents/*/intents/*}", + "body": "intent" + } + }, + { + "(google.api.method_signature)": "intent,update_mask" + } + ] + }, + "DeleteIntent": { + "requestType": "DeleteIntentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportIntents": { + "requestType": "ImportIntentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportIntentsResponse", + "(google.longrunning.operation_info).metadata_type": "ImportIntentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportIntentsResponse", + "metadata_type": "ImportIntentsMetadata" + } + } + ] + }, + "ExportIntents": { + "requestType": "ExportIntentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportIntentsResponse", + "(google.longrunning.operation_info).metadata_type": "ExportIntentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportIntentsResponse", + "metadata_type": "ExportIntentsMetadata" + } + } + ] + } + } + }, + "Intent": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Intent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trainingPhrases": { + "rule": "repeated", + "type": "TrainingPhrase", + "id": 3 + }, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 4 + }, + "priority": { + "type": "int32", + "id": 5 + }, + "isFallback": { + "type": "bool", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "description": { + "type": "string", + "id": 8 + }, + "dtmfPattern": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TrainingPhrase": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parts": { + "rule": "repeated", + "type": "Part", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "repeatCount": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "Part": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameterId": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Parameter": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entityType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "isList": { + "type": "bool", + "id": 3 + }, + "redact": { + "type": "bool", + "id": 4 + } + } + } + } + }, + "ListIntentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "intentView": { + "type": "IntentView", + "id": 5 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListIntentsResponse": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateIntentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intent": { + "type": "Intent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateIntentRequest": { + "fields": { + "intent": { + "type": "Intent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + } + } + }, + "IntentView": { + "values": { + "INTENT_VIEW_UNSPECIFIED": 0, + "INTENT_VIEW_PARTIAL": 1, + "INTENT_VIEW_FULL": 2 + } + }, + "ImportIntentsRequest": { + "oneofs": { + "intents": { + "oneof": [ + "intentsUri", + "intentsContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intentsUri": { + "type": "string", + "id": 2 + }, + "intentsContent": { + "type": "InlineSource", + "id": 3 + }, + "mergeOption": { + "type": "MergeOption", + "id": 4 + } + }, + "nested": { + "MergeOption": { + "valuesOptions": { + "REJECT": { + "deprecated": true + } + }, + "values": { + "MERGE_OPTION_UNSPECIFIED": 0, + "REJECT": 1, + "REPLACE": 2, + "MERGE": 3, + "RENAME": 4, + "REPORT_CONFLICT": 5, + "KEEP": 6 + } + } + } + }, + "ImportIntentsResponse": { + "fields": { + "intents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "conflictingResources": { + "type": "ConflictingResources", + "id": 2 + } + }, + "nested": { + "ConflictingResources": { + "fields": { + "intentDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "entityDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "ImportIntentsMetadata": { + "fields": {} + }, + "ExportIntentsRequest": { + "oneofs": { + "destination": { + "oneof": [ + "intentsUri", + "intentsContentInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intents": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "intentsUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentsContentInline": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON": 2, + "CSV": 3 + } + } + } + }, + "ExportIntentsResponse": { + "oneofs": { + "intents": { + "oneof": [ + "intentsUri", + "intentsContent" + ] + } + }, + "fields": { + "intentsUri": { + "type": "string", + "id": 1 + }, + "intentsContent": { + "type": "InlineDestination", + "id": 2 + } + } + }, + "ExportIntentsMetadata": { + "fields": {} + }, + "InlineDestination": { + "fields": { + "content": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "InlineSource": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + } + } + }, + "Sessions": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "DetectIntent": { + "requestType": "DetectIntentRequest", + "responseType": "DetectIntentResponse", + "options": { + "(google.api.http).post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent", + "body": "*", + "additional_bindings": { + "post": "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent", + "body": "*" + } + } + } + ] + }, + "ServerStreamingDetectIntent": { + "requestType": "DetectIntentRequest", + "responseType": "DetectIntentResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent", + "body": "*", + "additional_bindings": { + "post": "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent", + "body": "*" + } + } + } + ] + }, + "StreamingDetectIntent": { + "requestType": "StreamingDetectIntentRequest", + "requestStream": true, + "responseType": "StreamingDetectIntentResponse", + "responseStream": true + }, + "MatchIntent": { + "requestType": "MatchIntentRequest", + "responseType": "MatchIntentResponse", + "options": { + "(google.api.http).post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent", + "body": "*", + "additional_bindings": { + "post": "/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent", + "body": "*" + } + } + } + ] + }, + "FulfillIntent": { + "requestType": "FulfillIntentRequest", + "responseType": "FulfillIntentResponse", + "options": { + "(google.api.http).post": "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent", + "body": "*", + "additional_bindings": { + "post": "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent", + "body": "*" + } + } + } + ] + }, + "SubmitAnswerFeedback": { + "requestType": "SubmitAnswerFeedbackRequest", + "responseType": "AnswerFeedback", + "options": { + "(google.api.http).post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback", + "body": "*" + } + } + ] + } + } + }, + "AnswerFeedback": { + "fields": { + "rating": { + "type": "Rating", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ratingReason": { + "type": "RatingReason", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customRating": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Rating": { + "values": { + "RATING_UNSPECIFIED": 0, + "THUMBS_UP": 1, + "THUMBS_DOWN": 2 + } + }, + "RatingReason": { + "fields": { + "reasonLabels": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "feedback": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "SubmitAnswerFeedbackRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "responseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "answerFeedback": { + "type": "AnswerFeedback", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DetectIntentRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "queryParams": { + "type": "QueryParameters", + "id": 2 + }, + "queryInput": { + "type": "QueryInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + }, + "responseView": { + "type": "DetectIntentResponseView", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DetectIntentResponse": { + "fields": { + "responseId": { + "type": "string", + "id": 1 + }, + "queryResult": { + "type": "QueryResult", + "id": 2 + }, + "outputAudio": { + "type": "bytes", + "id": 4 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 5 + }, + "responseType": { + "type": "ResponseType", + "id": 6 + }, + "allowCancellation": { + "type": "bool", + "id": 7 + } + }, + "nested": { + "ResponseType": { + "values": { + "RESPONSE_TYPE_UNSPECIFIED": 0, + "PARTIAL": 1, + "FINAL": 2 + } + } + } + }, + "StreamingDetectIntentRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "queryParams": { + "type": "QueryParameters", + "id": 2 + }, + "queryInput": { + "type": "QueryInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + }, + "enablePartialResponse": { + "type": "bool", + "id": 5 + }, + "enableDebuggingInfo": { + "type": "bool", + "id": 8 + }, + "responseView": { + "type": "DetectIntentResponseView", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CloudConversationDebuggingInfo": { + "fields": { + "audioDataChunks": { + "type": "int32", + "id": 1 + }, + "resultEndTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "firstAudioDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "singleUtterance": { + "type": "bool", + "id": 5 + }, + "speechPartialResultsEndTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 6 + }, + "speechFinalResultsEndTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 7 + }, + "partialResponses": { + "type": "int32", + "id": 8 + }, + "speakerIdPassiveLatencyMsOffset": { + "type": "int32", + "id": 9 + }, + "bargeinEventTriggered": { + "type": "bool", + "id": 10 + }, + "speechSingleUtterance": { + "type": "bool", + "id": 11 + }, + "dtmfPartialResultsTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 12 + }, + "dtmfFinalResultsTimes": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 13 + }, + "singleUtteranceEndTimeOffset": { + "type": "google.protobuf.Duration", + "id": 14 + }, + "noSpeechTimeout": { + "type": "google.protobuf.Duration", + "id": 15 + }, + "endpointingTimeout": { + "type": "google.protobuf.Duration", + "id": 19 + }, + "isInputText": { + "type": "bool", + "id": 16 + }, + "clientHalfCloseTimeOffset": { + "type": "google.protobuf.Duration", + "id": 17 + }, + "clientHalfCloseStreamingTimeOffset": { + "type": "google.protobuf.Duration", + "id": 18 + } + } + }, + "StreamingDetectIntentResponse": { + "oneofs": { + "response": { + "oneof": [ + "recognitionResult", + "detectIntentResponse" + ] + } + }, + "fields": { + "recognitionResult": { + "type": "StreamingRecognitionResult", + "id": 1 + }, + "detectIntentResponse": { + "type": "DetectIntentResponse", + "id": 2 + }, + "debuggingInfo": { + "type": "CloudConversationDebuggingInfo", + "id": 4 + } + } + }, + "StreamingRecognitionResult": { + "fields": { + "messageType": { + "type": "MessageType", + "id": 1 + }, + "transcript": { + "type": "string", + "id": 2 + }, + "isFinal": { + "type": "bool", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "stability": { + "type": "float", + "id": 6 + }, + "speechWordInfo": { + "rule": "repeated", + "type": "SpeechWordInfo", + "id": 7 + }, + "speechEndOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "languageCode": { + "type": "string", + "id": 10 + } + }, + "nested": { + "MessageType": { + "values": { + "MESSAGE_TYPE_UNSPECIFIED": 0, + "TRANSCRIPT": 1, + "END_OF_SINGLE_UTTERANCE": 2 + } + } + } + }, + "QueryParameters": { + "fields": { + "timeZone": { + "type": "string", + "id": 1 + }, + "geoLocation": { + "type": "google.type.LatLng", + "id": 2 + }, + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 3 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 5 + }, + "parameterScope": { + "type": "string", + "id": 12 + }, + "currentPage": { + "type": "string", + "id": 6, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "disableWebhook": { + "type": "bool", + "id": 7 + }, + "analyzeQueryTextSentiment": { + "type": "bool", + "id": 8 + }, + "webhookHeaders": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "flowVersions": { + "rule": "repeated", + "type": "string", + "id": 14, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "currentPlaybook": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "channel": { + "type": "string", + "id": 15 + }, + "sessionTtl": { + "type": "google.protobuf.Duration", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endUserMetadata": { + "type": "google.protobuf.Struct", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "searchConfig": { + "type": "SearchConfig", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "populateDataStoreConnectionSignals": { + "type": "bool", + "id": 25, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchConfig": { + "fields": { + "boostSpecs": { + "rule": "repeated", + "type": "BoostSpecs", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterSpecs": { + "rule": "repeated", + "type": "FilterSpecs", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BoostSpec": { + "fields": { + "conditionBoostSpecs": { + "rule": "repeated", + "type": "ConditionBoostSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConditionBoostSpec": { + "fields": { + "condition": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boost": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostControlSpec": { + "type": "BoostControlSpec", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostControlSpec": { + "fields": { + "fieldName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributeType": { + "type": "AttributeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interpolationType": { + "type": "InterpolationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "controlPoints": { + "rule": "repeated", + "type": "ControlPoint", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "NUMERICAL": 1, + "FRESHNESS": 2 + } + }, + "InterpolationType": { + "values": { + "INTERPOLATION_TYPE_UNSPECIFIED": 0, + "LINEAR": 1 + } + }, + "ControlPoint": { + "fields": { + "attributeValue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostAmount": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + } + } + }, + "BoostSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "spec": { + "rule": "repeated", + "type": "BoostSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FilterSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryInput": { + "oneofs": { + "input": { + "oneof": [ + "text", + "intent", + "audio", + "event", + "dtmf", + "toolCallResult" + ] + } + }, + "fields": { + "text": { + "type": "TextInput", + "id": 2 + }, + "intent": { + "type": "IntentInput", + "id": 3 + }, + "audio": { + "type": "AudioInput", + "id": 5 + }, + "event": { + "type": "EventInput", + "id": 6 + }, + "dtmf": { + "type": "DtmfInput", + "id": 7 + }, + "toolCallResult": { + "type": "google.cloud.dialogflow.cx.v3beta1.ToolCallResult", + "id": 11 + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerativeInfo": { + "fields": { + "currentPlaybooks": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "actionTracingInfo": { + "type": "Example", + "id": 2 + } + } + }, + "QueryResult": { + "oneofs": { + "query": { + "oneof": [ + "text", + "triggerIntent", + "transcript", + "triggerEvent", + "dtmf" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "triggerIntent": { + "type": "string", + "id": 11, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "transcript": { + "type": "string", + "id": 12 + }, + "triggerEvent": { + "type": "string", + "id": 14 + }, + "dtmf": { + "type": "DtmfInput", + "id": 23 + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 3 + }, + "responseMessages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 4 + }, + "webhookIds": { + "rule": "repeated", + "type": "string", + "id": 25 + }, + "webhookDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 26 + }, + "webhookLatencies": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 27 + }, + "webhookTags": { + "rule": "repeated", + "type": "string", + "id": 29 + }, + "webhookStatuses": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 13 + }, + "webhookPayloads": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 6 + }, + "currentPage": { + "type": "Page", + "id": 7 + }, + "currentFlow": { + "type": "Flow", + "id": 31 + }, + "intent": { + "type": "Intent", + "id": 8, + "options": { + "deprecated": true + } + }, + "intentDetectionConfidence": { + "type": "float", + "id": 9, + "options": { + "deprecated": true + } + }, + "match": { + "type": "Match", + "id": 15 + }, + "diagnosticInfo": { + "type": "google.protobuf.Struct", + "id": 10 + }, + "generativeInfo": { + "type": "GenerativeInfo", + "id": 33 + }, + "sentimentAnalysisResult": { + "type": "SentimentAnalysisResult", + "id": 17 + }, + "advancedSettings": { + "type": "AdvancedSettings", + "id": 21 + }, + "allowAnswerFeedback": { + "type": "bool", + "id": 32 + }, + "dataStoreConnectionSignals": { + "type": "DataStoreConnectionSignals", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "traceBlocks": { + "rule": "repeated", + "type": "TraceBlock", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TextInput": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IntentInput": { + "fields": { + "intent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + } + } + }, + "AudioInput": { + "fields": { + "config": { + "type": "InputAudioConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "bytes", + "id": 2 + } + } + }, + "EventInput": { + "fields": { + "event": { + "type": "string", + "id": 1 + } + } + }, + "DtmfInput": { + "fields": { + "digits": { + "type": "string", + "id": 1 + }, + "finishDigit": { + "type": "string", + "id": 2 + } + } + }, + "Match": { + "fields": { + "intent": { + "type": "Intent", + "id": 1 + }, + "event": { + "type": "string", + "id": 6 + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "resolvedInput": { + "type": "string", + "id": 3 + }, + "matchType": { + "type": "MatchType", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "MatchType": { + "values": { + "MATCH_TYPE_UNSPECIFIED": 0, + "INTENT": 1, + "DIRECT_INTENT": 2, + "PARAMETER_FILLING": 3, + "NO_MATCH": 4, + "NO_INPUT": 5, + "EVENT": 6, + "KNOWLEDGE_CONNECTOR": 8, + "PLAYBOOK": 9 + } + } + } + }, + "MatchIntentRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "queryParams": { + "type": "QueryParameters", + "id": 2 + }, + "queryInput": { + "type": "QueryInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "persistParameterChanges": { + "type": "bool", + "id": 5 + } + } + }, + "MatchIntentResponse": { + "oneofs": { + "query": { + "oneof": [ + "text", + "triggerIntent", + "transcript", + "triggerEvent" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "triggerIntent": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "transcript": { + "type": "string", + "id": 3 + }, + "triggerEvent": { + "type": "string", + "id": 6 + }, + "matches": { + "rule": "repeated", + "type": "Match", + "id": 4 + }, + "currentPage": { + "type": "Page", + "id": 5 + } + } + }, + "FulfillIntentRequest": { + "fields": { + "matchIntentRequest": { + "type": "MatchIntentRequest", + "id": 1 + }, + "match": { + "type": "Match", + "id": 2 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 3 + } + } + }, + "FulfillIntentResponse": { + "fields": { + "responseId": { + "type": "string", + "id": 1 + }, + "queryResult": { + "type": "QueryResult", + "id": 2 + }, + "outputAudio": { + "type": "bytes", + "id": 3 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + } + } + }, + "SentimentAnalysisResult": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "magnitude": { + "type": "float", + "id": 2 + } + } + }, + "DetectIntentResponseView": { + "values": { + "DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED": 0, + "DETECT_INTENT_RESPONSE_VIEW_FULL": 1, + "DETECT_INTENT_RESPONSE_VIEW_BASIC": 2, + "DETECT_INTENT_RESPONSE_VIEW_DEFAULT": 3 + } + }, + "Examples": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateExample": { + "requestType": "CreateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples", + "(google.api.http).body": "example", + "(google.api.method_signature)": "parent,example" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples", + "body": "example" + } + }, + { + "(google.api.method_signature)": "parent,example" + } + ] + }, + "DeleteExample": { + "requestType": "DeleteExampleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExamples": { + "requestType": "ListExamplesRequest", + "responseType": "ListExamplesResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExample": { + "requestType": "GetExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateExample": { + "requestType": "UpdateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).patch": "/v3beta1/{example.name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "(google.api.http).body": "example", + "(google.api.method_signature)": "example,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{example.name=projects/*/locations/*/agents/*/playbooks/*/examples/*}", + "body": "example" + } + }, + { + "(google.api.method_signature)": "example,update_mask" + } + ] + } + } + }, + "CreateExampleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Example" + } + }, + "example": { + "type": "Example", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Example" + } + } + } + }, + "ListExamplesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Example" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExamplesResponse": { + "fields": { + "examples": { + "rule": "repeated", + "type": "Example", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Example" + } + } + } + }, + "UpdateExampleRequest": { + "fields": { + "example": { + "type": "Example", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Example": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Example", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}", + "(google.api.resource).plural": "examples", + "(google.api.resource).singular": "example" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "playbookInput": { + "type": "PlaybookInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookOutput": { + "type": "PlaybookOutput", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tokenCount": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conversationState": { + "type": "OutputState", + "id": 12, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TraceBlock": { + "oneofs": { + "traceMetadata": { + "oneof": [ + "playbookTraceMetadata", + "flowTraceMetadata", + "speechProcessingMetadata" + ] + } + }, + "fields": { + "playbookTraceMetadata": { + "type": "PlaybookTraceMetadata", + "id": 1 + }, + "flowTraceMetadata": { + "type": "FlowTraceMetadata", + "id": 2 + }, + "speechProcessingMetadata": { + "type": "SpeechProcessingMetadata", + "id": 8 + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputParameters": { + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputParameters": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endState": { + "type": "OutputState", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechProcessingMetadata": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PlaybookTraceMetadata": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "FlowTraceMetadata": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Action": { + "oneofs": { + "action": { + "oneof": [ + "userUtterance", + "event", + "agentUtterance", + "toolUse", + "llmCall", + "intentMatch", + "flowStateUpdate", + "playbookInvocation", + "flowInvocation", + "playbookTransition", + "flowTransition", + "tts", + "stt" + ] + } + }, + "fields": { + "userUtterance": { + "type": "UserUtterance", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "event": { + "type": "Event", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentUtterance": { + "type": "AgentUtterance", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolUse": { + "type": "ToolUse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmCall": { + "type": "LlmCall", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentMatch": { + "type": "IntentMatch", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flowStateUpdate": { + "type": "FlowStateUpdate", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookInvocation": { + "type": "PlaybookInvocation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flowInvocation": { + "type": "FlowInvocation", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookTransition": { + "type": "PlaybookTransition", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flowTransition": { + "type": "FlowTransition", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tts": { + "type": "TTS", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stt": { + "type": "STT", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "subExecutionSteps": { + "rule": "repeated", + "type": "Span", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "status": { + "type": "Status", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "IntentMatch": { + "fields": { + "matchedIntents": { + "rule": "repeated", + "type": "MatchedIntent", + "id": 1 + } + }, + "nested": { + "MatchedIntent": { + "fields": { + "intentId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "score": { + "type": "float", + "id": 3 + }, + "generativeFallback": { + "type": "google.protobuf.Struct", + "id": 4 + } + } + } + } + }, + "FlowStateUpdate": { + "fields": { + "eventType": { + "type": "string", + "id": 1 + }, + "pageState": { + "type": "PageState", + "id": 2 + }, + "updatedParameters": { + "type": "google.protobuf.Struct", + "id": 3 + }, + "destination": { + "type": "string", + "id": 4 + }, + "functionCall": { + "type": "FunctionCall", + "id": 5 + } + }, + "nested": { + "PageState": { + "fields": { + "page": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "status": { + "type": "string", + "id": 3 + } + } + }, + "FunctionCall": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + } + } + }, + "TTS": { + "fields": {} + }, + "STT": { + "fields": {} + } + } + }, + "UserUtterance": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audioTokens": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audio": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Event": { + "oneofs": { + "payload": { + "oneof": [ + "text" + ] + } + }, + "fields": { + "event": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "text": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AgentUtterance": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requireGeneration": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolUse": { + "oneofs": { + "ToolTrace": { + "oneof": [ + "dataStoreToolTrace", + "webhookToolTrace" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "displayName": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputActionParameters": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputActionParameters": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataStoreToolTrace": { + "type": "DataStoreToolTrace", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webhookToolTrace": { + "type": "WebhookToolTrace", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataStoreToolTrace": { + "fields": { + "dataStoreConnectionSignals": { + "type": "DataStoreConnectionSignals", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WebhookToolTrace": { + "fields": { + "webhookTag": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webhookUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "LlmCall": { + "fields": { + "retrievedExamples": { + "rule": "repeated", + "type": "RetrievedExample", + "id": 1 + }, + "tokenCount": { + "type": "TokenCount", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + }, + "temperature": { + "type": "float", + "id": 4 + } + }, + "nested": { + "RetrievedExample": { + "fields": { + "exampleId": { + "type": "string", + "id": 1 + }, + "exampleDisplayName": { + "type": "string", + "id": 2 + }, + "retrievalStrategy": { + "type": "RetrievalStrategy", + "id": 3 + }, + "matchedRetrievalLabel": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TokenCount": { + "fields": { + "totalInputTokenCount": { + "type": "int64", + "id": 1 + }, + "conversationContextTokenCount": { + "type": "int64", + "id": 3 + }, + "exampleTokenCount": { + "type": "int64", + "id": 4 + }, + "totalOutputTokenCount": { + "type": "int64", + "id": 5 + } + } + } + } + }, + "PlaybookInvocation": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "playbookInput": { + "type": "PlaybookInput", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookOutput": { + "type": "PlaybookOutput", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookState": { + "type": "OutputState", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FlowInvocation": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "displayName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputActionParameters": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputActionParameters": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flowState": { + "type": "OutputState", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PlaybookTransition": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputActionParameters": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "deprecated": true + } + } + } + }, + "FlowTransition": { + "fields": { + "flow": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputActionParameters": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "deprecated": true + } + } + } + }, + "PlaybookInput": { + "fields": { + "precedingConversationSummary": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "actionParameters": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PlaybookOutput": { + "fields": { + "executionSummary": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "deprecated": true + } + }, + "actionParameters": { + "type": "google.protobuf.Struct", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "options": { + "deprecated": true + }, + "values": { + "STATE_UNSPECIFIED": 0, + "OK": 1, + "CANCELLED": 2, + "FAILED": 3, + "ESCALATED": 4 + } + } + } + }, + "Span": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "metrics": { + "rule": "repeated", + "type": "NamedMetric", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "NamedMetric": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "google.protobuf.Value", + "id": 2 + }, + "unit": { + "type": "string", + "id": 3 + } + } + }, + "Status": { + "fields": { + "exception": { + "type": "ExceptionDetail", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExceptionDetail": { + "fields": { + "errorMessage": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OutputState": { + "values": { + "OUTPUT_STATE_UNSPECIFIED": 0, + "OUTPUT_STATE_OK": 1, + "OUTPUT_STATE_CANCELLED": 2, + "OUTPUT_STATE_FAILED": 3, + "OUTPUT_STATE_ESCALATED": 4, + "OUTPUT_STATE_PENDING": 5 + } + }, + "RetrievalStrategy": { + "values": { + "RETRIEVAL_STRATEGY_UNSPECIFIED": 0, + "DEFAULT": 1, + "STATIC": 2, + "NEVER": 3 + } + }, + "SessionEntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListSessionEntityTypes": { + "requestType": "ListSessionEntityTypesRequest", + "responseType": "ListSessionEntityTypesResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "additional_bindings": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSessionEntityType": { + "requestType": "GetSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "additional_bindings": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSessionEntityType": { + "requestType": "CreateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.post": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "parent,session_entity_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes", + "body": "session_entity_type", + "additional_bindings": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes", + "body": "session_entity_type" + } + } + }, + { + "(google.api.method_signature)": "parent,session_entity_type" + } + ] + }, + "UpdateSessionEntityType": { + "requestType": "UpdateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).patch": "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.patch": "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "session_entity_type,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "body": "session_entity_type", + "additional_bindings": { + "patch": "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "body": "session_entity_type" + } + } + }, + { + "(google.api.method_signature)": "session_entity_type,update_mask" + } + ] + }, + "DeleteSessionEntityType": { + "requestType": "DeleteSessionEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.delete": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}", + "additional_bindings": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "SessionEntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/SessionEntityType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entityOverrideMode": { + "type": "EntityOverrideMode", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "EntityOverrideMode": { + "values": { + "ENTITY_OVERRIDE_MODE_UNSPECIFIED": 0, + "ENTITY_OVERRIDE_MODE_OVERRIDE": 1, + "ENTITY_OVERRIDE_MODE_SUPPLEMENT": 2 + } + } + } + }, + "ListSessionEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSessionEntityTypesResponse": { + "fields": { + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "CreateSessionEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "sessionEntityType": { + "type": "SessionEntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSessionEntityTypeRequest": { + "fields": { + "sessionEntityType": { + "type": "SessionEntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "EntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "GetEntityType": { + "requestType": "GetEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEntityType": { + "requestType": "CreateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes", + "(google.api.http).body": "entity_type", + "(google.api.method_signature)": "parent,entity_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes", + "body": "entity_type" + } + }, + { + "(google.api.method_signature)": "parent,entity_type" + } + ] + }, + "UpdateEntityType": { + "requestType": "UpdateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).patch": "/v3beta1/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}", + "(google.api.http).body": "entity_type", + "(google.api.method_signature)": "entity_type,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}", + "body": "entity_type" + } + }, + { + "(google.api.method_signature)": "entity_type,update_mask" + } + ] + }, + "DeleteEntityType": { + "requestType": "DeleteEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEntityTypes": { + "requestType": "ListEntityTypesRequest", + "responseType": "ListEntityTypesResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ExportEntityTypes": { + "requestType": "ExportEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportEntityTypesResponse", + "(google.longrunning.operation_info).metadata_type": "ExportEntityTypesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportEntityTypesResponse", + "metadata_type": "ExportEntityTypesMetadata" + } + } + ] + }, + "ImportEntityTypes": { + "requestType": "ImportEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportEntityTypesResponse", + "(google.longrunning.operation_info).metadata_type": "ImportEntityTypesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportEntityTypesResponse", + "metadata_type": "ImportEntityTypesMetadata" + } + } + ] + } + } + }, + "EntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/EntityType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kind": { + "type": "Kind", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoExpansionMode": { + "type": "AutoExpansionMode", + "id": 4 + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 5 + }, + "excludedPhrases": { + "rule": "repeated", + "type": "ExcludedPhrase", + "id": 6 + }, + "enableFuzzyExtraction": { + "type": "bool", + "id": 7 + }, + "redact": { + "type": "bool", + "id": 9 + } + }, + "nested": { + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "KIND_MAP": 1, + "KIND_LIST": 2, + "KIND_REGEXP": 3 + } + }, + "AutoExpansionMode": { + "values": { + "AUTO_EXPANSION_MODE_UNSPECIFIED": 0, + "AUTO_EXPANSION_MODE_DEFAULT": 1 + } + }, + "Entity": { + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "synonyms": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExcludedPhrase": { + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ExportEntityTypesRequest": { + "oneofs": { + "destination": { + "oneof": [ + "entityTypesUri", + "entityTypesContentInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entityTypesUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entityTypesContentInline": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON_PACKAGE": 5 + } + } + } + }, + "ExportEntityTypesResponse": { + "oneofs": { + "exportedEntityTypes": { + "oneof": [ + "entityTypesUri", + "entityTypesContent" + ] + } + }, + "fields": { + "entityTypesUri": { + "type": "string", + "id": 1 + }, + "entityTypesContent": { + "type": "InlineDestination", + "id": 2 + } + } + }, + "ExportEntityTypesMetadata": { + "fields": {} + }, + "ImportEntityTypesRequest": { + "oneofs": { + "entityTypes": { + "oneof": [ + "entityTypesUri", + "entityTypesContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypesUri": { + "type": "string", + "id": 2 + }, + "entityTypesContent": { + "type": "InlineSource", + "id": 3 + }, + "mergeOption": { + "type": "MergeOption", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetEntityType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + } + }, + "nested": { + "MergeOption": { + "values": { + "MERGE_OPTION_UNSPECIFIED": 0, + "REPLACE": 1, + "MERGE": 2, + "RENAME": 3, + "REPORT_CONFLICT": 4, + "KEEP": 5 + } + } + } + }, + "ImportEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "conflictingResources": { + "type": "ConflictingResources", + "id": 2 + } + }, + "nested": { + "ConflictingResources": { + "fields": { + "entityTypeDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "entityDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "ImportEntityTypesMetadata": { + "fields": {} + }, + "ListEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityType": { + "type": "EntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateEntityTypeRequest": { + "fields": { + "entityType": { + "type": "EntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "TransitionRouteGroups": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListTransitionRouteGroups": { + "requestType": "ListTransitionRouteGroupsRequest", + "responseType": "ListTransitionRouteGroupsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "(google.api.http).additional_bindings.get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "additional_bindings": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTransitionRouteGroup": { + "requestType": "GetTransitionRouteGroupRequest", + "responseType": "TransitionRouteGroup", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "(google.api.http).additional_bindings.get": "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "additional_bindings": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTransitionRouteGroup": { + "requestType": "CreateTransitionRouteGroupRequest", + "responseType": "TransitionRouteGroup", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "(google.api.http).body": "transition_route_group", + "(google.api.http).additional_bindings.post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "(google.api.http).additional_bindings.body": "transition_route_group", + "(google.api.method_signature)": "parent,transition_route_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", + "body": "transition_route_group", + "additional_bindings": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "body": "transition_route_group" + } + } + }, + { + "(google.api.method_signature)": "parent,transition_route_group" + } + ] + }, + "UpdateTransitionRouteGroup": { + "requestType": "UpdateTransitionRouteGroupRequest", + "responseType": "TransitionRouteGroup", + "options": { + "(google.api.http).patch": "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "(google.api.http).body": "transition_route_group", + "(google.api.http).additional_bindings.patch": "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "(google.api.http).additional_bindings.body": "transition_route_group", + "(google.api.method_signature)": "transition_route_group,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "body": "transition_route_group", + "additional_bindings": { + "patch": "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "body": "transition_route_group" + } + } + }, + { + "(google.api.method_signature)": "transition_route_group,update_mask" + } + ] + }, + "DeleteTransitionRouteGroup": { + "requestType": "DeleteTransitionRouteGroupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "(google.api.http).additional_bindings.delete": "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", + "additional_bindings": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "TransitionRouteGroup": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/TransitionRouteGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}", + "(google.api.resource).plural": "transitionRouteGroups", + "(google.api.resource).singular": "transitionRouteGroup" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "transitionRoutes": { + "rule": "repeated", + "type": "TransitionRoute", + "id": 5 + } + } + }, + "ListTransitionRouteGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4 + } + } + }, + "ListTransitionRouteGroupsResponse": { + "fields": { + "transitionRouteGroups": { + "rule": "repeated", + "type": "TransitionRouteGroup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTransitionRouteGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateTransitionRouteGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "transitionRouteGroup": { + "type": "TransitionRouteGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateTransitionRouteGroupRequest": { + "fields": { + "transitionRouteGroup": { + "type": "TransitionRouteGroup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "DeleteTransitionRouteGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TransitionRouteGroup" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "Webhooks": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListWebhooks": { + "requestType": "ListWebhooksRequest", + "responseType": "ListWebhooksResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetWebhook": { + "requestType": "GetWebhookRequest", + "responseType": "Webhook", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateWebhook": { + "requestType": "CreateWebhookRequest", + "responseType": "Webhook", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks", + "(google.api.http).body": "webhook", + "(google.api.method_signature)": "parent,webhook" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks", + "body": "webhook" + } + }, + { + "(google.api.method_signature)": "parent,webhook" + } + ] + }, + "UpdateWebhook": { + "requestType": "UpdateWebhookRequest", + "responseType": "Webhook", + "options": { + "(google.api.http).patch": "/v3beta1/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}", + "(google.api.http).body": "webhook", + "(google.api.method_signature)": "webhook,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}", + "body": "webhook" + } + }, + { + "(google.api.method_signature)": "webhook,update_mask" + } + ] + }, + "DeleteWebhook": { + "requestType": "DeleteWebhookRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Webhook": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Webhook", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}" + }, + "oneofs": { + "webhook": { + "oneof": [ + "genericWebService", + "serviceDirectory" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "genericWebService": { + "type": "GenericWebService", + "id": 4 + }, + "serviceDirectory": { + "type": "ServiceDirectoryConfig", + "id": 7 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "disabled": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "GenericWebService": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "username": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "password": { + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + }, + "secretVersionForUsernamePassword": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "requestHeaders": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "secretVersionsForRequestHeaders": { + "keyType": "string", + "type": "SecretVersionHeaderValue", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedCaCerts": { + "rule": "repeated", + "type": "bytes", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauthConfig": { + "type": "OAuthConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAgentAuth": { + "type": "ServiceAgentAuth", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountAuthConfig": { + "type": "ServiceAccountAuthConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webhookType": { + "type": "WebhookType", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpMethod": { + "type": "HttpMethod", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestBody": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameterMapping": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SecretVersionHeaderValue": { + "fields": { + "secretVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "OAuthConfig": { + "fields": { + "clientId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientSecret": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForClientSecret": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "tokenEndpoint": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ServiceAgentAuth": { + "values": { + "SERVICE_AGENT_AUTH_UNSPECIFIED": 0, + "NONE": 1, + "ID_TOKEN": 2, + "ACCESS_TOKEN": 3 + } + }, + "ServiceAccountAuthConfig": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WebhookType": { + "values": { + "WEBHOOK_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "FLEXIBLE": 2 + } + }, + "HttpMethod": { + "values": { + "HTTP_METHOD_UNSPECIFIED": 0, + "POST": 1, + "GET": 2, + "HEAD": 3, + "PUT": 4, + "DELETE": 5, + "PATCH": 6, + "OPTIONS": 7 + } + } + } + }, + "ServiceDirectoryConfig": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" + } + }, + "genericWebService": { + "type": "GenericWebService", + "id": 2 + } + } + } + } + }, + "ListWebhooksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Webhook" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListWebhooksResponse": { + "fields": { + "webhooks": { + "rule": "repeated", + "type": "Webhook", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetWebhookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Webhook" + } + } + } + }, + "CreateWebhookRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Webhook" + } + }, + "webhook": { + "type": "Webhook", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateWebhookRequest": { + "fields": { + "webhook": { + "type": "Webhook", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteWebhookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Webhook" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "WebhookRequest": { + "oneofs": { + "query": { + "oneof": [ + "text", + "triggerIntent", + "transcript", + "triggerEvent", + "dtmfDigits" + ] + } + }, + "fields": { + "detectIntentResponseId": { + "type": "string", + "id": 1 + }, + "text": { + "type": "string", + "id": 10 + }, + "triggerIntent": { + "type": "string", + "id": 11, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "transcript": { + "type": "string", + "id": 12 + }, + "triggerEvent": { + "type": "string", + "id": 14 + }, + "dtmfDigits": { + "type": "string", + "id": 17 + }, + "languageCode": { + "type": "string", + "id": 15 + }, + "fulfillmentInfo": { + "type": "FulfillmentInfo", + "id": 6 + }, + "intentInfo": { + "type": "IntentInfo", + "id": 3 + }, + "pageInfo": { + "type": "PageInfo", + "id": 4 + }, + "sessionInfo": { + "type": "SessionInfo", + "id": 5 + }, + "messages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 7 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 8 + }, + "sentimentAnalysisResult": { + "type": "SentimentAnalysisResult", + "id": 9 + }, + "languageInfo": { + "type": "LanguageInfo", + "id": 18 + } + }, + "nested": { + "FulfillmentInfo": { + "fields": { + "tag": { + "type": "string", + "id": 1 + } + } + }, + "IntentInfo": { + "fields": { + "lastMatchedIntent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "parameters": { + "keyType": "string", + "type": "IntentParameterValue", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 4 + } + }, + "nested": { + "IntentParameterValue": { + "fields": { + "originalValue": { + "type": "string", + "id": 1 + }, + "resolvedValue": { + "type": "google.protobuf.Value", + "id": 2 + } + } + } + } + }, + "SentimentAnalysisResult": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "magnitude": { + "type": "float", + "id": 2 + } + } + } + } + }, + "WebhookResponse": { + "oneofs": { + "transition": { + "oneof": [ + "targetPage", + "targetFlow" + ] + } + }, + "fields": { + "fulfillmentResponse": { + "type": "FulfillmentResponse", + "id": 1 + }, + "pageInfo": { + "type": "PageInfo", + "id": 2 + }, + "sessionInfo": { + "type": "SessionInfo", + "id": 3 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "targetPage": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "targetFlow": { + "type": "string", + "id": 6, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + } + }, + "nested": { + "FulfillmentResponse": { + "fields": { + "messages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 1 + }, + "mergeBehavior": { + "type": "MergeBehavior", + "id": 2 + } + }, + "nested": { + "MergeBehavior": { + "values": { + "MERGE_BEHAVIOR_UNSPECIFIED": 0, + "APPEND": 1, + "REPLACE": 2 + } + } + } + } + } + }, + "PageInfo": { + "fields": { + "currentPage": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Page" + } + }, + "displayName": { + "type": "string", + "id": 4 + }, + "formInfo": { + "type": "FormInfo", + "id": 3 + } + }, + "nested": { + "FormInfo": { + "fields": { + "parameterInfo": { + "rule": "repeated", + "type": "ParameterInfo", + "id": 2 + } + }, + "nested": { + "ParameterInfo": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "required": { + "type": "bool", + "id": 2 + }, + "state": { + "type": "ParameterState", + "id": 3 + }, + "value": { + "type": "google.protobuf.Value", + "id": 4 + }, + "justCollected": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "ParameterState": { + "values": { + "PARAMETER_STATE_UNSPECIFIED": 0, + "EMPTY": 1, + "INVALID": 2, + "FILLED": 3 + } + } + } + } + } + } + } + }, + "SessionInfo": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } + }, + "parameters": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 2 + } + } + }, + "LanguageInfo": { + "fields": { + "inputLanguageCode": { + "type": "string", + "id": 1 + }, + "resolvedLanguageCode": { + "type": "string", + "id": 2 + }, + "confidenceScore": { + "type": "float", + "id": 3 + } + } + }, + "Deployments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListDeployments": { + "requestType": "ListDeploymentsRequest", + "responseType": "ListDeploymentsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeployment": { + "requestType": "GetDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Deployment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Deployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "flowVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "state": { + "type": "State", + "id": 3 + }, + "result": { + "type": "Result", + "id": 4 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + }, + "Result": { + "fields": { + "deploymentTestResults": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCaseResult" + } + }, + "experiment": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + } + } + }, + "ListDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Deployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDeploymentsResponse": { + "fields": { + "deployments": { + "rule": "repeated", + "type": "Deployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Deployment" + } + } + } + }, + "Experiments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListExperiments": { + "requestType": "ListExperimentsRequest", + "responseType": "ListExperimentsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExperiment": { + "requestType": "GetExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateExperiment": { + "requestType": "CreateExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments", + "(google.api.http).body": "experiment", + "(google.api.method_signature)": "parent,experiment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments", + "body": "experiment" + } + }, + { + "(google.api.method_signature)": "parent,experiment" + } + ] + }, + "UpdateExperiment": { + "requestType": "UpdateExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).patch": "/v3beta1/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "(google.api.http).body": "experiment", + "(google.api.method_signature)": "experiment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "body": "experiment" + } + }, + { + "(google.api.method_signature)": "experiment,update_mask" + } + ] + }, + "DeleteExperiment": { + "requestType": "DeleteExperimentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "StartExperiment": { + "requestType": "StartExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "StopExperiment": { + "requestType": "StopExperimentRequest", + "responseType": "Experiment", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Experiment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Experiment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "definition": { + "type": "Definition", + "id": 5 + }, + "rolloutConfig": { + "type": "RolloutConfig", + "id": 14 + }, + "rolloutState": { + "type": "RolloutState", + "id": 15 + }, + "rolloutFailureReason": { + "type": "string", + "id": 16 + }, + "result": { + "type": "Result", + "id": 6 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "experimentLength": { + "type": "google.protobuf.Duration", + "id": 11 + }, + "variantsHistory": { + "rule": "repeated", + "type": "VariantsHistory", + "id": 12 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "DRAFT": 1, + "RUNNING": 2, + "DONE": 3, + "ROLLOUT_FAILED": 4 + } + }, + "Definition": { + "oneofs": { + "variants": { + "oneof": [ + "versionVariants" + ] + } + }, + "fields": { + "condition": { + "type": "string", + "id": 1 + }, + "versionVariants": { + "type": "VersionVariants", + "id": 2 + } + } + }, + "Result": { + "fields": { + "versionMetrics": { + "rule": "repeated", + "type": "VersionMetrics", + "id": 1 + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + }, + "nested": { + "MetricType": { + "values": { + "METRIC_UNSPECIFIED": 0, + "CONTAINED_SESSION_NO_CALLBACK_RATE": 1, + "LIVE_AGENT_HANDOFF_RATE": 2, + "CALLBACK_SESSION_RATE": 3, + "ABANDONED_SESSION_RATE": 4, + "SESSION_END_RATE": 5 + } + }, + "CountType": { + "values": { + "COUNT_TYPE_UNSPECIFIED": 0, + "TOTAL_NO_MATCH_COUNT": 1, + "TOTAL_TURN_COUNT": 2, + "AVERAGE_TURN_COUNT": 3 + } + }, + "ConfidenceInterval": { + "fields": { + "confidenceLevel": { + "type": "double", + "id": 1 + }, + "ratio": { + "type": "double", + "id": 2 + }, + "lowerBound": { + "type": "double", + "id": 3 + }, + "upperBound": { + "type": "double", + "id": 4 + } + } + }, + "Metric": { + "oneofs": { + "value": { + "oneof": [ + "ratio", + "count" + ] + } + }, + "fields": { + "type": { + "type": "MetricType", + "id": 1 + }, + "countType": { + "type": "CountType", + "id": 5 + }, + "ratio": { + "type": "double", + "id": 2 + }, + "count": { + "type": "double", + "id": 4 + }, + "confidenceInterval": { + "type": "ConfidenceInterval", + "id": 3 + } + } + }, + "VersionMetrics": { + "fields": { + "version": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 2 + }, + "sessionCount": { + "type": "int32", + "id": 3 + } + } + } + } + } + } + }, + "VersionVariants": { + "fields": { + "variants": { + "rule": "repeated", + "type": "Variant", + "id": 1 + } + }, + "nested": { + "Variant": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "trafficAllocation": { + "type": "float", + "id": 2 + }, + "isControlGroup": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "RolloutConfig": { + "fields": { + "rolloutSteps": { + "rule": "repeated", + "type": "RolloutStep", + "id": 1 + }, + "rolloutCondition": { + "type": "string", + "id": 2 + }, + "failureCondition": { + "type": "string", + "id": 3 + } + }, + "nested": { + "RolloutStep": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "trafficPercent": { + "type": "int32", + "id": 2 + }, + "minDuration": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + } + } + }, + "RolloutState": { + "fields": { + "step": { + "type": "string", + "id": 1 + }, + "stepIndex": { + "type": "int32", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "VariantsHistory": { + "oneofs": { + "variants": { + "oneof": [ + "versionVariants" + ] + } + }, + "fields": { + "versionVariants": { + "type": "VersionVariants", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "ListExperimentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Experiment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListExperimentsResponse": { + "fields": { + "experiments": { + "rule": "repeated", + "type": "Experiment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "CreateExperimentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Experiment" + } + }, + "experiment": { + "type": "Experiment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateExperimentRequest": { + "fields": { + "experiment": { + "type": "Experiment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "StartExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "StopExperimentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Experiment" + } + } + } + }, + "Generators": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListGenerators": { + "requestType": "ListGeneratorsRequest", + "responseType": "ListGeneratorsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGenerator": { + "requestType": "GetGeneratorRequest", + "responseType": "Generator", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGenerator": { + "requestType": "CreateGeneratorRequest", + "responseType": "Generator", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators", + "(google.api.http).body": "generator", + "(google.api.method_signature)": "parent,generator" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators", + "body": "generator" + } + }, + { + "(google.api.method_signature)": "parent,generator" + } + ] + }, + "UpdateGenerator": { + "requestType": "UpdateGeneratorRequest", + "responseType": "Generator", + "options": { + "(google.api.http).patch": "/v3beta1/{generator.name=projects/*/locations/*/agents/*/generators/*}", + "(google.api.http).body": "generator", + "(google.api.method_signature)": "generator,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{generator.name=projects/*/locations/*/agents/*/generators/*}", + "body": "generator" + } + }, + { + "(google.api.method_signature)": "generator,update_mask" + } + ] + }, + "DeleteGenerator": { + "requestType": "DeleteGeneratorRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Generator": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Generator", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/generators/{generator}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "promptText": { + "type": "Phrase", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "placeholders": { + "rule": "repeated", + "type": "Placeholder", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 9 + }, + "modelParameter": { + "type": "ModelParameter", + "id": 8 + } + }, + "nested": { + "Placeholder": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "ModelParameter": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_maxDecodeSteps": { + "oneof": [ + "maxDecodeSteps" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "temperature": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "maxDecodeSteps": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "Phrase": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListGeneratorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Generator" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListGeneratorsResponse": { + "fields": { + "generators": { + "rule": "repeated", + "type": "Generator", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetGeneratorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Generator" + } + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "CreateGeneratorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Generator" + } + }, + "generator": { + "type": "Generator", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "UpdateGeneratorRequest": { + "fields": { + "generator": { + "type": "Generator", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteGeneratorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Generator" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "Playbooks": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreatePlaybook": { + "requestType": "CreatePlaybookRequest", + "responseType": "Playbook", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks", + "(google.api.http).body": "playbook", + "(google.api.method_signature)": "parent,playbook" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks", + "body": "playbook" + } + }, + { + "(google.api.method_signature)": "parent,playbook" + } + ] + }, + "DeletePlaybook": { + "requestType": "DeletePlaybookRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPlaybooks": { + "requestType": "ListPlaybooksRequest", + "responseType": "ListPlaybooksResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPlaybook": { + "requestType": "GetPlaybookRequest", + "responseType": "Playbook", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ExportPlaybook": { + "requestType": "ExportPlaybookRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportPlaybookResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*}:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportPlaybookResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ImportPlaybook": { + "requestType": "ImportPlaybookRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportPlaybookResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/playbooks:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportPlaybookResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "UpdatePlaybook": { + "requestType": "UpdatePlaybookRequest", + "responseType": "Playbook", + "options": { + "(google.api.http).patch": "/v3beta1/{playbook.name=projects/*/locations/*/agents/*/playbooks/*}", + "(google.api.http).body": "playbook", + "(google.api.method_signature)": "playbook,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{playbook.name=projects/*/locations/*/agents/*/playbooks/*}", + "body": "playbook" + } + }, + { + "(google.api.method_signature)": "playbook,update_mask" + } + ] + }, + "CreatePlaybookVersion": { + "requestType": "CreatePlaybookVersionRequest", + "responseType": "PlaybookVersion", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions", + "(google.api.http).body": "playbook_version", + "(google.api.method_signature)": "parent,playbook_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions", + "body": "playbook_version" + } + }, + { + "(google.api.method_signature)": "parent,playbook_version" + } + ] + }, + "GetPlaybookVersion": { + "requestType": "GetPlaybookVersionRequest", + "responseType": "PlaybookVersion", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestorePlaybookVersion": { + "requestType": "RestorePlaybookVersionRequest", + "responseType": "RestorePlaybookVersionResponse", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPlaybookVersions": { + "requestType": "ListPlaybookVersionsRequest", + "responseType": "ListPlaybookVersionsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeletePlaybookVersion": { + "requestType": "DeletePlaybookVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreatePlaybookRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Playbook" + } + }, + "playbook": { + "type": "Playbook", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeletePlaybookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + } + } + }, + "ListPlaybooksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Playbook" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListPlaybooksResponse": { + "fields": { + "playbooks": { + "rule": "repeated", + "type": "Playbook", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetPlaybookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + } + } + }, + "UpdatePlaybookRequest": { + "fields": { + "playbook": { + "type": "Playbook", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "Playbook": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Playbook", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "goal": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputParameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instruction": { + "type": "Instruction", + "id": 17 + }, + "tokenCount": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencedPlaybooks": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "referencedFlows": { + "rule": "repeated", + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" + } + }, + "referencedTools": { + "rule": "repeated", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "inlineActions": { + "rule": "repeated", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "codeBlock": { + "type": "CodeBlock", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmModelSettings": { + "type": "LlmModelSettings", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechSettings": { + "type": "AdvancedSettings.SpeechSettings", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "handlers": { + "rule": "repeated", + "type": "Handler", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbookType": { + "type": "PlaybookType", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Step": { + "oneofs": { + "instruction": { + "oneof": [ + "text" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "Step", + "id": 2 + } + } + }, + "Instruction": { + "fields": { + "guidelines": { + "type": "string", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "Step", + "id": 2 + } + } + }, + "PlaybookType": { + "values": { + "PLAYBOOK_TYPE_UNSPECIFIED": 0, + "TASK": 1, + "ROUTINE": 3 + } + } + } + }, + "CreatePlaybookVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/PlaybookVersion" + } + }, + "playbookVersion": { + "type": "PlaybookVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PlaybookVersion": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/PlaybookVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}", + "(google.api.resource).plural": "playbookVersions", + "(google.api.resource).singular": "playbookVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "playbook": { + "type": "Playbook", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "examples": { + "rule": "repeated", + "type": "Example", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetPlaybookVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/PlaybookVersion" + } + } + } + }, + "RestorePlaybookVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/PlaybookVersion" + } + } + } + }, + "RestorePlaybookVersionResponse": { + "fields": { + "playbook": { + "type": "Playbook", + "id": 2 + } + } + }, + "ListPlaybookVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/PlaybookVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPlaybookVersionsResponse": { + "fields": { + "playbookVersions": { + "rule": "repeated", + "type": "PlaybookVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeletePlaybookVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/PlaybookVersion" + } + } + } + }, + "ExportPlaybookRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "playbookUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1, + "JSON": 2 + } + } + } + }, + "ImportPlaybookRequest": { + "oneofs": { + "playbook": { + "oneof": [ + "playbookUri", + "playbookContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Playbook" + } + }, + "playbookUri": { + "type": "string", + "id": 2 + }, + "playbookContent": { + "type": "bytes", + "id": 3 + }, + "importStrategy": { + "type": "PlaybookImportStrategy", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PlaybookImportStrategy": { + "fields": { + "mainPlaybookImportStrategy": { + "type": "ImportStrategy", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nestedResourceImportStrategy": { + "type": "ImportStrategy", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolImportStrategy": { + "type": "ImportStrategy", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportPlaybookResponse": { + "fields": { + "playbook": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" + } + }, + "conflictingResources": { + "type": "ConflictingResources", + "id": 2 + } + }, + "nested": { + "ConflictingResources": { + "fields": { + "mainPlaybookDisplayName": { + "type": "string", + "id": 1 + }, + "nestedPlaybookDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "toolDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + }, + "ExportPlaybookResponse": { + "oneofs": { + "playbook": { + "oneof": [ + "playbookUri", + "playbookContent" + ] + } + }, + "fields": { + "playbookUri": { + "type": "string", + "id": 1 + }, + "playbookContent": { + "type": "bytes", + "id": 2 + } + } + }, + "Handler": { + "oneofs": { + "handler": { + "oneof": [ + "eventHandler", + "lifecycleHandler" + ] + } + }, + "fields": { + "eventHandler": { + "type": "EventHandler", + "id": 1 + }, + "lifecycleHandler": { + "type": "LifecycleHandler", + "id": 3 + } + }, + "nested": { + "EventHandler": { + "fields": { + "event": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "condition": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fulfillment": { + "type": "Fulfillment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LifecycleHandler": { + "fields": { + "lifecycleStage": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "condition": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fulfillment": { + "type": "Fulfillment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "SecuritySettingsService": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateSecuritySettings": { + "requestType": "CreateSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}/securitySettings", + "(google.api.http).body": "security_settings", + "(google.api.method_signature)": "parent,security_settings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}/securitySettings", + "body": "security_settings" + } + }, + { + "(google.api.method_signature)": "parent,security_settings" + } + ] + }, + "GetSecuritySettings": { + "requestType": "GetSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSecuritySettings": { + "requestType": "UpdateSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).patch": "/v3beta1/{security_settings.name=projects/*/locations/*/securitySettings/*}", + "(google.api.http).body": "security_settings", + "(google.api.method_signature)": "security_settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{security_settings.name=projects/*/locations/*/securitySettings/*}", + "body": "security_settings" + } + }, + { + "(google.api.method_signature)": "security_settings,update_mask" + } + ] + }, + "ListSecuritySettings": { + "requestType": "ListSecuritySettingsRequest", + "responseType": "ListSecuritySettingsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/securitySettings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*}/securitySettings" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSecuritySettings": { + "requestType": "DeleteSecuritySettingsRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetSecuritySettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + } + } + }, + "UpdateSecuritySettingsRequest": { + "fields": { + "securitySettings": { + "type": "SecuritySettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSecuritySettingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSecuritySettingsResponse": { + "fields": { + "securitySettings": { + "rule": "repeated", + "type": "SecuritySettings", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateSecuritySettingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "securitySettings": { + "type": "SecuritySettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSecuritySettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + } + } + }, + "SecuritySettings": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/SecuritySettings", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/securitySettings/{security_settings}" + }, + "oneofs": { + "dataRetention": { + "oneof": [ + "retentionWindowDays", + "retentionStrategy" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "redactionStrategy": { + "type": "RedactionStrategy", + "id": 3 + }, + "redactionScope": { + "type": "RedactionScope", + "id": 4 + }, + "inspectTemplate": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + }, + "deidentifyTemplate": { + "type": "string", + "id": 17, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + }, + "retentionWindowDays": { + "type": "int32", + "id": 6 + }, + "retentionStrategy": { + "type": "RetentionStrategy", + "id": 7 + }, + "purgeDataTypes": { + "rule": "repeated", + "type": "PurgeDataType", + "id": 8 + }, + "audioExportSettings": { + "type": "AudioExportSettings", + "id": 12 + }, + "insightsExportSettings": { + "type": "InsightsExportSettings", + "id": 13 + } + }, + "nested": { + "RedactionStrategy": { + "values": { + "REDACTION_STRATEGY_UNSPECIFIED": 0, + "REDACT_WITH_SERVICE": 1 + } + }, + "RedactionScope": { + "values": { + "REDACTION_SCOPE_UNSPECIFIED": 0, + "REDACT_DISK_STORAGE": 2 + } + }, + "RetentionStrategy": { + "values": { + "RETENTION_STRATEGY_UNSPECIFIED": 0, + "REMOVE_AFTER_CONVERSATION": 1 + } + }, + "PurgeDataType": { + "values": { + "PURGE_DATA_TYPE_UNSPECIFIED": 0, + "DIALOGFLOW_HISTORY": 1 + } + }, + "AudioExportSettings": { + "fields": { + "gcsBucket": { + "type": "string", + "id": 1 + }, + "audioExportPattern": { + "type": "string", + "id": 2 + }, + "enableAudioRedaction": { + "type": "bool", + "id": 3 + }, + "audioFormat": { + "type": "AudioFormat", + "id": 4 + }, + "storeTtsAudio": { + "type": "bool", + "id": 6 + } + }, + "nested": { + "AudioFormat": { + "values": { + "AUDIO_FORMAT_UNSPECIFIED": 0, + "MULAW": 1, + "MP3": 2, + "OGG": 3 + } + } + } + }, + "InsightsExportSettings": { + "fields": { + "enableInsightsExport": { + "type": "bool", + "id": 1 + } + } + } + } + }, + "Tools": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateTool": { + "requestType": "CreateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "parent,tool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "parent,tool" + } + ] + }, + "ListTools": { + "requestType": "ListToolsRequest", + "responseType": "ListToolsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ExportTools": { + "requestType": "ExportToolsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools:export", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportToolsResponse", + "(google.longrunning.operation_info).metadata_type": "ExportToolsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*}/tools:export", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportToolsResponse", + "metadata_type": "ExportToolsMetadata" + } + } + ] + }, + "GetTool": { + "requestType": "GetToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTool": { + "requestType": "UpdateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).patch": "/v3beta1/{tool.name=projects/*/locations/*/agents/*/tools/*}", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "tool,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{tool.name=projects/*/locations/*/agents/*/tools/*}", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "tool,update_mask" + } + ] + }, + "DeleteTool": { + "requestType": "DeleteToolRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListToolVersions": { + "requestType": "ListToolVersionsRequest", + "responseType": "ListToolVersionsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/tools/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/tools/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateToolVersion": { + "requestType": "CreateToolVersionRequest", + "responseType": "ToolVersion", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/tools/*}/versions", + "(google.api.http).body": "tool_version", + "(google.api.method_signature)": "parent,tool_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/tools/*}/versions", + "body": "tool_version" + } + }, + { + "(google.api.method_signature)": "parent,tool_version" + } + ] + }, + "GetToolVersion": { + "requestType": "GetToolVersionRequest", + "responseType": "ToolVersion", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteToolVersion": { + "requestType": "DeleteToolVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestoreToolVersion": { + "requestType": "RestoreToolVersionRequest", + "responseType": "RestoreToolVersionResponse", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/tools/*/versions/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateToolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Tool" + } + }, + "tool": { + "type": "Tool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListToolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Tool" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + } + } + }, + "ExportToolsRequest": { + "oneofs": { + "destination": { + "oneof": [ + "toolsUri", + "toolsContentInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Tool" + } + }, + "tools": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "toolsUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolsContentInline": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "BLOB": 1 + } + } + } + }, + "ExportToolsResponse": { + "oneofs": { + "tools": { + "oneof": [ + "toolsUri", + "toolsContent" + ] + } + }, + "fields": { + "toolsUri": { + "type": "string", + "id": 1 + }, + "toolsContent": { + "type": "InlineDestination", + "id": 2 + } + } + }, + "UpdateToolRequest": { + "fields": { + "tool": { + "type": "Tool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "Tool": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Tool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}" + }, + "oneofs": { + "specification": { + "oneof": [ + "openApiSpec", + "dataStoreSpec", + "extensionSpec", + "functionSpec", + "connectorSpec" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "openApiSpec": { + "type": "OpenApiTool", + "id": 4 + }, + "dataStoreSpec": { + "type": "DataStoreTool", + "id": 8 + }, + "extensionSpec": { + "type": "ExtensionTool", + "id": 11 + }, + "functionSpec": { + "type": "FunctionTool", + "id": 13 + }, + "connectorSpec": { + "type": "ConnectorTool", + "id": 15 + }, + "toolType": { + "type": "ToolType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OpenApiTool": { + "oneofs": { + "schema": { + "oneof": [ + "textSchema" + ] + } + }, + "fields": { + "textSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authentication": { + "type": "Authentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TLSConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreTool": { + "fields": { + "dataStoreConnections": { + "rule": "repeated", + "type": "DataStoreConnection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fallbackPrompt": { + "type": "FallbackPrompt", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "FallbackPrompt": { + "fields": {} + } + } + }, + "ExtensionTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FunctionTool": { + "fields": { + "inputSchema": { + "type": "google.protobuf.Struct", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputSchema": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConnectorTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endUserAuthConfig": { + "type": "EndUserAuthConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Action": { + "oneofs": { + "actionSpec": { + "oneof": [ + "connectionActionId", + "entityOperation" + ] + } + }, + "fields": { + "connectionActionId": { + "type": "string", + "id": 4 + }, + "entityOperation": { + "type": "EntityOperation", + "id": 5 + }, + "inputFields": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputFields": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EntityOperation": { + "fields": { + "entityId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operation": { + "type": "OperationType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "OperationType": { + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "LIST": 1, + "GET": 2, + "CREATE": 3, + "UPDATE": 4, + "DELETE": 5 + } + } + } + } + } + } + } + }, + "Authentication": { + "oneofs": { + "authConfig": { + "oneof": [ + "apiKeyConfig", + "oauthConfig", + "serviceAgentAuthConfig", + "bearerTokenConfig", + "serviceAccountAuthConfig" + ] + } + }, + "fields": { + "apiKeyConfig": { + "type": "ApiKeyConfig", + "id": 1 + }, + "oauthConfig": { + "type": "OAuthConfig", + "id": 2 + }, + "serviceAgentAuthConfig": { + "type": "ServiceAgentAuthConfig", + "id": 3 + }, + "bearerTokenConfig": { + "type": "BearerTokenConfig", + "id": 4 + }, + "serviceAccountAuthConfig": { + "type": "ServiceAccountAuthConfig", + "id": 5 + } + }, + "nested": { + "ApiKeyConfig": { + "fields": { + "keyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForApiKey": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "requestLocation": { + "type": "RequestLocation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RequestLocation": { + "values": { + "REQUEST_LOCATION_UNSPECIFIED": 0, + "HEADER": 1, + "QUERY_STRING": 2 + } + }, + "OAuthConfig": { + "fields": { + "oauthGrantType": { + "type": "OauthGrantType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientSecret": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForClientSecret": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "tokenEndpoint": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OauthGrantType": { + "values": { + "OAUTH_GRANT_TYPE_UNSPECIFIED": 0, + "CLIENT_CREDENTIAL": 1 + } + } + } + }, + "ServiceAgentAuthConfig": { + "fields": { + "serviceAgentAuth": { + "type": "ServiceAgentAuth", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ServiceAgentAuth": { + "values": { + "SERVICE_AGENT_AUTH_UNSPECIFIED": 0, + "ID_TOKEN": 1, + "ACCESS_TOKEN": 2 + } + } + } + }, + "BearerTokenConfig": { + "fields": { + "token": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secretVersionForToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "ServiceAccountAuthConfig": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "TLSConfig": { + "fields": { + "caCerts": { + "rule": "repeated", + "type": "CACert", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CACert": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cert": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ServiceDirectoryConfig": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" + } + } + } + }, + "EndUserAuthConfig": { + "oneofs": { + "endUserAuthConfig": { + "oneof": [ + "oauth2AuthCodeConfig", + "oauth2JwtBearerConfig" + ] + } + }, + "fields": { + "oauth2AuthCodeConfig": { + "type": "Oauth2AuthCodeConfig", + "id": 2 + }, + "oauth2JwtBearerConfig": { + "type": "Oauth2JwtBearerConfig", + "id": 3 + } + }, + "nested": { + "Oauth2AuthCodeConfig": { + "fields": { + "oauthToken": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Oauth2JwtBearerConfig": { + "fields": { + "issuer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientKey": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ToolType": { + "values": { + "TOOL_TYPE_UNSPECIFIED": 0, + "CUSTOMIZED_TOOL": 1, + "BUILTIN_TOOL": 2 + } + } + } + }, + "ListToolVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ToolVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolVersionsResponse": { + "fields": { + "toolVersions": { + "rule": "repeated", + "type": "ToolVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateToolVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ToolVersion" + } + }, + "toolVersion": { + "type": "ToolVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetToolVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ToolVersion" + } + } + } + }, + "DeleteToolVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ToolVersion" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreToolVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ToolVersion" + } + } + } + }, + "RestoreToolVersionResponse": { + "fields": { + "tool": { + "type": "Tool", + "id": 2 + } + } + }, + "ToolVersion": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/ToolVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}", + "(google.api.resource).plural": "toolVersions", + "(google.api.resource).singular": "toolVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tool": { + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ExportToolsMetadata": { + "fields": {} + }, + "Versions": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListVersions": { + "requestType": "ListVersionsRequest", + "responseType": "ListVersionsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetVersion": { + "requestType": "GetVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateVersion": { + "requestType": "CreateVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions", + "(google.api.http).body": "version", + "(google.api.method_signature)": "parent,version", + "(google.longrunning.operation_info).response_type": "Version", + "(google.longrunning.operation_info).metadata_type": "CreateVersionOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions", + "body": "version" + } + }, + { + "(google.api.method_signature)": "parent,version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Version", + "metadata_type": "CreateVersionOperationMetadata" + } + } + ] + }, + "UpdateVersion": { + "requestType": "UpdateVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).patch": "/v3beta1/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "(google.api.http).body": "version", + "(google.api.method_signature)": "version,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "body": "version" + } + }, + { + "(google.api.method_signature)": "version,update_mask" + } + ] + }, + "DeleteVersion": { + "requestType": "DeleteVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LoadVersion": { + "requestType": "LoadVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "CompareVersions": { + "requestType": "CompareVersionsRequest", + "responseType": "CompareVersionsResponse", + "options": { + "(google.api.http).post": "/v3beta1/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "base_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "base_version" + } + ] + } + } + }, + "CreateVersionOperationMetadata": { + "fields": { + "version": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "Version": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Version", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "nluSettings": { + "type": "NluSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + } + } + }, + "ListVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Version" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListVersionsResponse": { + "fields": { + "versions": { + "rule": "repeated", + "type": "Version", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "CreateVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Version" + } + }, + "version": { + "type": "Version", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateVersionRequest": { + "fields": { + "version": { + "type": "Version", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + } + } + }, + "LoadVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "allowOverrideAgentResources": { + "type": "bool", + "id": 2 + } + } + }, + "CompareVersionsRequest": { + "fields": { + "baseVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "targetVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Version" + } + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "CompareVersionsResponse": { + "fields": { + "baseVersionContentJson": { + "type": "string", + "id": 1 + }, + "targetVersionContentJson": { + "type": "string", + "id": 2 + }, + "compareTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + "php_generic_services", + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false, + "deprecated": true + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } + } + }, + "extensions": [ + [ + 1000, + 9994 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + }, + "reserved": [ + [ + 1, + 1 + ] + ] + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "overridableFeatures": { + "type": "FeatureSet", + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 + } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "java_multiple_files": true, + "java_outer_classname": "LatLngProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js new file mode 100644 index 000000000000..de91ab85d158 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, agent) { + // [START dialogflow_v3_generated_Agents_CreateAgent_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 to create a agent for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The agent to create. + */ + // const agent = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callCreateAgent() { + // Construct request + const request = { + parent, + agent, + }; + + // Run request + const response = await cxClient.createAgent(request); + console.log(response); + } + + callCreateAgent(); + // [END dialogflow_v3_generated_Agents_CreateAgent_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-dialogflow-cx/samples/generated/v3/agents.delete_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.delete_agent.js new file mode 100644 index 000000000000..1e7724cef860 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.delete_agent.js @@ -0,0 +1,62 @@ +// Copyright 2026 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 dialogflow_v3_generated_Agents_DeleteAgent_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 agent to delete. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callDeleteAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteAgent(request); + console.log(response); + } + + callDeleteAgent(); + // [END dialogflow_v3_generated_Agents_DeleteAgent_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-dialogflow-cx/samples/generated/v3/agents.export_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.export_agent.js new file mode 100644 index 000000000000..b031be8ada98 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.export_agent.js @@ -0,0 +1,94 @@ +// Copyright 2026 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 dialogflow_v3_generated_Agents_ExportAgent_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 agent to export. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const agentUri = 'abc123' + /** + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + */ + // const dataFormat = {} + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Optional. The Git branch to export the agent to. + */ + // const gitDestination = {} + /** + * Optional. Whether to include BigQuery Export setting. + */ + // const includeBigqueryExportSettings = true + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callExportAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportAgent(); + // [END dialogflow_v3_generated_Agents_ExportAgent_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-dialogflow-cx/samples/generated/v3/agents.get_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent.js new file mode 100644 index 000000000000..c5e9c4bb575a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent.js @@ -0,0 +1,62 @@ +// Copyright 2026 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 dialogflow_v3_generated_Agents_GetAgent_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 agent. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callGetAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgent(request); + console.log(response); + } + + callGetAgent(); + // [END dialogflow_v3_generated_Agents_GetAgent_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-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js new file mode 100644 index 000000000000..34a3af9336e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3_generated_Agents_GetAgentValidationResult_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 agent name. + * Format: + * `projects//locations//agents//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callGetAgentValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgentValidationResult(request); + console.log(response); + } + + callGetAgentValidationResult(); + // [END dialogflow_v3_generated_Agents_GetAgentValidationResult_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-dialogflow-cx/samples/generated/v3/agents.get_generative_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_generative_settings.js new file mode 100644 index 000000000000..51bb7f077bb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_generative_settings.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, languageCode) { + // [START dialogflow_v3_generated_Agents_GetGenerativeSettings_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. Format: + * `projects//locations//agents//generativeSettings`. + */ + // const name = 'abc123' + /** + * Required. Language code of the generative settings. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callGetGenerativeSettings() { + // Construct request + const request = { + name, + languageCode, + }; + + // Run request + const response = await cxClient.getGenerativeSettings(request); + console.log(response); + } + + callGetGenerativeSettings(); + // [END dialogflow_v3_generated_Agents_GetGenerativeSettings_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-dialogflow-cx/samples/generated/v3/agents.list_agents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.list_agents.js new file mode 100644 index 000000000000..7ca820d73836 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.list_agents.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3_generated_Agents_ListAgents_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 to list all agents for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callListAgents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listAgentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAgents(); + // [END dialogflow_v3_generated_Agents_ListAgents_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-dialogflow-cx/samples/generated/v3/agents.restore_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.restore_agent.js new file mode 100644 index 000000000000..f8a13cfbbc07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.restore_agent.js @@ -0,0 +1,86 @@ +// Copyright 2026 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 dialogflow_v3_generated_Agents_RestoreAgent_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 agent to restore into. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to restore agent from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const agentUri = 'abc123' + /** + * Uncompressed raw byte content for agent. + */ + // const agentContent = Buffer.from('string') + /** + * Setting for restoring from a git branch + */ + // const gitSource = {} + /** + * Agent restore mode. If not specified, `KEEP` is assumed. + */ + // const restoreOption = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callRestoreAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.restoreAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreAgent(); + // [END dialogflow_v3_generated_Agents_RestoreAgent_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-dialogflow-cx/samples/generated/v3/agents.update_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_agent.js new file mode 100644 index 000000000000..98a5a54d06cc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_agent.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(agent) { + // [START dialogflow_v3_generated_Agents_UpdateAgent_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 agent to update. + */ + // const agent = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callUpdateAgent() { + // Construct request + const request = { + agent, + }; + + // Run request + const response = await cxClient.updateAgent(request); + console.log(response); + } + + callUpdateAgent(); + // [END dialogflow_v3_generated_Agents_UpdateAgent_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-dialogflow-cx/samples/generated/v3/agents.update_generative_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_generative_settings.js new file mode 100644 index 000000000000..bcfc343ccf74 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_generative_settings.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(generativeSettings) { + // [START dialogflow_v3_generated_Agents_UpdateGenerativeSettings_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. Generative settings to update. + */ + // const generativeSettings = {} + /** + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callUpdateGenerativeSettings() { + // Construct request + const request = { + generativeSettings, + }; + + // Run request + const response = await cxClient.updateGenerativeSettings(request); + console.log(response); + } + + callUpdateGenerativeSettings(); + // [END dialogflow_v3_generated_Agents_UpdateGenerativeSettings_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-dialogflow-cx/samples/generated/v3/agents.validate_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.validate_agent.js new file mode 100644 index 000000000000..ad986cf183aa --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/agents.validate_agent.js @@ -0,0 +1,66 @@ +// Copyright 2026 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 dialogflow_v3_generated_Agents_ValidateAgent_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 agent to validate. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callValidateAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateAgent(request); + console.log(response); + } + + callValidateAgent(); + // [END dialogflow_v3_generated_Agents_ValidateAgent_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-dialogflow-cx/samples/generated/v3/changelogs.get_changelog.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/changelogs.get_changelog.js new file mode 100644 index 000000000000..4c79e63bb342 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/changelogs.get_changelog.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Changelogs_GetChangelog_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 changelog to get. + * Format: + * `projects//locations//agents//changelogs/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ChangelogsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ChangelogsClient(); + + async function callGetChangelog() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getChangelog(request); + console.log(response); + } + + callGetChangelog(); + // [END dialogflow_v3_generated_Changelogs_GetChangelog_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-dialogflow-cx/samples/generated/v3/changelogs.list_changelogs.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/changelogs.list_changelogs.js new file mode 100644 index 000000000000..f7e6c2eb137e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/changelogs.list_changelogs.js @@ -0,0 +1,96 @@ +// Copyright 2026 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 dialogflow_v3_generated_Changelogs_ListChangelogs_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 agent containing the changelogs. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + */ + // const filter = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ChangelogsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ChangelogsClient(); + + async function callListChangelogs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listChangelogsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChangelogs(); + // [END dialogflow_v3_generated_Changelogs_ListChangelogs_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-dialogflow-cx/samples/generated/v3/deployments.get_deployment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/deployments.get_deployment.js new file mode 100644 index 000000000000..e3bd3cf021fd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/deployments.get_deployment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Deployments_GetDeployment_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 + * Deployment google.cloud.dialogflow.cx.v3.Deployment. Format: + * `projects//locations//agents//environments//deployments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {DeploymentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new DeploymentsClient(); + + async function callGetDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getDeployment(request); + console.log(response); + } + + callGetDeployment(); + // [END dialogflow_v3_generated_Deployments_GetDeployment_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-dialogflow-cx/samples/generated/v3/deployments.list_deployments.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/deployments.list_deployments.js new file mode 100644 index 000000000000..42b4b9e3f76b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/deployments.list_deployments.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Deployments_ListDeployments_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 Environment google.cloud.dialogflow.cx.v3.Environment to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {DeploymentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new DeploymentsClient(); + + async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeployments(); + // [END dialogflow_v3_generated_Deployments_ListDeployments_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-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js new file mode 100644 index 000000000000..87263c036df6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js @@ -0,0 +1,79 @@ +// Copyright 2026 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, entityType) { + // [START dialogflow_v3_generated_EntityTypes_CreateEntityType_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 agent to create a entity type for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The entity type to create. + */ + // const entityType = {} + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callCreateEntityType() { + // Construct request + const request = { + parent, + entityType, + }; + + // Run request + const response = await cxClient.createEntityType(request); + console.log(response); + } + + callCreateEntityType(); + // [END dialogflow_v3_generated_EntityTypes_CreateEntityType_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-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js new file mode 100644 index 000000000000..a5f9bbf030f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js @@ -0,0 +1,77 @@ +// Copyright 2026 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 dialogflow_v3_generated_EntityTypes_DeleteEntityType_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 entity type to delete. + * Format: + * `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * This field has no effect for entity type not being used. + * For entity types that are used by intents or pages: + * * If `force` is set to false, an error will be returned with message + * indicating the referencing resources. + * * If `force` is set to true, Dialogflow will remove the entity type, as + * well as any references to the entity type (i.e. Page + * parameter google.cloud.dialogflow.cx.v3.Form.Parameter of the entity + * type will be changed to + * '@sys.any' and intent + * parameter google.cloud.dialogflow.cx.v3.Intent.Parameter of the + * entity type will be removed). + */ + // const force = true + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callDeleteEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEntityType(request); + console.log(response); + } + + callDeleteEntityType(); + // [END dialogflow_v3_generated_EntityTypes_DeleteEntityType_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-dialogflow-cx/samples/generated/v3/entity_types.export_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.export_entity_types.js new file mode 100644 index 000000000000..1ca8000038b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.export_entity_types.js @@ -0,0 +1,104 @@ +// Copyright 2026 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, entityTypes) { + // [START dialogflow_v3_generated_EntityTypes_ExportEntityTypes_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 parent agent to export entity types. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The name of the entity types to export. + * Format: + * `projects//locations//agents//entityTypes/`. + */ + // const entityTypes = ['abc','def'] + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the entity + * types to. The format of this URI must be + * `gs:///`. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const entityTypesUri = 'abc123' + /** + * Optional. The option to return the serialized entity types inline. + */ + // const entityTypesContentInline = true + /** + * Optional. The data format of the exported entity types. If not specified, + * `BLOB` is assumed. + */ + // const dataFormat = {} + /** + * Optional. The language to retrieve the entity type for. The following + * fields are language dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, all language dependent fields will be retrieved. + * Many + * languages (https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callExportEntityTypes() { + // Construct request + const request = { + parent, + entityTypes, + }; + + // Run request + const [operation] = await cxClient.exportEntityTypes(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportEntityTypes(); + // [END dialogflow_v3_generated_EntityTypes_ExportEntityTypes_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-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js new file mode 100644 index 000000000000..9b9967b0df44 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js @@ -0,0 +1,76 @@ +// Copyright 2026 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 dialogflow_v3_generated_EntityTypes_GetEntityType_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 entity type. + * Format: + * `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the entity type for. The following fields are + * language dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callGetEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEntityType(request); + console.log(response); + } + + callGetEntityType(); + // [END dialogflow_v3_generated_EntityTypes_GetEntityType_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-dialogflow-cx/samples/generated/v3/entity_types.import_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.import_entity_types.js new file mode 100644 index 000000000000..2558baf8d9e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.import_entity_types.js @@ -0,0 +1,94 @@ +// Copyright 2026 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, mergeOption) { + // [START dialogflow_v3_generated_EntityTypes_ImportEntityTypes_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 agent to import the entity types into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import entity types from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const entityTypesUri = 'abc123' + /** + * Uncompressed byte content of entity types. + */ + // const entityTypesContent = {} + /** + * Required. Merge option for importing entity types. + */ + // const mergeOption = {} + /** + * Optional. The target entity type to import into. + * Format: + * `projects//locations//agents//entity_types/`. + * If set, there should be only one entity type included in + * entity_types google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types, + * of which the type should match the type of the target entity type. All + * entities google.cloud.dialogflow.cx.v3.EntityType.entities in the + * imported entity type will be added to the target entity type. + */ + // const targetEntityType = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callImportEntityTypes() { + // Construct request + const request = { + parent, + mergeOption, + }; + + // Run request + const [operation] = await cxClient.importEntityTypes(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportEntityTypes(); + // [END dialogflow_v3_generated_EntityTypes_ImportEntityTypes_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-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js new file mode 100644 index 000000000000..50aaa554904b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js @@ -0,0 +1,86 @@ +// Copyright 2026 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 dialogflow_v3_generated_EntityTypes_ListEntityTypes_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 agent to list all entity types for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list entity types for. The following fields are language + * dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callListEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEntityTypes(); + // [END dialogflow_v3_generated_EntityTypes_ListEntityTypes_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-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js new file mode 100644 index 000000000000..809132506c8f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(entityType) { + // [START dialogflow_v3_generated_EntityTypes_UpdateEntityType_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 entity type to update. + */ + // const entityType = {} + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callUpdateEntityType() { + // Construct request + const request = { + entityType, + }; + + // Run request + const response = await cxClient.updateEntityType(request); + console.log(response); + } + + callUpdateEntityType(); + // [END dialogflow_v3_generated_EntityTypes_UpdateEntityType_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-dialogflow-cx/samples/generated/v3/environments.create_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.create_environment.js new file mode 100644 index 000000000000..21d6ba64e874 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.create_environment.js @@ -0,0 +1,69 @@ +// Copyright 2026 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, environment) { + // [START dialogflow_v3_generated_Environments_CreateEnvironment_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 Agent google.cloud.dialogflow.cx.v3.Agent to create an + * Environment google.cloud.dialogflow.cx.v3.Environment for. Format: + * `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The environment to create. + */ + // const environment = {} + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callCreateEnvironment() { + // Construct request + const request = { + parent, + environment, + }; + + // Run request + const [operation] = await cxClient.createEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEnvironment(); + // [END dialogflow_v3_generated_Environments_CreateEnvironment_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-dialogflow-cx/samples/generated/v3/environments.delete_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.delete_environment.js new file mode 100644 index 000000000000..cc87ab93f946 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.delete_environment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Environments_DeleteEnvironment_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 + * Environment google.cloud.dialogflow.cx.v3.Environment to delete. Format: + * `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callDeleteEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEnvironment(request); + console.log(response); + } + + callDeleteEnvironment(); + // [END dialogflow_v3_generated_Environments_DeleteEnvironment_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-dialogflow-cx/samples/generated/v3/environments.deploy_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.deploy_flow.js new file mode 100644 index 000000000000..be1d80ea2a6e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.deploy_flow.js @@ -0,0 +1,71 @@ +// Copyright 2026 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(environment, flowVersion) { + // [START dialogflow_v3_generated_Environments_DeployFlow_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 environment to deploy the flow to. + * Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Required. The flow version to deploy. + * Format: + * `projects//locations//agents//flows//versions/`. + */ + // const flowVersion = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callDeployFlow() { + // Construct request + const request = { + environment, + flowVersion, + }; + + // Run request + const [operation] = await cxClient.deployFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployFlow(); + // [END dialogflow_v3_generated_Environments_DeployFlow_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-dialogflow-cx/samples/generated/v3/environments.get_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.get_environment.js new file mode 100644 index 000000000000..5fbf0b4f3737 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.get_environment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Environments_GetEnvironment_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 + * Environment google.cloud.dialogflow.cx.v3.Environment. Format: + * `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callGetEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEnvironment(request); + console.log(response); + } + + callGetEnvironment(); + // [END dialogflow_v3_generated_Environments_GetEnvironment_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-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js new file mode 100644 index 000000000000..d765ff23da0d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Environments_ListContinuousTestResults_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 environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callListContinuousTestResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listContinuousTestResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListContinuousTestResults(); + // [END dialogflow_v3_generated_Environments_ListContinuousTestResults_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-dialogflow-cx/samples/generated/v3/environments.list_environments.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_environments.js new file mode 100644 index 000000000000..2ed538093a05 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_environments.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Environments_ListEnvironments_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 Agent google.cloud.dialogflow.cx.v3.Agent to list all + * environments for. Format: + * `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callListEnvironments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listEnvironmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEnvironments(); + // [END dialogflow_v3_generated_Environments_ListEnvironments_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-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js new file mode 100644 index 000000000000..2a6dfc0e175e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Environments_LookupEnvironmentHistory_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. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callLookupEnvironmentHistory() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = cxClient.lookupEnvironmentHistoryAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callLookupEnvironmentHistory(); + // [END dialogflow_v3_generated_Environments_LookupEnvironmentHistory_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-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js new file mode 100644 index 000000000000..b68fe12cb013 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js @@ -0,0 +1,63 @@ +// Copyright 2026 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(environment) { + // [START dialogflow_v3_generated_Environments_RunContinuousTest_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. Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callRunContinuousTest() { + // Construct request + const request = { + environment, + }; + + // Run request + const [operation] = await cxClient.runContinuousTest(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunContinuousTest(); + // [END dialogflow_v3_generated_Environments_RunContinuousTest_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-dialogflow-cx/samples/generated/v3/environments.update_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.update_environment.js new file mode 100644 index 000000000000..87a523fd3779 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/environments.update_environment.js @@ -0,0 +1,67 @@ +// Copyright 2026 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(environment, updateMask) { + // [START dialogflow_v3_generated_Environments_UpdateEnvironment_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 environment to update. + */ + // const environment = {} + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callUpdateEnvironment() { + // Construct request + const request = { + environment, + updateMask, + }; + + // Run request + const [operation] = await cxClient.updateEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEnvironment(); + // [END dialogflow_v3_generated_Environments_UpdateEnvironment_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-dialogflow-cx/samples/generated/v3/examples.create_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.create_example.js new file mode 100644 index 000000000000..298c84e26866 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.create_example.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, example) { + // [START dialogflow_v3_generated_Examples_CreateExample_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 playbook to create an example for. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Required. The example to create. + */ + // const example = {} + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callCreateExample() { + // Construct request + const request = { + parent, + example, + }; + + // Run request + const response = await cxClient.createExample(request); + console.log(response); + } + + callCreateExample(); + // [END dialogflow_v3_generated_Examples_CreateExample_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-dialogflow-cx/samples/generated/v3/examples.delete_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.delete_example.js new file mode 100644 index 000000000000..a9d99dbe95bb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.delete_example.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Examples_DeleteExample_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 example to delete. + * Format: + * `projects//locations//agents//playbooks//examples/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callDeleteExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteExample(request); + console.log(response); + } + + callDeleteExample(); + // [END dialogflow_v3_generated_Examples_DeleteExample_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-dialogflow-cx/samples/generated/v3/examples.get_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.get_example.js new file mode 100644 index 000000000000..d4992f036c40 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.get_example.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Examples_GetExample_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 example. + * Format: + * `projects//locations//agents//playbooks//examples/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callGetExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getExample(request); + console.log(response); + } + + callGetExample(); + // [END dialogflow_v3_generated_Examples_GetExample_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-dialogflow-cx/samples/generated/v3/examples.list_examples.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.list_examples.js new file mode 100644 index 000000000000..8d74ba5f11d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.list_examples.js @@ -0,0 +1,81 @@ +// Copyright 2026 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 dialogflow_v3_generated_Examples_ListExamples_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 playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token ListExampleResponse.next_page_token value + * returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callListExamples() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listExamplesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExamples(); + // [END dialogflow_v3_generated_Examples_ListExamples_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-dialogflow-cx/samples/generated/v3/examples.update_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.update_example.js new file mode 100644 index 000000000000..09f6b8bc60c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/examples.update_example.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(example) { + // [START dialogflow_v3_generated_Examples_UpdateExample_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 example to update. + */ + // const example = {} + /** + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callUpdateExample() { + // Construct request + const request = { + example, + }; + + // Run request + const response = await cxClient.updateExample(request); + console.log(response); + } + + callUpdateExample(); + // [END dialogflow_v3_generated_Examples_UpdateExample_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-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js new file mode 100644 index 000000000000..fab2e5fbd168 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, experiment) { + // [START dialogflow_v3_generated_Experiments_CreateExperiment_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 Agent google.cloud.dialogflow.cx.v3.Agent to create an + * Environment google.cloud.dialogflow.cx.v3.Environment for. Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * Required. The experiment to create. + */ + // const experiment = {} + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callCreateExperiment() { + // Construct request + const request = { + parent, + experiment, + }; + + // Run request + const response = await cxClient.createExperiment(request); + console.log(response); + } + + callCreateExperiment(); + // [END dialogflow_v3_generated_Experiments_CreateExperiment_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-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js new file mode 100644 index 000000000000..463bdc155a70 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Experiments_DeleteExperiment_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 + * Environment google.cloud.dialogflow.cx.v3.Environment to delete. Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callDeleteExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteExperiment(request); + console.log(response); + } + + callDeleteExperiment(); + // [END dialogflow_v3_generated_Experiments_DeleteExperiment_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-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js new file mode 100644 index 000000000000..d3c64e74f222 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Experiments_GetExperiment_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 + * Environment google.cloud.dialogflow.cx.v3.Environment. Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callGetExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getExperiment(request); + console.log(response); + } + + callGetExperiment(); + // [END dialogflow_v3_generated_Experiments_GetExperiment_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-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js new file mode 100644 index 000000000000..0d42f70d9a52 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Experiments_ListExperiments_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 Environment google.cloud.dialogflow.cx.v3.Environment to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callListExperiments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listExperimentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExperiments(); + // [END dialogflow_v3_generated_Experiments_ListExperiments_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-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js new file mode 100644 index 000000000000..c2cedc2644f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Experiments_StartExperiment_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. Resource name of the experiment to start. + * Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callStartExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.startExperiment(request); + console.log(response); + } + + callStartExperiment(); + // [END dialogflow_v3_generated_Experiments_StartExperiment_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-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js new file mode 100644 index 000000000000..6d5c3c754ef5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Experiments_StopExperiment_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. Resource name of the experiment to stop. + * Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callStopExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.stopExperiment(request); + console.log(response); + } + + callStopExperiment(); + // [END dialogflow_v3_generated_Experiments_StopExperiment_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-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js new file mode 100644 index 000000000000..b0d9d781a2fc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(experiment, updateMask) { + // [START dialogflow_v3_generated_Experiments_UpdateExperiment_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 experiment to update. + */ + // const experiment = {} + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callUpdateExperiment() { + // Construct request + const request = { + experiment, + updateMask, + }; + + // Run request + const response = await cxClient.updateExperiment(request); + console.log(response); + } + + callUpdateExperiment(); + // [END dialogflow_v3_generated_Experiments_UpdateExperiment_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-dialogflow-cx/samples/generated/v3/flows.create_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.create_flow.js new file mode 100644 index 000000000000..fbf0e43a8263 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.create_flow.js @@ -0,0 +1,80 @@ +// Copyright 2026 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, flow) { + // [START dialogflow_v3_generated_Flows_CreateFlow_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 agent to create a flow for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The flow to create. + */ + // const flow = {} + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callCreateFlow() { + // Construct request + const request = { + parent, + flow, + }; + + // Run request + const response = await cxClient.createFlow(request); + console.log(response); + } + + callCreateFlow(); + // [END dialogflow_v3_generated_Flows_CreateFlow_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-dialogflow-cx/samples/generated/v3/flows.delete_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.delete_flow.js new file mode 100644 index 000000000000..fcb45bba34ed --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.delete_flow.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_DeleteFlow_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 flow to delete. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * This field has no effect for flows with no incoming transitions. + * For flows with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the flow, as well as + * any transitions to the flow (i.e. Target + * flow EventHandler.target_flow in event handlers or Target + * flow TransitionRoute.target_flow in transition routes that point to + * this flow will be cleared). + */ + // const force = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callDeleteFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteFlow(request); + console.log(response); + } + + callDeleteFlow(); + // [END dialogflow_v3_generated_Flows_DeleteFlow_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-dialogflow-cx/samples/generated/v3/flows.export_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.export_flow.js new file mode 100644 index 000000000000..edb51898362d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.export_flow.js @@ -0,0 +1,80 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_ExportFlow_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 flow to export. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the flow to. + * The format of this URI must be `gs:///`. If left + * unspecified, the serialized flow is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const flowUri = 'abc123' + /** + * Optional. Whether to export flows referenced by the specified flow. + */ + // const includeReferencedFlows = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callExportFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportFlow(); + // [END dialogflow_v3_generated_Flows_ExportFlow_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-dialogflow-cx/samples/generated/v3/flows.get_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow.js new file mode 100644 index 000000000000..2f9808e3d330 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow.js @@ -0,0 +1,77 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_GetFlow_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 flow to get. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the flow for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callGetFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlow(request); + console.log(response); + } + + callGetFlow(); + // [END dialogflow_v3_generated_Flows_GetFlow_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-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js new file mode 100644 index 000000000000..f98c02deba53 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_GetFlowValidationResult_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 flow name. + * Format: + * `projects//locations//agents//flows//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callGetFlowValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlowValidationResult(request); + console.log(response); + } + + callGetFlowValidationResult(); + // [END dialogflow_v3_generated_Flows_GetFlowValidationResult_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-dialogflow-cx/samples/generated/v3/flows.import_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.import_flow.js new file mode 100644 index 000000000000..d74c6b7ccac0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.import_flow.js @@ -0,0 +1,87 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_ImportFlow_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 agent to import the flow into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import flow from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const flowUri = 'abc123' + /** + * Uncompressed raw byte content for flow. + */ + // const flowContent = Buffer.from('string') + /** + * Flow import mode. If not specified, `KEEP` is assumed. + */ + // const importOption = {} + /** + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + */ + // const flowImportStrategy = {} + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callImportFlow() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportFlow(); + // [END dialogflow_v3_generated_Flows_ImportFlow_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-dialogflow-cx/samples/generated/v3/flows.list_flows.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.list_flows.js new file mode 100644 index 000000000000..7eaf183abae4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.list_flows.js @@ -0,0 +1,87 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_ListFlows_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 agent containing the flows. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list flows for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callListFlows() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listFlowsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFlows(); + // [END dialogflow_v3_generated_Flows_ListFlows_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-dialogflow-cx/samples/generated/v3/flows.train_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.train_flow.js new file mode 100644 index 000000000000..448898496365 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.train_flow.js @@ -0,0 +1,64 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_TrainFlow_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 flow to train. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callTrainFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.trainFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTrainFlow(); + // [END dialogflow_v3_generated_Flows_TrainFlow_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-dialogflow-cx/samples/generated/v3/flows.update_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.update_flow.js new file mode 100644 index 000000000000..907490bd693a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.update_flow.js @@ -0,0 +1,79 @@ +// Copyright 2026 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(flow) { + // [START dialogflow_v3_generated_Flows_UpdateFlow_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 flow to update. + */ + // const flow = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callUpdateFlow() { + // Construct request + const request = { + flow, + }; + + // Run request + const response = await cxClient.updateFlow(request); + console.log(response); + } + + callUpdateFlow(); + // [END dialogflow_v3_generated_Flows_UpdateFlow_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-dialogflow-cx/samples/generated/v3/flows.validate_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.validate_flow.js new file mode 100644 index 000000000000..14e09d058d37 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/flows.validate_flow.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3_generated_Flows_ValidateFlow_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 flow to validate. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callValidateFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateFlow(request); + console.log(response); + } + + callValidateFlow(); + // [END dialogflow_v3_generated_Flows_ValidateFlow_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-dialogflow-cx/samples/generated/v3/generators.create_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.create_generator.js new file mode 100644 index 000000000000..59747eefd62b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.create_generator.js @@ -0,0 +1,73 @@ +// Copyright 2026 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, generator) { + // [START dialogflow_v3_generated_Generators_CreateGenerator_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 agent to create a generator for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The generator to create. + */ + // const generator = {} + /** + * The language to create generators for the following fields: + * * `Generator.prompt_text.text` + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callCreateGenerator() { + // Construct request + const request = { + parent, + generator, + }; + + // Run request + const response = await cxClient.createGenerator(request); + console.log(response); + } + + callCreateGenerator(); + // [END dialogflow_v3_generated_Generators_CreateGenerator_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-dialogflow-cx/samples/generated/v3/generators.delete_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.delete_generator.js new file mode 100644 index 000000000000..393d0f948f76 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.delete_generator.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3_generated_Generators_DeleteGenerator_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 generator to delete. + * Format: + * `projects//locations//agents//generators/`. + */ + // const name = 'abc123' + /** + * This field has no effect for generators not being used. + * For generators that are used by pages/flows/transition route groups: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the generator, as well + * as any references to the generator (i.e. + * Generator Fulfillment.generator) in fulfillments. + */ + // const force = true + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callDeleteGenerator() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteGenerator(request); + console.log(response); + } + + callDeleteGenerator(); + // [END dialogflow_v3_generated_Generators_DeleteGenerator_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-dialogflow-cx/samples/generated/v3/generators.get_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.get_generator.js new file mode 100644 index 000000000000..7d9d88cfad7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.get_generator.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3_generated_Generators_GetGenerator_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 generator. + * Format: + * `projects//locations//agents//generators/`. + */ + // const name = 'abc123' + /** + * The language to list generators for. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callGetGenerator() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getGenerator(request); + console.log(response); + } + + callGetGenerator(); + // [END dialogflow_v3_generated_Generators_GetGenerator_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-dialogflow-cx/samples/generated/v3/generators.list_generators.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.list_generators.js new file mode 100644 index 000000000000..d7a6e4d652cf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.list_generators.js @@ -0,0 +1,77 @@ +// Copyright 2026 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 dialogflow_v3_generated_Generators_ListGenerators_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 agent to list all generators for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list generators for. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callListGenerators() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listGeneratorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGenerators(); + // [END dialogflow_v3_generated_Generators_ListGenerators_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-dialogflow-cx/samples/generated/v3/generators.update_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.update_generator.js new file mode 100644 index 000000000000..95d28695ece5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/generators.update_generator.js @@ -0,0 +1,70 @@ +// Copyright 2026 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(generator) { + // [START dialogflow_v3_generated_Generators_UpdateGenerator_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 generator to update. + */ + // const generator = {} + /** + * The language to list generators for. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callUpdateGenerator() { + // Construct request + const request = { + generator, + }; + + // Run request + const response = await cxClient.updateGenerator(request); + console.log(response); + } + + callUpdateGenerator(); + // [END dialogflow_v3_generated_Generators_UpdateGenerator_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-dialogflow-cx/samples/generated/v3/intents.create_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.create_intent.js new file mode 100644 index 000000000000..7c354162c8e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.create_intent.js @@ -0,0 +1,77 @@ +// Copyright 2026 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, intent) { + // [START dialogflow_v3_generated_Intents_CreateIntent_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 agent to create an intent for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The intent to create. + */ + // const intent = {} + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callCreateIntent() { + // Construct request + const request = { + parent, + intent, + }; + + // Run request + const response = await cxClient.createIntent(request); + console.log(response); + } + + callCreateIntent(); + // [END dialogflow_v3_generated_Intents_CreateIntent_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-dialogflow-cx/samples/generated/v3/intents.delete_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.delete_intent.js new file mode 100644 index 000000000000..bd40dbd1a544 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.delete_intent.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Intents_DeleteIntent_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 intent to delete. + * Format: + * `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callDeleteIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteIntent(request); + console.log(response); + } + + callDeleteIntent(); + // [END dialogflow_v3_generated_Intents_DeleteIntent_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-dialogflow-cx/samples/generated/v3/intents.export_intents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.export_intents.js new file mode 100644 index 000000000000..c75f48c2d10c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.export_intents.js @@ -0,0 +1,91 @@ +// Copyright 2026 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, intents) { + // [START dialogflow_v3_generated_Intents_ExportIntents_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 parent agent to export intents. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The name of the intents to export. + * Format: + * `projects//locations//agents//intents/`. + */ + // const intents = ['abc','def'] + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the + * intents to. The format of this URI must be + * `gs:///`. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const intentsUri = 'abc123' + /** + * Optional. The option to return the serialized intents inline. + */ + // const intentsContentInline = true + /** + * Optional. The data format of the exported intents. If not specified, `BLOB` + * is assumed. + */ + // const dataFormat = {} + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callExportIntents() { + // Construct request + const request = { + parent, + intents, + }; + + // Run request + const [operation] = await cxClient.exportIntents(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportIntents(); + // [END dialogflow_v3_generated_Intents_ExportIntents_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-dialogflow-cx/samples/generated/v3/intents.get_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.get_intent.js new file mode 100644 index 000000000000..a478b3a21b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.get_intent.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Intents_GetIntent_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 intent. + * Format: + * `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the intent for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callGetIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getIntent(request); + console.log(response); + } + + callGetIntent(); + // [END dialogflow_v3_generated_Intents_GetIntent_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-dialogflow-cx/samples/generated/v3/intents.import_intents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.import_intents.js new file mode 100644 index 000000000000..807a3cf2263f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.import_intents.js @@ -0,0 +1,82 @@ +// Copyright 2026 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 dialogflow_v3_generated_Intents_ImportIntents_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 agent to import the intents into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import intents from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const intentsUri = 'abc123' + /** + * Uncompressed byte content of intents. + */ + // const intentsContent = {} + /** + * Merge option for importing intents. If not specified, `REJECT` is assumed. + */ + // const mergeOption = {} + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callImportIntents() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importIntents(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportIntents(); + // [END dialogflow_v3_generated_Intents_ImportIntents_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-dialogflow-cx/samples/generated/v3/intents.list_intents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.list_intents.js new file mode 100644 index 000000000000..c0bd795eab06 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.list_intents.js @@ -0,0 +1,88 @@ +// Copyright 2026 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 dialogflow_v3_generated_Intents_ListIntents_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 agent to list all intents for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list intents for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The resource view to apply to the returned intent. + */ + // const intentView = {} + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callListIntents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listIntentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListIntents(); + // [END dialogflow_v3_generated_Intents_ListIntents_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-dialogflow-cx/samples/generated/v3/intents.update_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.update_intent.js new file mode 100644 index 000000000000..58a5e6bf7a0d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/intents.update_intent.js @@ -0,0 +1,76 @@ +// Copyright 2026 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(intent) { + // [START dialogflow_v3_generated_Intents_UpdateIntent_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 intent to update. + */ + // const intent = {} + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callUpdateIntent() { + // Construct request + const request = { + intent, + }; + + // Run request + const response = await cxClient.updateIntent(request); + console.log(response); + } + + callUpdateIntent(); + // [END dialogflow_v3_generated_Intents_UpdateIntent_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-dialogflow-cx/samples/generated/v3/pages.create_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.create_page.js new file mode 100644 index 000000000000..d25dd5afac60 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.create_page.js @@ -0,0 +1,89 @@ +// Copyright 2026 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, page) { + // [START dialogflow_v3_generated_Pages_CreatePage_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 flow to create a page for. + * Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The page to create. + */ + // const page = {} + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callCreatePage() { + // Construct request + const request = { + parent, + page, + }; + + // Run request + const response = await cxClient.createPage(request); + console.log(response); + } + + callCreatePage(); + // [END dialogflow_v3_generated_Pages_CreatePage_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-dialogflow-cx/samples/generated/v3/pages.delete_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.delete_page.js new file mode 100644 index 000000000000..3ee58b72a595 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.delete_page.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3_generated_Pages_DeletePage_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 page to delete. + * Format: + * `projects//locations//agents//Flows//pages/`. + */ + // const name = 'abc123' + /** + * This field has no effect for pages with no incoming transitions. + * For pages with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the page, as well as + * any transitions to the page (i.e. Target + * page EventHandler.target_page in event handlers or Target + * page TransitionRoute.target_page in transition routes that point to + * this page will be cleared). + */ + // const force = true + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callDeletePage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePage(request); + console.log(response); + } + + callDeletePage(); + // [END dialogflow_v3_generated_Pages_DeletePage_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-dialogflow-cx/samples/generated/v3/pages.get_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.get_page.js new file mode 100644 index 000000000000..3b2459148e73 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.get_page.js @@ -0,0 +1,85 @@ +// Copyright 2026 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 dialogflow_v3_generated_Pages_GetPage_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 page. + * Format: + * `projects//locations//agents//flows//pages/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the page for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callGetPage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPage(request); + console.log(response); + } + + callGetPage(); + // [END dialogflow_v3_generated_Pages_GetPage_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-dialogflow-cx/samples/generated/v3/pages.list_pages.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.list_pages.js new file mode 100644 index 000000000000..80c8445a04a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.list_pages.js @@ -0,0 +1,96 @@ +// Copyright 2026 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 dialogflow_v3_generated_Pages_ListPages_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 flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The language to list pages for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callListPages() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listPagesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPages(); + // [END dialogflow_v3_generated_Pages_ListPages_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-dialogflow-cx/samples/generated/v3/pages.update_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.update_page.js new file mode 100644 index 000000000000..9e0d5ab0dbb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/pages.update_page.js @@ -0,0 +1,87 @@ +// Copyright 2026 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(page) { + // [START dialogflow_v3_generated_Pages_UpdatePage_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 page to update. + */ + // const page = {} + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callUpdatePage() { + // Construct request + const request = { + page, + }; + + // Run request + const response = await cxClient.updatePage(request); + console.log(response); + } + + callUpdatePage(); + // [END dialogflow_v3_generated_Pages_UpdatePage_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-dialogflow-cx/samples/generated/v3/playbooks.create_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.create_playbook.js new file mode 100644 index 000000000000..d02317cb143b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.create_playbook.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, playbook) { + // [START dialogflow_v3_generated_Playbooks_CreatePlaybook_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 agent to create a playbook for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The playbook to create. + */ + // const playbook = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callCreatePlaybook() { + // Construct request + const request = { + parent, + playbook, + }; + + // Run request + const response = await cxClient.createPlaybook(request); + console.log(response); + } + + callCreatePlaybook(); + // [END dialogflow_v3_generated_Playbooks_CreatePlaybook_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-dialogflow-cx/samples/generated/v3/playbooks.create_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.create_playbook_version.js new file mode 100644 index 000000000000..38d52875cd93 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.create_playbook_version.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, playbookVersion) { + // [START dialogflow_v3_generated_Playbooks_CreatePlaybookVersion_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 playbook to create a version for. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Required. The playbook version to create. + */ + // const playbookVersion = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callCreatePlaybookVersion() { + // Construct request + const request = { + parent, + playbookVersion, + }; + + // Run request + const response = await cxClient.createPlaybookVersion(request); + console.log(response); + } + + callCreatePlaybookVersion(); + // [END dialogflow_v3_generated_Playbooks_CreatePlaybookVersion_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-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook.js new file mode 100644 index 000000000000..d53cdee86191 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_DeletePlaybook_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 playbook to delete. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callDeletePlaybook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePlaybook(request); + console.log(response); + } + + callDeletePlaybook(); + // [END dialogflow_v3_generated_Playbooks_DeletePlaybook_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-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook_version.js new file mode 100644 index 000000000000..97bdfca82a66 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.delete_playbook_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_DeletePlaybookVersion_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 playbook version to delete. + * Format: + * `projects//locations//agents//playbooks//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callDeletePlaybookVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePlaybookVersion(request); + console.log(response); + } + + callDeletePlaybookVersion(); + // [END dialogflow_v3_generated_Playbooks_DeletePlaybookVersion_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-dialogflow-cx/samples/generated/v3/playbooks.export_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.export_playbook.js new file mode 100644 index 000000000000..1fc967ac0ab5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.export_playbook.js @@ -0,0 +1,81 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_ExportPlaybook_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 playbook to export. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const name = 'abc123' + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the playbook + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized playbook is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const playbookUri = 'abc123' + /** + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + */ + // const dataFormat = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callExportPlaybook() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportPlaybook(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportPlaybook(); + // [END dialogflow_v3_generated_Playbooks_ExportPlaybook_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-dialogflow-cx/samples/generated/v3/playbooks.get_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.get_playbook.js new file mode 100644 index 000000000000..8c8543702e75 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.get_playbook.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_GetPlaybook_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 playbook. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callGetPlaybook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPlaybook(request); + console.log(response); + } + + callGetPlaybook(); + // [END dialogflow_v3_generated_Playbooks_GetPlaybook_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-dialogflow-cx/samples/generated/v3/playbooks.get_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.get_playbook_version.js new file mode 100644 index 000000000000..6e0cedd1c827 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.get_playbook_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_GetPlaybookVersion_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 playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callGetPlaybookVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPlaybookVersion(request); + console.log(response); + } + + callGetPlaybookVersion(); + // [END dialogflow_v3_generated_Playbooks_GetPlaybookVersion_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-dialogflow-cx/samples/generated/v3/playbooks.import_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.import_playbook.js new file mode 100644 index 000000000000..ed16c94dabfd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.import_playbook.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_ImportPlaybook_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 agent to import the playbook into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Dialogflow access + * control + * (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const playbookUri = 'abc123' + /** + * Uncompressed raw byte content for playbook. + */ + // const playbookContent = Buffer.from('string') + /** + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + */ + // const importStrategy = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callImportPlaybook() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importPlaybook(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportPlaybook(); + // [END dialogflow_v3_generated_Playbooks_ImportPlaybook_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-dialogflow-cx/samples/generated/v3/playbooks.list_playbook_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.list_playbook_versions.js new file mode 100644 index 000000000000..029ade49acbd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.list_playbook_versions.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_ListPlaybookVersions_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 playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callListPlaybookVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listPlaybookVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPlaybookVersions(); + // [END dialogflow_v3_generated_Playbooks_ListPlaybookVersions_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-dialogflow-cx/samples/generated/v3/playbooks.list_playbooks.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.list_playbooks.js new file mode 100644 index 000000000000..2bad300b5316 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.list_playbooks.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_ListPlaybooks_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 agent to list playbooks from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callListPlaybooks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listPlaybooksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPlaybooks(); + // [END dialogflow_v3_generated_Playbooks_ListPlaybooks_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-dialogflow-cx/samples/generated/v3/playbooks.restore_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.restore_playbook_version.js new file mode 100644 index 000000000000..7c0f25b61934 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.restore_playbook_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Playbooks_RestorePlaybookVersion_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 playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callRestorePlaybookVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.restorePlaybookVersion(request); + console.log(response); + } + + callRestorePlaybookVersion(); + // [END dialogflow_v3_generated_Playbooks_RestorePlaybookVersion_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-dialogflow-cx/samples/generated/v3/playbooks.update_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.update_playbook.js new file mode 100644 index 000000000000..6ed5846b0441 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/playbooks.update_playbook.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(playbook) { + // [START dialogflow_v3_generated_Playbooks_UpdatePlaybook_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 playbook to update. + */ + // const playbook = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callUpdatePlaybook() { + // Construct request + const request = { + playbook, + }; + + // Run request + const response = await cxClient.updatePlaybook(request); + console.log(response); + } + + callUpdatePlaybook(); + // [END dialogflow_v3_generated_Playbooks_UpdatePlaybook_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-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js new file mode 100644 index 000000000000..20518a1429ba --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, securitySettings) { + // [START dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_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 to create an + * SecuritySettings google.cloud.dialogflow.cx.v3.SecuritySettings for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The security settings to create. + */ + // const securitySettings = {} + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callCreateSecuritySettings() { + // Construct request + const request = { + parent, + securitySettings, + }; + + // Run request + const response = await cxClient.createSecuritySettings(request); + console.log(response); + } + + callCreateSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_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-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js new file mode 100644 index 000000000000..4544eff84d52 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js @@ -0,0 +1,64 @@ +// Copyright 2026 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 dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_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 + * SecuritySettings google.cloud.dialogflow.cx.v3.SecuritySettings to + * delete. Format: + * `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callDeleteSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSecuritySettings(request); + console.log(response); + } + + callDeleteSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_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-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js new file mode 100644 index 000000000000..d01f5707a7e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_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. Resource name of the settings. + * Format: + * `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callGetSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSecuritySettings(request); + console.log(response); + } + + callGetSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_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-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js new file mode 100644 index 000000000000..ee4fe5b403e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_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 to list all security settings for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callListSecuritySettings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listSecuritySettingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_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-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js new file mode 100644 index 000000000000..35529dc0fc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js @@ -0,0 +1,68 @@ +// Copyright 2026 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(securitySettings, updateMask) { + // [START dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_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. SecuritySettings object that contains values for each of the + * fields to update. + */ + // const securitySettings = {} + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callUpdateSecuritySettings() { + // Construct request + const request = { + securitySettings, + updateMask, + }; + + // Run request + const response = await cxClient.updateSecuritySettings(request); + console.log(response); + } + + callUpdateSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_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-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js new file mode 100644 index 000000000000..ca03930811d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js @@ -0,0 +1,72 @@ +// Copyright 2026 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, sessionEntityType) { + // [START dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_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 session to create a session entity type for. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * Required. The session entity type to create. + */ + // const sessionEntityType = {} + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callCreateSessionEntityType() { + // Construct request + const request = { + parent, + sessionEntityType, + }; + + // Run request + const response = await cxClient.createSessionEntityType(request); + console.log(response); + } + + callCreateSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_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-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js new file mode 100644 index 000000000000..155fd4dfb0cc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_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 session entity type to delete. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, + * we assume default 'draft' environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callDeleteSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSessionEntityType(request); + console.log(response); + } + + callDeleteSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_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-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js new file mode 100644 index 000000000000..f9256be667f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_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 session entity type. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callGetSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSessionEntityType(request); + console.log(response); + } + + callGetSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_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-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js new file mode 100644 index 000000000000..da094f6587e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_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 session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callListSessionEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listSessionEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSessionEntityTypes(); + // [END dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_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-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js new file mode 100644 index 000000000000..781593962270 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js @@ -0,0 +1,71 @@ +// Copyright 2026 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(sessionEntityType) { + // [START dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_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 session entity type to update. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, + * we assume default 'draft' environment. + */ + // const sessionEntityType = {} + /** + * The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callUpdateSessionEntityType() { + // Construct request + const request = { + sessionEntityType, + }; + + // Run request + const response = await cxClient.updateSessionEntityType(request); + console.log(response); + } + + callUpdateSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_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-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js new file mode 100644 index 000000000000..094178524495 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js @@ -0,0 +1,94 @@ +// Copyright 2026 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(session, queryInput) { + // [START dialogflow_v3_generated_Sessions_DetectIntent_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 session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See Versions and + * environments (https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = {} + /** + * Optional. Specifies which fields in the + * QueryResult google.cloud.dialogflow.cx.v3.QueryResult to return. If not + * set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + */ + // const responseView = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callDetectIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.detectIntent(request); + console.log(response); + } + + callDetectIntent(); + // [END dialogflow_v3_generated_Sessions_DetectIntent_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-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js new file mode 100644 index 000000000000..fe51de7003ca --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js @@ -0,0 +1,69 @@ +// Copyright 2026 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() { + // [START dialogflow_v3_generated_Sessions_FulfillIntent_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. + */ + /** + * Must be same as the corresponding MatchIntent request, otherwise the + * behavior is undefined. + */ + // const matchIntentRequest = {} + /** + * The matched intent/event to fulfill. + */ + // const match = {} + /** + * Instructs the speech synthesizer how to generate output audio. + */ + // const outputAudioConfig = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callFulfillIntent() { + // Construct request + const request = { + }; + + // Run request + const response = await cxClient.fulfillIntent(request); + console.log(response); + } + + callFulfillIntent(); + // [END dialogflow_v3_generated_Sessions_FulfillIntent_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-dialogflow-cx/samples/generated/v3/sessions.match_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.match_intent.js new file mode 100644 index 000000000000..02dc87ad0b96 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.match_intent.js @@ -0,0 +1,85 @@ +// Copyright 2026 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(session, queryInput) { + // [START dialogflow_v3_generated_Sessions_MatchIntent_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 session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Persist session parameter changes from `query_params`. + */ + // const persistParameterChanges = true + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callMatchIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.matchIntent(request); + console.log(response); + } + + callMatchIntent(); + // [END dialogflow_v3_generated_Sessions_MatchIntent_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-dialogflow-cx/samples/generated/v3/sessions.server_streaming_detect_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.server_streaming_detect_intent.js new file mode 100644 index 000000000000..c5cd4cff3ed1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.server_streaming_detect_intent.js @@ -0,0 +1,96 @@ +// Copyright 2026 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(session, queryInput) { + // [START dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_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 session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See Versions and + * environments (https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = {} + /** + * Optional. Specifies which fields in the + * QueryResult google.cloud.dialogflow.cx.v3.QueryResult to return. If not + * set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + */ + // const responseView = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callServerStreamingDetectIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const stream = await cxClient.serverStreamingDetectIntent(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callServerStreamingDetectIntent(); + // [END dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_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-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js new file mode 100644 index 000000000000..6190c650506a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js @@ -0,0 +1,109 @@ +// Copyright 2026 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(queryInput) { + // [START dialogflow_v3_generated_Sessions_StreamingDetectIntent_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. + */ + /** + * The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * Note: session must be set in the first request. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See Versions and + * environments (https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = {} + /** + * Enable partial detect intent response. If this flag is not enabled, + * response stream still contains only one final `DetectIntentResponse` even + * if some `Fulfillment`s in the agent have been configured to return partial + * responses. + */ + // const enablePartialResponse = true + /** + * If true, `StreamingDetectIntentResponse.debugging_info` will get populated. + */ + // const enableDebuggingInfo = true + /** + * Optional. Specifies which fields in the + * QueryResult google.cloud.dialogflow.cx.v3.QueryResult to return. If not + * set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + */ + // const responseView = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callStreamingDetectIntent() { + // Construct request + const request = { + queryInput, + }; + + // Run request + const stream = await cxClient.streamingDetectIntent(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingDetectIntent(); + // [END dialogflow_v3_generated_Sessions_StreamingDetectIntent_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-dialogflow-cx/samples/generated/v3/sessions.submit_answer_feedback.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.submit_answer_feedback.js new file mode 100644 index 000000000000..3e0e8987c004 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/sessions.submit_answer_feedback.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(session, responseId, answerFeedback) { + // [START dialogflow_v3_generated_Sessions_SubmitAnswerFeedback_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 session the feedback was sent to. + */ + // const session = 'abc123' + /** + * Required. ID of the response to update its feedback. This is the same as + * DetectIntentResponse.response_id. + */ + // const responseId = 'abc123' + /** + * Required. Feedback provided for a bot answer. + */ + // const answerFeedback = {} + /** + * Optional. The mask to control which fields to update. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callSubmitAnswerFeedback() { + // Construct request + const request = { + session, + responseId, + answerFeedback, + }; + + // Run request + const response = await cxClient.submitAnswerFeedback(request); + console.log(response); + } + + callSubmitAnswerFeedback(); + // [END dialogflow_v3_generated_Sessions_SubmitAnswerFeedback_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-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js new file mode 100644 index 000000000000..34fd95504dc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, names) { + // [START dialogflow_v3_generated_TestCases_BatchDeleteTestCases_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 agent to delete test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. Format of test case names: + * `projects//locations//agents//testCases/`. + */ + // const names = ['abc','def'] + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callBatchDeleteTestCases() { + // Construct request + const request = { + parent, + names, + }; + + // Run request + const response = await cxClient.batchDeleteTestCases(request); + console.log(response); + } + + callBatchDeleteTestCases(); + // [END dialogflow_v3_generated_TestCases_BatchDeleteTestCases_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-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js new file mode 100644 index 000000000000..9637b2087a78 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js @@ -0,0 +1,74 @@ +// Copyright 2026 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, testCases) { + // [START dialogflow_v3_generated_TestCases_BatchRunTestCases_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. Agent name. Format: + * `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Optional. If not set, draft environment is assumed. Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Required. Format: + * `projects//locations//agents//testCases/`. + */ + // const testCases = ['abc','def'] + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callBatchRunTestCases() { + // Construct request + const request = { + parent, + testCases, + }; + + // Run request + const [operation] = await cxClient.batchRunTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchRunTestCases(); + // [END dialogflow_v3_generated_TestCases_BatchRunTestCases_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-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js new file mode 100644 index 000000000000..ba1cd452e0ce --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js @@ -0,0 +1,67 @@ +// Copyright 2026 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(agent, type) { + // [START dialogflow_v3_generated_TestCases_CalculateCoverage_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 agent to calculate coverage for. + * Format: `projects//locations//agents/`. + */ + // const agent = 'abc123' + /** + * Required. The type of coverage requested. + */ + // const type = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callCalculateCoverage() { + // Construct request + const request = { + agent, + type, + }; + + // Run request + const response = await cxClient.calculateCoverage(request); + console.log(response); + } + + callCalculateCoverage(); + // [END dialogflow_v3_generated_TestCases_CalculateCoverage_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-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js new file mode 100644 index 000000000000..4e5b20478bbb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, testCase) { + // [START dialogflow_v3_generated_TestCases_CreateTestCase_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 agent to create the test case for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The test case to create. + */ + // const testCase = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callCreateTestCase() { + // Construct request + const request = { + parent, + testCase, + }; + + // Run request + const response = await cxClient.createTestCase(request); + console.log(response); + } + + callCreateTestCase(); + // [END dialogflow_v3_generated_TestCases_CreateTestCase_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-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js new file mode 100644 index 000000000000..8b8dd972fef1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js @@ -0,0 +1,90 @@ +// Copyright 2026 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 dialogflow_v3_generated_TestCases_ExportTestCases_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 agent where to export test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI to + * export the test cases to. The format of this URI must be + * `gs:///`. If unspecified, the serialized test + * cases is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const gcsUri = 'abc123' + /** + * The data format of the exported test cases. If not specified, `BLOB` is + * assumed. + */ + // const dataFormat = {} + /** + * The filter expression used to filter exported test cases, see + * API Filtering (https://aip.dev/160). The expression is case insensitive + * and supports the following syntax: + * name = OR name = ... + * For example: + * * "name = t1 OR name = t2" matches the test case with the exact resource + * name "t1" or "t2". + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callExportTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.exportTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportTestCases(); + // [END dialogflow_v3_generated_TestCases_ExportTestCases_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-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js new file mode 100644 index 000000000000..27f2cf5ee1db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_TestCases_GetTestCase_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 testcase. + * Format: + * `projects//locations//agents//testCases/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callGetTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCase(request); + console.log(response); + } + + callGetTestCase(); + // [END dialogflow_v3_generated_TestCases_GetTestCase_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-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js new file mode 100644 index 000000000000..66d9db80724e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_TestCases_GetTestCaseResult_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 testcase. + * Format: + * `projects//locations//agents//testCases//results/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callGetTestCaseResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCaseResult(request); + console.log(response); + } + + callGetTestCaseResult(); + // [END dialogflow_v3_generated_TestCases_GetTestCaseResult_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-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js new file mode 100644 index 000000000000..2a365dbb84fd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3_generated_TestCases_ImportTestCases_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 agent to import test cases to. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import test cases from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const gcsUri = 'abc123' + /** + * Uncompressed raw byte content for test cases. + */ + // const content = Buffer.from('string') + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callImportTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportTestCases(); + // [END dialogflow_v3_generated_TestCases_ImportTestCases_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-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js new file mode 100644 index 000000000000..2a4e4c3a241a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js @@ -0,0 +1,98 @@ +// Copyright 2026 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 dialogflow_v3_generated_TestCases_ListTestCaseResults_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 test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The filter expression used to filter test case results. See + * API Filtering (https://aip.dev/160). + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * AND ... + * AND latest + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * `latest` only returns the latest test result in all results for each test + * case. + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callListTestCaseResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listTestCaseResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTestCaseResults(); + // [END dialogflow_v3_generated_TestCases_ListTestCaseResults_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-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js new file mode 100644 index 000000000000..90bb299eba52 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3_generated_TestCases_ListTestCases_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 agent to list all pages for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * Specifies whether response should include all fields or just the metadata. + */ + // const view = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callListTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listTestCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTestCases(); + // [END dialogflow_v3_generated_TestCases_ListTestCases_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-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js new file mode 100644 index 000000000000..47f1df2f79f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js @@ -0,0 +1,69 @@ +// Copyright 2026 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 dialogflow_v3_generated_TestCases_RunTestCase_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. Format of test case name to run: + * `projects//locations//agents//testCases/`. + */ + // const name = 'abc123' + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callRunTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.runTestCase(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunTestCase(); + // [END dialogflow_v3_generated_TestCases_RunTestCase_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-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js new file mode 100644 index 000000000000..dc7a631f9a24 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js @@ -0,0 +1,69 @@ +// Copyright 2026 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(testCase, updateMask) { + // [START dialogflow_v3_generated_TestCases_UpdateTestCase_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 test case to update. + */ + // const testCase = {} + /** + * Required. The mask to specify which fields should be updated. The + * `creationTime` google.cloud.dialogflow.cx.v3.TestCase.creation_time and + * `lastTestResult` google.cloud.dialogflow.cx.v3.TestCase.last_test_result + * cannot be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callUpdateTestCase() { + // Construct request + const request = { + testCase, + updateMask, + }; + + // Run request + const response = await cxClient.updateTestCase(request); + console.log(response); + } + + callUpdateTestCase(); + // [END dialogflow_v3_generated_TestCases_UpdateTestCase_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-dialogflow-cx/samples/generated/v3/tools.create_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.create_tool.js new file mode 100644 index 000000000000..44c479beb361 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.create_tool.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, tool) { + // [START dialogflow_v3_generated_Tools_CreateTool_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 agent to create a Tool for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The Tool to be created. + */ + // const tool = {} + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callCreateTool() { + // Construct request + const request = { + parent, + tool, + }; + + // Run request + const response = await cxClient.createTool(request); + console.log(response); + } + + callCreateTool(); + // [END dialogflow_v3_generated_Tools_CreateTool_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-dialogflow-cx/samples/generated/v3/tools.create_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.create_tool_version.js new file mode 100644 index 000000000000..d94d67dc07a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.create_tool_version.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, toolVersion) { + // [START dialogflow_v3_generated_Tools_CreateToolVersion_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 tool to create a version for. + * Format: + * `projects//locations//agents//tools/`. + */ + // const parent = 'abc123' + /** + * Required. The tool version to create. + */ + // const toolVersion = {} + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callCreateToolVersion() { + // Construct request + const request = { + parent, + toolVersion, + }; + + // Run request + const response = await cxClient.createToolVersion(request); + console.log(response); + } + + callCreateToolVersion(); + // [END dialogflow_v3_generated_Tools_CreateToolVersion_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-dialogflow-cx/samples/generated/v3/tools.delete_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.delete_tool.js new file mode 100644 index 000000000000..04d1e40fd32a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.delete_tool.js @@ -0,0 +1,72 @@ +// Copyright 2026 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 dialogflow_v3_generated_Tools_DeleteTool_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 Tool to be deleted. + * Format: + * `projects//locations//agents//tools/`. + */ + // const name = 'abc123' + /** + * This field has no effect for Tools not being used. + * For Tools that are used: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + */ + // const force = true + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callDeleteTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteTool(request); + console.log(response); + } + + callDeleteTool(); + // [END dialogflow_v3_generated_Tools_DeleteTool_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-dialogflow-cx/samples/generated/v3/tools.delete_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.delete_tool_version.js new file mode 100644 index 000000000000..4683218621eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.delete_tool_version.js @@ -0,0 +1,72 @@ +// Copyright 2026 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 dialogflow_v3_generated_Tools_DeleteToolVersion_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 tool version to delete. + * Format: + * `projects//locations//agents//tools//versions/`. + */ + // const name = 'abc123' + /** + * Optional. This field has no effect for Tools not being used. + * For Tools that are used: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + */ + // const force = true + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callDeleteToolVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteToolVersion(request); + console.log(response); + } + + callDeleteToolVersion(); + // [END dialogflow_v3_generated_Tools_DeleteToolVersion_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-dialogflow-cx/samples/generated/v3/tools.get_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.get_tool.js new file mode 100644 index 000000000000..21384a836571 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.get_tool.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Tools_GetTool_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 Tool. + * Format: + * `projects//locations//agents//tools/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callGetTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTool(request); + console.log(response); + } + + callGetTool(); + // [END dialogflow_v3_generated_Tools_GetTool_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-dialogflow-cx/samples/generated/v3/tools.get_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.get_tool_version.js new file mode 100644 index 000000000000..da26466fd935 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.get_tool_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Tools_GetToolVersion_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 tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callGetToolVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getToolVersion(request); + console.log(response); + } + + callGetToolVersion(); + // [END dialogflow_v3_generated_Tools_GetToolVersion_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-dialogflow-cx/samples/generated/v3/tools.list_tool_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.list_tool_versions.js new file mode 100644 index 000000000000..3a65be4a2c4e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.list_tool_versions.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Tools_ListToolVersions_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 of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callListToolVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listToolVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListToolVersions(); + // [END dialogflow_v3_generated_Tools_ListToolVersions_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-dialogflow-cx/samples/generated/v3/tools.list_tools.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.list_tools.js new file mode 100644 index 000000000000..179c6ae0e296 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.list_tools.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3_generated_Tools_ListTools_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 agent to list the Tools from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callListTools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listToolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTools(); + // [END dialogflow_v3_generated_Tools_ListTools_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-dialogflow-cx/samples/generated/v3/tools.restore_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.restore_tool_version.js new file mode 100644 index 000000000000..9a10e89e12ba --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.restore_tool_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Tools_RestoreToolVersion_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 tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callRestoreToolVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.restoreToolVersion(request); + console.log(response); + } + + callRestoreToolVersion(); + // [END dialogflow_v3_generated_Tools_RestoreToolVersion_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-dialogflow-cx/samples/generated/v3/tools.update_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.update_tool.js new file mode 100644 index 000000000000..117c579b42ae --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/tools.update_tool.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(tool) { + // [START dialogflow_v3_generated_Tools_UpdateTool_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 Tool to be updated. + */ + // const tool = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callUpdateTool() { + // Construct request + const request = { + tool, + }; + + // Run request + const response = await cxClient.updateTool(request); + console.log(response); + } + + callUpdateTool(); + // [END dialogflow_v3_generated_Tools_UpdateTool_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-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js new file mode 100644 index 000000000000..8dd7bc5461b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js @@ -0,0 +1,83 @@ +// Copyright 2026 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, transitionRouteGroup) { + // [START dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_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 flow to create an + * TransitionRouteGroup google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * for. Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/` + * for agent-level groups. + */ + // const parent = 'abc123' + /** + * Required. The transition route group to create. + */ + // const transitionRouteGroup = {} + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callCreateTransitionRouteGroup() { + // Construct request + const request = { + parent, + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.createTransitionRouteGroup(request); + console.log(response); + } + + callCreateTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js new file mode 100644 index 000000000000..8651db92ea99 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_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 + * TransitionRouteGroup google.cloud.dialogflow.cx.v3.TransitionRouteGroup + * to delete. Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * This field has no effect for transition route group that no page is using. + * If the transition route group is referenced by any page: + * * If `force` is set to false, an error will be returned with message + * indicating pages that reference the transition route group. + * * If `force` is set to true, Dialogflow will remove the transition route + * group, as well as any reference to it. + */ + // const force = true + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callDeleteTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteTransitionRouteGroup(request); + console.log(response); + } + + callDeleteTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js new file mode 100644 index 000000000000..07762bb06de0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js @@ -0,0 +1,79 @@ +// Copyright 2026 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 dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_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 + * TransitionRouteGroup google.cloud.dialogflow.cx.v3.TransitionRouteGroup. + * Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the transition route group for. The following + * fields are language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callGetTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTransitionRouteGroup(request); + console.log(response); + } + + callGetTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js new file mode 100644 index 000000000000..7ec61e9e9e7f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js @@ -0,0 +1,88 @@ +// Copyright 2026 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 dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_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 flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list transition route groups for. The following fields are + * language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callListTransitionRouteGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listTransitionRouteGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransitionRouteGroups(); + // [END dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_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-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js new file mode 100644 index 000000000000..b3236e0316fd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(transitionRouteGroup) { + // [START dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_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 transition route group to update. + */ + // const transitionRouteGroup = {} + /** + * The mask to control which fields get updated. + */ + // const updateMask = {} + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callUpdateTransitionRouteGroup() { + // Construct request + const request = { + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.updateTransitionRouteGroup(request); + console.log(response); + } + + callUpdateTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3/versions.compare_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.compare_versions.js new file mode 100644 index 000000000000..887969a1ff62 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.compare_versions.js @@ -0,0 +1,81 @@ +// Copyright 2026 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(baseVersion, targetVersion) { + // [START dialogflow_v3_generated_Versions_CompareVersions_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. Name of the base flow version to compare with the target version. + * Use version ID `0` to indicate the draft version of the specified flow. + * Format: + * `projects//locations//agents//flows//versions/`. + */ + // const baseVersion = 'abc123' + /** + * Required. Name of the target flow version to compare with the + * base version. Use version ID `0` to indicate the draft version of the + * specified flow. Format: + * `projects//locations//agents//flows//versions/`. + */ + // const targetVersion = 'abc123' + /** + * The language to compare the flow versions for. + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/docs/reference/language) are + * supported. Note: languages must be enabled in the agent before they can be + * used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callCompareVersions() { + // Construct request + const request = { + baseVersion, + targetVersion, + }; + + // Run request + const response = await cxClient.compareVersions(request); + console.log(response); + } + + callCompareVersions(); + // [END dialogflow_v3_generated_Versions_CompareVersions_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-dialogflow-cx/samples/generated/v3/versions.create_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.create_version.js new file mode 100644 index 000000000000..4159788378c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.create_version.js @@ -0,0 +1,69 @@ +// Copyright 2026 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, version) { + // [START dialogflow_v3_generated_Versions_CreateVersion_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 Flow google.cloud.dialogflow.cx.v3.Flow to create an + * Version google.cloud.dialogflow.cx.v3.Version for. Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The version to create. + */ + // const version = {} + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callCreateVersion() { + // Construct request + const request = { + parent, + version, + }; + + // Run request + const [operation] = await cxClient.createVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateVersion(); + // [END dialogflow_v3_generated_Versions_CreateVersion_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-dialogflow-cx/samples/generated/v3/versions.delete_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.delete_version.js new file mode 100644 index 000000000000..5cf716bcfa5a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.delete_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Versions_DeleteVersion_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 Version google.cloud.dialogflow.cx.v3.Version + * to delete. Format: + * `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callDeleteVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteVersion(request); + console.log(response); + } + + callDeleteVersion(); + // [END dialogflow_v3_generated_Versions_DeleteVersion_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-dialogflow-cx/samples/generated/v3/versions.get_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.get_version.js new file mode 100644 index 000000000000..c74645f74805 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.get_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Versions_GetVersion_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 Version google.cloud.dialogflow.cx.v3.Version. + * Format: + * `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callGetVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getVersion(request); + console.log(response); + } + + callGetVersion(); + // [END dialogflow_v3_generated_Versions_GetVersion_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-dialogflow-cx/samples/generated/v3/versions.list_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.list_versions.js new file mode 100644 index 000000000000..be73f2209cbc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.list_versions.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3_generated_Versions_ListVersions_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 Flow google.cloud.dialogflow.cx.v3.Flow to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callListVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVersions(); + // [END dialogflow_v3_generated_Versions_ListVersions_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-dialogflow-cx/samples/generated/v3/versions.load_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.load_version.js new file mode 100644 index 000000000000..fe8930b183da --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.load_version.js @@ -0,0 +1,71 @@ +// Copyright 2026 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 dialogflow_v3_generated_Versions_LoadVersion_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 Version google.cloud.dialogflow.cx.v3.Version to be loaded + * to draft flow. Format: + * `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + /** + * This field is used to prevent accidental overwrite of other agent + * resources, which can potentially impact other flow's behavior. If + * `allow_override_agent_resources` is false, conflicted agent-level resources + * will not be overridden (i.e. intents, entities, webhooks). + */ + // const allowOverrideAgentResources = true + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callLoadVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.loadVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLoadVersion(); + // [END dialogflow_v3_generated_Versions_LoadVersion_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-dialogflow-cx/samples/generated/v3/versions.update_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.update_version.js new file mode 100644 index 000000000000..c9fe94a32ddd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/versions.update_version.js @@ -0,0 +1,67 @@ +// Copyright 2026 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(version, updateMask) { + // [START dialogflow_v3_generated_Versions_UpdateVersion_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 version to update. + */ + // const version = {} + /** + * Required. The mask to control which fields get updated. Currently only + * `description` and `display_name` can be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callUpdateVersion() { + // Construct request + const request = { + version, + updateMask, + }; + + // Run request + const response = await cxClient.updateVersion(request); + console.log(response); + } + + callUpdateVersion(); + // [END dialogflow_v3_generated_Versions_UpdateVersion_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-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js new file mode 100644 index 000000000000..426dcef24ab3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, webhook) { + // [START dialogflow_v3_generated_Webhooks_CreateWebhook_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 agent to create a webhook for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The webhook to create. + */ + // const webhook = {} + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callCreateWebhook() { + // Construct request + const request = { + parent, + webhook, + }; + + // Run request + const response = await cxClient.createWebhook(request); + console.log(response); + } + + callCreateWebhook(); + // [END dialogflow_v3_generated_Webhooks_CreateWebhook_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-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js new file mode 100644 index 000000000000..d0870af65ca2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3_generated_Webhooks_DeleteWebhook_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 webhook to delete. + * Format: + * `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + /** + * This field has no effect for webhook not being used. + * For webhooks that are used by pages/flows/transition route groups: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the webhook, as well + * as any references to the webhook (i.e. + * Webhook google.cloud.dialogflow.cx.v3.Fulfillment.webhook and + * tag google.cloud.dialogflow.cx.v3.Fulfillment.tag in fulfillments that + * point to this webhook will be removed). + */ + // const force = true + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callDeleteWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteWebhook(request); + console.log(response); + } + + callDeleteWebhook(); + // [END dialogflow_v3_generated_Webhooks_DeleteWebhook_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-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js new file mode 100644 index 000000000000..b308fab1e8d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3_generated_Webhooks_GetWebhook_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 webhook. + * Format: + * `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callGetWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getWebhook(request); + console.log(response); + } + + callGetWebhook(); + // [END dialogflow_v3_generated_Webhooks_GetWebhook_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-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js new file mode 100644 index 000000000000..1f6b5b155f76 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3_generated_Webhooks_ListWebhooks_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 agent to list all webhooks for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callListWebhooks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listWebhooksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWebhooks(); + // [END dialogflow_v3_generated_Webhooks_ListWebhooks_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-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js new file mode 100644 index 000000000000..8a2432ac19ee --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(webhook) { + // [START dialogflow_v3_generated_Webhooks_UpdateWebhook_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 webhook to update. + */ + // const webhook = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callUpdateWebhook() { + // Construct request + const request = { + webhook, + }; + + // Run request + const response = await cxClient.updateWebhook(request); + console.log(response); + } + + callUpdateWebhook(); + // [END dialogflow_v3_generated_Webhooks_UpdateWebhook_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-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js new file mode 100644 index 000000000000..3c0abbde52c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, agent) { + // [START dialogflow_v3beta1_generated_Agents_CreateAgent_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 to create a agent for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The agent to create. + */ + // const agent = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callCreateAgent() { + // Construct request + const request = { + parent, + agent, + }; + + // Run request + const response = await cxClient.createAgent(request); + console.log(response); + } + + callCreateAgent(); + // [END dialogflow_v3beta1_generated_Agents_CreateAgent_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-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js new file mode 100644 index 000000000000..de4a53b2d365 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js @@ -0,0 +1,62 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Agents_DeleteAgent_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 agent to delete. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callDeleteAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteAgent(request); + console.log(response); + } + + callDeleteAgent(); + // [END dialogflow_v3beta1_generated_Agents_DeleteAgent_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-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js new file mode 100644 index 000000000000..36b23bf0389a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js @@ -0,0 +1,94 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Agents_ExportAgent_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 agent to export. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const agentUri = 'abc123' + /** + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + */ + // const dataFormat = {} + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Optional. The Git branch to export the agent to. + */ + // const gitDestination = {} + /** + * Optional. Whether to include BigQuery Export setting. + */ + // const includeBigqueryExportSettings = true + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callExportAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportAgent(); + // [END dialogflow_v3beta1_generated_Agents_ExportAgent_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-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js new file mode 100644 index 000000000000..9818893e3b05 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js @@ -0,0 +1,62 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Agents_GetAgent_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 agent. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callGetAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgent(request); + console.log(response); + } + + callGetAgent(); + // [END dialogflow_v3beta1_generated_Agents_GetAgent_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-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js new file mode 100644 index 000000000000..1c190c36e381 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Agents_GetAgentValidationResult_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 agent name. + * Format: + * `projects//locations//agents//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callGetAgentValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgentValidationResult(request); + console.log(response); + } + + callGetAgentValidationResult(); + // [END dialogflow_v3beta1_generated_Agents_GetAgentValidationResult_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-dialogflow-cx/samples/generated/v3beta1/agents.get_generative_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_generative_settings.js new file mode 100644 index 000000000000..75e027ccf950 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_generative_settings.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, languageCode) { + // [START dialogflow_v3beta1_generated_Agents_GetGenerativeSettings_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. Format: + * `projects//locations//agents//generativeSettings`. + */ + // const name = 'abc123' + /** + * Required. Language code of the generative settings. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callGetGenerativeSettings() { + // Construct request + const request = { + name, + languageCode, + }; + + // Run request + const response = await cxClient.getGenerativeSettings(request); + console.log(response); + } + + callGetGenerativeSettings(); + // [END dialogflow_v3beta1_generated_Agents_GetGenerativeSettings_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-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js new file mode 100644 index 000000000000..6f96972500ab --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Agents_ListAgents_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 to list all agents for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callListAgents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listAgentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAgents(); + // [END dialogflow_v3beta1_generated_Agents_ListAgents_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-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js new file mode 100644 index 000000000000..dca81e3edb11 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js @@ -0,0 +1,86 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Agents_RestoreAgent_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 agent to restore into. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to restore agent from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const agentUri = 'abc123' + /** + * Uncompressed raw byte content for agent. + */ + // const agentContent = Buffer.from('string') + /** + * Setting for restoring from a git branch + */ + // const gitSource = {} + /** + * Agent restore mode. If not specified, `KEEP` is assumed. + */ + // const restoreOption = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callRestoreAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.restoreAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreAgent(); + // [END dialogflow_v3beta1_generated_Agents_RestoreAgent_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-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js new file mode 100644 index 000000000000..7b0b029460cb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(agent) { + // [START dialogflow_v3beta1_generated_Agents_UpdateAgent_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 agent to update. + */ + // const agent = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callUpdateAgent() { + // Construct request + const request = { + agent, + }; + + // Run request + const response = await cxClient.updateAgent(request); + console.log(response); + } + + callUpdateAgent(); + // [END dialogflow_v3beta1_generated_Agents_UpdateAgent_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-dialogflow-cx/samples/generated/v3beta1/agents.update_generative_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_generative_settings.js new file mode 100644 index 000000000000..90a53634a89a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_generative_settings.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(generativeSettings) { + // [START dialogflow_v3beta1_generated_Agents_UpdateGenerativeSettings_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. Generative settings to update. + */ + // const generativeSettings = {} + /** + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callUpdateGenerativeSettings() { + // Construct request + const request = { + generativeSettings, + }; + + // Run request + const response = await cxClient.updateGenerativeSettings(request); + console.log(response); + } + + callUpdateGenerativeSettings(); + // [END dialogflow_v3beta1_generated_Agents_UpdateGenerativeSettings_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-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js new file mode 100644 index 000000000000..3e4e3d1a4125 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js @@ -0,0 +1,66 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Agents_ValidateAgent_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 agent to validate. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function callValidateAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateAgent(request); + console.log(response); + } + + callValidateAgent(); + // [END dialogflow_v3beta1_generated_Agents_ValidateAgent_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-dialogflow-cx/samples/generated/v3beta1/changelogs.get_changelog.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/changelogs.get_changelog.js new file mode 100644 index 000000000000..c1df88903882 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/changelogs.get_changelog.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Changelogs_GetChangelog_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 changelog to get. + * Format: + * `projects//locations//agents//changelogs/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ChangelogsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ChangelogsClient(); + + async function callGetChangelog() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getChangelog(request); + console.log(response); + } + + callGetChangelog(); + // [END dialogflow_v3beta1_generated_Changelogs_GetChangelog_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-dialogflow-cx/samples/generated/v3beta1/changelogs.list_changelogs.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/changelogs.list_changelogs.js new file mode 100644 index 000000000000..b67baefbaba0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/changelogs.list_changelogs.js @@ -0,0 +1,96 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Changelogs_ListChangelogs_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 agent containing the changelogs. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + */ + // const filter = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ChangelogsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ChangelogsClient(); + + async function callListChangelogs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listChangelogsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChangelogs(); + // [END dialogflow_v3beta1_generated_Changelogs_ListChangelogs_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-dialogflow-cx/samples/generated/v3beta1/conversation_history.delete_conversation.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.delete_conversation.js new file mode 100644 index 000000000000..0908026ff547 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.delete_conversation.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_ConversationHistory_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. + * Format: + * `projects//locations//agents//conversations/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ConversationHistoryClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ConversationHistoryClient(); + + async function callDeleteConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteConversation(request); + console.log(response); + } + + callDeleteConversation(); + // [END dialogflow_v3beta1_generated_ConversationHistory_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-dialogflow-cx/samples/generated/v3beta1/conversation_history.get_conversation.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.get_conversation.js new file mode 100644 index 000000000000..5c825a262286 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.get_conversation.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_ConversationHistory_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. + * Format: + * `projects//locations//agents//conversations/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ConversationHistoryClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ConversationHistoryClient(); + + async function callGetConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getConversation(request); + console.log(response); + } + + callGetConversation(); + // [END dialogflow_v3beta1_generated_ConversationHistory_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-dialogflow-cx/samples/generated/v3beta1/conversation_history.list_conversations.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.list_conversations.js new file mode 100644 index 000000000000..3c8df0e984cb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/conversation_history.list_conversations.js @@ -0,0 +1,88 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_ConversationHistory_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 agent to list all conversations for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Optional. The filter string. Supports filter by create_time, + * metrics.has_end_interaction, metrics.has_live_agent_handoff, + * intents.display_name, pages.display_name and flows.display_name. Timestamps + * expect an RFC-3339 https://datatracker.ietf.org/doc/html/rfc3339 + * formatted string (e.g. 2012-04-21T11:30:00-04:00). UTC offsets are + * supported. Some examples: + * 1. By create time: + * create_time > "2022-04-21T11:30:00-04:00" + * 2. By intent display name: + * intents.display_name : "billing" + * 3. By end interaction signal: + * metrics.has_end_interaction = true + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ConversationHistoryClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ConversationHistoryClient(); + + async function callListConversations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listConversationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConversations(); + // [END dialogflow_v3beta1_generated_ConversationHistory_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-dialogflow-cx/samples/generated/v3beta1/deployments.get_deployment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/deployments.get_deployment.js new file mode 100644 index 000000000000..195b6b18121c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/deployments.get_deployment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Deployments_GetDeployment_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 + * Deployment google.cloud.dialogflow.cx.v3beta1.Deployment. Format: + * `projects//locations//agents//environments//deployments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {DeploymentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new DeploymentsClient(); + + async function callGetDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getDeployment(request); + console.log(response); + } + + callGetDeployment(); + // [END dialogflow_v3beta1_generated_Deployments_GetDeployment_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-dialogflow-cx/samples/generated/v3beta1/deployments.list_deployments.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/deployments.list_deployments.js new file mode 100644 index 000000000000..6b5cbca197e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/deployments.list_deployments.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Deployments_ListDeployments_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 Environment google.cloud.dialogflow.cx.v3beta1.Environment + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {DeploymentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new DeploymentsClient(); + + async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeployments(); + // [END dialogflow_v3beta1_generated_Deployments_ListDeployments_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-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js new file mode 100644 index 000000000000..7f830915b43e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js @@ -0,0 +1,79 @@ +// Copyright 2026 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, entityType) { + // [START dialogflow_v3beta1_generated_EntityTypes_CreateEntityType_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 agent to create a entity type for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The entity type to create. + */ + // const entityType = {} + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callCreateEntityType() { + // Construct request + const request = { + parent, + entityType, + }; + + // Run request + const response = await cxClient.createEntityType(request); + console.log(response); + } + + callCreateEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_CreateEntityType_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-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js new file mode 100644 index 000000000000..5d0336c8ca42 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js @@ -0,0 +1,77 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_EntityTypes_DeleteEntityType_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 entity type to delete. + * Format: + * `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * This field has no effect for entity type not being used. + * For entity types that are used by intents or pages: + * * If `force` is set to false, an error will be returned with message + * indicating the referencing resources. + * * If `force` is set to true, Dialogflow will remove the entity type, as + * well as any references to the entity type (i.e. Page + * parameter google.cloud.dialogflow.cx.v3beta1.Form.Parameter of the + * entity type will be changed to + * '@sys.any' and intent + * parameter google.cloud.dialogflow.cx.v3beta1.Intent.Parameter of the + * entity type will be removed). + */ + // const force = true + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callDeleteEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEntityType(request); + console.log(response); + } + + callDeleteEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_DeleteEntityType_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-dialogflow-cx/samples/generated/v3beta1/entity_types.export_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.export_entity_types.js new file mode 100644 index 000000000000..933bd31b46b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.export_entity_types.js @@ -0,0 +1,104 @@ +// Copyright 2026 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, entityTypes) { + // [START dialogflow_v3beta1_generated_EntityTypes_ExportEntityTypes_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 parent agent to export entity types. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The name of the entity types to export. + * Format: + * `projects//locations//agents//entityTypes/`. + */ + // const entityTypes = ['abc','def'] + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the entity + * types to. The format of this URI must be + * `gs:///`. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const entityTypesUri = 'abc123' + /** + * Optional. The option to return the serialized entity types inline. + */ + // const entityTypesContentInline = true + /** + * Optional. The data format of the exported entity types. If not specified, + * `BLOB` is assumed. + */ + // const dataFormat = {} + /** + * Optional. The language to retrieve the entity type for. The following + * fields are language dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, all language dependent fields will be retrieved. + * Many + * languages (https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callExportEntityTypes() { + // Construct request + const request = { + parent, + entityTypes, + }; + + // Run request + const [operation] = await cxClient.exportEntityTypes(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportEntityTypes(); + // [END dialogflow_v3beta1_generated_EntityTypes_ExportEntityTypes_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-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js new file mode 100644 index 000000000000..1fa73a0c08bf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js @@ -0,0 +1,76 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_EntityTypes_GetEntityType_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 entity type. + * Format: + * `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the entity type for. The following fields are + * language dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callGetEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEntityType(request); + console.log(response); + } + + callGetEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_GetEntityType_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-dialogflow-cx/samples/generated/v3beta1/entity_types.import_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.import_entity_types.js new file mode 100644 index 000000000000..8ef5afaf48a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.import_entity_types.js @@ -0,0 +1,94 @@ +// Copyright 2026 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, mergeOption) { + // [START dialogflow_v3beta1_generated_EntityTypes_ImportEntityTypes_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 agent to import the entity types into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import entity types from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const entityTypesUri = 'abc123' + /** + * Uncompressed byte content of entity types. + */ + // const entityTypesContent = {} + /** + * Required. Merge option for importing entity types. + */ + // const mergeOption = {} + /** + * Optional. The target entity type to import into. + * Format: + * `projects//locations//agents//entity_types/`. + * If set, there should be only one entity type included in + * entity_types google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.entity_types, + * of which the type should match the type of the target entity type. All + * entities google.cloud.dialogflow.cx.v3beta1.EntityType.entities in the + * imported entity type will be added to the target entity type. + */ + // const targetEntityType = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callImportEntityTypes() { + // Construct request + const request = { + parent, + mergeOption, + }; + + // Run request + const [operation] = await cxClient.importEntityTypes(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportEntityTypes(); + // [END dialogflow_v3beta1_generated_EntityTypes_ImportEntityTypes_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-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js new file mode 100644 index 000000000000..6403fa153dd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js @@ -0,0 +1,86 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_EntityTypes_ListEntityTypes_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 agent to list all entity types for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list entity types for. The following fields are language + * dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callListEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEntityTypes(); + // [END dialogflow_v3beta1_generated_EntityTypes_ListEntityTypes_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-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js new file mode 100644 index 000000000000..3b49bfcd33ea --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(entityType) { + // [START dialogflow_v3beta1_generated_EntityTypes_UpdateEntityType_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 entity type to update. + */ + // const entityType = {} + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function callUpdateEntityType() { + // Construct request + const request = { + entityType, + }; + + // Run request + const response = await cxClient.updateEntityType(request); + console.log(response); + } + + callUpdateEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_UpdateEntityType_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-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js new file mode 100644 index 000000000000..bb1e2bffea6a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js @@ -0,0 +1,69 @@ +// Copyright 2026 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, environment) { + // [START dialogflow_v3beta1_generated_Environments_CreateEnvironment_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 Agent google.cloud.dialogflow.cx.v3beta1.Agent to create + * an Environment google.cloud.dialogflow.cx.v3beta1.Environment for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The environment to create. + */ + // const environment = {} + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callCreateEnvironment() { + // Construct request + const request = { + parent, + environment, + }; + + // Run request + const [operation] = await cxClient.createEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_CreateEnvironment_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-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js new file mode 100644 index 000000000000..497ce61df490 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js @@ -0,0 +1,64 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Environments_DeleteEnvironment_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 + * Environment google.cloud.dialogflow.cx.v3beta1.Environment to delete. + * Format: + * `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callDeleteEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEnvironment(request); + console.log(response); + } + + callDeleteEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_DeleteEnvironment_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-dialogflow-cx/samples/generated/v3beta1/environments.deploy_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.deploy_flow.js new file mode 100644 index 000000000000..bf42cc73fc30 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.deploy_flow.js @@ -0,0 +1,71 @@ +// Copyright 2026 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(environment, flowVersion) { + // [START dialogflow_v3beta1_generated_Environments_DeployFlow_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 environment to deploy the flow to. + * Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Required. The flow version to deploy. + * Format: + * `projects//locations//agents//flows//versions/`. + */ + // const flowVersion = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callDeployFlow() { + // Construct request + const request = { + environment, + flowVersion, + }; + + // Run request + const [operation] = await cxClient.deployFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployFlow(); + // [END dialogflow_v3beta1_generated_Environments_DeployFlow_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-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js new file mode 100644 index 000000000000..58ea6996aa15 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Environments_GetEnvironment_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 + * Environment google.cloud.dialogflow.cx.v3beta1.Environment. Format: + * `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callGetEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEnvironment(request); + console.log(response); + } + + callGetEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_GetEnvironment_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-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js new file mode 100644 index 000000000000..487131e8df6d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Environments_ListContinuousTestResults_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 environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callListContinuousTestResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listContinuousTestResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListContinuousTestResults(); + // [END dialogflow_v3beta1_generated_Environments_ListContinuousTestResults_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-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js new file mode 100644 index 000000000000..3cb56b8208bb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Environments_ListEnvironments_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 Agent google.cloud.dialogflow.cx.v3beta1.Agent to list all + * environments for. Format: + * `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callListEnvironments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listEnvironmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEnvironments(); + // [END dialogflow_v3beta1_generated_Environments_ListEnvironments_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-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js new file mode 100644 index 000000000000..3c81b5106630 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Environments_LookupEnvironmentHistory_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. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callLookupEnvironmentHistory() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = cxClient.lookupEnvironmentHistoryAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callLookupEnvironmentHistory(); + // [END dialogflow_v3beta1_generated_Environments_LookupEnvironmentHistory_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-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js new file mode 100644 index 000000000000..6c2c0e810c5a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js @@ -0,0 +1,63 @@ +// Copyright 2026 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(environment) { + // [START dialogflow_v3beta1_generated_Environments_RunContinuousTest_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. Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callRunContinuousTest() { + // Construct request + const request = { + environment, + }; + + // Run request + const [operation] = await cxClient.runContinuousTest(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunContinuousTest(); + // [END dialogflow_v3beta1_generated_Environments_RunContinuousTest_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-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js new file mode 100644 index 000000000000..b7ebd14b0f36 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js @@ -0,0 +1,67 @@ +// Copyright 2026 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(environment, updateMask) { + // [START dialogflow_v3beta1_generated_Environments_UpdateEnvironment_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 environment to update. + */ + // const environment = {} + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function callUpdateEnvironment() { + // Construct request + const request = { + environment, + updateMask, + }; + + // Run request + const [operation] = await cxClient.updateEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_UpdateEnvironment_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-dialogflow-cx/samples/generated/v3beta1/examples.create_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.create_example.js new file mode 100644 index 000000000000..83b743313698 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.create_example.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, example) { + // [START dialogflow_v3beta1_generated_Examples_CreateExample_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 playbook to create an example for. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Required. The example to create. + */ + // const example = {} + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callCreateExample() { + // Construct request + const request = { + parent, + example, + }; + + // Run request + const response = await cxClient.createExample(request); + console.log(response); + } + + callCreateExample(); + // [END dialogflow_v3beta1_generated_Examples_CreateExample_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-dialogflow-cx/samples/generated/v3beta1/examples.delete_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.delete_example.js new file mode 100644 index 000000000000..c0cfca9951af --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.delete_example.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Examples_DeleteExample_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 example to delete. + * Format: + * `projects//locations//agents//playbooks//examples/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callDeleteExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteExample(request); + console.log(response); + } + + callDeleteExample(); + // [END dialogflow_v3beta1_generated_Examples_DeleteExample_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-dialogflow-cx/samples/generated/v3beta1/examples.get_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.get_example.js new file mode 100644 index 000000000000..c6872eb72b65 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.get_example.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Examples_GetExample_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 example. + * Format: + * `projects//locations//agents//playbooks//examples/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callGetExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getExample(request); + console.log(response); + } + + callGetExample(); + // [END dialogflow_v3beta1_generated_Examples_GetExample_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-dialogflow-cx/samples/generated/v3beta1/examples.list_examples.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.list_examples.js new file mode 100644 index 000000000000..054afe4b7161 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.list_examples.js @@ -0,0 +1,81 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Examples_ListExamples_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 playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token ListExampleResponse.next_page_token value + * returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callListExamples() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listExamplesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExamples(); + // [END dialogflow_v3beta1_generated_Examples_ListExamples_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-dialogflow-cx/samples/generated/v3beta1/examples.update_example.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.update_example.js new file mode 100644 index 000000000000..2216f86d4631 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/examples.update_example.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(example) { + // [START dialogflow_v3beta1_generated_Examples_UpdateExample_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 example to update. + */ + // const example = {} + /** + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {ExamplesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExamplesClient(); + + async function callUpdateExample() { + // Construct request + const request = { + example, + }; + + // Run request + const response = await cxClient.updateExample(request); + console.log(response); + } + + callUpdateExample(); + // [END dialogflow_v3beta1_generated_Examples_UpdateExample_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-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js new file mode 100644 index 000000000000..6599dda0adac --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js @@ -0,0 +1,69 @@ +// Copyright 2026 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, experiment) { + // [START dialogflow_v3beta1_generated_Experiments_CreateExperiment_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 Agent google.cloud.dialogflow.cx.v3beta1.Agent to create + * an Environment google.cloud.dialogflow.cx.v3beta1.Environment for. + * Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * Required. The experiment to create. + */ + // const experiment = {} + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callCreateExperiment() { + // Construct request + const request = { + parent, + experiment, + }; + + // Run request + const response = await cxClient.createExperiment(request); + console.log(response); + } + + callCreateExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_CreateExperiment_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-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js new file mode 100644 index 000000000000..ca49b917e972 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js @@ -0,0 +1,64 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Experiments_DeleteExperiment_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 + * Environment google.cloud.dialogflow.cx.v3beta1.Environment to delete. + * Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callDeleteExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteExperiment(request); + console.log(response); + } + + callDeleteExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_DeleteExperiment_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-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js new file mode 100644 index 000000000000..ab41dfabb589 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Experiments_GetExperiment_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 + * Environment google.cloud.dialogflow.cx.v3beta1.Environment. Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callGetExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getExperiment(request); + console.log(response); + } + + callGetExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_GetExperiment_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-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js new file mode 100644 index 000000000000..3b4eb595f54b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Experiments_ListExperiments_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 Environment google.cloud.dialogflow.cx.v3beta1.Environment + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callListExperiments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listExperimentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExperiments(); + // [END dialogflow_v3beta1_generated_Experiments_ListExperiments_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-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js new file mode 100644 index 000000000000..7ee5335eb8f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Experiments_StartExperiment_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. Resource name of the experiment to start. + * Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callStartExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.startExperiment(request); + console.log(response); + } + + callStartExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_StartExperiment_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-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js new file mode 100644 index 000000000000..3d1b52c6f97d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Experiments_StopExperiment_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. Resource name of the experiment to stop. + * Format: + * `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callStopExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.stopExperiment(request); + console.log(response); + } + + callStopExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_StopExperiment_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-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js new file mode 100644 index 000000000000..e92c3a5f5860 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(experiment, updateMask) { + // [START dialogflow_v3beta1_generated_Experiments_UpdateExperiment_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 experiment to update. + */ + // const experiment = {} + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function callUpdateExperiment() { + // Construct request + const request = { + experiment, + updateMask, + }; + + // Run request + const response = await cxClient.updateExperiment(request); + console.log(response); + } + + callUpdateExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_UpdateExperiment_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-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js new file mode 100644 index 000000000000..f32a59df10d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js @@ -0,0 +1,80 @@ +// Copyright 2026 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, flow) { + // [START dialogflow_v3beta1_generated_Flows_CreateFlow_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 agent to create a flow for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The flow to create. + */ + // const flow = {} + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callCreateFlow() { + // Construct request + const request = { + parent, + flow, + }; + + // Run request + const response = await cxClient.createFlow(request); + console.log(response); + } + + callCreateFlow(); + // [END dialogflow_v3beta1_generated_Flows_CreateFlow_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-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js new file mode 100644 index 000000000000..d47fac4e4d36 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_DeleteFlow_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 flow to delete. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * This field has no effect for flows with no incoming transitions. + * For flows with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the flow, as well as + * any transitions to the flow (i.e. Target + * flow EventHandler.target_flow in event handlers or Target + * flow TransitionRoute.target_flow in transition routes that point to + * this flow will be cleared). + */ + // const force = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callDeleteFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteFlow(request); + console.log(response); + } + + callDeleteFlow(); + // [END dialogflow_v3beta1_generated_Flows_DeleteFlow_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-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js new file mode 100644 index 000000000000..575831a3b79a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js @@ -0,0 +1,80 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_ExportFlow_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 flow to export. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the flow to. + * The format of this URI must be `gs:///`. If left + * unspecified, the serialized flow is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const flowUri = 'abc123' + /** + * Optional. Whether to export flows referenced by the specified flow. + */ + // const includeReferencedFlows = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callExportFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportFlow(); + // [END dialogflow_v3beta1_generated_Flows_ExportFlow_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-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js new file mode 100644 index 000000000000..a295b11dc140 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js @@ -0,0 +1,77 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_GetFlow_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 flow to get. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the flow for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callGetFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlow(request); + console.log(response); + } + + callGetFlow(); + // [END dialogflow_v3beta1_generated_Flows_GetFlow_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-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js new file mode 100644 index 000000000000..8775acb0b7bd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_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 flow name. + * Format: + * `projects//locations//agents//flows//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callGetFlowValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlowValidationResult(request); + console.log(response); + } + + callGetFlowValidationResult(); + // [END dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_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-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js new file mode 100644 index 000000000000..f60134d01d5d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js @@ -0,0 +1,87 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_ImportFlow_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 agent to import the flow into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import flow from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const flowUri = 'abc123' + /** + * Uncompressed raw byte content for flow. + */ + // const flowContent = Buffer.from('string') + /** + * Flow import mode. If not specified, `KEEP` is assumed. + */ + // const importOption = {} + /** + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + */ + // const flowImportStrategy = {} + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callImportFlow() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportFlow(); + // [END dialogflow_v3beta1_generated_Flows_ImportFlow_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-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js new file mode 100644 index 000000000000..34983f4b67a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js @@ -0,0 +1,87 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_ListFlows_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 agent containing the flows. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list flows for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callListFlows() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listFlowsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFlows(); + // [END dialogflow_v3beta1_generated_Flows_ListFlows_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-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js new file mode 100644 index 000000000000..628b20ce505e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js @@ -0,0 +1,64 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_TrainFlow_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 flow to train. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callTrainFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.trainFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTrainFlow(); + // [END dialogflow_v3beta1_generated_Flows_TrainFlow_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-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js new file mode 100644 index 000000000000..a68e2ade15d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js @@ -0,0 +1,79 @@ +// Copyright 2026 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(flow) { + // [START dialogflow_v3beta1_generated_Flows_UpdateFlow_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 flow to update. + */ + // const flow = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callUpdateFlow() { + // Construct request + const request = { + flow, + }; + + // Run request + const response = await cxClient.updateFlow(request); + console.log(response); + } + + callUpdateFlow(); + // [END dialogflow_v3beta1_generated_Flows_UpdateFlow_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-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js new file mode 100644 index 000000000000..94acc547c75f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Flows_ValidateFlow_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 flow to validate. + * Format: + * `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function callValidateFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateFlow(request); + console.log(response); + } + + callValidateFlow(); + // [END dialogflow_v3beta1_generated_Flows_ValidateFlow_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-dialogflow-cx/samples/generated/v3beta1/generators.create_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.create_generator.js new file mode 100644 index 000000000000..584541f76bda --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.create_generator.js @@ -0,0 +1,73 @@ +// Copyright 2026 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, generator) { + // [START dialogflow_v3beta1_generated_Generators_CreateGenerator_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 agent to create a generator for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The generator to create. + */ + // const generator = {} + /** + * The language to create generators for the following fields: + * * `Generator.prompt_text.text` + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callCreateGenerator() { + // Construct request + const request = { + parent, + generator, + }; + + // Run request + const response = await cxClient.createGenerator(request); + console.log(response); + } + + callCreateGenerator(); + // [END dialogflow_v3beta1_generated_Generators_CreateGenerator_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-dialogflow-cx/samples/generated/v3beta1/generators.delete_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.delete_generator.js new file mode 100644 index 000000000000..28aff2edd078 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.delete_generator.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Generators_DeleteGenerator_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 generator to delete. + * Format: + * `projects//locations//agents//generators/`. + */ + // const name = 'abc123' + /** + * This field has no effect for generators not being used. + * For generators that are used by pages/flows/transition route groups: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the generator, as well + * as any references to the generator (i.e. + * Generator Fulfillment.generator) in fulfillments. + */ + // const force = true + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callDeleteGenerator() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteGenerator(request); + console.log(response); + } + + callDeleteGenerator(); + // [END dialogflow_v3beta1_generated_Generators_DeleteGenerator_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-dialogflow-cx/samples/generated/v3beta1/generators.get_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.get_generator.js new file mode 100644 index 000000000000..a87c96634b41 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.get_generator.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Generators_GetGenerator_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 generator. + * Format: + * `projects//locations//agents//generators/`. + */ + // const name = 'abc123' + /** + * The language to list generators for. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callGetGenerator() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getGenerator(request); + console.log(response); + } + + callGetGenerator(); + // [END dialogflow_v3beta1_generated_Generators_GetGenerator_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-dialogflow-cx/samples/generated/v3beta1/generators.list_generators.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.list_generators.js new file mode 100644 index 000000000000..08475ea6545c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.list_generators.js @@ -0,0 +1,77 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Generators_ListGenerators_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 agent to list all generators for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list generators for. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callListGenerators() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listGeneratorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGenerators(); + // [END dialogflow_v3beta1_generated_Generators_ListGenerators_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-dialogflow-cx/samples/generated/v3beta1/generators.update_generator.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.update_generator.js new file mode 100644 index 000000000000..1c25aacf55d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/generators.update_generator.js @@ -0,0 +1,70 @@ +// Copyright 2026 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(generator) { + // [START dialogflow_v3beta1_generated_Generators_UpdateGenerator_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 generator to update. + */ + // const generator = {} + /** + * The language to list generators for. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {GeneratorsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new GeneratorsClient(); + + async function callUpdateGenerator() { + // Construct request + const request = { + generator, + }; + + // Run request + const response = await cxClient.updateGenerator(request); + console.log(response); + } + + callUpdateGenerator(); + // [END dialogflow_v3beta1_generated_Generators_UpdateGenerator_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-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js new file mode 100644 index 000000000000..2f3434e987db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js @@ -0,0 +1,77 @@ +// Copyright 2026 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, intent) { + // [START dialogflow_v3beta1_generated_Intents_CreateIntent_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 agent to create an intent for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The intent to create. + */ + // const intent = {} + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callCreateIntent() { + // Construct request + const request = { + parent, + intent, + }; + + // Run request + const response = await cxClient.createIntent(request); + console.log(response); + } + + callCreateIntent(); + // [END dialogflow_v3beta1_generated_Intents_CreateIntent_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-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js new file mode 100644 index 000000000000..dae6933ed2b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Intents_DeleteIntent_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 intent to delete. + * Format: + * `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callDeleteIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteIntent(request); + console.log(response); + } + + callDeleteIntent(); + // [END dialogflow_v3beta1_generated_Intents_DeleteIntent_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-dialogflow-cx/samples/generated/v3beta1/intents.export_intents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.export_intents.js new file mode 100644 index 000000000000..ee5e70b4f57a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.export_intents.js @@ -0,0 +1,91 @@ +// Copyright 2026 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, intents) { + // [START dialogflow_v3beta1_generated_Intents_ExportIntents_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 parent agent to export intents. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The name of the intents to export. + * Format: + * `projects//locations//agents//intents/`. + */ + // const intents = ['abc','def'] + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the + * intents to. The format of this URI must be + * `gs:///`. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const intentsUri = 'abc123' + /** + * Optional. The option to return the serialized intents inline. + */ + // const intentsContentInline = true + /** + * Optional. The data format of the exported intents. If not specified, `BLOB` + * is assumed. + */ + // const dataFormat = {} + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callExportIntents() { + // Construct request + const request = { + parent, + intents, + }; + + // Run request + const [operation] = await cxClient.exportIntents(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportIntents(); + // [END dialogflow_v3beta1_generated_Intents_ExportIntents_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-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js new file mode 100644 index 000000000000..8543d4264532 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Intents_GetIntent_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 intent. + * Format: + * `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the intent for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callGetIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getIntent(request); + console.log(response); + } + + callGetIntent(); + // [END dialogflow_v3beta1_generated_Intents_GetIntent_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-dialogflow-cx/samples/generated/v3beta1/intents.import_intents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.import_intents.js new file mode 100644 index 000000000000..77a7b33d13df --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.import_intents.js @@ -0,0 +1,82 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Intents_ImportIntents_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 agent to import the intents into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import intents from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const intentsUri = 'abc123' + /** + * Uncompressed byte content of intents. + */ + // const intentsContent = {} + /** + * Merge option for importing intents. If not specified, `REJECT` is assumed. + */ + // const mergeOption = {} + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callImportIntents() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importIntents(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportIntents(); + // [END dialogflow_v3beta1_generated_Intents_ImportIntents_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-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js new file mode 100644 index 000000000000..8220b534d19e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js @@ -0,0 +1,88 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Intents_ListIntents_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 agent to list all intents for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list intents for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The resource view to apply to the returned intent. + */ + // const intentView = {} + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callListIntents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listIntentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListIntents(); + // [END dialogflow_v3beta1_generated_Intents_ListIntents_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-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js new file mode 100644 index 000000000000..1532a39d8589 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js @@ -0,0 +1,76 @@ +// Copyright 2026 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(intent) { + // [START dialogflow_v3beta1_generated_Intents_UpdateIntent_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 intent to update. + */ + // const intent = {} + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function callUpdateIntent() { + // Construct request + const request = { + intent, + }; + + // Run request + const response = await cxClient.updateIntent(request); + console.log(response); + } + + callUpdateIntent(); + // [END dialogflow_v3beta1_generated_Intents_UpdateIntent_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-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js new file mode 100644 index 000000000000..aa282d393d9c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js @@ -0,0 +1,89 @@ +// Copyright 2026 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, page) { + // [START dialogflow_v3beta1_generated_Pages_CreatePage_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 flow to create a page for. + * Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The page to create. + */ + // const page = {} + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callCreatePage() { + // Construct request + const request = { + parent, + page, + }; + + // Run request + const response = await cxClient.createPage(request); + console.log(response); + } + + callCreatePage(); + // [END dialogflow_v3beta1_generated_Pages_CreatePage_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-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js new file mode 100644 index 000000000000..a277a594e229 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Pages_DeletePage_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 page to delete. + * Format: + * `projects//locations//agents//Flows//pages/`. + */ + // const name = 'abc123' + /** + * This field has no effect for pages with no incoming transitions. + * For pages with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the page, as well as + * any transitions to the page (i.e. Target + * page EventHandler.target_page in event handlers or Target + * page TransitionRoute.target_page in transition routes that point to + * this page will be cleared). + */ + // const force = true + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callDeletePage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePage(request); + console.log(response); + } + + callDeletePage(); + // [END dialogflow_v3beta1_generated_Pages_DeletePage_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-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js new file mode 100644 index 000000000000..d5ed1f8f9b0e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js @@ -0,0 +1,85 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Pages_GetPage_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 page. + * Format: + * `projects//locations//agents//flows//pages/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the page for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callGetPage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPage(request); + console.log(response); + } + + callGetPage(); + // [END dialogflow_v3beta1_generated_Pages_GetPage_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-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js new file mode 100644 index 000000000000..1fe67344a84f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js @@ -0,0 +1,96 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Pages_ListPages_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 flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The language to list pages for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callListPages() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listPagesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPages(); + // [END dialogflow_v3beta1_generated_Pages_ListPages_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-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js new file mode 100644 index 000000000000..50e8c53b4c3a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js @@ -0,0 +1,87 @@ +// Copyright 2026 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(page) { + // [START dialogflow_v3beta1_generated_Pages_UpdatePage_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 page to update. + */ + // const page = {} + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function callUpdatePage() { + // Construct request + const request = { + page, + }; + + // Run request + const response = await cxClient.updatePage(request); + console.log(response); + } + + callUpdatePage(); + // [END dialogflow_v3beta1_generated_Pages_UpdatePage_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-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook.js new file mode 100644 index 000000000000..dbc6943ef2ba --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, playbook) { + // [START dialogflow_v3beta1_generated_Playbooks_CreatePlaybook_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 agent to create a playbook for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The playbook to create. + */ + // const playbook = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callCreatePlaybook() { + // Construct request + const request = { + parent, + playbook, + }; + + // Run request + const response = await cxClient.createPlaybook(request); + console.log(response); + } + + callCreatePlaybook(); + // [END dialogflow_v3beta1_generated_Playbooks_CreatePlaybook_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-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook_version.js new file mode 100644 index 000000000000..93390dc55b73 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.create_playbook_version.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, playbookVersion) { + // [START dialogflow_v3beta1_generated_Playbooks_CreatePlaybookVersion_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 playbook to create a version for. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Required. The playbook version to create. + */ + // const playbookVersion = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callCreatePlaybookVersion() { + // Construct request + const request = { + parent, + playbookVersion, + }; + + // Run request + const response = await cxClient.createPlaybookVersion(request); + console.log(response); + } + + callCreatePlaybookVersion(); + // [END dialogflow_v3beta1_generated_Playbooks_CreatePlaybookVersion_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-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook.js new file mode 100644 index 000000000000..e2d93659b274 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_DeletePlaybook_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 playbook to delete. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callDeletePlaybook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePlaybook(request); + console.log(response); + } + + callDeletePlaybook(); + // [END dialogflow_v3beta1_generated_Playbooks_DeletePlaybook_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-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook_version.js new file mode 100644 index 000000000000..9937d629bae3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.delete_playbook_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_DeletePlaybookVersion_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 playbook version to delete. + * Format: + * `projects//locations//agents//playbooks//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callDeletePlaybookVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePlaybookVersion(request); + console.log(response); + } + + callDeletePlaybookVersion(); + // [END dialogflow_v3beta1_generated_Playbooks_DeletePlaybookVersion_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-dialogflow-cx/samples/generated/v3beta1/playbooks.export_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.export_playbook.js new file mode 100644 index 000000000000..5b6fd6121350 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.export_playbook.js @@ -0,0 +1,81 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_ExportPlaybook_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 playbook to export. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const name = 'abc123' + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the playbook + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized playbook is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const playbookUri = 'abc123' + /** + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + */ + // const dataFormat = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callExportPlaybook() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportPlaybook(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportPlaybook(); + // [END dialogflow_v3beta1_generated_Playbooks_ExportPlaybook_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-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook.js new file mode 100644 index 000000000000..886c97da2b54 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_GetPlaybook_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 playbook. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callGetPlaybook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPlaybook(request); + console.log(response); + } + + callGetPlaybook(); + // [END dialogflow_v3beta1_generated_Playbooks_GetPlaybook_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-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook_version.js new file mode 100644 index 000000000000..ebc866f96cf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.get_playbook_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_GetPlaybookVersion_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 playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callGetPlaybookVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPlaybookVersion(request); + console.log(response); + } + + callGetPlaybookVersion(); + // [END dialogflow_v3beta1_generated_Playbooks_GetPlaybookVersion_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-dialogflow-cx/samples/generated/v3beta1/playbooks.import_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.import_playbook.js new file mode 100644 index 000000000000..1cd3d342bd08 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.import_playbook.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_ImportPlaybook_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 agent to import the playbook into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Dialogflow access + * control + * (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const playbookUri = 'abc123' + /** + * Uncompressed raw byte content for playbook. + */ + // const playbookContent = Buffer.from('string') + /** + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + */ + // const importStrategy = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callImportPlaybook() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importPlaybook(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportPlaybook(); + // [END dialogflow_v3beta1_generated_Playbooks_ImportPlaybook_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-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbook_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbook_versions.js new file mode 100644 index 000000000000..afd825caa14d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbook_versions.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_ListPlaybookVersions_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 playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callListPlaybookVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listPlaybookVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPlaybookVersions(); + // [END dialogflow_v3beta1_generated_Playbooks_ListPlaybookVersions_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-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbooks.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbooks.js new file mode 100644 index 000000000000..11496f4d6820 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.list_playbooks.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_ListPlaybooks_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 agent to list playbooks from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callListPlaybooks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listPlaybooksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPlaybooks(); + // [END dialogflow_v3beta1_generated_Playbooks_ListPlaybooks_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-dialogflow-cx/samples/generated/v3beta1/playbooks.restore_playbook_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.restore_playbook_version.js new file mode 100644 index 000000000000..442db7be8858 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.restore_playbook_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Playbooks_RestorePlaybookVersion_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 playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callRestorePlaybookVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.restorePlaybookVersion(request); + console.log(response); + } + + callRestorePlaybookVersion(); + // [END dialogflow_v3beta1_generated_Playbooks_RestorePlaybookVersion_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-dialogflow-cx/samples/generated/v3beta1/playbooks.update_playbook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.update_playbook.js new file mode 100644 index 000000000000..614c50214bbc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/playbooks.update_playbook.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(playbook) { + // [START dialogflow_v3beta1_generated_Playbooks_UpdatePlaybook_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 playbook to update. + */ + // const playbook = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {PlaybooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PlaybooksClient(); + + async function callUpdatePlaybook() { + // Construct request + const request = { + playbook, + }; + + // Run request + const response = await cxClient.updatePlaybook(request); + console.log(response); + } + + callUpdatePlaybook(); + // [END dialogflow_v3beta1_generated_Playbooks_UpdatePlaybook_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-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js new file mode 100644 index 000000000000..d03d507456d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, securitySettings) { + // [START dialogflow_v3beta1_generated_SecuritySettingsService_CreateSecuritySettings_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 to create an + * SecuritySettings google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * for. Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The security settings to create. + */ + // const securitySettings = {} + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callCreateSecuritySettings() { + // Construct request + const request = { + parent, + securitySettings, + }; + + // Run request + const response = await cxClient.createSecuritySettings(request); + console.log(response); + } + + callCreateSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_CreateSecuritySettings_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-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js new file mode 100644 index 000000000000..8361ae7b177f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js @@ -0,0 +1,64 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_SecuritySettingsService_DeleteSecuritySettings_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 + * SecuritySettings google.cloud.dialogflow.cx.v3beta1.SecuritySettings to + * delete. Format: + * `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callDeleteSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSecuritySettings(request); + console.log(response); + } + + callDeleteSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_DeleteSecuritySettings_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-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js new file mode 100644 index 000000000000..15cc7f428a3a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_SecuritySettingsService_GetSecuritySettings_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. Resource name of the settings. + * Format: + * `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callGetSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSecuritySettings(request); + console.log(response); + } + + callGetSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_GetSecuritySettings_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-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js new file mode 100644 index 000000000000..5681f98d6dfc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_SecuritySettingsService_ListSecuritySettings_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 to list all security settings for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callListSecuritySettings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listSecuritySettingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_ListSecuritySettings_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-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js new file mode 100644 index 000000000000..692792f6de2c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js @@ -0,0 +1,68 @@ +// Copyright 2026 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(securitySettings, updateMask) { + // [START dialogflow_v3beta1_generated_SecuritySettingsService_UpdateSecuritySettings_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. SecuritySettings object that contains values for each of the + * fields to update. + */ + // const securitySettings = {} + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {SecuritySettingsServiceClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function callUpdateSecuritySettings() { + // Construct request + const request = { + securitySettings, + updateMask, + }; + + // Run request + const response = await cxClient.updateSecuritySettings(request); + console.log(response); + } + + callUpdateSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_UpdateSecuritySettings_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-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js new file mode 100644 index 000000000000..fd6b9051216a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js @@ -0,0 +1,72 @@ +// Copyright 2026 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, sessionEntityType) { + // [START dialogflow_v3beta1_generated_SessionEntityTypes_CreateSessionEntityType_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 session to create a session entity type for. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * Required. The session entity type to create. + */ + // const sessionEntityType = {} + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callCreateSessionEntityType() { + // Construct request + const request = { + parent, + sessionEntityType, + }; + + // Run request + const response = await cxClient.createSessionEntityType(request); + console.log(response); + } + + callCreateSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_CreateSessionEntityType_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-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js new file mode 100644 index 000000000000..713fa0aab9b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_SessionEntityTypes_DeleteSessionEntityType_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 session entity type to delete. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callDeleteSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSessionEntityType(request); + console.log(response); + } + + callDeleteSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_DeleteSessionEntityType_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-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js new file mode 100644 index 000000000000..395651ccf4c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js @@ -0,0 +1,67 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_SessionEntityTypes_GetSessionEntityType_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 session entity type. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callGetSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSessionEntityType(request); + console.log(response); + } + + callGetSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_GetSessionEntityType_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-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js new file mode 100644 index 000000000000..38c9509044da --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_SessionEntityTypes_ListSessionEntityTypes_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 session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callListSessionEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listSessionEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSessionEntityTypes(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_ListSessionEntityTypes_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-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js new file mode 100644 index 000000000000..4a8c7fe358a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js @@ -0,0 +1,71 @@ +// Copyright 2026 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(sessionEntityType) { + // [START dialogflow_v3beta1_generated_SessionEntityTypes_UpdateSessionEntityType_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 session entity type to update. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const sessionEntityType = {} + /** + * The mask to control which fields get updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function callUpdateSessionEntityType() { + // Construct request + const request = { + sessionEntityType, + }; + + // Run request + const response = await cxClient.updateSessionEntityType(request); + console.log(response); + } + + callUpdateSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_UpdateSessionEntityType_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-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js new file mode 100644 index 000000000000..4b65e2946242 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js @@ -0,0 +1,94 @@ +// Copyright 2026 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(session, queryInput) { + // [START dialogflow_v3beta1_generated_Sessions_DetectIntent_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 session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. It's up to the API caller to choose an appropriate `Session + * ID`. It can be a random number or some type of session identifiers + * (preferably hashed). The length of the `Session ID` must not exceed 36 + * characters. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See Versions and + * environments (https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = {} + /** + * Optional. Specifies which fields in the + * QueryResult google.cloud.dialogflow.cx.v3beta1.QueryResult to return. If + * not set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + */ + // const responseView = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callDetectIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.detectIntent(request); + console.log(response); + } + + callDetectIntent(); + // [END dialogflow_v3beta1_generated_Sessions_DetectIntent_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-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js new file mode 100644 index 000000000000..671021d08c35 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js @@ -0,0 +1,69 @@ +// Copyright 2026 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() { + // [START dialogflow_v3beta1_generated_Sessions_FulfillIntent_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. + */ + /** + * Must be same as the corresponding MatchIntent request, otherwise the + * behavior is undefined. + */ + // const matchIntentRequest = {} + /** + * The matched intent/event to fulfill. + */ + // const match = {} + /** + * Instructs the speech synthesizer how to generate output audio. + */ + // const outputAudioConfig = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callFulfillIntent() { + // Construct request + const request = { + }; + + // Run request + const response = await cxClient.fulfillIntent(request); + console.log(response); + } + + callFulfillIntent(); + // [END dialogflow_v3beta1_generated_Sessions_FulfillIntent_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-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js new file mode 100644 index 000000000000..f20d6b8f6f7e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js @@ -0,0 +1,85 @@ +// Copyright 2026 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(session, queryInput) { + // [START dialogflow_v3beta1_generated_Sessions_MatchIntent_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 session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Persist session parameter changes from `query_params`. + */ + // const persistParameterChanges = true + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callMatchIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.matchIntent(request); + console.log(response); + } + + callMatchIntent(); + // [END dialogflow_v3beta1_generated_Sessions_MatchIntent_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-dialogflow-cx/samples/generated/v3beta1/sessions.server_streaming_detect_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.server_streaming_detect_intent.js new file mode 100644 index 000000000000..9d815640d972 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.server_streaming_detect_intent.js @@ -0,0 +1,96 @@ +// Copyright 2026 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(session, queryInput) { + // [START dialogflow_v3beta1_generated_Sessions_ServerStreamingDetectIntent_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 session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. It's up to the API caller to choose an appropriate `Session + * ID`. It can be a random number or some type of session identifiers + * (preferably hashed). The length of the `Session ID` must not exceed 36 + * characters. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See Versions and + * environments (https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = {} + /** + * Optional. Specifies which fields in the + * QueryResult google.cloud.dialogflow.cx.v3beta1.QueryResult to return. If + * not set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + */ + // const responseView = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callServerStreamingDetectIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const stream = await cxClient.serverStreamingDetectIntent(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callServerStreamingDetectIntent(); + // [END dialogflow_v3beta1_generated_Sessions_ServerStreamingDetectIntent_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-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js new file mode 100644 index 000000000000..6184938198a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js @@ -0,0 +1,109 @@ +// Copyright 2026 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(queryInput) { + // [START dialogflow_v3beta1_generated_Sessions_StreamingDetectIntent_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. + */ + /** + * The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * Note: session must be set in the first request. + * For more information, see the sessions + * guide (https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See Versions and + * environments (https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = {} + /** + * Required. The input specification. + */ + // const queryInput = {} + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = {} + /** + * Enable partial detect intent response. If this flag is not enabled, + * response stream still contains only one final `DetectIntentResponse` even + * if some `Fulfillment`s in the agent have been configured to return partial + * responses. + */ + // const enablePartialResponse = true + /** + * If true, `StreamingDetectIntentResponse.debugging_info` will get populated. + */ + // const enableDebuggingInfo = true + /** + * Optional. Specifies which fields in the + * QueryResult google.cloud.dialogflow.cx.v3beta1.QueryResult to return. If + * not set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + */ + // const responseView = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callStreamingDetectIntent() { + // Construct request + const request = { + queryInput, + }; + + // Run request + const stream = await cxClient.streamingDetectIntent(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingDetectIntent(); + // [END dialogflow_v3beta1_generated_Sessions_StreamingDetectIntent_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-dialogflow-cx/samples/generated/v3beta1/sessions.submit_answer_feedback.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.submit_answer_feedback.js new file mode 100644 index 000000000000..686c48b1e5eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.submit_answer_feedback.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(session, responseId, answerFeedback) { + // [START dialogflow_v3beta1_generated_Sessions_SubmitAnswerFeedback_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 session the feedback was sent to. + */ + // const session = 'abc123' + /** + * Required. ID of the response to update its feedback. This is the same as + * DetectIntentResponse.response_id. + */ + // const responseId = 'abc123' + /** + * Required. Feedback provided for a bot answer. + */ + // const answerFeedback = {} + /** + * Optional. The mask to control which fields to update. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function callSubmitAnswerFeedback() { + // Construct request + const request = { + session, + responseId, + answerFeedback, + }; + + // Run request + const response = await cxClient.submitAnswerFeedback(request); + console.log(response); + } + + callSubmitAnswerFeedback(); + // [END dialogflow_v3beta1_generated_Sessions_SubmitAnswerFeedback_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-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js new file mode 100644 index 000000000000..e0150596c0ee --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, names) { + // [START dialogflow_v3beta1_generated_TestCases_BatchDeleteTestCases_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 agent to delete test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. Format of test case names: + * `projects//locations//agents//testCases/`. + */ + // const names = ['abc','def'] + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callBatchDeleteTestCases() { + // Construct request + const request = { + parent, + names, + }; + + // Run request + const response = await cxClient.batchDeleteTestCases(request); + console.log(response); + } + + callBatchDeleteTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_BatchDeleteTestCases_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-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js new file mode 100644 index 000000000000..537a9d80b09b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js @@ -0,0 +1,74 @@ +// Copyright 2026 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, testCases) { + // [START dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_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. Agent name. Format: + * `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Optional. If not set, draft environment is assumed. Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Required. Format: + * `projects//locations//agents//testCases/`. + */ + // const testCases = ['abc','def'] + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callBatchRunTestCases() { + // Construct request + const request = { + parent, + testCases, + }; + + // Run request + const [operation] = await cxClient.batchRunTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchRunTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_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-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js new file mode 100644 index 000000000000..3140c7f3601b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js @@ -0,0 +1,67 @@ +// Copyright 2026 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(agent, type) { + // [START dialogflow_v3beta1_generated_TestCases_CalculateCoverage_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 agent to calculate coverage for. + * Format: `projects//locations//agents/`. + */ + // const agent = 'abc123' + /** + * Required. The type of coverage requested. + */ + // const type = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callCalculateCoverage() { + // Construct request + const request = { + agent, + type, + }; + + // Run request + const response = await cxClient.calculateCoverage(request); + console.log(response); + } + + callCalculateCoverage(); + // [END dialogflow_v3beta1_generated_TestCases_CalculateCoverage_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-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js new file mode 100644 index 000000000000..1f684fadfca8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, testCase) { + // [START dialogflow_v3beta1_generated_TestCases_CreateTestCase_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 agent to create the test case for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The test case to create. + */ + // const testCase = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callCreateTestCase() { + // Construct request + const request = { + parent, + testCase, + }; + + // Run request + const response = await cxClient.createTestCase(request); + console.log(response); + } + + callCreateTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_CreateTestCase_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-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js new file mode 100644 index 000000000000..ca20c71ce73b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js @@ -0,0 +1,90 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TestCases_ExportTestCases_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 agent where to export test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI to + * export the test cases to. The format of this URI must be + * `gs:///`. If unspecified, the serialized test + * cases is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const gcsUri = 'abc123' + /** + * The data format of the exported test cases. If not specified, `BLOB` is + * assumed. + */ + // const dataFormat = {} + /** + * The filter expression used to filter exported test cases, see + * API Filtering (https://aip.dev/160). The expression is case insensitive + * and supports the following syntax: + * name = OR name = ... + * For example: + * * "name = t1 OR name = t2" matches the test case with the exact resource + * name "t1" or "t2". + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callExportTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.exportTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_ExportTestCases_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-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js new file mode 100644 index 000000000000..416bc814eacc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TestCases_GetTestCase_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 testcase. + * Format: + * `projects//locations//agents//testCases/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callGetTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCase(request); + console.log(response); + } + + callGetTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_GetTestCase_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-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js new file mode 100644 index 000000000000..aff931d8abec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TestCases_GetTestCaseResult_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 testcase. + * Format: + * `projects//locations//agents//testCases//results/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callGetTestCaseResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCaseResult(request); + console.log(response); + } + + callGetTestCaseResult(); + // [END dialogflow_v3beta1_generated_TestCases_GetTestCaseResult_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-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js new file mode 100644 index 000000000000..094d4dec6a2b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TestCases_ImportTestCases_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 agent to import test cases to. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * to import test cases from. The format of this URI must be + * `gs:///`. + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const gcsUri = 'abc123' + /** + * Uncompressed raw byte content for test cases. + */ + // const content = Buffer.from('string') + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callImportTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_ImportTestCases_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-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js new file mode 100644 index 000000000000..a0feae86916b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js @@ -0,0 +1,98 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TestCases_ListTestCaseResults_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 test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The filter expression used to filter test case results. See + * API Filtering (https://aip.dev/160). + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * AND ... + * AND latest + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * `latest` only returns the latest test result in all results for each test + * case. + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callListTestCaseResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listTestCaseResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTestCaseResults(); + // [END dialogflow_v3beta1_generated_TestCases_ListTestCaseResults_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-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js new file mode 100644 index 000000000000..d11f8335f215 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js @@ -0,0 +1,78 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TestCases_ListTestCases_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 agent to list all pages for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * Specifies whether response should include all fields or just the metadata. + */ + // const view = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callListTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listTestCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_ListTestCases_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-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js new file mode 100644 index 000000000000..db1d8253ddc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js @@ -0,0 +1,69 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TestCases_RunTestCase_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. Format of test case name to run: + * `projects//locations//agents//testCases/`. + */ + // const name = 'abc123' + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callRunTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.runTestCase(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_RunTestCase_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-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js new file mode 100644 index 000000000000..3328056a1e02 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js @@ -0,0 +1,70 @@ +// Copyright 2026 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(testCase, updateMask) { + // [START dialogflow_v3beta1_generated_TestCases_UpdateTestCase_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 test case to update. + */ + // const testCase = {} + /** + * Required. The mask to specify which fields should be updated. The + * `creationTime` google.cloud.dialogflow.cx.v3beta1.TestCase.creation_time + * and + * `lastTestResult` google.cloud.dialogflow.cx.v3beta1.TestCase.last_test_result + * cannot be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function callUpdateTestCase() { + // Construct request + const request = { + testCase, + updateMask, + }; + + // Run request + const response = await cxClient.updateTestCase(request); + console.log(response); + } + + callUpdateTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_UpdateTestCase_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-dialogflow-cx/samples/generated/v3beta1/tools.create_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.create_tool.js new file mode 100644 index 000000000000..17ac08f6996b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.create_tool.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, tool) { + // [START dialogflow_v3beta1_generated_Tools_CreateTool_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 agent to create a Tool for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The Tool to be created. + */ + // const tool = {} + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callCreateTool() { + // Construct request + const request = { + parent, + tool, + }; + + // Run request + const response = await cxClient.createTool(request); + console.log(response); + } + + callCreateTool(); + // [END dialogflow_v3beta1_generated_Tools_CreateTool_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-dialogflow-cx/samples/generated/v3beta1/tools.create_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.create_tool_version.js new file mode 100644 index 000000000000..6da8eaab88b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.create_tool_version.js @@ -0,0 +1,68 @@ +// Copyright 2026 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, toolVersion) { + // [START dialogflow_v3beta1_generated_Tools_CreateToolVersion_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 tool to create a version for. + * Format: + * `projects//locations//agents//tools/`. + */ + // const parent = 'abc123' + /** + * Required. The tool version to create. + */ + // const toolVersion = {} + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callCreateToolVersion() { + // Construct request + const request = { + parent, + toolVersion, + }; + + // Run request + const response = await cxClient.createToolVersion(request); + console.log(response); + } + + callCreateToolVersion(); + // [END dialogflow_v3beta1_generated_Tools_CreateToolVersion_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-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool.js new file mode 100644 index 000000000000..535a1a88cd72 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool.js @@ -0,0 +1,72 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Tools_DeleteTool_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 Tool to be deleted. + * Format: + * `projects//locations//agents//tools/`. + */ + // const name = 'abc123' + /** + * This field has no effect for Tools not being used. + * For Tools that are used: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + */ + // const force = true + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callDeleteTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteTool(request); + console.log(response); + } + + callDeleteTool(); + // [END dialogflow_v3beta1_generated_Tools_DeleteTool_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-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool_version.js new file mode 100644 index 000000000000..32b2e0a0d89c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.delete_tool_version.js @@ -0,0 +1,72 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Tools_DeleteToolVersion_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 tool version to delete. + * Format: + * `projects//locations//agents//tools//versions/`. + */ + // const name = 'abc123' + /** + * Optional. This field has no effect for Tools not being used. + * For Tools that are used: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + */ + // const force = true + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callDeleteToolVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteToolVersion(request); + console.log(response); + } + + callDeleteToolVersion(); + // [END dialogflow_v3beta1_generated_Tools_DeleteToolVersion_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-dialogflow-cx/samples/generated/v3beta1/tools.export_tools.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.export_tools.js new file mode 100644 index 000000000000..955075ea4f80 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.export_tools.js @@ -0,0 +1,90 @@ +// Copyright 2026 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, tools) { + // [START dialogflow_v3beta1_generated_Tools_ExportTools_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 agent to export tools from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The name of the tools to export. + * Format: + * `projects//locations//agents//tools/`. + */ + // const tools = ['abc','def'] + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to export the tools + * to. The format of this URI must be `gs:///`. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * Dialogflow access + * control (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ + // const toolsUri = 'abc123' + /** + * Optional. The option to return the serialized tools inline. + */ + // const toolsContentInline = true + /** + * Optional. The data format of the exported tools. If not specified, `BLOB` + * is assumed. + */ + // const dataFormat = {} + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callExportTools() { + // Construct request + const request = { + parent, + tools, + }; + + // Run request + const [operation] = await cxClient.exportTools(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportTools(); + // [END dialogflow_v3beta1_generated_Tools_ExportTools_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-dialogflow-cx/samples/generated/v3beta1/tools.get_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.get_tool.js new file mode 100644 index 000000000000..2ecfe27d6392 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.get_tool.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Tools_GetTool_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 Tool. + * Format: + * `projects//locations//agents//tools/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callGetTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTool(request); + console.log(response); + } + + callGetTool(); + // [END dialogflow_v3beta1_generated_Tools_GetTool_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-dialogflow-cx/samples/generated/v3beta1/tools.get_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.get_tool_version.js new file mode 100644 index 000000000000..ddb4e7c5b785 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.get_tool_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Tools_GetToolVersion_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 tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callGetToolVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getToolVersion(request); + console.log(response); + } + + callGetToolVersion(); + // [END dialogflow_v3beta1_generated_Tools_GetToolVersion_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-dialogflow-cx/samples/generated/v3beta1/tools.list_tool_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.list_tool_versions.js new file mode 100644 index 000000000000..9c84b9b5d975 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.list_tool_versions.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Tools_ListToolVersions_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 of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callListToolVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listToolVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListToolVersions(); + // [END dialogflow_v3beta1_generated_Tools_ListToolVersions_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-dialogflow-cx/samples/generated/v3beta1/tools.list_tools.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.list_tools.js new file mode 100644 index 000000000000..a9b785636e36 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.list_tools.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Tools_ListTools_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 agent to list the Tools from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callListTools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listToolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTools(); + // [END dialogflow_v3beta1_generated_Tools_ListTools_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-dialogflow-cx/samples/generated/v3beta1/tools.restore_tool_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.restore_tool_version.js new file mode 100644 index 000000000000..4c953e9823c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.restore_tool_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Tools_RestoreToolVersion_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 tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callRestoreToolVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.restoreToolVersion(request); + console.log(response); + } + + callRestoreToolVersion(); + // [END dialogflow_v3beta1_generated_Tools_RestoreToolVersion_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-dialogflow-cx/samples/generated/v3beta1/tools.update_tool.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.update_tool.js new file mode 100644 index 000000000000..a093f8e0e6ca --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/tools.update_tool.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(tool) { + // [START dialogflow_v3beta1_generated_Tools_UpdateTool_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 Tool to be updated. + */ + // const tool = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {ToolsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ToolsClient(); + + async function callUpdateTool() { + // Construct request + const request = { + tool, + }; + + // Run request + const response = await cxClient.updateTool(request); + console.log(response); + } + + callUpdateTool(); + // [END dialogflow_v3beta1_generated_Tools_UpdateTool_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-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js new file mode 100644 index 000000000000..15cda44f22f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js @@ -0,0 +1,83 @@ +// Copyright 2026 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, transitionRouteGroup) { + // [START dialogflow_v3beta1_generated_TransitionRouteGroups_CreateTransitionRouteGroup_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 flow to create an + * TransitionRouteGroup google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * for. Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/` + * for agent-level groups. + */ + // const parent = 'abc123' + /** + * Required. The transition route group to create. + */ + // const transitionRouteGroup = {} + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callCreateTransitionRouteGroup() { + // Construct request + const request = { + parent, + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.createTransitionRouteGroup(request); + console.log(response); + } + + callCreateTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_CreateTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js new file mode 100644 index 000000000000..ad4eca5218f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_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 + * TransitionRouteGroup google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + * to delete. Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * This field has no effect for transition route group that no page is using. + * If the transition route group is referenced by any page: + * * If `force` is set to false, an error will be returned with message + * indicating pages that reference the transition route group. + * * If `force` is set to true, Dialogflow will remove the transition route + * group, as well as any reference to it. + */ + // const force = true + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callDeleteTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteTransitionRouteGroup(request); + console.log(response); + } + + callDeleteTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js new file mode 100644 index 000000000000..9955881b8f69 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js @@ -0,0 +1,79 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TransitionRouteGroups_GetTransitionRouteGroup_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 + * TransitionRouteGroup google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup. + * Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the transition route group for. The following + * fields are language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callGetTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTransitionRouteGroup(request); + console.log(response); + } + + callGetTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_GetTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js new file mode 100644 index 000000000000..c0eadcd3e622 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js @@ -0,0 +1,88 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_TransitionRouteGroups_ListTransitionRouteGroups_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 flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list transition route groups for. The following fields are + * language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callListTransitionRouteGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listTransitionRouteGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransitionRouteGroups(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_ListTransitionRouteGroups_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-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js new file mode 100644 index 000000000000..5c3871aef8df --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(transitionRouteGroup) { + // [START dialogflow_v3beta1_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_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 transition route group to update. + */ + // const transitionRouteGroup = {} + /** + * The mask to control which fields get updated. + */ + // const updateMask = {} + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function callUpdateTransitionRouteGroup() { + // Construct request + const request = { + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.updateTransitionRouteGroup(request); + console.log(response); + } + + callUpdateTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_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-dialogflow-cx/samples/generated/v3beta1/versions.compare_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.compare_versions.js new file mode 100644 index 000000000000..c9df07d05f62 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.compare_versions.js @@ -0,0 +1,81 @@ +// Copyright 2026 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(baseVersion, targetVersion) { + // [START dialogflow_v3beta1_generated_Versions_CompareVersions_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. Name of the base flow version to compare with the target version. + * Use version ID `0` to indicate the draft version of the specified flow. + * Format: + * `projects//locations//agents//flows//versions/`. + */ + // const baseVersion = 'abc123' + /** + * Required. Name of the target flow version to compare with the + * base version. Use version ID `0` to indicate the draft version of the + * specified flow. Format: + * `projects//locations//agents//flows//versions/`. + */ + // const targetVersion = 'abc123' + /** + * The language to compare the flow versions for. + * If not specified, the agent's default language is used. + * Many + * languages (https://cloud.google.com/dialogflow/docs/reference/language) are + * supported. Note: languages must be enabled in the agent before they can be + * used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callCompareVersions() { + // Construct request + const request = { + baseVersion, + targetVersion, + }; + + // Run request + const response = await cxClient.compareVersions(request); + console.log(response); + } + + callCompareVersions(); + // [END dialogflow_v3beta1_generated_Versions_CompareVersions_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-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js new file mode 100644 index 000000000000..ba209b19d9ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js @@ -0,0 +1,69 @@ +// Copyright 2026 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, version) { + // [START dialogflow_v3beta1_generated_Versions_CreateVersion_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 Flow google.cloud.dialogflow.cx.v3beta1.Flow to create an + * Version google.cloud.dialogflow.cx.v3beta1.Version for. Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The version to create. + */ + // const version = {} + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callCreateVersion() { + // Construct request + const request = { + parent, + version, + }; + + // Run request + const [operation] = await cxClient.createVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateVersion(); + // [END dialogflow_v3beta1_generated_Versions_CreateVersion_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-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js new file mode 100644 index 000000000000..5effa4024d3d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Versions_DeleteVersion_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 + * Version google.cloud.dialogflow.cx.v3beta1.Version to delete. Format: + * `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callDeleteVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteVersion(request); + console.log(response); + } + + callDeleteVersion(); + // [END dialogflow_v3beta1_generated_Versions_DeleteVersion_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-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js new file mode 100644 index 000000000000..879cac480f84 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Versions_GetVersion_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 + * Version google.cloud.dialogflow.cx.v3beta1.Version. Format: + * `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callGetVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getVersion(request); + console.log(response); + } + + callGetVersion(); + // [END dialogflow_v3beta1_generated_Versions_GetVersion_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-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js new file mode 100644 index 000000000000..629f048f8237 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js @@ -0,0 +1,74 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Versions_ListVersions_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 Flow google.cloud.dialogflow.cx.v3beta1.Flow to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callListVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVersions(); + // [END dialogflow_v3beta1_generated_Versions_ListVersions_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-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js new file mode 100644 index 000000000000..10209bfb0921 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js @@ -0,0 +1,71 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Versions_LoadVersion_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 Version google.cloud.dialogflow.cx.v3beta1.Version to be + * loaded to draft flow. Format: + * `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + /** + * This field is used to prevent accidental overwrite of other agent + * resources, which can potentially impact other flow's behavior. If + * `allow_override_agent_resources` is false, conflicted agent-level resources + * will not be overridden (i.e. intents, entities, webhooks). + */ + // const allowOverrideAgentResources = true + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callLoadVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.loadVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLoadVersion(); + // [END dialogflow_v3beta1_generated_Versions_LoadVersion_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-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js new file mode 100644 index 000000000000..ea0c6498c601 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js @@ -0,0 +1,67 @@ +// Copyright 2026 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(version, updateMask) { + // [START dialogflow_v3beta1_generated_Versions_UpdateVersion_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 version to update. + */ + // const version = {} + /** + * Required. The mask to control which fields get updated. Currently only + * `description` and `display_name` can be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function callUpdateVersion() { + // Construct request + const request = { + version, + updateMask, + }; + + // Run request + const response = await cxClient.updateVersion(request); + console.log(response); + } + + callUpdateVersion(); + // [END dialogflow_v3beta1_generated_Versions_UpdateVersion_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-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js new file mode 100644 index 000000000000..371dcbe0f1d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js @@ -0,0 +1,67 @@ +// Copyright 2026 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, webhook) { + // [START dialogflow_v3beta1_generated_Webhooks_CreateWebhook_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 agent to create a webhook for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The webhook to create. + */ + // const webhook = {} + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callCreateWebhook() { + // Construct request + const request = { + parent, + webhook, + }; + + // Run request + const response = await cxClient.createWebhook(request); + console.log(response); + } + + callCreateWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_CreateWebhook_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-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js new file mode 100644 index 000000000000..32c66f2da99e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js @@ -0,0 +1,75 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Webhooks_DeleteWebhook_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 webhook to delete. + * Format: + * `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + /** + * This field has no effect for webhook not being used. + * For webhooks that are used by pages/flows/transition route groups: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the webhook, as well + * as any references to the webhook (i.e. + * Webhook google.cloud.dialogflow.cx.v3beta1.Fulfillment.webhook and + * tag google.cloud.dialogflow.cx.v3beta1.Fulfillment.tag in fulfillments + * that point to this webhook will be removed). + */ + // const force = true + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callDeleteWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteWebhook(request); + console.log(response); + } + + callDeleteWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_DeleteWebhook_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-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js new file mode 100644 index 000000000000..112b39d1b9d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js @@ -0,0 +1,63 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Webhooks_GetWebhook_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 webhook. + * Format: + * `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callGetWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getWebhook(request); + console.log(response); + } + + callGetWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_GetWebhook_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-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js new file mode 100644 index 000000000000..76cd43d71693 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js @@ -0,0 +1,73 @@ +// Copyright 2026 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 dialogflow_v3beta1_generated_Webhooks_ListWebhooks_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 agent to list all webhooks for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callListWebhooks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cxClient.listWebhooksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWebhooks(); + // [END dialogflow_v3beta1_generated_Webhooks_ListWebhooks_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-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js new file mode 100644 index 000000000000..66b000255a4f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js @@ -0,0 +1,66 @@ +// Copyright 2026 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(webhook) { + // [START dialogflow_v3beta1_generated_Webhooks_UpdateWebhook_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 webhook to update. + */ + // const webhook = {} + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = {} + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function callUpdateWebhook() { + // Construct request + const request = { + webhook, + }; + + // Run request + const response = await cxClient.updateWebhook(request); + console.log(response); + } + + callUpdateWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_UpdateWebhook_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-dialogflow-cx/src/index.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/index.ts new file mode 100644 index 000000000000..f445270e0ab5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/index.ts @@ -0,0 +1,66 @@ +// Copyright 2026 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v3 from './v3'; +import * as v3beta1 from './v3beta1'; + +const AgentsClient = v3.AgentsClient; +type AgentsClient = v3.AgentsClient; +const ChangelogsClient = v3.ChangelogsClient; +type ChangelogsClient = v3.ChangelogsClient; +const DeploymentsClient = v3.DeploymentsClient; +type DeploymentsClient = v3.DeploymentsClient; +const EntityTypesClient = v3.EntityTypesClient; +type EntityTypesClient = v3.EntityTypesClient; +const EnvironmentsClient = v3.EnvironmentsClient; +type EnvironmentsClient = v3.EnvironmentsClient; +const ExamplesClient = v3.ExamplesClient; +type ExamplesClient = v3.ExamplesClient; +const ExperimentsClient = v3.ExperimentsClient; +type ExperimentsClient = v3.ExperimentsClient; +const FlowsClient = v3.FlowsClient; +type FlowsClient = v3.FlowsClient; +const GeneratorsClient = v3.GeneratorsClient; +type GeneratorsClient = v3.GeneratorsClient; +const IntentsClient = v3.IntentsClient; +type IntentsClient = v3.IntentsClient; +const PagesClient = v3.PagesClient; +type PagesClient = v3.PagesClient; +const PlaybooksClient = v3.PlaybooksClient; +type PlaybooksClient = v3.PlaybooksClient; +const SecuritySettingsServiceClient = v3.SecuritySettingsServiceClient; +type SecuritySettingsServiceClient = v3.SecuritySettingsServiceClient; +const SessionEntityTypesClient = v3.SessionEntityTypesClient; +type SessionEntityTypesClient = v3.SessionEntityTypesClient; +const SessionsClient = v3.SessionsClient; +type SessionsClient = v3.SessionsClient; +const TestCasesClient = v3.TestCasesClient; +type TestCasesClient = v3.TestCasesClient; +const ToolsClient = v3.ToolsClient; +type ToolsClient = v3.ToolsClient; +const TransitionRouteGroupsClient = v3.TransitionRouteGroupsClient; +type TransitionRouteGroupsClient = v3.TransitionRouteGroupsClient; +const VersionsClient = v3.VersionsClient; +type VersionsClient = v3.VersionsClient; +const WebhooksClient = v3.WebhooksClient; +type WebhooksClient = v3.WebhooksClient; + +export {v3, v3beta1, AgentsClient, ChangelogsClient, DeploymentsClient, EntityTypesClient, EnvironmentsClient, ExamplesClient, ExperimentsClient, FlowsClient, GeneratorsClient, IntentsClient, PagesClient, PlaybooksClient, SecuritySettingsServiceClient, SessionEntityTypesClient, SessionsClient, TestCasesClient, ToolsClient, TransitionRouteGroupsClient, VersionsClient, WebhooksClient}; +export default {v3, v3beta1, AgentsClient, ChangelogsClient, DeploymentsClient, EntityTypesClient, EnvironmentsClient, ExamplesClient, ExperimentsClient, FlowsClient, GeneratorsClient, IntentsClient, PagesClient, PlaybooksClient, SecuritySettingsServiceClient, SessionEntityTypesClient, SessionsClient, TestCasesClient, ToolsClient, TransitionRouteGroupsClient, VersionsClient, WebhooksClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_client.ts new file mode 100644 index 000000000000..447ef2c35874 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_client.ts @@ -0,0 +1,4878 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/agents_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './agents_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agents}. + * @class + * @memberof v3 + */ +export class AgentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + agentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of AgentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 AgentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AgentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listAgents: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'agents', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const exportAgentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportAgentResponse', + ) as gax.protobuf.Type; + const exportAgentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const restoreAgentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const restoreAgentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportAgent: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAgentResponse.decode.bind(exportAgentResponse), + exportAgentMetadata.decode.bind(exportAgentMetadata), + ), + restoreAgent: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreAgentResponse.decode.bind(restoreAgentResponse), + restoreAgentMetadata.decode.bind(restoreAgentMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Agents', + 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.agentsStub) { + return this.agentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Agents. + this.agentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Agents', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Agents, + 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 agentsStubMethods = [ + 'listAgents', + 'getAgent', + 'createAgent', + 'updateAgent', + 'deleteAgent', + 'exportAgent', + 'restoreAgent', + 'validateAgent', + 'getAgentValidationResult', + 'getGenerativeSettings', + 'updateGenerativeSettings', + ]; + for (const methodName of agentsStubMethods) { + const callPromise = this.agentsStub.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.agentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent. + * Format: `projects//locations//agents/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.get_agent.js + * region_tag:dialogflow_v3_generated_Agents_GetAgent_async + */ + getAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest | undefined, + {} | undefined, + ] + >; + getAgent( + request: protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest | null | undefined, + {} | null | undefined + >, + ): void; + getAgent( + request: protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest | null | undefined, + {} | null | undefined + >, + ): void; + getAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IGetAgentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an agent in the specified location. + * + * Note: You should always train flows prior to sending them queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to create a agent for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.cx.v3.Agent} request.agent + * Required. The agent 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 {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.create_agent.js + * region_tag:dialogflow_v3_generated_Agents_CreateAgent_async + */ + createAgent( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest | undefined, + {} | undefined, + ] + >; + createAgent( + request: protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAgent( + request: protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAgent( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.ICreateAgentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified agent. + * + * Note: You should always train flows prior to sending them queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Agent} request.agent + * Required. The agent to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.update_agent.js + * region_tag:dialogflow_v3_generated_Agents_UpdateAgent_async + */ + updateAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest | undefined, + {} | undefined, + ] + >; + updateAgent( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAgent( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest | 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({ + 'agent.name': request.agent!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IAgent, + protos.google.cloud.dialogflow.cx.v3.IUpdateAgentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent to delete. + * Format: `projects//locations//agents/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.delete_agent.js + * region_tag:dialogflow_v3_generated_Agents_DeleteAgent_async + */ + deleteAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest | undefined, + {} | undefined, + ] + >; + deleteAgent( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAgent( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteAgentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Validates the specified agent and creates or updates validation results. + * The agent in draft version is validated. Please call this API after the + * training is completed to get the complete validation results. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The agent to validate. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.AgentValidationResult|AgentValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.validate_agent.js + * region_tag:dialogflow_v3_generated_Agents_ValidateAgent_async + */ + validateAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest | undefined, + {} | undefined, + ] + >; + validateAgent( + request: protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateAgent( + request: protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('validateAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .validateAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IValidateAgentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('validateAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the latest agent validation result. Agent validation is performed + * when ValidateAgent is called. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The agent name. + * Format: + * `projects//locations//agents//validationResult`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.AgentValidationResult|AgentValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.get_agent_validation_result.js + * region_tag:dialogflow_v3_generated_Agents_GetAgentValidationResult_async + */ + getAgentValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | undefined + ), + {} | undefined, + ] + >; + getAgentValidationResult( + request: protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAgentValidationResult( + request: protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAgentValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getAgentValidationResult request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAgentValidationResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAgentValidationResult(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetAgentValidationResultRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAgentValidationResult response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the generative settings for the agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format: + * `projects//locations//agents//generativeSettings`. + * @param {string} request.languageCode + * Required. Language code of the generative settings. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.GenerativeSettings|GenerativeSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.get_generative_settings.js + * region_tag:dialogflow_v3_generated_Agents_GetGenerativeSettings_async + */ + getGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + getGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getGenerativeSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGenerativeSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getGenerativeSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getGenerativeSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the generative settings for the agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.GenerativeSettings} request.generativeSettings + * Required. Generative settings to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.GenerativeSettings|GenerativeSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.update_generative_settings.js + * region_tag:dialogflow_v3_generated_Agents_UpdateGenerativeSettings_async + */ + updateGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + updateGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | 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({ + 'generative_settings.name': request.generativeSettings!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateGenerativeSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGenerativeSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateGenerativeSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateGenerativeSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Exports the specified agent to a binary file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.ExportAgentResponse|ExportAgentResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent to export. + * Format: `projects//locations//agents/`. + * @param {string} [request.agentUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + * @param {string} [request.environment] + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + * @param {google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination} [request.gitDestination] + * Optional. The Git branch to export the agent to. + * @param {boolean} [request.includeBigqueryExportSettings] + * Optional. Whether to include BigQuery Export setting. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.export_agent.js + * region_tag:dialogflow_v3_generated_Agents_ExportAgent_async + */ + exportAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IExportAgentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportAgent( + request: protos.google.cloud.dialogflow.cx.v3.IExportAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportAgent( + request: protos.google.cloud.dialogflow.cx.v3.IExportAgentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IExportAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportAgent response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportAgent request %j', request); + return this.innerApiCalls + .exportAgent(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportAgent response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportAgent()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.export_agent.js + * region_tag:dialogflow_v3_generated_Agents_ExportAgent_async + */ + async checkExportAgentProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportAgentResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('exportAgent long-running'); + 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.exportAgent, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportAgentResponse, + protos.google.protobuf.Struct + >; + } + /** + * Restores the specified agent from a binary file. + * + * Replaces the current agent with a new one. Note that all existing resources + * in agent (e.g. intents, entity types, flows) will be removed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train flows prior to sending them queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent to restore into. + * Format: `projects//locations//agents/`. + * @param {string} request.agentUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to restore agent from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.agentContent + * Uncompressed raw byte content for agent. + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource} request.gitSource + * Setting for restoring from a git branch + * @param {google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption} request.restoreOption + * Agent restore mode. If not specified, `KEEP` is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.restore_agent.js + * region_tag:dialogflow_v3_generated_Agents_RestoreAgent_async + */ + restoreAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IRestoreAgentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + restoreAgent( + request: protos.google.cloud.dialogflow.cx.v3.IRestoreAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreAgent( + request: protos.google.cloud.dialogflow.cx.v3.IRestoreAgentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreAgent( + request?: protos.google.cloud.dialogflow.cx.v3.IRestoreAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreAgent response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreAgent request %j', request); + return this.innerApiCalls + .restoreAgent(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreAgent response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `restoreAgent()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.restore_agent.js + * region_tag:dialogflow_v3_generated_Agents_RestoreAgent_async + */ + async checkRestoreAgentProgress( + name: string, + ): Promise< + LROperation + > { + this._log.info('restoreAgent long-running'); + 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.restoreAgent, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } + /** + * Returns the list of all agents in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all agents for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent}. + * 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 `listAgentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAgents( + request?: protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent[], + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse, + ] + >; + listAgents( + request: protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IAgent + >, + ): void; + listAgents( + request: protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IAgent + >, + ): void; + listAgents( + request?: protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IAgent + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IAgent + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAgent[], + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IAgent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAgents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAgents request %j', request); + return this.innerApiCalls + .listAgents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IAgent[], + protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListAgentsResponse, + ]) => { + this._log.info('listAgents values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listAgents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all agents for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent} 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 `listAgentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAgentsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAgents stream %j', request); + return this.descriptors.page.listAgents.createStream( + this.innerApiCalls.listAgents as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listAgents`, 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 location to list all agents for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/agents.list_agents.js + * region_tag:dialogflow_v3_generated_Agents_ListAgents_async + */ + listAgentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAgents iterate %j', request); + return this.descriptors.page.listAgents.asyncIterate( + this.innerApiCalls['listAgents'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.agentsStub && !this._terminated) { + return this.agentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_client_config.json new file mode 100644 index 000000000000..c8dedc5a22e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Agents": { + "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 + } + }, + "methods": { + "ListAgents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateAgent": { + "timeout_millis": 180000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RestoreAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetAgentValidationResult": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetGenerativeSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateGenerativeSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/agents_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_client.ts new file mode 100644 index 000000000000..ca322c2f6f48 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_client.ts @@ -0,0 +1,3510 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/changelogs_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './changelogs_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Changelog|Changelogs}. + * @class + * @memberof v3 + */ +export class ChangelogsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + changelogsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ChangelogsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ChangelogsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ChangelogsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listChangelogs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'changelogs', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Changelogs', + 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.changelogsStub) { + return this.changelogsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Changelogs. + this.changelogsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Changelogs', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Changelogs, + 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 changelogsStubMethods = ['listChangelogs', 'getChangelog']; + for (const methodName of changelogsStubMethods) { + const callPromise = this.changelogsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.changelogsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified Changelog. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the changelog to get. + * Format: + * `projects//locations//agents//changelogs/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Changelog|Changelog}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/changelogs.get_changelog.js + * region_tag:dialogflow_v3_generated_Changelogs_GetChangelog_async + */ + getChangelog( + request?: protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IChangelog, + protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest | undefined, + {} | undefined, + ] + >; + getChangelog( + request: protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IChangelog, + | protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getChangelog( + request: protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IChangelog, + | protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getChangelog( + request?: protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IChangelog, + | protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IChangelog, + | protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IChangelog, + protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getChangelog request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IChangelog, + | protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChangelog response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getChangelog(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IChangelog, + protos.google.cloud.dialogflow.cx.v3.IGetChangelogRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getChangelog response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of Changelogs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the changelogs. + * Format: `projects//locations//agents/`. + * @param {string} request.filter + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Changelog|Changelog}. + * 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 `listChangelogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listChangelogs( + request?: protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IChangelog[], + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse, + ] + >; + listChangelogs( + request: protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IChangelog + >, + ): void; + listChangelogs( + request: protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IChangelog + >, + ): void; + listChangelogs( + request?: protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IChangelog + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IChangelog + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IChangelog[], + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IChangelog + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChangelogs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChangelogs request %j', request); + return this.innerApiCalls + .listChangelogs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IChangelog[], + protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListChangelogsResponse, + ]) => { + this._log.info('listChangelogs values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listChangelogs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the changelogs. + * Format: `projects//locations//agents/`. + * @param {string} request.filter + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Changelog|Changelog} 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 `listChangelogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listChangelogsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listChangelogs stream %j', request); + return this.descriptors.page.listChangelogs.createStream( + this.innerApiCalls.listChangelogs as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listChangelogs`, 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 agent containing the changelogs. + * Format: `projects//locations//agents/`. + * @param {string} request.filter + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Changelog|Changelog}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/changelogs.list_changelogs.js + * region_tag:dialogflow_v3_generated_Changelogs_ListChangelogs_async + */ + listChangelogsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listChangelogs iterate %j', request); + return this.descriptors.page.listChangelogs.asyncIterate( + this.innerApiCalls['listChangelogs'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.changelogsStub && !this._terminated) { + return this.changelogsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_client_config.json new file mode 100644 index 000000000000..440b52442960 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Changelogs": { + "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 + } + }, + "methods": { + "ListChangelogs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetChangelog": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/changelogs_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_client.ts new file mode 100644 index 000000000000..7c06301a18fb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_client.ts @@ -0,0 +1,3455 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/deployments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './deployments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Deployment|Deployments}. + * @class + * @memberof v3 + */ +export class DeploymentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + deploymentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of DeploymentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 DeploymentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DeploymentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'deployments', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Deployments', + 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.deploymentsStub) { + return this.deploymentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Deployments. + this.deploymentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Deployments', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Deployments, + 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 deploymentsStubMethods = ['listDeployments', 'getDeployment']; + for (const methodName of deploymentsStubMethods) { + const callPromise = this.deploymentsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.deploymentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Deployment|Deployment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.Deployment|Deployment}. Format: + * `projects//locations//agents//environments//deployments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Deployment|Deployment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/deployments.get_deployment.js + * region_tag:dialogflow_v3_generated_Deployments_GetDeployment_async + */ + getDeployment( + request?: protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IDeployment, + protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest | undefined, + {} | undefined, + ] + >; + getDeployment( + request: protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IDeployment, + | protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getDeployment( + request: protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IDeployment, + | protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getDeployment( + request?: protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IDeployment, + | protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IDeployment, + | protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IDeployment, + protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IDeployment, + | protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IDeployment, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetDeploymentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDeployment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all deployments in the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Deployment|Deployment}. + * 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 `listDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDeployments( + request?: protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IDeployment[], + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse, + ] + >; + listDeployments( + request: protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IDeployment + >, + ): void; + listDeployments( + request: protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IDeployment + >, + ): void; + listDeployments( + request?: protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IDeployment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IDeployment[], + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IDeployment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDeployments request %j', request); + return this.innerApiCalls + .listDeployments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IDeployment[], + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListDeploymentsResponse, + ]) => { + this._log.info('listDeployments values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listDeployments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Deployment|Deployment} 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 `listDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDeploymentsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDeployments stream %j', request); + return this.descriptors.page.listDeployments.createStream( + this.innerApiCalls.listDeployments as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listDeployments`, 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 {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Deployment|Deployment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/deployments.list_deployments.js + * region_tag:dialogflow_v3_generated_Deployments_ListDeployments_async + */ + listDeploymentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDeployments iterate %j', request); + return this.descriptors.page.listDeployments.asyncIterate( + this.innerApiCalls['listDeployments'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.deploymentsStub && !this._terminated) { + return this.deploymentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_client_config.json new file mode 100644 index 000000000000..d3047f2c75e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Deployments": { + "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 + } + }, + "methods": { + "ListDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/deployments_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_client.ts new file mode 100644 index 000000000000..372756eb7178 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_client.ts @@ -0,0 +1,4400 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/entity_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './entity_types_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.EntityType|EntityTypes}. + * @class + * @memberof v3 + */ +export class EntityTypesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + entityTypesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of EntityTypesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 EntityTypesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EntityTypesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listEntityTypes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'entityTypes', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const exportEntityTypesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse', + ) as gax.protobuf.Type; + const exportEntityTypesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata', + ) as gax.protobuf.Type; + const importEntityTypesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse', + ) as gax.protobuf.Type; + const importEntityTypesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportEntityTypes: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportEntityTypesResponse.decode.bind(exportEntityTypesResponse), + exportEntityTypesMetadata.decode.bind(exportEntityTypesMetadata), + ), + importEntityTypes: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importEntityTypesResponse.decode.bind(importEntityTypesResponse), + importEntityTypesMetadata.decode.bind(importEntityTypesMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.EntityTypes', + 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.entityTypesStub) { + return this.entityTypesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.EntityTypes. + this.entityTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.EntityTypes', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.EntityTypes, + 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 entityTypesStubMethods = [ + 'getEntityType', + 'createEntityType', + 'updateEntityType', + 'deleteEntityType', + 'listEntityTypes', + 'exportEntityTypes', + 'importEntityTypes', + ]; + for (const methodName of entityTypesStubMethods) { + const callPromise = this.entityTypesStub.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.entityTypesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type. + * Format: + * `projects//locations//agents//entityTypes/`. + * @param {string} request.languageCode + * The language to retrieve the entity type for. The following fields are + * language dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.EntityType|EntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.get_entity_type.js + * region_tag:dialogflow_v3_generated_EntityTypes_GetEntityType_async + */ + getEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest | undefined, + {} | undefined, + ] + >; + getEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an entity type in the specified agent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a entity type for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.EntityType} request.entityType + * Required. The entity type to create. + * @param {string} request.languageCode + * The language of the following fields in `entity_type`: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.EntityType|EntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.create_entity_type.js + * region_tag:dialogflow_v3_generated_EntityTypes_CreateEntityType_async + */ + createEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest | undefined, + {} | undefined, + ] + >; + createEntityType( + request: protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createEntityType( + request: protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified entity type. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.EntityType} request.entityType + * Required. The entity type to update. + * @param {string} request.languageCode + * The language of the following fields in `entity_type`: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get 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 {@link protos.google.cloud.dialogflow.cx.v3.EntityType|EntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.update_entity_type.js + * region_tag:dialogflow_v3_generated_EntityTypes_UpdateEntityType_async + */ + updateEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest | undefined, + {} | undefined, + ] + >; + updateEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest | 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({ + 'entity_type.name': request.entityType!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified entity type. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type to delete. + * Format: + * `projects//locations//agents//entityTypes/`. + * @param {boolean} request.force + * This field has no effect for entity type not being used. + * For entity types that are used by intents or pages: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referencing resources. + * * If `force` is set to true, Dialogflow will remove the entity type, as + * well as any references to the entity type (i.e. Page + * {@link protos.google.cloud.dialogflow.cx.v3.Form.Parameter|parameter} of the entity + * type will be changed to + * '@sys.any' and intent + * {@link protos.google.cloud.dialogflow.cx.v3.Intent.Parameter|parameter} of the + * entity type will be removed). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.delete_entity_type.js + * region_tag:dialogflow_v3_generated_EntityTypes_DeleteEntityType_async + */ + deleteEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest | undefined, + {} | undefined, + ] + >; + deleteEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Exports the selected entity types. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent agent to export entity types. + * Format: `projects//locations//agents/`. + * @param {string[]} request.entityTypes + * Required. The name of the entity types to export. + * Format: + * `projects//locations//agents//entityTypes/`. + * @param {string} [request.entityTypesUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the entity + * types to. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {boolean} [request.entityTypesContentInline] + * Optional. The option to return the serialized entity types inline. + * @param {google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported entity types. If not specified, + * `BLOB` is assumed. + * @param {string} [request.languageCode] + * Optional. The language to retrieve the entity type for. The following + * fields are language dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, all language dependent fields will be retrieved. + * [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.export_entity_types.js + * region_tag:dialogflow_v3_generated_EntityTypes_ExportEntityTypes_async + */ + exportEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportEntityTypes response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportEntityTypes request %j', request); + return this.innerApiCalls + .exportEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportEntityTypes response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportEntityTypes()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.export_entity_types.js + * region_tag:dialogflow_v3_generated_EntityTypes_ExportEntityTypes_async + */ + async checkExportEntityTypesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + > + > { + this._log.info('exportEntityTypes long-running'); + 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.exportEntityTypes, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata + >; + } + /** + * Imports the specified entitytypes into the agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the entity types into. + * Format: `projects//locations//agents/`. + * @param {string} request.entityTypesUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import entity types from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3.InlineSource} request.entityTypesContent + * Uncompressed byte content of entity types. + * @param {google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption} request.mergeOption + * Required. Merge option for importing entity types. + * @param {string} [request.targetEntityType] + * Optional. The target entity type to import into. + * Format: + * `projects//locations//agents//entity_types/`. + * If set, there should be only one entity type included in + * {@link protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types|entity_types}, + * of which the type should match the type of the target entity type. All + * {@link protos.google.cloud.dialogflow.cx.v3.EntityType.entities|entities} in the + * imported entity type will be added to the target entity type. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.import_entity_types.js + * region_tag:dialogflow_v3_generated_EntityTypes_ImportEntityTypes_async + */ + importEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importEntityTypes response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importEntityTypes request %j', request); + return this.innerApiCalls + .importEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importEntityTypes response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importEntityTypes()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.import_entity_types.js + * region_tag:dialogflow_v3_generated_EntityTypes_ImportEntityTypes_async + */ + async checkImportEntityTypesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + > + > { + this._log.info('importEntityTypes long-running'); + 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.importEntityTypes, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata + >; + } + /** + * Returns the list of all entity types in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all entity types for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list entity types for. The following fields are language + * dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.EntityType|EntityType}. + * 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 `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType[], + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse, + ] + >; + listEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEntityType + >, + ): void; + listEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEntityType + >, + ): void; + listEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEntityType + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEntityType + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEntityType[], + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEntityType + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEntityTypes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEntityTypes request %j', request); + return this.innerApiCalls + .listEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IEntityType[], + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListEntityTypesResponse, + ]) => { + this._log.info('listEntityTypes values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listEntityTypes`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all entity types for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list entity types for. The following fields are language + * dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.EntityType|EntityType} 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 `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEntityTypesStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + 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['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEntityTypes stream %j', request); + return this.descriptors.page.listEntityTypes.createStream( + this.innerApiCalls.listEntityTypes as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listEntityTypes`, 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 agent to list all entity types for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list entity types for. The following fields are language + * dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.EntityType|EntityType}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/entity_types.list_entity_types.js + * region_tag:dialogflow_v3_generated_EntityTypes_ListEntityTypes_async + */ + listEntityTypesAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListEntityTypesRequest, + 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['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEntityTypes iterate %j', request); + return this.descriptors.page.listEntityTypes.asyncIterate( + this.innerApiCalls['listEntityTypes'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.entityTypesStub && !this._terminated) { + return this.entityTypesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_client_config.json new file mode 100644 index 000000000000..1e4e72ecce5b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.EntityTypes": { + "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 + } + }, + "methods": { + "GetEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/entity_types_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_client.ts new file mode 100644 index 000000000000..0afe4423727e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_client.ts @@ -0,0 +1,4857 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/environments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './environments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environments}. + * @class + * @memberof v3 + */ +export class EnvironmentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + environmentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of EnvironmentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 EnvironmentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EnvironmentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listEnvironments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'environments', + ), + lookupEnvironmentHistory: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'environments', + ), + listContinuousTestResults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'continuousTestResults', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.Environment', + ) as gax.protobuf.Type; + const createEnvironmentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const updateEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.Environment', + ) as gax.protobuf.Type; + const updateEnvironmentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const runContinuousTestResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse', + ) as gax.protobuf.Type; + const runContinuousTestMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata', + ) as gax.protobuf.Type; + const deployFlowResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.DeployFlowResponse', + ) as gax.protobuf.Type; + const deployFlowMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.DeployFlowMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEnvironmentResponse.decode.bind(createEnvironmentResponse), + createEnvironmentMetadata.decode.bind(createEnvironmentMetadata), + ), + updateEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), + updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata), + ), + runContinuousTest: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runContinuousTestResponse.decode.bind(runContinuousTestResponse), + runContinuousTestMetadata.decode.bind(runContinuousTestMetadata), + ), + deployFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployFlowResponse.decode.bind(deployFlowResponse), + deployFlowMetadata.decode.bind(deployFlowMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Environments', + 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.environmentsStub) { + return this.environmentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Environments. + this.environmentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Environments', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Environments, + 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 environmentsStubMethods = [ + 'listEnvironments', + 'getEnvironment', + 'createEnvironment', + 'updateEnvironment', + 'deleteEnvironment', + 'lookupEnvironmentHistory', + 'runContinuousTest', + 'listContinuousTestResults', + 'deployFlow', + ]; + for (const methodName of environmentsStubMethods) { + const callPromise = this.environmentsStub.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.environmentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. Format: + * `projects//locations//agents//environments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.get_environment.js + * region_tag:dialogflow_v3_generated_Environments_GetEnvironment_async + */ + getEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest | undefined, + {} | undefined, + ] + >; + getEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getEnvironment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEnvironment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEnvironment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetEnvironmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEnvironment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to delete. Format: + * `projects//locations//agents//environments/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.delete_environment.js + * region_tag:dialogflow_v3_generated_Environments_DeleteEnvironment_async + */ + deleteEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteEnvironment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEnvironment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteEnvironment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteEnvironmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteEnvironment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates an {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} in the + * specified {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent} to create an + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} for. Format: + * `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.Environment} request.environment + * Required. The environment 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.create_environment.js + * region_tag:dialogflow_v3_generated_Environments_CreateEnvironment_async + */ + createEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createEnvironment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createEnvironment request %j', request); + return this.innerApiCalls + .createEnvironment(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createEnvironment response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createEnvironment()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.create_environment.js + * region_tag:dialogflow_v3_generated_Environments_CreateEnvironment_async + */ + async checkCreateEnvironmentProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.Environment, + protos.google.protobuf.Struct + > + > { + this._log.info('createEnvironment long-running'); + 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.createEnvironment, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.Environment, + protos.google.protobuf.Struct + >; + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Environment} request.environment + * Required. The environment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.update_environment.js + * region_tag:dialogflow_v3_generated_Environments_UpdateEnvironment_async + */ + updateEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateEnvironment( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + 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({ + 'environment.name': request.environment!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateEnvironment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateEnvironment request %j', request); + return this.innerApiCalls + .updateEnvironment(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateEnvironment response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateEnvironment()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.update_environment.js + * region_tag:dialogflow_v3_generated_Environments_UpdateEnvironment_async + */ + async checkUpdateEnvironmentProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.Environment, + protos.google.protobuf.Struct + > + > { + this._log.info('updateEnvironment long-running'); + 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.updateEnvironment, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.Environment, + protos.google.protobuf.Struct + >; + } + /** + * Kicks off a continuous test under the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata|RunContinuousTestMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse|RunContinuousTestResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Required. Format: + * `projects//locations//agents//environments/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.run_continuous_test.js + * region_tag:dialogflow_v3_generated_Environments_RunContinuousTest_async + */ + runContinuousTest( + request?: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runContinuousTest( + request?: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + 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({ + environment: request.environment ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runContinuousTest response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runContinuousTest request %j', request); + return this.innerApiCalls + .runContinuousTest(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('runContinuousTest response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `runContinuousTest()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.run_continuous_test.js + * region_tag:dialogflow_v3_generated_Environments_RunContinuousTest_async + */ + async checkRunContinuousTestProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + > + > { + this._log.info('runContinuousTest long-running'); + 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.runContinuousTest, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + >; + } + /** + * Deploys a flow to the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.DeployFlowMetadata|DeployFlowMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.DeployFlowResponse|DeployFlowResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Required. The environment to deploy the flow to. + * Format: + * `projects//locations//agents//environments/`. + * @param {string} request.flowVersion + * Required. The flow version to deploy. + * Format: + * `projects//locations//agents//flows//versions/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.deploy_flow.js + * region_tag:dialogflow_v3_generated_Environments_DeployFlow_async + */ + deployFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IDeployFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployFlow( + request: protos.google.cloud.dialogflow.cx.v3.IDeployFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deployFlow( + request: protos.google.cloud.dialogflow.cx.v3.IDeployFlowRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deployFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IDeployFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + 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({ + environment: request.environment ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deployFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deployFlow request %j', request); + return this.innerApiCalls + .deployFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deployFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deployFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.deploy_flow.js + * region_tag:dialogflow_v3_generated_Environments_DeployFlow_async + */ + async checkDeployFlowProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.DeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.DeployFlowMetadata + > + > { + this._log.info('deployFlow long-running'); + 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.deployFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.DeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.DeployFlowMetadata + >; + } + /** + * Returns the list of all environments in the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent} to list all + * environments for. Format: + * `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * 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 `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEnvironments( + request?: protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse, + ] + >; + listEnvironments( + request: protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + ): void; + listEnvironments( + request: protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + ): void; + listEnvironments( + request?: protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEnvironments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEnvironments request %j', request); + return this.innerApiCalls + .listEnvironments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsResponse, + ]) => { + this._log.info('listEnvironments values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listEnvironments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent} to list all + * environments for. Format: + * `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} 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 `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEnvironmentsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + 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['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEnvironments stream %j', request); + return this.descriptors.page.listEnvironments.createStream( + this.innerApiCalls.listEnvironments as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listEnvironments`, 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 {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent} to list all + * environments for. Format: + * `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.list_environments.js + * region_tag:dialogflow_v3_generated_Environments_ListEnvironments_async + */ + listEnvironmentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, + 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['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEnvironments iterate %j', request); + return this.descriptors.page.listEnvironments.asyncIterate( + this.innerApiCalls['listEnvironments'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Looks up the history of the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * 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 `lookupEnvironmentHistoryAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + lookupEnvironmentHistory( + request?: protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest | null, + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse, + ] + >; + lookupEnvironmentHistory( + request: protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + ): void; + lookupEnvironmentHistory( + request: protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + ): void; + lookupEnvironmentHistory( + request?: protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest | null, + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IEnvironment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('lookupEnvironmentHistory values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('lookupEnvironmentHistory request %j', request); + return this.innerApiCalls + .lookupEnvironmentHistory(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest | null, + protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryResponse, + ]) => { + this._log.info('lookupEnvironmentHistory values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `lookupEnvironmentHistory`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} 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 `lookupEnvironmentHistoryAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + lookupEnvironmentHistoryStream( + request?: protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('lookupEnvironmentHistory stream %j', request); + return this.descriptors.page.lookupEnvironmentHistory.createStream( + this.innerApiCalls.lookupEnvironmentHistory as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `lookupEnvironmentHistory`, 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.name + * Required. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.lookup_environment_history.js + * region_tag:dialogflow_v3_generated_Environments_LookupEnvironmentHistory_async + */ + lookupEnvironmentHistoryAsync( + request?: protos.google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('lookupEnvironmentHistory iterate %j', request); + return this.descriptors.page.lookupEnvironmentHistory.asyncIterate( + this.innerApiCalls['lookupEnvironmentHistory'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Fetches a list of continuous test results for a given environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult|ContinuousTestResult}. + * 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 `listContinuousTestResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listContinuousTestResults( + request?: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse, + ] + >; + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + >, + ): void; + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + >, + ): void; + listContinuousTestResults( + request?: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listContinuousTestResults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listContinuousTestResults request %j', request); + return this.innerApiCalls + .listContinuousTestResults(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse, + ]) => { + this._log.info('listContinuousTestResults values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listContinuousTestResults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult|ContinuousTestResult} 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 `listContinuousTestResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listContinuousTestResultsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + 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['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listContinuousTestResults stream %j', request); + return this.descriptors.page.listContinuousTestResults.createStream( + this.innerApiCalls.listContinuousTestResults as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listContinuousTestResults`, 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 environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult|ContinuousTestResult}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/environments.list_continuous_test_results.js + * region_tag:dialogflow_v3_generated_Environments_ListContinuousTestResults_async + */ + listContinuousTestResultsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + 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['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listContinuousTestResults iterate %j', request); + return this.descriptors.page.listContinuousTestResults.asyncIterate( + this.innerApiCalls['listContinuousTestResults'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.environmentsStub && !this._terminated) { + return this.environmentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_client_config.json new file mode 100644 index 000000000000..76329059bcf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Environments": { + "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 + } + }, + "methods": { + "ListEnvironments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "LookupEnvironmentHistory": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RunContinuousTest": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListContinuousTestResults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeployFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/environments_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_client.ts new file mode 100644 index 000000000000..8766f726338b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_client.ts @@ -0,0 +1,3891 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/examples_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './examples_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Example|Examples}. + * @class + * @memberof v3 + */ +export class ExamplesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + examplesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ExamplesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ExamplesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ExamplesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listExamples: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'examples', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Examples', + 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.examplesStub) { + return this.examplesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Examples. + this.examplesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Examples', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Examples, + 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 examplesStubMethods = [ + 'createExample', + 'deleteExample', + 'listExamples', + 'getExample', + 'updateExample', + ]; + for (const methodName of examplesStubMethods) { + const callPromise = this.examplesStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.examplesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 an example in the specified playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to create an example for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {google.cloud.dialogflow.cx.v3.Example} request.example + * Required. The example 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 {@link protos.google.cloud.dialogflow.cx.v3.Example|Example}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/examples.create_example.js + * region_tag:dialogflow_v3_generated_Examples_CreateExample_async + */ + createExample( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample, + protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest | undefined, + {} | undefined, + ] + >; + createExample( + request: protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExample( + request: protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExample( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample, + protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateExampleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the example to delete. + * Format: + * `projects//locations//agents//playbooks//examples/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/examples.delete_example.js + * region_tag:dialogflow_v3_generated_Examples_DeleteExample_async + */ + deleteExample( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest | undefined, + {} | undefined, + ] + >; + deleteExample( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExample( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExample( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteExampleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the example. + * Format: + * `projects//locations//agents//playbooks//examples/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Example|Example}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/examples.get_example.js + * region_tag:dialogflow_v3_generated_Examples_GetExample_async + */ + getExample( + request?: protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample, + protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest | undefined, + {} | undefined, + ] + >; + getExample( + request: protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExample( + request: protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExample( + request?: protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample, + protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExample, + protos.google.cloud.dialogflow.cx.v3.IGetExampleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Example} request.example + * Required. The example to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Example|Example}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/examples.update_example.js + * region_tag:dialogflow_v3_generated_Examples_UpdateExample_async + */ + updateExample( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample, + protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest | undefined, + {} | undefined, + ] + >; + updateExample( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExample( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExample( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample, + protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest | 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({ + 'example.name': request.example!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExample, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateExampleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns a list of examples in the specified playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The {@link protos.ListExampleResponse.next_page_token|next_page_token} value + * returned from a previous list request. + * @param {string} [request.languageCode] + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Example|Example}. + * 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 `listExamplesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExamples( + request?: protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample[], + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse, + ] + >; + listExamples( + request: protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExample + >, + ): void; + listExamples( + request: protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExample + >, + ): void; + listExamples( + request?: protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExample + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExample + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExample[], + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExample + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExamples values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExamples request %j', request); + return this.innerApiCalls + .listExamples(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IExample[], + protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListExamplesResponse, + ]) => { + this._log.info('listExamples values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listExamples`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The {@link protos.ListExampleResponse.next_page_token|next_page_token} value + * returned from a previous list request. + * @param {string} [request.languageCode] + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Example|Example} 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 `listExamplesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExamplesStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExamples stream %j', request); + return this.descriptors.page.listExamples.createStream( + this.innerApiCalls.listExamples as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listExamples`, 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 playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The {@link protos.ListExampleResponse.next_page_token|next_page_token} value + * returned from a previous list request. + * @param {string} [request.languageCode] + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Example|Example}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/examples.list_examples.js + * region_tag:dialogflow_v3_generated_Examples_ListExamples_async + */ + listExamplesAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExamples iterate %j', request); + return this.descriptors.page.listExamples.asyncIterate( + this.innerApiCalls['listExamples'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.examplesStub && !this._terminated) { + return this.examplesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_client_config.json new file mode 100644 index 000000000000..e5a642712faa --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Examples": { + "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 + } + }, + "methods": { + "CreateExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListExamples": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/examples_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_client.ts new file mode 100644 index 000000000000..c04c4bbacb45 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_client.ts @@ -0,0 +1,4166 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/experiments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './experiments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiments}. + * @class + * @memberof v3 + */ +export class ExperimentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + experimentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ExperimentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ExperimentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ExperimentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listExperiments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'experiments', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Experiments', + 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.experimentsStub) { + return this.experimentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Experiments. + this.experimentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Experiments', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Experiments, + 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 experimentsStubMethods = [ + 'listExperiments', + 'getExperiment', + 'createExperiment', + 'updateExperiment', + 'deleteExperiment', + 'startExperiment', + 'stopExperiment', + ]; + for (const methodName of experimentsStubMethods) { + const callPromise = this.experimentsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.experimentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/experiments.get_experiment.js + * region_tag:dialogflow_v3_generated_Experiments_GetExperiment_async + */ + getExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest | undefined, + {} | undefined, + ] + >; + getExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment} in the + * specified {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Agent|Agent} to create an + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} for. Format: + * `projects//locations//agents//environments/`. + * @param {google.cloud.dialogflow.cx.v3.Experiment} request.experiment + * Required. The experiment 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 {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/experiments.create_experiment.js + * region_tag:dialogflow_v3_generated_Experiments_CreateExperiment_async + */ + createExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest | undefined, + {} | undefined, + ] + >; + createExperiment( + request: protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExperiment( + request: protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Experiment} request.experiment + * Required. The experiment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get 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 {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/experiments.update_experiment.js + * region_tag:dialogflow_v3_generated_Experiments_UpdateExperiment_async + */ + updateExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest | undefined, + {} | undefined, + ] + >; + updateExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest | 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({ + 'experiment.name': request.experiment!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to delete. Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/experiments.delete_experiment.js + * region_tag:dialogflow_v3_generated_Experiments_DeleteExperiment_async + */ + deleteExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest | undefined, + {} | undefined, + ] + >; + deleteExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Starts the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. This rpc only + * changes the state of experiment from PENDING to RUNNING. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the experiment to start. + * Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/experiments.start_experiment.js + * region_tag:dialogflow_v3_generated_Experiments_StartExperiment_async + */ + startExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest | undefined, + {} | undefined, + ] + >; + startExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + startExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + startExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('startExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('startExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .startExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3.IStartExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('startExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Stops the specified {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * This rpc only changes the state of experiment from RUNNING to DONE. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the experiment to stop. + * Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/experiments.stop_experiment.js + * region_tag:dialogflow_v3_generated_Experiments_StopExperiment_async + */ + stopExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest | undefined, + {} | undefined, + ] + >; + stopExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + stopExperiment( + request: protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + stopExperiment( + request?: protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('stopExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IExperiment, + | protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('stopExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .stopExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3.IStopExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('stopExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all experiments in the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. + * 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 `listExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExperiments( + request?: protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment[], + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse, + ] + >; + listExperiments( + request: protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExperiment + >, + ): void; + listExperiments( + request: protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExperiment + >, + ): void; + listExperiments( + request?: protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExperiment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExperiment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IExperiment[], + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IExperiment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExperiments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExperiments request %j', request); + return this.innerApiCalls + .listExperiments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IExperiment[], + protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListExperimentsResponse, + ]) => { + this._log.info('listExperiments values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listExperiments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment} 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 `listExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExperimentsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + 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['listExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExperiments stream %j', request); + return this.descriptors.page.listExperiments.createStream( + this.innerApiCalls.listExperiments as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listExperiments`, 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 {@link protos.google.cloud.dialogflow.cx.v3.Environment|Environment} to + * list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Experiment|Experiment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/experiments.list_experiments.js + * region_tag:dialogflow_v3_generated_Experiments_ListExperiments_async + */ + listExperimentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListExperimentsRequest, + 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['listExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExperiments iterate %j', request); + return this.descriptors.page.listExperiments.asyncIterate( + this.innerApiCalls['listExperiments'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.experimentsStub && !this._terminated) { + return this.experimentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_client_config.json new file mode 100644 index 000000000000..9853d644f316 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Experiments": { + "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 + } + }, + "methods": { + "ListExperiments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "StartExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "StopExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/experiments_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_client.ts new file mode 100644 index 000000000000..f183c515cbee --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_client.ts @@ -0,0 +1,4867 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/flows_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './flows_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flows}. + * @class + * @memberof v3 + */ +export class FlowsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + flowsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of FlowsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 FlowsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FlowsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listFlows: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'flows', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const trainFlowResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const trainFlowMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const importFlowResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportFlowResponse', + ) as gax.protobuf.Type; + const importFlowMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const exportFlowResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportFlowResponse', + ) as gax.protobuf.Type; + const exportFlowMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + trainFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + trainFlowResponse.decode.bind(trainFlowResponse), + trainFlowMetadata.decode.bind(trainFlowMetadata), + ), + importFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importFlowResponse.decode.bind(importFlowResponse), + importFlowMetadata.decode.bind(importFlowMetadata), + ), + exportFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportFlowResponse.decode.bind(exportFlowResponse), + exportFlowMetadata.decode.bind(exportFlowMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Flows', + 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.flowsStub) { + return this.flowsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Flows. + this.flowsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Flows', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Flows, + 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 flowsStubMethods = [ + 'createFlow', + 'deleteFlow', + 'listFlows', + 'getFlow', + 'updateFlow', + 'trainFlow', + 'validateFlow', + 'getFlowValidationResult', + 'importFlow', + 'exportFlow', + ]; + for (const methodName of flowsStubMethods) { + const callPromise = this.flowsStub.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.flowsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 flow in the specified agent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a flow for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.Flow} request.flow + * Required. The flow to create. + * @param {string} request.languageCode + * The language of the following fields in `flow`: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.create_flow.js + * region_tag:dialogflow_v3_generated_Flows_CreateFlow_async + */ + createFlow( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest | undefined, + {} | undefined, + ] + >; + createFlow( + request: protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createFlow( + request: protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createFlow( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.ICreateFlowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the flow to delete. + * Format: + * `projects//locations//agents//flows/`. + * @param {boolean} request.force + * This field has no effect for flows with no incoming transitions. + * For flows with incoming transitions: + * + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the flow, as well as + * any transitions to the flow (i.e. [Target + * flow][EventHandler.target_flow] in event handlers or [Target + * flow][TransitionRoute.target_flow] in transition routes that point to + * this flow will be cleared). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.delete_flow.js + * region_tag:dialogflow_v3_generated_Flows_DeleteFlow_async + */ + deleteFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest | undefined, + {} | undefined, + ] + >; + deleteFlow( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteFlow( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteFlowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the flow to get. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to retrieve the flow for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.get_flow.js + * region_tag:dialogflow_v3_generated_Flows_GetFlow_async + */ + getFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest | undefined, + {} | undefined, + ] + >; + getFlow( + request: protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest | null | undefined, + {} | null | undefined + >, + ): void; + getFlow( + request: protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest | null | undefined, + {} | null | undefined + >, + ): void; + getFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IGetFlowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified flow. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Flow} request.flow + * Required. The flow to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + * @param {string} request.languageCode + * The language of the following fields in `flow`: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.update_flow.js + * region_tag:dialogflow_v3_generated_Flows_UpdateFlow_async + */ + updateFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest | undefined, + {} | undefined, + ] + >; + updateFlow( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateFlow( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest | 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({ + 'flow.name': request.flow!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlow, + | protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IFlow, + protos.google.cloud.dialogflow.cx.v3.IUpdateFlowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Validates the specified flow and creates or updates validation results. + * Please call this API after the training is completed to get the complete + * validation results. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The flow to validate. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.FlowValidationResult|FlowValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.validate_flow.js + * region_tag:dialogflow_v3_generated_Flows_ValidateFlow_async + */ + validateFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest | undefined, + {} | undefined, + ] + >; + validateFlow( + request: protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateFlow( + request: protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest | 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().catch((err) => { + throw err; + }); + this._log.info('validateFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .validateFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + protos.google.cloud.dialogflow.cx.v3.IValidateFlowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('validateFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the latest flow validation result. Flow validation is performed + * when ValidateFlow is called. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The flow name. + * Format: + * `projects//locations//agents//flows//validationResult`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.FlowValidationResult|FlowValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.get_flow_validation_result.js + * region_tag:dialogflow_v3_generated_Flows_GetFlowValidationResult_async + */ + getFlowValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | undefined + ), + {} | undefined, + ] + >; + getFlowValidationResult( + request: protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getFlowValidationResult( + request: protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getFlowValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getFlowValidationResult request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFlowValidationResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFlowValidationResult(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetFlowValidationResultRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getFlowValidationResult response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Trains the specified flow. Note that only the flow in 'draft' environment + * is trained. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The flow to train. + * Format: + * `projects//locations//agents//flows/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.train_flow.js + * region_tag:dialogflow_v3_generated_Flows_TrainFlow_async + */ + trainFlow( + request?: protos.google.cloud.dialogflow.cx.v3.ITrainFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + trainFlow( + request: protos.google.cloud.dialogflow.cx.v3.ITrainFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + trainFlow( + request: protos.google.cloud.dialogflow.cx.v3.ITrainFlowRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + trainFlow( + request?: protos.google.cloud.dialogflow.cx.v3.ITrainFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('trainFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('trainFlow request %j', request); + return this.innerApiCalls + .trainFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('trainFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `trainFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.train_flow.js + * region_tag:dialogflow_v3_generated_Flows_TrainFlow_async + */ + async checkTrainFlowProgress( + name: string, + ): Promise< + LROperation + > { + this._log.info('trainFlow long-running'); + 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.trainFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } + /** + * Imports the specified flow to the specified agent from a binary file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.ImportFlowResponse|ImportFlowResponse} + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the flow into. + * Format: `projects//locations//agents/`. + * @param {string} request.flowUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import flow from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.flowContent + * Uncompressed raw byte content for flow. + * @param {google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption} request.importOption + * Flow import mode. If not specified, `KEEP` is assumed. + * @param {google.cloud.dialogflow.cx.v3.FlowImportStrategy} [request.flowImportStrategy] + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.import_flow.js + * region_tag:dialogflow_v3_generated_Flows_ImportFlow_async + */ + importFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IImportFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importFlow( + request: protos.google.cloud.dialogflow.cx.v3.IImportFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importFlow( + request: protos.google.cloud.dialogflow.cx.v3.IImportFlowRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IImportFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importFlow request %j', request); + return this.innerApiCalls + .importFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.import_flow.js + * region_tag:dialogflow_v3_generated_Flows_ImportFlow_async + */ + async checkImportFlowProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportFlowResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('importFlow long-running'); + 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.importFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportFlowResponse, + protos.google.protobuf.Struct + >; + } + /** + * Exports the specified flow to a binary file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.ExportFlowResponse|ExportFlowResponse} + * + * Note that resources (e.g. intents, entities, webhooks) that the flow + * references will also be exported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the flow to export. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} [request.flowUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. + * The format of this URI must be `gs:///`. If left + * unspecified, the serialized flow is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {boolean} [request.includeReferencedFlows] + * Optional. Whether to export flows referenced by the specified flow. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.export_flow.js + * region_tag:dialogflow_v3_generated_Flows_ExportFlow_async + */ + exportFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IExportFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportFlow( + request: protos.google.cloud.dialogflow.cx.v3.IExportFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportFlow( + request: protos.google.cloud.dialogflow.cx.v3.IExportFlowRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportFlow( + request?: protos.google.cloud.dialogflow.cx.v3.IExportFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportFlow request %j', request); + return this.innerApiCalls + .exportFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.export_flow.js + * region_tag:dialogflow_v3_generated_Flows_ExportFlow_async + */ + async checkExportFlowProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportFlowResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('exportFlow long-running'); + 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.exportFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportFlowResponse, + protos.google.protobuf.Struct + >; + } + /** + * Returns the list of all flows in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the flows. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list flows for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow}. + * 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 `listFlowsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFlows( + request?: protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow[], + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse, + ] + >; + listFlows( + request: protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IFlow + >, + ): void; + listFlows( + request: protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IFlow + >, + ): void; + listFlows( + request?: protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IFlow + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IFlow + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFlow[], + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IFlow + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFlows values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFlows request %j', request); + return this.innerApiCalls + .listFlows(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IFlow[], + protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListFlowsResponse, + ]) => { + this._log.info('listFlows values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listFlows`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the flows. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list flows for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow} 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 `listFlowsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFlowsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + 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['listFlows']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listFlows stream %j', request); + return this.descriptors.page.listFlows.createStream( + this.innerApiCalls.listFlows as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listFlows`, 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 agent containing the flows. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list flows for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/flows.list_flows.js + * region_tag:dialogflow_v3_generated_Flows_ListFlows_async + */ + listFlowsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListFlowsRequest, + 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['listFlows']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listFlows iterate %j', request); + return this.descriptors.page.listFlows.asyncIterate( + this.innerApiCalls['listFlows'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.flowsStub && !this._terminated) { + return this.flowsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_client_config.json new file mode 100644 index 000000000000..607446d7d2aa --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Flows": { + "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 + } + }, + "methods": { + "CreateFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListFlows": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "TrainFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetFlowValidationResult": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/flows_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/gapic_metadata.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/gapic_metadata.json new file mode 100644 index 000000000000..7b74a2ddbc05 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/gapic_metadata.json @@ -0,0 +1,1745 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.dialogflow.cx.v3", + "libraryPackage": "@google-cloud/dialogflow-cx", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "ValidateAgent": { + "methods": [ + "validateAgent" + ] + }, + "GetAgentValidationResult": { + "methods": [ + "getAgentValidationResult" + ] + }, + "GetGenerativeSettings": { + "methods": [ + "getGenerativeSettings" + ] + }, + "UpdateGenerativeSettings": { + "methods": [ + "updateGenerativeSettings" + ] + }, + "ExportAgent": { + "methods": [ + "exportAgent" + ] + }, + "RestoreAgent": { + "methods": [ + "restoreAgent" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AgentsClient", + "rpcs": { + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "ValidateAgent": { + "methods": [ + "validateAgent" + ] + }, + "GetAgentValidationResult": { + "methods": [ + "getAgentValidationResult" + ] + }, + "GetGenerativeSettings": { + "methods": [ + "getGenerativeSettings" + ] + }, + "UpdateGenerativeSettings": { + "methods": [ + "updateGenerativeSettings" + ] + }, + "ExportAgent": { + "methods": [ + "exportAgent" + ] + }, + "RestoreAgent": { + "methods": [ + "restoreAgent" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + } + } + } + } + }, + "Changelogs": { + "clients": { + "grpc": { + "libraryClient": "ChangelogsClient", + "rpcs": { + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ChangelogsClient", + "rpcs": { + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + } + } + }, + "Deployments": { + "clients": { + "grpc": { + "libraryClient": "DeploymentsClient", + "rpcs": { + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DeploymentsClient", + "rpcs": { + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + } + } + } + } + }, + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "ExportEntityTypes": { + "methods": [ + "exportEntityTypes" + ] + }, + "ImportEntityTypes": { + "methods": [ + "importEntityTypes" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "ExportEntityTypes": { + "methods": [ + "exportEntityTypes" + ] + }, + "ImportEntityTypes": { + "methods": [ + "importEntityTypes" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + } + } + } + } + }, + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "RunContinuousTest": { + "methods": [ + "runContinuousTest" + ] + }, + "DeployFlow": { + "methods": [ + "deployFlow" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + }, + "LookupEnvironmentHistory": { + "methods": [ + "lookupEnvironmentHistory", + "lookupEnvironmentHistoryStream", + "lookupEnvironmentHistoryAsync" + ] + }, + "ListContinuousTestResults": { + "methods": [ + "listContinuousTestResults", + "listContinuousTestResultsStream", + "listContinuousTestResultsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "RunContinuousTest": { + "methods": [ + "runContinuousTest" + ] + }, + "DeployFlow": { + "methods": [ + "deployFlow" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + }, + "LookupEnvironmentHistory": { + "methods": [ + "lookupEnvironmentHistory", + "lookupEnvironmentHistoryStream", + "lookupEnvironmentHistoryAsync" + ] + }, + "ListContinuousTestResults": { + "methods": [ + "listContinuousTestResults", + "listContinuousTestResultsStream", + "listContinuousTestResultsAsync" + ] + } + } + } + } + }, + "Examples": { + "clients": { + "grpc": { + "libraryClient": "ExamplesClient", + "rpcs": { + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ExamplesClient", + "rpcs": { + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + } + } + } + } + }, + "Experiments": { + "clients": { + "grpc": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "GetExperiment": { + "methods": [ + "getExperiment" + ] + }, + "CreateExperiment": { + "methods": [ + "createExperiment" + ] + }, + "UpdateExperiment": { + "methods": [ + "updateExperiment" + ] + }, + "DeleteExperiment": { + "methods": [ + "deleteExperiment" + ] + }, + "StartExperiment": { + "methods": [ + "startExperiment" + ] + }, + "StopExperiment": { + "methods": [ + "stopExperiment" + ] + }, + "ListExperiments": { + "methods": [ + "listExperiments", + "listExperimentsStream", + "listExperimentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "GetExperiment": { + "methods": [ + "getExperiment" + ] + }, + "CreateExperiment": { + "methods": [ + "createExperiment" + ] + }, + "UpdateExperiment": { + "methods": [ + "updateExperiment" + ] + }, + "DeleteExperiment": { + "methods": [ + "deleteExperiment" + ] + }, + "StartExperiment": { + "methods": [ + "startExperiment" + ] + }, + "StopExperiment": { + "methods": [ + "stopExperiment" + ] + }, + "ListExperiments": { + "methods": [ + "listExperiments", + "listExperimentsStream", + "listExperimentsAsync" + ] + } + } + } + } + }, + "Flows": { + "clients": { + "grpc": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ + "createFlow" + ] + }, + "DeleteFlow": { + "methods": [ + "deleteFlow" + ] + }, + "GetFlow": { + "methods": [ + "getFlow" + ] + }, + "UpdateFlow": { + "methods": [ + "updateFlow" + ] + }, + "ValidateFlow": { + "methods": [ + "validateFlow" + ] + }, + "GetFlowValidationResult": { + "methods": [ + "getFlowValidationResult" + ] + }, + "TrainFlow": { + "methods": [ + "trainFlow" + ] + }, + "ImportFlow": { + "methods": [ + "importFlow" + ] + }, + "ExportFlow": { + "methods": [ + "exportFlow" + ] + }, + "ListFlows": { + "methods": [ + "listFlows", + "listFlowsStream", + "listFlowsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ + "createFlow" + ] + }, + "DeleteFlow": { + "methods": [ + "deleteFlow" + ] + }, + "GetFlow": { + "methods": [ + "getFlow" + ] + }, + "UpdateFlow": { + "methods": [ + "updateFlow" + ] + }, + "ValidateFlow": { + "methods": [ + "validateFlow" + ] + }, + "GetFlowValidationResult": { + "methods": [ + "getFlowValidationResult" + ] + }, + "TrainFlow": { + "methods": [ + "trainFlow" + ] + }, + "ImportFlow": { + "methods": [ + "importFlow" + ] + }, + "ExportFlow": { + "methods": [ + "exportFlow" + ] + }, + "ListFlows": { + "methods": [ + "listFlows", + "listFlowsStream", + "listFlowsAsync" + ] + } + } + } + } + }, + "Generators": { + "clients": { + "grpc": { + "libraryClient": "GeneratorsClient", + "rpcs": { + "GetGenerator": { + "methods": [ + "getGenerator" + ] + }, + "CreateGenerator": { + "methods": [ + "createGenerator" + ] + }, + "UpdateGenerator": { + "methods": [ + "updateGenerator" + ] + }, + "DeleteGenerator": { + "methods": [ + "deleteGenerator" + ] + }, + "ListGenerators": { + "methods": [ + "listGenerators", + "listGeneratorsStream", + "listGeneratorsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GeneratorsClient", + "rpcs": { + "GetGenerator": { + "methods": [ + "getGenerator" + ] + }, + "CreateGenerator": { + "methods": [ + "createGenerator" + ] + }, + "UpdateGenerator": { + "methods": [ + "updateGenerator" + ] + }, + "DeleteGenerator": { + "methods": [ + "deleteGenerator" + ] + }, + "ListGenerators": { + "methods": [ + "listGenerators", + "listGeneratorsStream", + "listGeneratorsAsync" + ] + } + } + } + } + }, + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "GetIntent": { + "methods": [ + "getIntent" + ] + }, + "CreateIntent": { + "methods": [ + "createIntent" + ] + }, + "UpdateIntent": { + "methods": [ + "updateIntent" + ] + }, + "DeleteIntent": { + "methods": [ + "deleteIntent" + ] + }, + "ImportIntents": { + "methods": [ + "importIntents" + ] + }, + "ExportIntents": { + "methods": [ + "exportIntents" + ] + }, + "ListIntents": { + "methods": [ + "listIntents", + "listIntentsStream", + "listIntentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IntentsClient", + "rpcs": { + "GetIntent": { + "methods": [ + "getIntent" + ] + }, + "CreateIntent": { + "methods": [ + "createIntent" + ] + }, + "UpdateIntent": { + "methods": [ + "updateIntent" + ] + }, + "DeleteIntent": { + "methods": [ + "deleteIntent" + ] + }, + "ImportIntents": { + "methods": [ + "importIntents" + ] + }, + "ExportIntents": { + "methods": [ + "exportIntents" + ] + }, + "ListIntents": { + "methods": [ + "listIntents", + "listIntentsStream", + "listIntentsAsync" + ] + } + } + } + } + }, + "Pages": { + "clients": { + "grpc": { + "libraryClient": "PagesClient", + "rpcs": { + "GetPage": { + "methods": [ + "getPage" + ] + }, + "CreatePage": { + "methods": [ + "createPage" + ] + }, + "UpdatePage": { + "methods": [ + "updatePage" + ] + }, + "DeletePage": { + "methods": [ + "deletePage" + ] + }, + "ListPages": { + "methods": [ + "listPages", + "listPagesStream", + "listPagesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PagesClient", + "rpcs": { + "GetPage": { + "methods": [ + "getPage" + ] + }, + "CreatePage": { + "methods": [ + "createPage" + ] + }, + "UpdatePage": { + "methods": [ + "updatePage" + ] + }, + "DeletePage": { + "methods": [ + "deletePage" + ] + }, + "ListPages": { + "methods": [ + "listPages", + "listPagesStream", + "listPagesAsync" + ] + } + } + } + } + }, + "Playbooks": { + "clients": { + "grpc": { + "libraryClient": "PlaybooksClient", + "rpcs": { + "CreatePlaybook": { + "methods": [ + "createPlaybook" + ] + }, + "DeletePlaybook": { + "methods": [ + "deletePlaybook" + ] + }, + "GetPlaybook": { + "methods": [ + "getPlaybook" + ] + }, + "UpdatePlaybook": { + "methods": [ + "updatePlaybook" + ] + }, + "CreatePlaybookVersion": { + "methods": [ + "createPlaybookVersion" + ] + }, + "GetPlaybookVersion": { + "methods": [ + "getPlaybookVersion" + ] + }, + "RestorePlaybookVersion": { + "methods": [ + "restorePlaybookVersion" + ] + }, + "DeletePlaybookVersion": { + "methods": [ + "deletePlaybookVersion" + ] + }, + "ExportPlaybook": { + "methods": [ + "exportPlaybook" + ] + }, + "ImportPlaybook": { + "methods": [ + "importPlaybook" + ] + }, + "ListPlaybooks": { + "methods": [ + "listPlaybooks", + "listPlaybooksStream", + "listPlaybooksAsync" + ] + }, + "ListPlaybookVersions": { + "methods": [ + "listPlaybookVersions", + "listPlaybookVersionsStream", + "listPlaybookVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PlaybooksClient", + "rpcs": { + "CreatePlaybook": { + "methods": [ + "createPlaybook" + ] + }, + "DeletePlaybook": { + "methods": [ + "deletePlaybook" + ] + }, + "GetPlaybook": { + "methods": [ + "getPlaybook" + ] + }, + "UpdatePlaybook": { + "methods": [ + "updatePlaybook" + ] + }, + "CreatePlaybookVersion": { + "methods": [ + "createPlaybookVersion" + ] + }, + "GetPlaybookVersion": { + "methods": [ + "getPlaybookVersion" + ] + }, + "RestorePlaybookVersion": { + "methods": [ + "restorePlaybookVersion" + ] + }, + "DeletePlaybookVersion": { + "methods": [ + "deletePlaybookVersion" + ] + }, + "ExportPlaybook": { + "methods": [ + "exportPlaybook" + ] + }, + "ImportPlaybook": { + "methods": [ + "importPlaybook" + ] + }, + "ListPlaybooks": { + "methods": [ + "listPlaybooks", + "listPlaybooksStream", + "listPlaybooksAsync" + ] + }, + "ListPlaybookVersions": { + "methods": [ + "listPlaybookVersions", + "listPlaybookVersionsStream", + "listPlaybookVersionsAsync" + ] + } + } + } + } + }, + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecuritySettingsServiceClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ + "createSecuritySettings" + ] + }, + "GetSecuritySettings": { + "methods": [ + "getSecuritySettings" + ] + }, + "UpdateSecuritySettings": { + "methods": [ + "updateSecuritySettings" + ] + }, + "DeleteSecuritySettings": { + "methods": [ + "deleteSecuritySettings" + ] + }, + "ListSecuritySettings": { + "methods": [ + "listSecuritySettings", + "listSecuritySettingsStream", + "listSecuritySettingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecuritySettingsServiceClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ + "createSecuritySettings" + ] + }, + "GetSecuritySettings": { + "methods": [ + "getSecuritySettings" + ] + }, + "UpdateSecuritySettings": { + "methods": [ + "updateSecuritySettings" + ] + }, + "DeleteSecuritySettings": { + "methods": [ + "deleteSecuritySettings" + ] + }, + "ListSecuritySettings": { + "methods": [ + "listSecuritySettings", + "listSecuritySettingsStream", + "listSecuritySettingsAsync" + ] + } + } + } + } + }, + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "GetSessionEntityType": { + "methods": [ + "getSessionEntityType" + ] + }, + "CreateSessionEntityType": { + "methods": [ + "createSessionEntityType" + ] + }, + "UpdateSessionEntityType": { + "methods": [ + "updateSessionEntityType" + ] + }, + "DeleteSessionEntityType": { + "methods": [ + "deleteSessionEntityType" + ] + }, + "ListSessionEntityTypes": { + "methods": [ + "listSessionEntityTypes", + "listSessionEntityTypesStream", + "listSessionEntityTypesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "GetSessionEntityType": { + "methods": [ + "getSessionEntityType" + ] + }, + "CreateSessionEntityType": { + "methods": [ + "createSessionEntityType" + ] + }, + "UpdateSessionEntityType": { + "methods": [ + "updateSessionEntityType" + ] + }, + "DeleteSessionEntityType": { + "methods": [ + "deleteSessionEntityType" + ] + }, + "ListSessionEntityTypes": { + "methods": [ + "listSessionEntityTypes", + "listSessionEntityTypesStream", + "listSessionEntityTypesAsync" + ] + } + } + } + } + }, + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ + "detectIntent" + ] + }, + "MatchIntent": { + "methods": [ + "matchIntent" + ] + }, + "FulfillIntent": { + "methods": [ + "fulfillIntent" + ] + }, + "SubmitAnswerFeedback": { + "methods": [ + "submitAnswerFeedback" + ] + }, + "ServerStreamingDetectIntent": { + "methods": [ + "serverStreamingDetectIntent" + ] + }, + "StreamingDetectIntent": { + "methods": [ + "streamingDetectIntent" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ + "detectIntent" + ] + }, + "MatchIntent": { + "methods": [ + "matchIntent" + ] + }, + "FulfillIntent": { + "methods": [ + "fulfillIntent" + ] + }, + "SubmitAnswerFeedback": { + "methods": [ + "submitAnswerFeedback" + ] + } + } + } + } + }, + "TestCases": { + "clients": { + "grpc": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ + "batchDeleteTestCases" + ] + }, + "GetTestCase": { + "methods": [ + "getTestCase" + ] + }, + "CreateTestCase": { + "methods": [ + "createTestCase" + ] + }, + "UpdateTestCase": { + "methods": [ + "updateTestCase" + ] + }, + "CalculateCoverage": { + "methods": [ + "calculateCoverage" + ] + }, + "GetTestCaseResult": { + "methods": [ + "getTestCaseResult" + ] + }, + "RunTestCase": { + "methods": [ + "runTestCase" + ] + }, + "BatchRunTestCases": { + "methods": [ + "batchRunTestCases" + ] + }, + "ImportTestCases": { + "methods": [ + "importTestCases" + ] + }, + "ExportTestCases": { + "methods": [ + "exportTestCases" + ] + }, + "ListTestCases": { + "methods": [ + "listTestCases", + "listTestCasesStream", + "listTestCasesAsync" + ] + }, + "ListTestCaseResults": { + "methods": [ + "listTestCaseResults", + "listTestCaseResultsStream", + "listTestCaseResultsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ + "batchDeleteTestCases" + ] + }, + "GetTestCase": { + "methods": [ + "getTestCase" + ] + }, + "CreateTestCase": { + "methods": [ + "createTestCase" + ] + }, + "UpdateTestCase": { + "methods": [ + "updateTestCase" + ] + }, + "CalculateCoverage": { + "methods": [ + "calculateCoverage" + ] + }, + "GetTestCaseResult": { + "methods": [ + "getTestCaseResult" + ] + }, + "RunTestCase": { + "methods": [ + "runTestCase" + ] + }, + "BatchRunTestCases": { + "methods": [ + "batchRunTestCases" + ] + }, + "ImportTestCases": { + "methods": [ + "importTestCases" + ] + }, + "ExportTestCases": { + "methods": [ + "exportTestCases" + ] + }, + "ListTestCases": { + "methods": [ + "listTestCases", + "listTestCasesStream", + "listTestCasesAsync" + ] + }, + "ListTestCaseResults": { + "methods": [ + "listTestCaseResults", + "listTestCaseResultsStream", + "listTestCaseResultsAsync" + ] + } + } + } + } + }, + "Tools": { + "clients": { + "grpc": { + "libraryClient": "ToolsClient", + "rpcs": { + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "CreateToolVersion": { + "methods": [ + "createToolVersion" + ] + }, + "GetToolVersion": { + "methods": [ + "getToolVersion" + ] + }, + "DeleteToolVersion": { + "methods": [ + "deleteToolVersion" + ] + }, + "RestoreToolVersion": { + "methods": [ + "restoreToolVersion" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListToolVersions": { + "methods": [ + "listToolVersions", + "listToolVersionsStream", + "listToolVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ToolsClient", + "rpcs": { + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "CreateToolVersion": { + "methods": [ + "createToolVersion" + ] + }, + "GetToolVersion": { + "methods": [ + "getToolVersion" + ] + }, + "DeleteToolVersion": { + "methods": [ + "deleteToolVersion" + ] + }, + "RestoreToolVersion": { + "methods": [ + "restoreToolVersion" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListToolVersions": { + "methods": [ + "listToolVersions", + "listToolVersionsStream", + "listToolVersionsAsync" + ] + } + } + } + } + }, + "TransitionRouteGroups": { + "clients": { + "grpc": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "GetTransitionRouteGroup": { + "methods": [ + "getTransitionRouteGroup" + ] + }, + "CreateTransitionRouteGroup": { + "methods": [ + "createTransitionRouteGroup" + ] + }, + "UpdateTransitionRouteGroup": { + "methods": [ + "updateTransitionRouteGroup" + ] + }, + "DeleteTransitionRouteGroup": { + "methods": [ + "deleteTransitionRouteGroup" + ] + }, + "ListTransitionRouteGroups": { + "methods": [ + "listTransitionRouteGroups", + "listTransitionRouteGroupsStream", + "listTransitionRouteGroupsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "GetTransitionRouteGroup": { + "methods": [ + "getTransitionRouteGroup" + ] + }, + "CreateTransitionRouteGroup": { + "methods": [ + "createTransitionRouteGroup" + ] + }, + "UpdateTransitionRouteGroup": { + "methods": [ + "updateTransitionRouteGroup" + ] + }, + "DeleteTransitionRouteGroup": { + "methods": [ + "deleteTransitionRouteGroup" + ] + }, + "ListTransitionRouteGroups": { + "methods": [ + "listTransitionRouteGroups", + "listTransitionRouteGroupsStream", + "listTransitionRouteGroupsAsync" + ] + } + } + } + } + }, + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CompareVersions": { + "methods": [ + "compareVersions" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "LoadVersion": { + "methods": [ + "loadVersion" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VersionsClient", + "rpcs": { + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CompareVersions": { + "methods": [ + "compareVersions" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "LoadVersion": { + "methods": [ + "loadVersion" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + } + } + } + } + }, + "Webhooks": { + "clients": { + "grpc": { + "libraryClient": "WebhooksClient", + "rpcs": { + "GetWebhook": { + "methods": [ + "getWebhook" + ] + }, + "CreateWebhook": { + "methods": [ + "createWebhook" + ] + }, + "UpdateWebhook": { + "methods": [ + "updateWebhook" + ] + }, + "DeleteWebhook": { + "methods": [ + "deleteWebhook" + ] + }, + "ListWebhooks": { + "methods": [ + "listWebhooks", + "listWebhooksStream", + "listWebhooksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WebhooksClient", + "rpcs": { + "GetWebhook": { + "methods": [ + "getWebhook" + ] + }, + "CreateWebhook": { + "methods": [ + "createWebhook" + ] + }, + "UpdateWebhook": { + "methods": [ + "updateWebhook" + ] + }, + "DeleteWebhook": { + "methods": [ + "deleteWebhook" + ] + }, + "ListWebhooks": { + "methods": [ + "listWebhooks", + "listWebhooksStream", + "listWebhooksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_client.ts new file mode 100644 index 000000000000..61f2072aacf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_client.ts @@ -0,0 +1,3895 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/generators_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './generators_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Generator|Generators} + * @class + * @memberof v3 + */ +export class GeneratorsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + generatorsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of GeneratorsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 GeneratorsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof GeneratorsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listGenerators: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'generators', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Generators', + 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.generatorsStub) { + return this.generatorsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Generators. + this.generatorsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Generators', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Generators, + 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 generatorsStubMethods = [ + 'listGenerators', + 'getGenerator', + 'createGenerator', + 'updateGenerator', + 'deleteGenerator', + ]; + for (const methodName of generatorsStubMethods) { + const callPromise = this.generatorsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.generatorsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified generator. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the generator. + * Format: + * `projects//locations//agents//generators/`. + * @param {string} request.languageCode + * The language to list generators for. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Generator|Generator}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/generators.get_generator.js + * region_tag:dialogflow_v3_generated_Generators_GetGenerator_async + */ + getGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest | undefined, + {} | undefined, + ] + >; + getGenerator( + request: protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerator( + request: protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + protos.google.cloud.dialogflow.cx.v3.IGetGeneratorRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a generator in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a generator for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.Generator} request.generator + * Required. The generator to create. + * @param {string} request.languageCode + * The language to create generators for the following fields: + * * `Generator.prompt_text.text` + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Generator|Generator}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/generators.create_generator.js + * region_tag:dialogflow_v3_generated_Generators_CreateGenerator_async + */ + createGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest | undefined, + {} | undefined, + ] + >; + createGenerator( + request: protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createGenerator( + request: protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateGeneratorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update the specified generator. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Generator} request.generator + * Required. The generator to update. + * @param {string} request.languageCode + * The language to list generators for. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Generator|Generator}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/generators.update_generator.js + * region_tag:dialogflow_v3_generated_Generators_UpdateGenerator_async + */ + updateGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest | undefined, + {} | undefined, + ] + >; + updateGenerator( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerator( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest | 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({ + 'generator.name': request.generator!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IGenerator, + | protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateGeneratorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified generators. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the generator to delete. + * Format: + * `projects//locations//agents//generators/`. + * @param {boolean} request.force + * This field has no effect for generators not being used. + * For generators that are used by pages/flows/transition route groups: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the generator, as well + * as any references to the generator (i.e. + * {@link protos.Fulfillment.generator|Generator}) in fulfillments. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/generators.delete_generator.js + * region_tag:dialogflow_v3_generated_Generators_DeleteGenerator_async + */ + deleteGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest | undefined, + {} | undefined, + ] + >; + deleteGenerator( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteGenerator( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteGenerator( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteGeneratorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all generators in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all generators for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list generators for. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Generator|Generator}. + * 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 `listGeneratorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGenerators( + request?: protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator[], + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse, + ] + >; + listGenerators( + request: protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IGenerator + >, + ): void; + listGenerators( + request: protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IGenerator + >, + ): void; + listGenerators( + request?: protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IGenerator + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IGenerator + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IGenerator[], + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IGenerator + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGenerators values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGenerators request %j', request); + return this.innerApiCalls + .listGenerators(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IGenerator[], + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListGeneratorsResponse, + ]) => { + this._log.info('listGenerators values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listGenerators`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all generators for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list generators for. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Generator|Generator} 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 `listGeneratorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGeneratorsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + 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['listGenerators']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listGenerators stream %j', request); + return this.descriptors.page.listGenerators.createStream( + this.innerApiCalls.listGenerators as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listGenerators`, 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 agent to list all generators for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list generators for. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Generator|Generator}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/generators.list_generators.js + * region_tag:dialogflow_v3_generated_Generators_ListGenerators_async + */ + listGeneratorsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListGeneratorsRequest, + 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['listGenerators']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listGenerators iterate %j', request); + return this.descriptors.page.listGenerators.asyncIterate( + this.innerApiCalls['listGenerators'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.generatorsStub && !this._terminated) { + return this.generatorsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_client_config.json new file mode 100644 index 000000000000..5e8fe6c997b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Generators": { + "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 + } + }, + "methods": { + "ListGenerators": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/generators_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/index.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/index.ts new file mode 100644 index 000000000000..a17a1c4d1a5a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/index.ts @@ -0,0 +1,38 @@ +// Copyright 2026 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 { AgentsClient } from './agents_client'; +export { ChangelogsClient } from './changelogs_client'; +export { DeploymentsClient } from './deployments_client'; +export { EntityTypesClient } from './entity_types_client'; +export { EnvironmentsClient } from './environments_client'; +export { ExamplesClient } from './examples_client'; +export { ExperimentsClient } from './experiments_client'; +export { FlowsClient } from './flows_client'; +export { GeneratorsClient } from './generators_client'; +export { IntentsClient } from './intents_client'; +export { PagesClient } from './pages_client'; +export { PlaybooksClient } from './playbooks_client'; +export { SecuritySettingsServiceClient } from './security_settings_service_client'; +export { SessionEntityTypesClient } from './session_entity_types_client'; +export { SessionsClient } from './sessions_client'; +export { TestCasesClient } from './test_cases_client'; +export { ToolsClient } from './tools_client'; +export { TransitionRouteGroupsClient } from './transition_route_groups_client'; +export { VersionsClient } from './versions_client'; +export { WebhooksClient } from './webhooks_client'; diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_client.ts new file mode 100644 index 000000000000..223db8f27c7e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_client.ts @@ -0,0 +1,4360 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/intents_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './intents_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Intent|Intents}. + * @class + * @memberof v3 + */ +export class IntentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + intentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of IntentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 IntentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof IntentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listIntents: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'intents', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const importIntentsResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportIntentsResponse', + ) as gax.protobuf.Type; + const importIntentsMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportIntentsMetadata', + ) as gax.protobuf.Type; + const exportIntentsResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportIntentsResponse', + ) as gax.protobuf.Type; + const exportIntentsMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportIntentsMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + importIntents: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importIntentsResponse.decode.bind(importIntentsResponse), + importIntentsMetadata.decode.bind(importIntentsMetadata), + ), + exportIntents: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportIntentsResponse.decode.bind(exportIntentsResponse), + exportIntentsMetadata.decode.bind(exportIntentsMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Intents', + 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.intentsStub) { + return this.intentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Intents. + this.intentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Intents', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Intents, + 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 intentsStubMethods = [ + 'listIntents', + 'getIntent', + 'createIntent', + 'updateIntent', + 'deleteIntent', + 'importIntents', + 'exportIntents', + ]; + for (const methodName of intentsStubMethods) { + const callPromise = this.intentsStub.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.intentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified intent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent. + * Format: + * `projects//locations//agents//intents/`. + * @param {string} request.languageCode + * The language to retrieve the intent for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Intent|Intent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.get_intent.js + * region_tag:dialogflow_v3_generated_Intents_GetIntent_async + */ + getIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest | undefined, + {} | undefined, + ] + >; + getIntent( + request: protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest | null | undefined, + {} | null | undefined + >, + ): void; + getIntent( + request: protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest | null | undefined, + {} | null | undefined + >, + ): void; + getIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IGetIntentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an intent in the specified agent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create an intent for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.Intent} request.intent + * Required. The intent to create. + * @param {string} request.languageCode + * The language of the following fields in `intent`: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Intent|Intent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.create_intent.js + * region_tag:dialogflow_v3_generated_Intents_CreateIntent_async + */ + createIntent( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest | undefined, + {} | undefined, + ] + >; + createIntent( + request: protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createIntent( + request: protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createIntent( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.ICreateIntentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified intent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Intent} request.intent + * Required. The intent to update. + * @param {string} request.languageCode + * The language of the following fields in `intent`: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Intent|Intent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.update_intent.js + * region_tag:dialogflow_v3_generated_Intents_UpdateIntent_async + */ + updateIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest | undefined, + {} | undefined, + ] + >; + updateIntent( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateIntent( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest | 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({ + 'intent.name': request.intent!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IIntent, + | protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IIntent, + protos.google.cloud.dialogflow.cx.v3.IUpdateIntentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified intent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent to delete. + * Format: + * `projects//locations//agents//intents/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.delete_intent.js + * region_tag:dialogflow_v3_generated_Intents_DeleteIntent_async + */ + deleteIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest | undefined, + {} | undefined, + ] + >; + deleteIntent( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteIntent( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteIntentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Imports the specified intents into the agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.ImportIntentsMetadata|ImportIntentsMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.ImportIntentsResponse|ImportIntentsResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the intents into. + * Format: `projects//locations//agents/`. + * @param {string} request.intentsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import intents from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3.InlineSource} request.intentsContent + * Uncompressed byte content of intents. + * @param {google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption} request.mergeOption + * Merge option for importing intents. If not specified, `REJECT` is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.import_intents.js + * region_tag:dialogflow_v3_generated_Intents_ImportIntents_async + */ + importIntents( + request?: protos.google.cloud.dialogflow.cx.v3.IImportIntentsRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importIntents( + request: protos.google.cloud.dialogflow.cx.v3.IImportIntentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importIntents( + request: protos.google.cloud.dialogflow.cx.v3.IImportIntentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importIntents( + request?: protos.google.cloud.dialogflow.cx.v3.IImportIntentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importIntents response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importIntents request %j', request); + return this.innerApiCalls + .importIntents(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importIntents response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importIntents()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.import_intents.js + * region_tag:dialogflow_v3_generated_Intents_ImportIntents_async + */ + async checkImportIntentsProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + > + > { + this._log.info('importIntents long-running'); + 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.importIntents, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.ImportIntentsMetadata + >; + } + /** + * Exports the selected intents. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.ExportIntentsMetadata|ExportIntentsMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.ExportIntentsResponse|ExportIntentsResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent agent to export intents. + * Format: `projects//locations//agents/`. + * @param {string[]} request.intents + * Required. The name of the intents to export. + * Format: + * `projects//locations//agents//intents/`. + * @param {string} [request.intentsUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the + * intents to. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {boolean} [request.intentsContentInline] + * Optional. The option to return the serialized intents inline. + * @param {google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported intents. If not specified, `BLOB` + * is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.export_intents.js + * region_tag:dialogflow_v3_generated_Intents_ExportIntents_async + */ + exportIntents( + request?: protos.google.cloud.dialogflow.cx.v3.IExportIntentsRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportIntents( + request: protos.google.cloud.dialogflow.cx.v3.IExportIntentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportIntents( + request: protos.google.cloud.dialogflow.cx.v3.IExportIntentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportIntents( + request?: protos.google.cloud.dialogflow.cx.v3.IExportIntentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportIntents response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportIntents request %j', request); + return this.innerApiCalls + .exportIntents(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportIntents response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportIntents()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.export_intents.js + * region_tag:dialogflow_v3_generated_Intents_ExportIntents_async + */ + async checkExportIntentsProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + > + > { + this._log.info('exportIntents long-running'); + 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.exportIntents, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.ExportIntentsMetadata + >; + } + /** + * Returns the list of all intents in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all intents for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list intents for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.cloud.dialogflow.cx.v3.IntentView} request.intentView + * The resource view to apply to the returned intent. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Intent|Intent}. + * 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 `listIntentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listIntents( + request?: protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent[], + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse, + ] + >; + listIntents( + request: protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IIntent + >, + ): void; + listIntents( + request: protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IIntent + >, + ): void; + listIntents( + request?: protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IIntent + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IIntent + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IIntent[], + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IIntent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listIntents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listIntents request %j', request); + return this.innerApiCalls + .listIntents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IIntent[], + protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListIntentsResponse, + ]) => { + this._log.info('listIntents values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listIntents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all intents for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list intents for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.cloud.dialogflow.cx.v3.IntentView} request.intentView + * The resource view to apply to the returned intent. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Intent|Intent} 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 `listIntentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listIntentsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + 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['listIntents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listIntents stream %j', request); + return this.descriptors.page.listIntents.createStream( + this.innerApiCalls.listIntents as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listIntents`, 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 agent to list all intents for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list intents for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.cloud.dialogflow.cx.v3.IntentView} request.intentView + * The resource view to apply to the returned intent. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Intent|Intent}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/intents.list_intents.js + * region_tag:dialogflow_v3_generated_Intents_ListIntents_async + */ + listIntentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListIntentsRequest, + 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['listIntents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listIntents iterate %j', request); + return this.descriptors.page.listIntents.asyncIterate( + this.innerApiCalls['listIntents'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.intentsStub && !this._terminated) { + return this.intentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_client_config.json new file mode 100644 index 000000000000..ce1d78560238 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Intents": { + "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 + } + }, + "methods": { + "ListIntents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportIntents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportIntents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/intents_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_client.ts new file mode 100644 index 000000000000..fe522afee965 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_client.ts @@ -0,0 +1,4014 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/pages_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './pages_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Page|Pages}. + * @class + * @memberof v3 + */ +export class PagesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + pagesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of PagesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 PagesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PagesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listPages: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'pages', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Pages', + 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.pagesStub) { + return this.pagesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Pages. + this.pagesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Pages', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Pages, + 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 pagesStubMethods = [ + 'listPages', + 'getPage', + 'createPage', + 'updatePage', + 'deletePage', + ]; + for (const methodName of pagesStubMethods) { + const callPromise = this.pagesStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.pagesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified page. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the page. + * Format: + * `projects//locations//agents//flows//pages/`. + * @param {string} request.languageCode + * The language to retrieve the page for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Page|Page}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/pages.get_page.js + * region_tag:dialogflow_v3_generated_Pages_GetPage_async + */ + getPage( + request?: protos.google.cloud.dialogflow.cx.v3.IGetPageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IGetPageRequest | undefined, + {} | undefined, + ] + >; + getPage( + request: protos.google.cloud.dialogflow.cx.v3.IGetPageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IGetPageRequest | null | undefined, + {} | null | undefined + >, + ): void; + getPage( + request: protos.google.cloud.dialogflow.cx.v3.IGetPageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IGetPageRequest | null | undefined, + {} | null | undefined + >, + ): void; + getPage( + request?: protos.google.cloud.dialogflow.cx.v3.IGetPageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.IGetPageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IGetPageRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IGetPageRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getPage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.IGetPageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IGetPageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getPage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a page in the specified flow. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to create a page for. + * Format: + * `projects//locations//agents//flows/`. + * @param {google.cloud.dialogflow.cx.v3.Page} request.page + * Required. The page to create. + * @param {string} request.languageCode + * The language of the following fields in `page`: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Page|Page}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/pages.create_page.js + * region_tag:dialogflow_v3_generated_Pages_CreatePage_async + */ + createPage( + request?: protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest | undefined, + {} | undefined, + ] + >; + createPage( + request: protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPage( + request: protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPage( + request?: protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createPage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.ICreatePageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createPage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified page. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Page} request.page + * Required. The page to update. + * @param {string} request.languageCode + * The language of the following fields in `page`: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Page|Page}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/pages.update_page.js + * region_tag:dialogflow_v3_generated_Pages_UpdatePage_async + */ + updatePage( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest | undefined, + {} | undefined, + ] + >; + updatePage( + request: protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePage( + request: protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePage( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest | 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({ + 'page.name': request.page!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updatePage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPage, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPage, + protos.google.cloud.dialogflow.cx.v3.IUpdatePageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updatePage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified page. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the page to delete. + * Format: + * `projects//locations//agents//Flows//pages/`. + * @param {boolean} request.force + * This field has no effect for pages with no incoming transitions. + * For pages with incoming transitions: + * + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the page, as well as + * any transitions to the page (i.e. [Target + * page][EventHandler.target_page] in event handlers or [Target + * page][TransitionRoute.target_page] in transition routes that point to + * this page will be cleared). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/pages.delete_page.js + * region_tag:dialogflow_v3_generated_Pages_DeletePage_async + */ + deletePage( + request?: protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest | undefined, + {} | undefined, + ] + >; + deletePage( + request: protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePage( + request: protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePage( + request?: protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deletePage request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeletePageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deletePage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all pages in the specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to list pages for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Page|Page}. + * 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 `listPagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPages( + request?: protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage[], + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPagesResponse, + ] + >; + listPages( + request: protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPage + >, + ): void; + listPages( + request: protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPage + >, + ): void; + listPages( + request?: protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPage + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPage + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPage[], + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPagesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPage + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPages values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPages request %j', request); + return this.innerApiCalls + .listPages(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IPage[], + protos.google.cloud.dialogflow.cx.v3.IListPagesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPagesResponse, + ]) => { + this._log.info('listPages values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listPages`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to list pages for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Page|Page} 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 `listPagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPagesStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + 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['listPages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPages stream %j', request); + return this.descriptors.page.listPages.createStream( + this.innerApiCalls.listPages as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listPages`, 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 flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to list pages for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Page|Page}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/pages.list_pages.js + * region_tag:dialogflow_v3_generated_Pages_ListPages_async + */ + listPagesAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListPagesRequest, + 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['listPages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPages iterate %j', request); + return this.descriptors.page.listPages.asyncIterate( + this.innerApiCalls['listPages'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.pagesStub && !this._terminated) { + return this.pagesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_client_config.json new file mode 100644 index 000000000000..932e877f2a18 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Pages": { + "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 + } + }, + "methods": { + "ListPages": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetPage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreatePage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdatePage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeletePage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/pages_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_client.ts new file mode 100644 index 000000000000..137e3311563b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_client.ts @@ -0,0 +1,5090 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/playbooks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './playbooks_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Playbook|Playbooks}. + * @class + * @memberof v3 + */ +export class PlaybooksClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + playbooksStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of PlaybooksClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 PlaybooksClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PlaybooksClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listPlaybooks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'playbooks', + ), + listPlaybookVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'playbookVersions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const exportPlaybookResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportPlaybookResponse', + ) as gax.protobuf.Type; + const exportPlaybookMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const importPlaybookResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse', + ) as gax.protobuf.Type; + const importPlaybookMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportPlaybook: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportPlaybookResponse.decode.bind(exportPlaybookResponse), + exportPlaybookMetadata.decode.bind(exportPlaybookMetadata), + ), + importPlaybook: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importPlaybookResponse.decode.bind(importPlaybookResponse), + importPlaybookMetadata.decode.bind(importPlaybookMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Playbooks', + 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.playbooksStub) { + return this.playbooksStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Playbooks. + this.playbooksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Playbooks', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Playbooks, + 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 playbooksStubMethods = [ + 'createPlaybook', + 'deletePlaybook', + 'listPlaybooks', + 'getPlaybook', + 'exportPlaybook', + 'importPlaybook', + 'updatePlaybook', + 'createPlaybookVersion', + 'getPlaybookVersion', + 'restorePlaybookVersion', + 'listPlaybookVersions', + 'deletePlaybookVersion', + ]; + for (const methodName of playbooksStubMethods) { + const callPromise = this.playbooksStub.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.playbooksStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 playbook in a specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a playbook for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.Playbook} request.playbook + * Required. The playbook 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 {@link protos.google.cloud.dialogflow.cx.v3.Playbook|Playbook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.create_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_CreatePlaybook_async + */ + createPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest | undefined, + {} | undefined, + ] + >; + createPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createPlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a specified playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook to delete. + * Format: + * `projects//locations//agents//playbooks/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.delete_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_DeletePlaybook_async + */ + deletePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest | undefined, + {} | undefined, + ] + >; + deletePlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deletePlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook. + * Format: + * `projects//locations//agents//playbooks/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Playbook|Playbook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.get_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_GetPlaybook_async + */ + getPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest | undefined, + {} | undefined, + ] + >; + getPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getPlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + protos.google.cloud.dialogflow.cx.v3.IGetPlaybookRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getPlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Playbook} request.playbook + * Required. The playbook to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Playbook|Playbook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.update_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_UpdatePlaybook_async + */ + updatePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest | undefined, + {} | undefined, + ] + >; + updatePlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest | 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({ + 'playbook.name': request.playbook!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updatePlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdatePlaybookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a version for the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to create a version for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {google.cloud.dialogflow.cx.v3.PlaybookVersion} request.playbookVersion + * Required. The playbook version 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 {@link protos.google.cloud.dialogflow.cx.v3.PlaybookVersion|PlaybookVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.create_playbook_version.js + * region_tag:dialogflow_v3_generated_Playbooks_CreatePlaybookVersion_async + */ + createPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + createPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createPlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreatePlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.PlaybookVersion|PlaybookVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.get_playbook_version.js + * region_tag:dialogflow_v3_generated_Playbooks_GetPlaybookVersion_async + */ + getPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + getPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getPlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetPlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the Playbook and stores it as the + * current playbook draft, returning the playbook with resources updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse|RestorePlaybookVersionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.restore_playbook_version.js + * region_tag:dialogflow_v3_generated_Playbooks_RestorePlaybookVersion_async + */ + restorePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + restorePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restorePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restorePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('restorePlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('restorePlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .restorePlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('restorePlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified version of the Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook version to delete. + * Format: + * `projects//locations//agents//playbooks//versions/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.delete_playbook_version.js + * region_tag:dialogflow_v3_generated_Playbooks_DeletePlaybookVersion_async + */ + deletePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + deletePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deletePlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeletePlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Exports the specified playbook to a binary file. + * + * Note that resources (e.g. examples, tools) that the playbook + * references will also be exported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook to export. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {string} [request.playbookUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the playbook + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized playbook is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.export_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_ExportPlaybook_async + */ + exportPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IExportPlaybookRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IExportPlaybookRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IExportPlaybookRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IExportPlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportPlaybook response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportPlaybook request %j', request); + return this.innerApiCalls + .exportPlaybook(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportPlaybook response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportPlaybook()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.export_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_ExportPlaybook_async + */ + async checkExportPlaybookProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportPlaybookResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('exportPlaybook long-running'); + 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.exportPlaybook, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportPlaybookResponse, + protos.google.protobuf.Struct + >; + } + /** + * Imports the specified playbook to the specified agent from a binary file. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the playbook into. + * Format: `projects//locations//agents/`. + * @param {string} request.playbookUri + * [Dialogflow access + * control] + * (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.playbookContent + * Uncompressed raw byte content for playbook. + * @param {google.cloud.dialogflow.cx.v3.PlaybookImportStrategy} [request.importStrategy] + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.import_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_ImportPlaybook_async + */ + importPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IImportPlaybookRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IImportPlaybookRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importPlaybook( + request: protos.google.cloud.dialogflow.cx.v3.IImportPlaybookRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3.IImportPlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importPlaybook response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importPlaybook request %j', request); + return this.innerApiCalls + .importPlaybook(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importPlaybook response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importPlaybook()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.import_playbook.js + * region_tag:dialogflow_v3_generated_Playbooks_ImportPlaybook_async + */ + async checkImportPlaybookProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('importPlaybook long-running'); + 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.importPlaybook, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse, + protos.google.protobuf.Struct + >; + } + /** + * Returns a list of playbooks in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list playbooks from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Playbook|Playbook}. + * 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 `listPlaybooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybooks( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook[], + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse, + ] + >; + listPlaybooks( + request: protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybook + >, + ): void; + listPlaybooks( + request: protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybook + >, + ): void; + listPlaybooks( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybook + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybook + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook[], + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybook + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPlaybooks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPlaybooks request %j', request); + return this.innerApiCalls + .listPlaybooks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IPlaybook[], + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPlaybooksResponse, + ]) => { + this._log.info('listPlaybooks values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listPlaybooks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list playbooks from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Playbook|Playbook} 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 `listPlaybooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybooksStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + 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['listPlaybooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybooks stream %j', request); + return this.descriptors.page.listPlaybooks.createStream( + this.innerApiCalls.listPlaybooks as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listPlaybooks`, 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 agent to list playbooks from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Playbook|Playbook}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.list_playbooks.js + * region_tag:dialogflow_v3_generated_Playbooks_ListPlaybooks_async + */ + listPlaybooksAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybooksRequest, + 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['listPlaybooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybooks iterate %j', request); + return this.descriptors.page.listPlaybooks.asyncIterate( + this.innerApiCalls['listPlaybooks'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists versions for the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.PlaybookVersion|PlaybookVersion}. + * 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 `listPlaybookVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybookVersions( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion[], + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse, + ] + >; + listPlaybookVersions( + request: protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion + >, + ): void; + listPlaybookVersions( + request: protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion + >, + ): void; + listPlaybookVersions( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion[], + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPlaybookVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPlaybookVersions request %j', request); + return this.innerApiCalls + .listPlaybookVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion[], + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsResponse, + ]) => { + this._log.info('listPlaybookVersions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listPlaybookVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.PlaybookVersion|PlaybookVersion} 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 `listPlaybookVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybookVersionsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + 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['listPlaybookVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybookVersions stream %j', request); + return this.descriptors.page.listPlaybookVersions.createStream( + this.innerApiCalls.listPlaybookVersions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listPlaybookVersions`, 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 playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.PlaybookVersion|PlaybookVersion}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/playbooks.list_playbook_versions.js + * region_tag:dialogflow_v3_generated_Playbooks_ListPlaybookVersions_async + */ + listPlaybookVersionsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListPlaybookVersionsRequest, + 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['listPlaybookVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybookVersions iterate %j', request); + return this.descriptors.page.listPlaybookVersions.asyncIterate( + this.innerApiCalls['listPlaybookVersions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.playbooksStub && !this._terminated) { + return this.playbooksStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_client_config.json new file mode 100644 index 000000000000..696ca9eb5eec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Playbooks": { + "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 + } + }, + "methods": { + "CreatePlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeletePlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListPlaybooks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetPlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportPlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportPlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdatePlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreatePlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetPlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RestorePlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListPlaybookVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeletePlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/playbooks_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_client.ts new file mode 100644 index 000000000000..3e0795697911 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_client.ts @@ -0,0 +1,4192 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/security_settings_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './security_settings_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing security settings for Dialogflow. + * @class + * @memberof v3 + */ +export class SecuritySettingsServiceClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + securitySettingsServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of SecuritySettingsServiceClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 SecuritySettingsServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof SecuritySettingsServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + organizationLocationDeidentifyTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}', + ), + organizationLocationInspectTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationDeidentifyTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}', + ), + projectLocationInspectTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/inspectTemplates/{inspect_template}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listSecuritySettings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'securitySettings', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.SecuritySettingsService', + 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.securitySettingsServiceStub) { + return this.securitySettingsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.SecuritySettingsService. + this.securitySettingsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.SecuritySettingsService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3 + .SecuritySettingsService, + 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 securitySettingsServiceStubMethods = [ + 'createSecuritySettings', + 'getSecuritySettings', + 'updateSecuritySettings', + 'listSecuritySettings', + 'deleteSecuritySettings', + ]; + for (const methodName of securitySettingsServiceStubMethods) { + const callPromise = this.securitySettingsServiceStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securitySettingsServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Create security settings in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to create an + * {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings} for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings} request.securitySettings + * Required. The security settings 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 {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/security_settings_service.create_security_settings.js + * region_tag:dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_async + */ + createSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. The + * returned settings may be stale by up to 1 minute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the settings. + * Format: + * `projects//locations//securitySettings/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/security_settings_service.get_security_settings.js + * region_tag:dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_async + */ + getSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.SecuritySettings} request.securitySettings + * Required. [SecuritySettings] object that contains values for each of the + * fields to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/security_settings_service.update_security_settings.js + * region_tag:dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_async + */ + updateSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | 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({ + 'security_settings.name': request.securitySettings!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings} to + * delete. Format: + * `projects//locations//securitySettings/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/security_settings_service.delete_security_settings.js + * region_tag:dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_async + */ + deleteSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all security settings in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. + * 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 `listSecuritySettingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse, + ] + >; + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings + >, + ): void; + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings + >, + ): void; + listSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSecuritySettings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSecuritySettings request %j', request); + return this.innerApiCalls + .listSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsResponse, + ]) => { + this._log.info('listSecuritySettings values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSecuritySettings`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings} 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 `listSecuritySettingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecuritySettingsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + 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['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSecuritySettings stream %j', request); + return this.descriptors.page.listSecuritySettings.createStream( + this.innerApiCalls.listSecuritySettings as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSecuritySettings`, 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 location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.SecuritySettings|SecuritySettings}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/security_settings_service.list_security_settings.js + * region_tag:dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_async + */ + listSecuritySettingsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListSecuritySettingsRequest, + 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['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSecuritySettings iterate %j', request); + return this.descriptors.page.listSecuritySettings.asyncIterate( + this.innerApiCalls['listSecuritySettings'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 organizationLocationDeidentifyTemplate resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + organizationLocationDeidentifyTemplatePath( + organization: string, + location: string, + deidentifyTemplate: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render( + { + organization: organization, + location: location, + deidentify_template: deidentifyTemplate, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationDeidentifyTemplateName( + organizationLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match( + organizationLocationDeidentifyTemplateName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationDeidentifyTemplateName( + organizationLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match( + organizationLocationDeidentifyTemplateName, + ).location; + } + + /** + * Parse the deidentify_template from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName( + organizationLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match( + organizationLocationDeidentifyTemplateName, + ).deidentify_template; + } + + /** + * Return a fully-qualified organizationLocationInspectTemplate resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + organizationLocationInspectTemplatePath( + organization: string, + location: string, + inspectTemplate: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.render( + { + organization: organization, + location: location, + inspect_template: inspectTemplate, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationInspectTemplateName( + organizationLocationInspectTemplateName: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match( + organizationLocationInspectTemplateName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationInspectTemplateName( + organizationLocationInspectTemplateName: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match( + organizationLocationInspectTemplateName, + ).location; + } + + /** + * Parse the inspect_template from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromOrganizationLocationInspectTemplateName( + organizationLocationInspectTemplateName: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match( + organizationLocationInspectTemplateName, + ).inspect_template; + } + + /** + * Return a fully-qualified page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationDeidentifyTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + projectLocationDeidentifyTemplatePath( + project: string, + location: string, + deidentifyTemplate: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render( + { + project: project, + location: location, + deidentify_template: deidentifyTemplate, + }, + ); + } + + /** + * Parse the project from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDeidentifyTemplateName( + projectLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match( + projectLocationDeidentifyTemplateName, + ).project; + } + + /** + * Parse the location from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDeidentifyTemplateName( + projectLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match( + projectLocationDeidentifyTemplateName, + ).location; + } + + /** + * Parse the deidentify_template from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName( + projectLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match( + projectLocationDeidentifyTemplateName, + ).deidentify_template; + } + + /** + * Return a fully-qualified projectLocationInspectTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + projectLocationInspectTemplatePath( + project: string, + location: string, + inspectTemplate: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.render( + { + project: project, + location: location, + inspect_template: inspectTemplate, + }, + ); + } + + /** + * Parse the project from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationInspectTemplateName( + projectLocationInspectTemplateName: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match( + projectLocationInspectTemplateName, + ).project; + } + + /** + * Parse the location from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationInspectTemplateName( + projectLocationInspectTemplateName: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match( + projectLocationInspectTemplateName, + ).location; + } + + /** + * Parse the inspect_template from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromProjectLocationInspectTemplateName( + projectLocationInspectTemplateName: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match( + projectLocationInspectTemplateName, + ).inspect_template; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.securitySettingsServiceStub && !this._terminated) { + return this.securitySettingsServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_client_config.json new file mode 100644 index 000000000000..ac615872f2f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.SecuritySettingsService": { + "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 + } + }, + "methods": { + "CreateSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/security_settings_service_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_client.ts new file mode 100644 index 000000000000..9e4a73017ce5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_client.ts @@ -0,0 +1,4020 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/session_entity_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './session_entity_types_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3.SessionEntityType|SessionEntityTypes}. + * @class + * @memberof v3 + */ +export class SessionEntityTypesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + sessionEntityTypesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of SessionEntityTypesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 SessionEntityTypesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SessionEntityTypesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listSessionEntityTypes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sessionEntityTypes', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.SessionEntityTypes', + 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.sessionEntityTypesStub) { + return this.sessionEntityTypesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.SessionEntityTypes. + this.sessionEntityTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.SessionEntityTypes', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3 + .SessionEntityTypes, + 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 sessionEntityTypesStubMethods = [ + 'listSessionEntityTypes', + 'getSessionEntityType', + 'createSessionEntityType', + 'updateSessionEntityType', + 'deleteSessionEntityType', + ]; + for (const methodName of sessionEntityTypesStubMethods) { + const callPromise = this.sessionEntityTypesStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.sessionEntityTypesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session entity type. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.SessionEntityType|SessionEntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/session_entity_types.get_session_entity_type.js + * region_tag:dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_async + */ + getSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + getSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to create a session entity type for. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {google.cloud.dialogflow.cx.v3.SessionEntityType} request.sessionEntityType + * Required. The session entity type 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 {@link protos.google.cloud.dialogflow.cx.v3.SessionEntityType|SessionEntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/session_entity_types.create_session_entity_type.js + * region_tag:dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_async + */ + createSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + createSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.SessionEntityType} request.sessionEntityType + * Required. The session entity type to update. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, + * we assume default 'draft' environment. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get 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 {@link protos.google.cloud.dialogflow.cx.v3.SessionEntityType|SessionEntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/session_entity_types.update_session_entity_type.js + * region_tag:dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_async + */ + updateSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + updateSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | 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({ + 'session_entity_type.name': request.sessionEntityType!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session entity type to delete. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, + * we assume default 'draft' environment. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/session_entity_types.delete_session_entity_type.js + * region_tag:dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_async + */ + deleteSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + deleteSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all session entity types in the specified session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.SessionEntityType|SessionEntityType}. + * 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 `listSessionEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessionEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType[], + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse, + ] + >; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType + >, + ): void; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType + >, + ): void; + listSessionEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType[], + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSessionEntityTypes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSessionEntityTypes request %j', request); + return this.innerApiCalls + .listSessionEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.ISessionEntityType[], + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesResponse, + ]) => { + this._log.info('listSessionEntityTypes values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSessionEntityTypes`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.SessionEntityType|SessionEntityType} 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 `listSessionEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessionEntityTypesStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + 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['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSessionEntityTypes stream %j', request); + return this.descriptors.page.listSessionEntityTypes.createStream( + this.innerApiCalls.listSessionEntityTypes as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSessionEntityTypes`, 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 session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.SessionEntityType|SessionEntityType}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/session_entity_types.list_session_entity_types.js + * region_tag:dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_async + */ + listSessionEntityTypesAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListSessionEntityTypesRequest, + 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['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSessionEntityTypes iterate %j', request); + return this.descriptors.page.listSessionEntityTypes.asyncIterate( + this.innerApiCalls['listSessionEntityTypes'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentSessionPath( + project: string, + location: string, + agent: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.render({ + project: project, + location: location, + agent: agent, + session: session, + }); + } + + /** + * Parse the project from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.sessionEntityTypesStub && !this._terminated) { + return this.sessionEntityTypesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_client_config.json new file mode 100644 index 000000000000..e5acb93ab13b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.SessionEntityTypes": { + "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 + } + }, + "methods": { + "ListSessionEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/session_entity_types_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_client.ts new file mode 100644 index 000000000000..b707e1df228b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_client.ts @@ -0,0 +1,4107 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/sessions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './sessions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A session represents an interaction with a user. You retrieve user input + * and pass it to the + * {@link protos.google.cloud.dialogflow.cx.v3.Sessions.DetectIntent|DetectIntent} method to + * determine user intent and respond. + * @class + * @memberof v3 + */ +export class SessionsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + sessionsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of SessionsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 SessionsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SessionsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectLocationAgentEnvironmentSessionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationCollectionDataStorePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + ), + projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + serverStreamingDetectIntent: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + streamingDetectIntent: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Sessions', + 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.sessionsStub) { + return this.sessionsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Sessions. + this.sessionsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Sessions', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Sessions, + 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 sessionsStubMethods = [ + 'detectIntent', + 'serverStreamingDetectIntent', + 'streamingDetectIntent', + 'matchIntent', + 'fulfillIntent', + 'submitAnswerFeedback', + ]; + for (const methodName of sessionsStubMethods) { + const callPromise = this.sessionsStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({ objectMode: true }); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.', + ), + ); + }); + return stream; + } + 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.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.sessionsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Processes a natural language query and returns structured, actionable data + * as a result. This method is not idempotent, because it may cause session + * entity types to be updated, which in turn might affect results of future + * queries. + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * @param {google.cloud.dialogflow.cx.v3.QueryParameters} request.queryParams + * The parameters of this query. + * @param {google.cloud.dialogflow.cx.v3.QueryInput} request.queryInput + * Required. The input specification. + * @param {google.cloud.dialogflow.cx.v3.OutputAudioConfig} request.outputAudioConfig + * Instructs the speech synthesizer how to generate the output audio. + * @param {google.cloud.dialogflow.cx.v3.DetectIntentResponseView} [request.responseView] + * Optional. Specifies which fields in the + * {@link protos.google.cloud.dialogflow.cx.v3.QueryResult|QueryResult} to return. If not + * set, the default is DETECT_INTENT_RESPONSE_VIEW_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 {@link protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse|DetectIntentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/sessions.detect_intent.js + * region_tag:dialogflow_v3_generated_Sessions_DetectIntent_async + */ + detectIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest | undefined, + {} | undefined, + ] + >; + detectIntent( + request: protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + detectIntent( + request: protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + detectIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest | 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('detectIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('detectIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .detectIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('detectIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns preliminary intent match results, doesn't change the session + * status. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * @param {google.cloud.dialogflow.cx.v3.QueryParameters} request.queryParams + * The parameters of this query. + * @param {google.cloud.dialogflow.cx.v3.QueryInput} request.queryInput + * Required. The input specification. + * @param {boolean} request.persistParameterChanges + * Persist session parameter changes from `query_params`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.MatchIntentResponse|MatchIntentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/sessions.match_intent.js + * region_tag:dialogflow_v3_generated_Sessions_MatchIntent_async + */ + matchIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest | undefined, + {} | undefined, + ] + >; + matchIntent( + request: protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + matchIntent( + request: protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + matchIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest | 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('matchIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('matchIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .matchIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IMatchIntentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('matchIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Fulfills a matched intent returned by + * {@link protos.google.cloud.dialogflow.cx.v3.Sessions.MatchIntent|MatchIntent}. Must be + * called after + * {@link protos.google.cloud.dialogflow.cx.v3.Sessions.MatchIntent|MatchIntent}, with + * input from + * {@link protos.google.cloud.dialogflow.cx.v3.MatchIntentResponse|MatchIntentResponse}. + * Otherwise, the behavior is undefined. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.MatchIntentRequest} request.matchIntentRequest + * Must be same as the corresponding MatchIntent request, otherwise the + * behavior is undefined. + * @param {google.cloud.dialogflow.cx.v3.Match} request.match + * The matched intent/event to fulfill. + * @param {google.cloud.dialogflow.cx.v3.OutputAudioConfig} request.outputAudioConfig + * Instructs the speech synthesizer how to generate output audio. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.FulfillIntentResponse|FulfillIntentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/sessions.fulfill_intent.js + * region_tag:dialogflow_v3_generated_Sessions_FulfillIntent_async + */ + fulfillIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest | undefined, + {} | undefined, + ] + >; + fulfillIntent( + request: protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fulfillIntent( + request: protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fulfillIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest | 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({ + 'match_intent_request.session': + request.matchIntentRequest!.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('fulfillIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fulfillIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .fulfillIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.IFulfillIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('fulfillIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the feedback received from the user for a single turn of the bot + * response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session the feedback was sent to. + * @param {string} request.responseId + * Required. ID of the response to update its feedback. This is the same as + * DetectIntentResponse.response_id. + * @param {google.cloud.dialogflow.cx.v3.AnswerFeedback} request.answerFeedback + * Required. Feedback provided for a bot answer. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields to update. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.AnswerFeedback|AnswerFeedback}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/sessions.submit_answer_feedback.js + * region_tag:dialogflow_v3_generated_Sessions_SubmitAnswerFeedback_async + */ + submitAnswerFeedback( + request?: protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + ( + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | undefined + ), + {} | undefined, + ] + >; + submitAnswerFeedback( + request: protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + submitAnswerFeedback( + request: protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + submitAnswerFeedback( + request?: protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + ( + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('submitAnswerFeedback request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('submitAnswerFeedback response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .submitAnswerFeedback(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback, + ( + | protos.google.cloud.dialogflow.cx.v3.ISubmitAnswerFeedbackRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('submitAnswerFeedback response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Processes a natural language query and returns structured, actionable data + * as a result through server-side streaming. Server-side streaming allows + * Dialogflow to send [partial + * responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) + * earlier in a single request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * @param {google.cloud.dialogflow.cx.v3.QueryParameters} request.queryParams + * The parameters of this query. + * @param {google.cloud.dialogflow.cx.v3.QueryInput} request.queryInput + * Required. The input specification. + * @param {google.cloud.dialogflow.cx.v3.OutputAudioConfig} request.outputAudioConfig + * Instructs the speech synthesizer how to generate the output audio. + * @param {google.cloud.dialogflow.cx.v3.DetectIntentResponseView} [request.responseView] + * Optional. Specifies which fields in the + * {@link protos.google.cloud.dialogflow.cx.v3.QueryResult|QueryResult} to return. If not + * set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse|DetectIntentResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v3/sessions.server_streaming_detect_intent.js + * region_tag:dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_async + */ + serverStreamingDetectIntent( + request?: protos.google.cloud.dialogflow.cx.v3.IDetectIntentRequest, + options?: CallOptions, + ): gax.CancellableStream { + 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('serverStreamingDetectIntent stream %j', options); + return this.innerApiCalls.serverStreamingDetectIntent(request, options); + } + + /** + * Processes a natural language query in audio format in a streaming fashion + * and returns structured, actionable data as a result. This method is only + * available via the gRPC API (not REST). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * + * @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 is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest|StreamingDetectIntentRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse|StreamingDetectIntentResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v3/sessions.streaming_detect_intent.js + * region_tag:dialogflow_v3_generated_Sessions_StreamingDetectIntent_async + */ + streamingDetectIntent(options?: CallOptions): gax.CancellableStream { + this.initialize().catch((err) => { + throw err; + }); + this._log.info('streamingDetectIntent stream %j', options); + return this.innerApiCalls.streamingDetectIntent(null, options); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionPath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentSessionPath( + project: string, + location: string, + agent: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.render({ + project: project, + location: location, + agent: agent, + session: session, + }); + } + + /** + * Parse the project from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStorePath( + project: string, + location: string, + collection: string, + dataStore: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + }, + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStorePath( + project: string, + location: string, + dataStore: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.render({ + project: project, + location: location, + data_store: dataStore, + }); + } + + /** + * Parse the project from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreName( + projectLocationDataStoreName: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName, + ).project; + } + + /** + * Parse the location from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreName( + projectLocationDataStoreName: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName, + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreName( + projectLocationDataStoreName: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName, + ).data_store; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.sessionsStub && !this._terminated) { + return this.sessionsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_client_config.json new file mode 100644 index 000000000000..88c47ea37cc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Sessions": { + "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 + } + }, + "methods": { + "DetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ServerStreamingDetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingDetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MatchIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "FulfillIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SubmitAnswerFeedback": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/sessions_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_client.ts new file mode 100644 index 000000000000..a72a1b1aaec1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_client.ts @@ -0,0 +1,5321 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/test_cases_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './test_cases_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.TestCase|Test Cases} and + * {@link protos.google.cloud.dialogflow.cx.v3.TestCaseResult|Test Case Results}. + * @class + * @memberof v3 + */ +export class TestCasesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + testCasesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of TestCasesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 TestCasesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TestCasesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listTestCases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'testCases', + ), + listTestCaseResults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'testCaseResults', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const runTestCaseResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.RunTestCaseResponse', + ) as gax.protobuf.Type; + const runTestCaseMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.RunTestCaseMetadata', + ) as gax.protobuf.Type; + const batchRunTestCasesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse', + ) as gax.protobuf.Type; + const batchRunTestCasesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata', + ) as gax.protobuf.Type; + const importTestCasesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportTestCasesResponse', + ) as gax.protobuf.Type; + const importTestCasesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata', + ) as gax.protobuf.Type; + const exportTestCasesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportTestCasesResponse', + ) as gax.protobuf.Type; + const exportTestCasesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + runTestCase: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runTestCaseResponse.decode.bind(runTestCaseResponse), + runTestCaseMetadata.decode.bind(runTestCaseMetadata), + ), + batchRunTestCases: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchRunTestCasesResponse.decode.bind(batchRunTestCasesResponse), + batchRunTestCasesMetadata.decode.bind(batchRunTestCasesMetadata), + ), + importTestCases: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importTestCasesResponse.decode.bind(importTestCasesResponse), + importTestCasesMetadata.decode.bind(importTestCasesMetadata), + ), + exportTestCases: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportTestCasesResponse.decode.bind(exportTestCasesResponse), + exportTestCasesMetadata.decode.bind(exportTestCasesMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.TestCases', + 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.testCasesStub) { + return this.testCasesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.TestCases. + this.testCasesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.TestCases', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.TestCases, + 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 testCasesStubMethods = [ + 'listTestCases', + 'batchDeleteTestCases', + 'getTestCase', + 'createTestCase', + 'updateTestCase', + 'runTestCase', + 'batchRunTestCases', + 'calculateCoverage', + 'importTestCases', + 'exportTestCases', + 'listTestCaseResults', + 'getTestCaseResult', + ]; + for (const methodName of testCasesStubMethods) { + const callPromise = this.testCasesStub.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.testCasesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Batch deletes test cases. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to delete test cases from. + * Format: `projects//locations//agents/`. + * @param {string[]} request.names + * Required. Format of test case names: + * `projects//locations//agents//testCases/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.batch_delete_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_BatchDeleteTestCases_async + */ + batchDeleteTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | undefined + ), + {} | undefined, + ] + >; + batchDeleteTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + batchDeleteTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + batchDeleteTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('batchDeleteTestCases request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchDeleteTestCases response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchDeleteTestCases(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IBatchDeleteTestCasesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchDeleteTestCases response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a test case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the testcase. + * Format: + * `projects//locations//agents//testCases/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TestCase|TestCase}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.get_test_case.js + * region_tag:dialogflow_v3_generated_TestCases_GetTestCase_async + */ + getTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest | undefined, + {} | undefined, + ] + >; + getTestCase( + request: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCase( + request: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getTestCase request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTestCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTestCase(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + protos.google.cloud.dialogflow.cx.v3.IGetTestCaseRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTestCase response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a test case for the given agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create the test case for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.TestCase} request.testCase + * Required. The test case 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 {@link protos.google.cloud.dialogflow.cx.v3.TestCase|TestCase}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.create_test_case.js + * region_tag:dialogflow_v3_generated_TestCases_CreateTestCase_async + */ + createTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest | undefined, + {} | undefined, + ] + >; + createTestCase( + request: protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTestCase( + request: protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createTestCase request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTestCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTestCase(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateTestCaseRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createTestCase response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified test case. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.TestCase} request.testCase + * Required. The test case to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to specify which fields should be updated. The + * {@link protos.google.cloud.dialogflow.cx.v3.TestCase.creation_time|`creationTime`} and + * {@link protos.google.cloud.dialogflow.cx.v3.TestCase.last_test_result|`lastTestResult`} + * cannot 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 {@link protos.google.cloud.dialogflow.cx.v3.TestCase|TestCase}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.update_test_case.js + * region_tag:dialogflow_v3_generated_TestCases_UpdateTestCase_async + */ + updateTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest | undefined, + {} | undefined, + ] + >; + updateTestCase( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTestCase( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest | 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({ + 'test_case.name': request.testCase!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateTestCase request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCase, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTestCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTestCase(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateTestCaseRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTestCase response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Calculates the test coverage for an agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.agent + * Required. The agent to calculate coverage for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType} request.type + * Required. The type of coverage requested. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse|CalculateCoverageResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.calculate_coverage.js + * region_tag:dialogflow_v3_generated_TestCases_CalculateCoverage_async + */ + calculateCoverage( + request?: protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | undefined + ), + {} | undefined, + ] + >; + calculateCoverage( + request: protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + calculateCoverage( + request: protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + calculateCoverage( + request?: protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | 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({ + agent: request.agent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('calculateCoverage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('calculateCoverage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .calculateCoverage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('calculateCoverage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a test case result. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the testcase. + * Format: + * `projects//locations//agents//testCases//results/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TestCaseResult|TestCaseResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.get_test_case_result.js + * region_tag:dialogflow_v3_generated_TestCases_GetTestCaseResult_async + */ + getTestCaseResult( + request?: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | undefined + ), + {} | undefined, + ] + >; + getTestCaseResult( + request: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCaseResult( + request: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCaseResult( + request?: protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getTestCaseResult request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTestCaseResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTestCaseResult(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetTestCaseResultRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTestCaseResult response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Kicks off a test case run. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.RunTestCaseMetadata|RunTestCaseMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.RunTestCaseResponse|RunTestCaseResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format of test case name to run: + * `projects//locations//agents//testCases/`. + * @param {string} [request.environment] + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.run_test_case.js + * region_tag:dialogflow_v3_generated_TestCases_RunTestCase_async + */ + runTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.IRunTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + runTestCase( + request: protos.google.cloud.dialogflow.cx.v3.IRunTestCaseRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runTestCase( + request: protos.google.cloud.dialogflow.cx.v3.IRunTestCaseRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runTestCase( + request?: protos.google.cloud.dialogflow.cx.v3.IRunTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runTestCase response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runTestCase request %j', request); + return this.innerApiCalls + .runTestCase(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('runTestCase response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `runTestCase()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.run_test_case.js + * region_tag:dialogflow_v3_generated_TestCases_RunTestCase_async + */ + async checkRunTestCaseProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.RunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + > + > { + this._log.info('runTestCase long-running'); + 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.runTestCase, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.RunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.RunTestCaseMetadata + >; + } + /** + * Kicks off a batch run of test cases. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata|BatchRunTestCasesMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse|BatchRunTestCasesResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Agent name. Format: + * `projects//locations//agents/`. + * @param {string} [request.environment] + * Optional. If not set, draft environment is assumed. Format: + * `projects//locations//agents//environments/`. + * @param {string[]} request.testCases + * Required. Format: + * `projects//locations//agents//testCases/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.batch_run_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_BatchRunTestCases_async + */ + batchRunTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + batchRunTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + batchRunTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + batchRunTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchRunTestCases response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchRunTestCases request %j', request); + return this.innerApiCalls + .batchRunTestCases(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchRunTestCases response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `batchRunTestCases()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.batch_run_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_BatchRunTestCases_async + */ + async checkBatchRunTestCasesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + > + > { + this._log.info('batchRunTestCases long-running'); + 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.batchRunTestCases, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata + >; + } + /** + * Imports the test cases from a Cloud Storage bucket or a local file. It + * always creates new test cases and won't overwrite any existing ones. The + * provided ID in the imported test case is neglected. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata|ImportTestCasesMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.ImportTestCasesResponse|ImportTestCasesResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import test cases to. + * Format: `projects//locations//agents/`. + * @param {string} request.gcsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import test cases from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.content + * Uncompressed raw byte content for test cases. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.import_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_ImportTestCases_async + */ + importTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IImportTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IImportTestCasesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IImportTestCasesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IImportTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importTestCases response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importTestCases request %j', request); + return this.innerApiCalls + .importTestCases(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importTestCases response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importTestCases()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.import_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_ImportTestCases_async + */ + async checkImportTestCasesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + > + > { + this._log.info('importTestCases long-running'); + 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.importTestCases, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata + >; + } + /** + * Exports the test cases under the agent to a Cloud Storage bucket or a local + * file. Filter can be applied to export a subset of test cases. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata|ExportTestCasesMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3.ExportTestCasesResponse|ExportTestCasesResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent where to export test cases from. + * Format: `projects//locations//agents/`. + * @param {string} request.gcsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the test cases to. The format of this URI must be + * `gs:///`. If unspecified, the serialized test + * cases is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat} request.dataFormat + * The data format of the exported test cases. If not specified, `BLOB` is + * assumed. + * @param {string} request.filter + * The filter expression used to filter exported test cases, see + * [API Filtering](https://aip.dev/160). The expression is case insensitive + * and supports the following syntax: + * + * name = [OR name = ] ... + * + * For example: + * + * * "name = t1 OR name = t2" matches the test case with the exact resource + * name "t1" or "t2". + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.export_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_ExportTestCases_async + */ + exportTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IExportTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IExportTestCasesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IExportTestCasesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IExportTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportTestCases response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportTestCases request %j', request); + return this.innerApiCalls + .exportTestCases(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportTestCases response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportTestCases()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.export_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_ExportTestCases_async + */ + async checkExportTestCasesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + > + > { + this._log.info('exportTestCases long-running'); + 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.exportTestCases, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.ExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata + >; + } + /** + * Fetches a list of test cases for a given agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all pages for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView} request.view + * Specifies whether response should include all fields or just the metadata. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TestCase|TestCase}. + * 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 `listTestCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase[], + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse, + ] + >; + listTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCase + >, + ): void; + listTestCases( + request: protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCase + >, + ): void; + listTestCases( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCase + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCase + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCase[], + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCase + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTestCases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTestCases request %j', request); + return this.innerApiCalls + .listTestCases(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.ITestCase[], + protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTestCasesResponse, + ]) => { + this._log.info('listTestCases values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTestCases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all pages for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView} request.view + * Specifies whether response should include all fields or just the metadata. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TestCase|TestCase} 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 `listTestCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCasesStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + 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['listTestCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCases stream %j', request); + return this.descriptors.page.listTestCases.createStream( + this.innerApiCalls.listTestCases as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTestCases`, 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 agent to list all pages for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView} request.view + * Specifies whether response should include all fields or just the metadata. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.TestCase|TestCase}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.list_test_cases.js + * region_tag:dialogflow_v3_generated_TestCases_ListTestCases_async + */ + listTestCasesAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCasesRequest, + 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['listTestCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCases iterate %j', request); + return this.descriptors.page.listTestCases.asyncIterate( + this.innerApiCalls['listTestCases'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Fetches the list of run results for the given test case. A maximum of 100 + * results are kept for each test case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.filter + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * + * [AND ] ... + * [AND latest] + * + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * + * `latest` only returns the latest test result in all results for each test + * case. + * + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TestCaseResult|TestCaseResult}. + * 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 `listTestCaseResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCaseResults( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult[], + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse, + ] + >; + listTestCaseResults( + request: protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult + >, + ): void; + listTestCaseResults( + request: protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult + >, + ): void; + listTestCaseResults( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult[], + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTestCaseResults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTestCaseResults request %j', request); + return this.innerApiCalls + .listTestCaseResults(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.ITestCaseResult[], + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsResponse, + ]) => { + this._log.info('listTestCaseResults values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTestCaseResults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.filter + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * + * [AND ] ... + * [AND latest] + * + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * + * `latest` only returns the latest test result in all results for each test + * case. + * + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TestCaseResult|TestCaseResult} 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 `listTestCaseResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCaseResultsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + 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['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCaseResults stream %j', request); + return this.descriptors.page.listTestCaseResults.createStream( + this.innerApiCalls.listTestCaseResults as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTestCaseResults`, 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 test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.filter + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * + * [AND ] ... + * [AND latest] + * + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * + * `latest` only returns the latest test result in all results for each test + * case. + * + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.TestCaseResult|TestCaseResult}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/test_cases.list_test_case_results.js + * region_tag:dialogflow_v3_generated_TestCases_ListTestCaseResults_async + */ + listTestCaseResultsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListTestCaseResultsRequest, + 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['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCaseResults iterate %j', request); + return this.descriptors.page.listTestCaseResults.asyncIterate( + this.innerApiCalls['listTestCaseResults'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.testCasesStub && !this._terminated) { + return this.testCasesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_client_config.json new file mode 100644 index 000000000000..cd8f6ce590e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.TestCases": { + "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 + } + }, + "methods": { + "ListTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "BatchDeleteTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RunTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "BatchRunTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CalculateCoverage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListTestCaseResults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTestCaseResult": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/test_cases_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_client.ts new file mode 100644 index 000000000000..30b0e7bd3ecd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_client.ts @@ -0,0 +1,4694 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/tools_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tools_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tools}. + * @class + * @memberof v3 + */ +export class ToolsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + toolsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ToolsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ToolsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ToolsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listTools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tools', + ), + listToolVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'toolVersions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Tools', + 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.toolsStub) { + return this.toolsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Tools. + this.toolsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Tools', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Tools, + 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 toolsStubMethods = [ + 'createTool', + 'listTools', + 'getTool', + 'updateTool', + 'deleteTool', + 'listToolVersions', + 'createToolVersion', + 'getToolVersion', + 'deleteToolVersion', + 'restoreToolVersion', + ]; + for (const methodName of toolsStubMethods) { + const callPromise = this.toolsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.toolsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool} in the specified + * agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a Tool for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.Tool} request.tool + * Required. The Tool to be created. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.create_tool.js + * region_tag:dialogflow_v3_generated_Tools_CreateTool_async + */ + createTool( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest | undefined, + {} | undefined, + ] + >; + createTool( + request: protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTool( + request: protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTool( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.ICreateToolRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tool. + * Format: + * `projects//locations//agents//tools/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.get_tool.js + * region_tag:dialogflow_v3_generated_Tools_GetTool_async + */ + getTool( + request?: protos.google.cloud.dialogflow.cx.v3.IGetToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IGetToolRequest | undefined, + {} | undefined, + ] + >; + getTool( + request: protos.google.cloud.dialogflow.cx.v3.IGetToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IGetToolRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTool( + request: protos.google.cloud.dialogflow.cx.v3.IGetToolRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IGetToolRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTool( + request?: protos.google.cloud.dialogflow.cx.v3.IGetToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.IGetToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IGetToolRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IGetToolRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.IGetToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IGetToolRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update the specified {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Tool} request.tool + * Required. The Tool to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.update_tool.js + * region_tag:dialogflow_v3_generated_Tools_UpdateTool_async + */ + updateTool( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest | undefined, + {} | undefined, + ] + >; + updateTool( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTool( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTool( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest | 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({ + 'tool.name': request.tool!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITool, + | protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITool, + protos.google.cloud.dialogflow.cx.v3.IUpdateToolRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a specified {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tool to be deleted. + * Format: + * `projects//locations//agents//tools/`. + * @param {boolean} request.force + * This field has no effect for Tools not being used. + * For Tools that are used: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.delete_tool.js + * region_tag:dialogflow_v3_generated_Tools_DeleteTool_async + */ + deleteTool( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest | undefined, + {} | undefined, + ] + >; + deleteTool( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTool( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTool( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteToolRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a version for the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The tool to create a version for. + * Format: + * `projects//locations//agents//tools/`. + * @param {google.cloud.dialogflow.cx.v3.ToolVersion} request.toolVersion + * Required. The tool version 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 {@link protos.google.cloud.dialogflow.cx.v3.ToolVersion|ToolVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.create_tool_version.js + * region_tag:dialogflow_v3_generated_Tools_CreateToolVersion_async + */ + createToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | undefined + ), + {} | undefined, + ] + >; + createToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the + * {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.ToolVersion|ToolVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.get_tool_version.js + * region_tag:dialogflow_v3_generated_Tools_GetToolVersion_async + */ + getToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest | undefined, + {} | undefined, + ] + >; + getToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified version of the + * {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the tool version to delete. + * Format: + * `projects//locations//agents//tools//versions/`. + * @param {boolean} [request.force] + * Optional. This field has no effect for Tools not being used. + * For Tools that are used: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.delete_tool_version.js + * region_tag:dialogflow_v3_generated_Tools_DeleteToolVersion_async + */ + deleteToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the Tool and stores it as the + * current tool draft, returning the tool with resources updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse|RestoreToolVersionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.restore_tool_version.js + * region_tag:dialogflow_v3_generated_Tools_RestoreToolVersion_async + */ + restoreToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | undefined + ), + {} | undefined, + ] + >; + restoreToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restoreToolVersion( + request: protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restoreToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('restoreToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('restoreToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .restoreToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('restoreToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns a list of {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tools} in the + * specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list the Tools from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * 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 `listToolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTools( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool[], + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListToolsResponse, + ] + >; + listTools( + request: protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITool + >, + ): void; + listTools( + request: protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITool + >, + ): void; + listTools( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITool + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITool + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITool[], + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListToolsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITool + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTools values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTools request %j', request); + return this.innerApiCalls + .listTools(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.ITool[], + protos.google.cloud.dialogflow.cx.v3.IListToolsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListToolsResponse, + ]) => { + this._log.info('listTools values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTools`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list the Tools from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool} 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 `listToolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listToolsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTools stream %j', request); + return this.descriptors.page.listTools.createStream( + this.innerApiCalls.listTools as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTools`, 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 agent to list the Tools from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.list_tools.js + * region_tag:dialogflow_v3_generated_Tools_ListTools_async + */ + listToolsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTools iterate %j', request); + return this.descriptors.page.listTools.asyncIterate( + this.innerApiCalls['listTools'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * List versions of the specified {@link protos.google.cloud.dialogflow.cx.v3.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.ToolVersion|ToolVersion}. + * 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 `listToolVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listToolVersions( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion[], + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse, + ] + >; + listToolVersions( + request: protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IToolVersion + >, + ): void; + listToolVersions( + request: protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IToolVersion + >, + ): void; + listToolVersions( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IToolVersion + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IToolVersion + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion[], + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IToolVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listToolVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listToolVersions request %j', request); + return this.innerApiCalls + .listToolVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IToolVersion[], + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListToolVersionsResponse, + ]) => { + this._log.info('listToolVersions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listToolVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.ToolVersion|ToolVersion} 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 `listToolVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listToolVersionsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + 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['listToolVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listToolVersions stream %j', request); + return this.descriptors.page.listToolVersions.createStream( + this.innerApiCalls.listToolVersions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listToolVersions`, 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 of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.ToolVersion|ToolVersion}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/tools.list_tool_versions.js + * region_tag:dialogflow_v3_generated_Tools_ListToolVersions_async + */ + listToolVersionsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListToolVersionsRequest, + 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['listToolVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listToolVersions iterate %j', request); + return this.descriptors.page.listToolVersions.asyncIterate( + this.innerApiCalls['listToolVersions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.toolsStub && !this._terminated) { + return this.toolsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_client_config.json new file mode 100644 index 000000000000..6010136c1dec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Tools": { + "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 + } + }, + "methods": { + "CreateTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListTools": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListToolVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RestoreToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/tools_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client.ts new file mode 100644 index 000000000000..ebdd895eb98d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client.ts @@ -0,0 +1,4018 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/transition_route_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './transition_route_groups_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroups}. + * @class + * @memberof v3 + */ +export class TransitionRouteGroupsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + transitionRouteGroupsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of TransitionRouteGroupsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 TransitionRouteGroupsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof TransitionRouteGroupsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listTransitionRouteGroups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transitionRouteGroups', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.TransitionRouteGroups', + 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.transitionRouteGroupsStub) { + return this.transitionRouteGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.TransitionRouteGroups. + this.transitionRouteGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.TransitionRouteGroups', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3 + .TransitionRouteGroups, + 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 transitionRouteGroupsStubMethods = [ + 'listTransitionRouteGroups', + 'getTransitionRouteGroup', + 'createTransitionRouteGroup', + 'updateTransitionRouteGroup', + 'deleteTransitionRouteGroup', + ]; + for (const methodName of transitionRouteGroupsStubMethods) { + const callPromise = this.transitionRouteGroupsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.transitionRouteGroupsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + * @param {string} request.languageCode + * The language to retrieve the transition route group for. The following + * fields are language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/transition_route_groups.get_transition_route_group.js + * region_tag:dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_async + */ + getTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + getTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.IGetTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup} + * in the specified flow. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to create an + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup} + * for. Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/` + * for agent-level groups. + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} request.transitionRouteGroup + * Required. The transition route group to create. + * @param {string} request.languageCode + * The language of the following fields in `TransitionRouteGroup`: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/transition_route_groups.create_transition_route_group.js + * region_tag:dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async + */ + createTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + createTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} request.transitionRouteGroup + * Required. The transition route group to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. + * @param {string} request.languageCode + * The language of the following fields in `TransitionRouteGroup`: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/transition_route_groups.update_transition_route_group.js + * region_tag:dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async + */ + updateTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + updateTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | 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({ + 'transition_route_group.name': request.transitionRouteGroup!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup} + * to delete. Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + * @param {boolean} request.force + * This field has no effect for transition route group that no page is using. + * If the transition route group is referenced by any page: + * + * * If `force` is set to false, an error will be returned with message + * indicating pages that reference the transition route group. + * * If `force` is set to true, Dialogflow will remove the transition route + * group, as well as any reference to it. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/transition_route_groups.delete_transition_route_group.js + * region_tag:dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async + */ + deleteTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + deleteTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all transition route groups in the specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list transition route groups for. The following fields are + * language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. + * 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 `listTransitionRouteGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTransitionRouteGroups( + request?: protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[], + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse, + ] + >; + listTransitionRouteGroups( + request: protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup + >, + ): void; + listTransitionRouteGroups( + request: protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup + >, + ): void; + listTransitionRouteGroups( + request?: protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[], + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTransitionRouteGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTransitionRouteGroups request %j', request); + return this.innerApiCalls + .listTransitionRouteGroups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[], + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsResponse, + ]) => { + this._log.info('listTransitionRouteGroups values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTransitionRouteGroups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list transition route groups for. The following fields are + * language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup} 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 `listTransitionRouteGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTransitionRouteGroupsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + 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['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTransitionRouteGroups stream %j', request); + return this.descriptors.page.listTransitionRouteGroups.createStream( + this.innerApiCalls.listTransitionRouteGroups as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTransitionRouteGroups`, 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 flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list transition route groups for. The following fields are + * language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/transition_route_groups.list_transition_route_groups.js + * region_tag:dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_async + */ + listTransitionRouteGroupsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListTransitionRouteGroupsRequest, + 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['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTransitionRouteGroups iterate %j', request); + return this.descriptors.page.listTransitionRouteGroups.asyncIterate( + this.innerApiCalls['listTransitionRouteGroups'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.transitionRouteGroupsStub && !this._terminated) { + return this.transitionRouteGroupsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client_config.json new file mode 100644 index 000000000000..6b22d9071e23 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.TransitionRouteGroups": { + "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 + } + }, + "methods": { + "ListTransitionRouteGroups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/transition_route_groups_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_client.ts new file mode 100644 index 000000000000..a69942af2745 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_client.ts @@ -0,0 +1,4283 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/versions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './versions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Version|Versions}. + * @class + * @memberof v3 + */ +export class VersionsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + versionsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of VersionsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 VersionsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof VersionsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'versions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createVersionResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.Version', + ) as gax.protobuf.Type; + const createVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata', + ) as gax.protobuf.Type; + const loadVersionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const loadVersionMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createVersionResponse.decode.bind(createVersionResponse), + createVersionMetadata.decode.bind(createVersionMetadata), + ), + loadVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + loadVersionResponse.decode.bind(loadVersionResponse), + loadVersionMetadata.decode.bind(loadVersionMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Versions', + 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.versionsStub) { + return this.versionsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Versions. + this.versionsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Versions', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Versions, + 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 versionsStubMethods = [ + 'listVersions', + 'getVersion', + 'createVersion', + 'updateVersion', + 'deleteVersion', + 'loadVersion', + 'compareVersions', + ]; + for (const methodName of versionsStubMethods) { + const callPromise = this.versionsStub.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.versionsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. + * Format: + * `projects//locations//agents//flows//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.get_version.js + * region_tag:dialogflow_v3_generated_Versions_GetVersion_async + */ + getVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest | undefined, + {} | undefined, + ] + >; + getVersion( + request: protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getVersion( + request: protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.IGetVersionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Version} request.version + * Required. The version to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. Currently only + * `description` and `display_name` can 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 {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.update_version.js + * region_tag:dialogflow_v3_generated_Versions_UpdateVersion_async + */ + updateVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest | undefined, + {} | undefined, + ] + >; + updateVersion( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateVersion( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest | 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({ + 'version.name': request.version!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IVersion, + | protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IVersion, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the {@link protos.google.cloud.dialogflow.cx.v3.Version|Version} + * to delete. Format: + * `projects//locations//agents//flows//versions/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.delete_version.js + * region_tag:dialogflow_v3_generated_Versions_DeleteVersion_async + */ + deleteVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest | undefined, + {} | undefined, + ] + >; + deleteVersion( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteVersion( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteVersion( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Compares the specified base version with target version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.baseVersion + * Required. Name of the base flow version to compare with the target version. + * Use version ID `0` to indicate the draft version of the specified flow. + * + * Format: + * `projects//locations//agents//flows//versions/`. + * @param {string} request.targetVersion + * Required. Name of the target flow version to compare with the + * base version. Use version ID `0` to indicate the draft version of the + * specified flow. Format: + * `projects//locations//agents//flows//versions/`. + * @param {string} request.languageCode + * The language to compare the flow versions for. + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) are + * supported. Note: languages must be enabled in the agent before they can be + * used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.CompareVersionsResponse|CompareVersionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.compare_versions.js + * region_tag:dialogflow_v3_generated_Versions_CompareVersions_async + */ + compareVersions( + request?: protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest | undefined, + {} | undefined, + ] + >; + compareVersions( + request: protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + compareVersions( + request: protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + compareVersions( + request?: protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest | 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({ + base_version: request.baseVersion ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('compareVersions request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('compareVersions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .compareVersions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse, + ( + | protos.google.cloud.dialogflow.cx.v3.ICompareVersionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('compareVersions response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates a {@link protos.google.cloud.dialogflow.cx.v3.Version|Version} in the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata|CreateVersionOperationMetadata} + * - `response`: {@link protos.google.cloud.dialogflow.cx.v3.Version|Version} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow} to create an + * {@link protos.google.cloud.dialogflow.cx.v3.Version|Version} for. Format: + * `projects//locations//agents//flows/`. + * @param {google.cloud.dialogflow.cx.v3.Version} request.version + * Required. The version 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.create_version.js + * region_tag:dialogflow_v3_generated_Versions_CreateVersion_async + */ + createVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateVersionRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createVersion( + request: protos.google.cloud.dialogflow.cx.v3.ICreateVersionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createVersion( + request: protos.google.cloud.dialogflow.cx.v3.ICreateVersionRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createVersion request %j', request); + return this.innerApiCalls + .createVersion(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createVersion response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createVersion()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.create_version.js + * region_tag:dialogflow_v3_generated_Versions_CreateVersion_async + */ + async checkCreateVersionProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.Version, + protos.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + > + > { + this._log.info('createVersion long-running'); + 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.createVersion, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.Version, + protos.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata + >; + } + /** + * Loads resources in the specified version to the draft flow. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Version|Version} to be loaded + * to draft flow. Format: + * `projects//locations//agents//flows//versions/`. + * @param {boolean} request.allowOverrideAgentResources + * This field is used to prevent accidental overwrite of other agent + * resources, which can potentially impact other flow's behavior. If + * `allow_override_agent_resources` is false, conflicted agent-level resources + * will not be overridden (i.e. intents, entities, webhooks). + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.load_version.js + * region_tag:dialogflow_v3_generated_Versions_LoadVersion_async + */ + loadVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ILoadVersionRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + loadVersion( + request: protos.google.cloud.dialogflow.cx.v3.ILoadVersionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + loadVersion( + request: protos.google.cloud.dialogflow.cx.v3.ILoadVersionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + loadVersion( + request?: protos.google.cloud.dialogflow.cx.v3.ILoadVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('loadVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('loadVersion request %j', request); + return this.innerApiCalls + .loadVersion(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('loadVersion response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `loadVersion()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.load_version.js + * region_tag:dialogflow_v3_generated_Versions_LoadVersion_async + */ + async checkLoadVersionProgress( + name: string, + ): Promise< + LROperation + > { + this._log.info('loadVersion long-running'); + 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.loadVersion, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } + /** + * Returns the list of all versions in the specified + * {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow} to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. + * 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 `listVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listVersions( + request?: protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IVersion[], + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse, + ] + >; + listVersions( + request: protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IVersion + >, + ): void; + listVersions( + request: protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IVersion + >, + ): void; + listVersions( + request?: protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IVersion + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IVersion + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IVersion[], + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listVersions request %j', request); + return this.innerApiCalls + .listVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IVersion[], + protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListVersionsResponse, + ]) => { + this._log.info('listVersions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow} to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Version|Version} 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 `listVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listVersionsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listVersions stream %j', request); + return this.descriptors.page.listVersions.createStream( + this.innerApiCalls.listVersions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listVersions`, 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 {@link protos.google.cloud.dialogflow.cx.v3.Flow|Flow} to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Version|Version}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/versions.list_versions.js + * region_tag:dialogflow_v3_generated_Versions_ListVersions_async + */ + listVersionsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listVersions iterate %j', request); + return this.descriptors.page.listVersions.asyncIterate( + this.innerApiCalls['listVersions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.versionsStub && !this._terminated) { + return this.versionsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_client_config.json new file mode 100644 index 000000000000..a66a45447f9c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Versions": { + "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 + } + }, + "methods": { + "ListVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "LoadVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CompareVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/versions_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_client.ts new file mode 100644 index 000000000000..301e27dabca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_client.ts @@ -0,0 +1,4076 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3/webhooks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './webhooks_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3.Webhook|Webhooks}. + * @class + * @memberof v3 + */ +export class WebhooksClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + webhooksStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of WebhooksClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 WebhooksClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WebhooksClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listWebhooks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'webhooks', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { post: '/v3/{name=projects/*/locations/*/operations/*}:cancel' }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3.Webhooks', + 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.webhooksStub) { + return this.webhooksStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3.Webhooks. + this.webhooksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3.Webhooks', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3.Webhooks, + 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 webhooksStubMethods = [ + 'listWebhooks', + 'getWebhook', + 'createWebhook', + 'updateWebhook', + 'deleteWebhook', + ]; + for (const methodName of webhooksStubMethods) { + const callPromise = this.webhooksStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.webhooksStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified webhook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the webhook. + * Format: + * `projects//locations//agents//webhooks/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Webhook|Webhook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/webhooks.get_webhook.js + * region_tag:dialogflow_v3_generated_Webhooks_GetWebhook_async + */ + getWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest | undefined, + {} | undefined, + ] + >; + getWebhook( + request: protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getWebhook( + request: protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + protos.google.cloud.dialogflow.cx.v3.IGetWebhookRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a webhook in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a webhook for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3.Webhook} request.webhook + * Required. The webhook 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 {@link protos.google.cloud.dialogflow.cx.v3.Webhook|Webhook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/webhooks.create_webhook.js + * region_tag:dialogflow_v3_generated_Webhooks_CreateWebhook_async + */ + createWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest | undefined, + {} | undefined, + ] + >; + createWebhook( + request: protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createWebhook( + request: protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3.ICreateWebhookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified webhook. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3.Webhook} request.webhook + * Required. The webhook to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3.Webhook|Webhook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/webhooks.update_webhook.js + * region_tag:dialogflow_v3_generated_Webhooks_UpdateWebhook_async + */ + updateWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest | undefined, + {} | undefined, + ] + >; + updateWebhook( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateWebhook( + request: protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest | 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({ + 'webhook.name': request.webhook!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3.IWebhook, + | protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3.IUpdateWebhookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified webhook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the webhook to delete. + * Format: + * `projects//locations//agents//webhooks/`. + * @param {boolean} request.force + * This field has no effect for webhook not being used. + * For webhooks that are used by pages/flows/transition route groups: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the webhook, as well + * as any references to the webhook (i.e. + * {@link protos.google.cloud.dialogflow.cx.v3.Fulfillment.webhook|Webhook} and + * {@link protos.google.cloud.dialogflow.cx.v3.Fulfillment.tag|tag}in fulfillments that + * point to this webhook will be removed). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3/webhooks.delete_webhook.js + * region_tag:dialogflow_v3_generated_Webhooks_DeleteWebhook_async + */ + deleteWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest | undefined, + {} | undefined, + ] + >; + deleteWebhook( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteWebhook( + request: protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteWebhook( + request?: protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3.IDeleteWebhookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all webhooks in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all webhooks for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Webhook|Webhook}. + * 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 `listWebhooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listWebhooks( + request?: protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook[], + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse, + ] + >; + listWebhooks( + request: protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IWebhook + >, + ): void; + listWebhooks( + request: protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IWebhook + >, + ): void; + listWebhooks( + request?: protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IWebhook + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IWebhook + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IWebhook[], + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IWebhook + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWebhooks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWebhooks request %j', request); + return this.innerApiCalls + .listWebhooks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3.IWebhook[], + protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListWebhooksResponse, + ]) => { + this._log.info('listWebhooks values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listWebhooks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all webhooks for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3.Webhook|Webhook} 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 `listWebhooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listWebhooksStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + 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['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listWebhooks stream %j', request); + return this.descriptors.page.listWebhooks.createStream( + this.innerApiCalls.listWebhooks as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listWebhooks`, 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 agent to list all webhooks for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3.Webhook|Webhook}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3/webhooks.list_webhooks.js + * region_tag:dialogflow_v3_generated_Webhooks_ListWebhooks_async + */ + listWebhooksAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListWebhooksRequest, + 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['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listWebhooks iterate %j', request); + return this.descriptors.page.listWebhooks.asyncIterate( + this.innerApiCalls['listWebhooks'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionPath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentSessionPath( + project: string, + location: string, + agent: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.render({ + project: project, + location: location, + agent: agent, + session: session, + }); + } + + /** + * Parse the project from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.webhooksStub && !this._terminated) { + return this.webhooksStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_client_config.json new file mode 100644 index 000000000000..3291f479ae45 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3.Webhooks": { + "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 + } + }, + "methods": { + "ListWebhooks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_proto_list.json new file mode 100644 index 000000000000..081858680c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3/webhooks_proto_list.json @@ -0,0 +1,37 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_client.ts new file mode 100644 index 000000000000..711188ceaf4e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_client.ts @@ -0,0 +1,4978 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/agents_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './agents_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agents}. + * @class + * @memberof v3beta1 + */ +export class AgentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + agentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of AgentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 AgentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AgentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listAgents: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'agents', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const exportAgentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse', + ) as gax.protobuf.Type; + const exportAgentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const restoreAgentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const restoreAgentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportAgent: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAgentResponse.decode.bind(exportAgentResponse), + exportAgentMetadata.decode.bind(exportAgentMetadata), + ), + restoreAgent: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreAgentResponse.decode.bind(restoreAgentResponse), + restoreAgentMetadata.decode.bind(restoreAgentMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Agents', + 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.agentsStub) { + return this.agentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Agents. + this.agentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Agents', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Agents, + 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 agentsStubMethods = [ + 'listAgents', + 'getAgent', + 'createAgent', + 'updateAgent', + 'deleteAgent', + 'exportAgent', + 'restoreAgent', + 'validateAgent', + 'getAgentValidationResult', + 'getGenerativeSettings', + 'updateGenerativeSettings', + ]; + for (const methodName of agentsStubMethods) { + const callPromise = this.agentsStub.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.agentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent. + * Format: `projects//locations//agents/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.get_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_GetAgent_async + */ + getAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest | undefined, + {} | undefined, + ] + >; + getAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an agent in the specified location. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to create a agent for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Agent} request.agent + * Required. The agent 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.create_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_CreateAgent_async + */ + createAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest | undefined, + {} | undefined, + ] + >; + createAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateAgentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified agent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Agent} request.agent + * Required. The agent to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.update_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_UpdateAgent_async + */ + updateAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest | undefined, + {} | undefined, + ] + >; + updateAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest | 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({ + 'agent.name': request.agent!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateAgentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent to delete. + * Format: `projects//locations//agents/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.delete_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_DeleteAgent_async + */ + deleteAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest | undefined, + {} | undefined, + ] + >; + deleteAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteAgentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Validates the specified agent and creates or updates validation results. + * The agent in draft version is validated. Please call this API after the + * training is completed to get the complete validation results. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The agent to validate. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult|AgentValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.validate_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_ValidateAgent_async + */ + validateAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | undefined + ), + {} | undefined, + ] + >; + validateAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('validateAgent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .validateAgent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateAgentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('validateAgent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the latest agent validation result. Agent validation is performed + * when ValidateAgent is called. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The agent name. + * Format: + * `projects//locations//agents//validationResult`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult|AgentValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.get_agent_validation_result.js + * region_tag:dialogflow_v3beta1_generated_Agents_GetAgentValidationResult_async + */ + getAgentValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | undefined + ), + {} | undefined, + ] + >; + getAgentValidationResult( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAgentValidationResult( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAgentValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getAgentValidationResult request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAgentValidationResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAgentValidationResult(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetAgentValidationResultRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAgentValidationResult response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the generative settings for the agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format: + * `projects//locations//agents//generativeSettings`. + * @param {string} request.languageCode + * Required. Language code of the generative settings. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings|GenerativeSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.get_generative_settings.js + * region_tag:dialogflow_v3beta1_generated_Agents_GetGenerativeSettings_async + */ + getGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + getGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getGenerativeSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGenerativeSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getGenerativeSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getGenerativeSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the generative settings for the agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.GenerativeSettings} request.generativeSettings + * Required. Generative settings to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings|GenerativeSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.update_generative_settings.js + * region_tag:dialogflow_v3beta1_generated_Agents_UpdateGenerativeSettings_async + */ + updateGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + updateGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerativeSettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerativeSettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | 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({ + 'generative_settings.name': request.generativeSettings!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateGenerativeSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGenerativeSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateGenerativeSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGenerativeSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateGenerativeSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Exports the specified agent to a binary file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse|ExportAgentResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent to export. + * Format: `projects//locations//agents/`. + * @param {string} [request.agentUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + * @param {string} [request.environment] + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + * @param {google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.GitDestination} [request.gitDestination] + * Optional. The Git branch to export the agent to. + * @param {boolean} [request.includeBigqueryExportSettings] + * Optional. Whether to include BigQuery Export setting. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.export_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_ExportAgent_async + */ + exportAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportAgent response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportAgent request %j', request); + return this.innerApiCalls + .exportAgent(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportAgent response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportAgent()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.export_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_ExportAgent_async + */ + async checkExportAgentProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('exportAgent long-running'); + 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.exportAgent, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse, + protos.google.protobuf.Struct + >; + } + /** + * Restores the specified agent from a binary file. + * + * Replaces the current agent with a new one. Note that all existing resources + * in agent (e.g. intents, entity types, flows) will be removed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent to restore into. + * Format: `projects//locations//agents/`. + * @param {string} request.agentUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to restore agent from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.agentContent + * Uncompressed raw byte content for agent. + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.GitSource} request.gitSource + * Setting for restoring from a git branch + * @param {google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.RestoreOption} request.restoreOption + * Agent restore mode. If not specified, `KEEP` is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.restore_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_RestoreAgent_async + */ + restoreAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + restoreAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreAgent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreAgent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreAgentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreAgent response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreAgent request %j', request); + return this.innerApiCalls + .restoreAgent(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreAgent response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `restoreAgent()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.restore_agent.js + * region_tag:dialogflow_v3beta1_generated_Agents_RestoreAgent_async + */ + async checkRestoreAgentProgress( + name: string, + ): Promise< + LROperation + > { + this._log.info('restoreAgent long-running'); + 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.restoreAgent, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } + /** + * Returns the list of all agents in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all agents for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent}. + * 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 `listAgentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAgents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent[], + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse, + ] + >; + listAgents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IAgent + >, + ): void; + listAgents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IAgent + >, + ): void; + listAgents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IAgent + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IAgent + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent[], + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IAgent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAgents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAgents request %j', request); + return this.innerApiCalls + .listAgents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IAgent[], + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsResponse, + ]) => { + this._log.info('listAgents values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listAgents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all agents for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent} 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 `listAgentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAgentsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAgents stream %j', request); + return this.descriptors.page.listAgents.createStream( + this.innerApiCalls.listAgents as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listAgents`, 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 location to list all agents for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/agents.list_agents.js + * region_tag:dialogflow_v3beta1_generated_Agents_ListAgents_async + */ + listAgentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAgents iterate %j', request); + return this.descriptors.page.listAgents.asyncIterate( + this.innerApiCalls['listAgents'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.agentsStub && !this._terminated) { + return this.agentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_client_config.json new file mode 100644 index 000000000000..7cb019dd72a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Agents": { + "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 + } + }, + "methods": { + "ListAgents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateAgent": { + "timeout_millis": 180000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RestoreAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetAgentValidationResult": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetGenerativeSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateGenerativeSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/agents_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_client.ts new file mode 100644 index 000000000000..5ac8fa1eb295 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_client.ts @@ -0,0 +1,3320 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/changelogs_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './changelogs_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Changelog|Changelogs}. + * @class + * @memberof v3beta1 + */ +export class ChangelogsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + changelogsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ChangelogsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ChangelogsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ChangelogsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listChangelogs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'changelogs', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Changelogs', + 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.changelogsStub) { + return this.changelogsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Changelogs. + this.changelogsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Changelogs', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Changelogs, + 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 changelogsStubMethods = ['listChangelogs', 'getChangelog']; + for (const methodName of changelogsStubMethods) { + const callPromise = this.changelogsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.changelogsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified Changelog. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the changelog to get. + * Format: + * `projects//locations//agents//changelogs/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Changelog|Changelog}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/changelogs.get_changelog.js + * region_tag:dialogflow_v3beta1_generated_Changelogs_GetChangelog_async + */ + getChangelog( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | undefined + ), + {} | undefined, + ] + >; + getChangelog( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getChangelog( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getChangelog( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getChangelog request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChangelog response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getChangelog(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetChangelogRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getChangelog response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of Changelogs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the changelogs. + * Format: `projects//locations//agents/`. + * @param {string} request.filter + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Changelog|Changelog}. + * 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 `listChangelogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listChangelogs( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog[], + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse, + ] + >; + listChangelogs( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog + >, + ): void; + listChangelogs( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog + >, + ): void; + listChangelogs( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog[], + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChangelogs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChangelogs request %j', request); + return this.innerApiCalls + .listChangelogs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IChangelog[], + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsResponse, + ]) => { + this._log.info('listChangelogs values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listChangelogs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the changelogs. + * Format: `projects//locations//agents/`. + * @param {string} request.filter + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Changelog|Changelog} 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 `listChangelogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listChangelogsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listChangelogs stream %j', request); + return this.descriptors.page.listChangelogs.createStream( + this.innerApiCalls.listChangelogs as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listChangelogs`, 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 agent containing the changelogs. + * Format: `projects//locations//agents/`. + * @param {string} request.filter + * The filter string. Supports filter by user_email, resource, type and + * create_time. Some examples: + * 1. By user email: + * user_email = "someone@google.com" + * 2. By resource name: + * resource = "projects/123/locations/global/agents/456/flows/789" + * 3. By resource display name: + * display_name = "my agent" + * 4. By action: + * action = "Create" + * 5. By type: + * type = "flows" + * 6. By create time. Currently predicates on `create_time` and + * `create_time_epoch_seconds` are supported: + * create_time_epoch_seconds > 1551790877 AND create_time <= + * 2017-01-15T01:30:15.01Z + * 7. Combination of above filters: + * resource = "projects/123/locations/global/agents/456/flows/789" + * AND user_email = "someone@google.com" + * AND create_time <= 2017-01-15T01:30:15.01Z + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Changelog|Changelog}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/changelogs.list_changelogs.js + * region_tag:dialogflow_v3beta1_generated_Changelogs_ListChangelogs_async + */ + listChangelogsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listChangelogs iterate %j', request); + return this.descriptors.page.listChangelogs.asyncIterate( + this.innerApiCalls['listChangelogs'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.changelogsStub && !this._terminated) { + return this.changelogsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_client_config.json new file mode 100644 index 000000000000..f67655c602cb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Changelogs": { + "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 + } + }, + "methods": { + "ListChangelogs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetChangelog": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/changelogs_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_client.ts new file mode 100644 index 000000000000..930fa4c58a55 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_client.ts @@ -0,0 +1,3445 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/conversation_history_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './conversation_history_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing conversation history. + * @class + * @memberof v3beta1 + */ +export class ConversationHistoryClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + conversationHistoryStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ConversationHistoryClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ConversationHistoryClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ConversationHistoryClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.ConversationHistory', + 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.conversationHistoryStub) { + return this.conversationHistoryStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.ConversationHistory. + this.conversationHistoryStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.ConversationHistory', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1 + .ConversationHistory, + 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 conversationHistoryStubMethods = [ + 'listConversations', + 'getConversation', + 'deleteConversation', + ]; + for (const methodName of conversationHistoryStubMethods) { + const callPromise = this.conversationHistoryStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.conversationHistoryStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation. + * Format: + * `projects//locations//agents//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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Conversation|Conversation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/conversation_history.get_conversation.js + * region_tag:dialogflow_v3beta1_generated_ConversationHistory_GetConversation_async + */ + getConversation( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest + | undefined + ), + {} | undefined, + ] + >; + getConversation( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getConversation( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getConversation( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.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().catch((err) => { + throw err; + }); + this._log.info('getConversation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConversation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConversation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IConversation, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetConversationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConversation response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation. + * Format: + * `projects//locations//agents//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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/conversation_history.delete_conversation.js + * region_tag:dialogflow_v3beta1_generated_ConversationHistory_DeleteConversation_async + */ + deleteConversation( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest + | undefined + ), + {} | undefined, + ] + >; + deleteConversation( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteConversation( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteConversation( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.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().catch((err) => { + throw err; + }); + this._log.info('deleteConversation request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConversation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteConversation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteConversationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteConversation response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all conversations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all conversations for. + * Format: `projects//locations//agents/`. + * @param {string} [request.filter] + * Optional. The filter string. Supports filter by create_time, + * metrics.has_end_interaction, metrics.has_live_agent_handoff, + * intents.display_name, pages.display_name and flows.display_name. Timestamps + * expect an {@link protos.https://datatracker.ietf.org/doc/html/rfc3339|RFC-3339} + * formatted string (e.g. 2012-04-21T11:30:00-04:00). UTC offsets are + * supported. Some examples: + * 1. By create time: + * create_time > "2022-04-21T11:30:00-04:00" + * 2. By intent display name: + * intents.display_name : "billing" + * 3. By end interaction signal: + * metrics.has_end_interaction = true + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Conversation|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConversations( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IConversation[], + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse, + ] + >; + listConversations( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IConversation + >, + ): void; + listConversations( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IConversation + >, + ): void; + listConversations( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IConversation + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IConversation + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IConversation[], + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IConversation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConversations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConversations request %j', request); + return this.innerApiCalls + .listConversations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IConversation[], + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListConversationsResponse, + ]) => { + this._log.info('listConversations values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listConversations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all conversations for. + * Format: `projects//locations//agents/`. + * @param {string} [request.filter] + * Optional. The filter string. Supports filter by create_time, + * metrics.has_end_interaction, metrics.has_live_agent_handoff, + * intents.display_name, pages.display_name and flows.display_name. Timestamps + * expect an {@link protos.https://datatracker.ietf.org/doc/html/rfc3339|RFC-3339} + * formatted string (e.g. 2012-04-21T11:30:00-04:00). UTC offsets are + * supported. Some examples: + * 1. By create time: + * create_time > "2022-04-21T11:30:00-04:00" + * 2. By intent display name: + * intents.display_name : "billing" + * 3. By end interaction signal: + * metrics.has_end_interaction = true + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Conversation|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConversationsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.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().catch((err) => { + throw err; + }); + this._log.info('listConversations stream %j', request); + 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 agent to list all conversations for. + * Format: `projects//locations//agents/`. + * @param {string} [request.filter] + * Optional. The filter string. Supports filter by create_time, + * metrics.has_end_interaction, metrics.has_live_agent_handoff, + * intents.display_name, pages.display_name and flows.display_name. Timestamps + * expect an {@link protos.https://datatracker.ietf.org/doc/html/rfc3339|RFC-3339} + * formatted string (e.g. 2012-04-21T11:30:00-04:00). UTC offsets are + * supported. Some examples: + * 1. By create time: + * create_time > "2022-04-21T11:30:00-04:00" + * 2. By intent display name: + * intents.display_name : "billing" + * 3. By end interaction signal: + * metrics.has_end_interaction = true + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Conversation|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/conversation_history.list_conversations.js + * region_tag:dialogflow_v3beta1_generated_ConversationHistory_ListConversations_async + */ + listConversationsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.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().catch((err) => { + throw err; + }); + this._log.info('listConversations iterate %j', request); + return this.descriptors.page.listConversations.asyncIterate( + this.innerApiCalls['listConversations'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.conversationHistoryStub && !this._terminated) { + return this.conversationHistoryStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_client_config.json new file mode 100644 index 000000000000..453162b79c8c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.ConversationHistory": { + "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 + } + }, + "methods": { + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/conversation_history_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_client.ts new file mode 100644 index 000000000000..8d39b78754b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_client.ts @@ -0,0 +1,3262 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/deployments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './deployments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Deployment|Deployments}. + * @class + * @memberof v3beta1 + */ +export class DeploymentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + deploymentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of DeploymentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 DeploymentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DeploymentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'deployments', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Deployments', + 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.deploymentsStub) { + return this.deploymentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Deployments. + this.deploymentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Deployments', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Deployments, + 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 deploymentsStubMethods = ['listDeployments', 'getDeployment']; + for (const methodName of deploymentsStubMethods) { + const callPromise = this.deploymentsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.deploymentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Deployment|Deployment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Deployment|Deployment}. Format: + * `projects//locations//agents//environments//deployments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Deployment|Deployment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/deployments.get_deployment.js + * region_tag:dialogflow_v3beta1_generated_Deployments_GetDeployment_async + */ + getDeployment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + getDeployment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getDeployment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getDeployment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetDeploymentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDeployment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all deployments in the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Deployment|Deployment}. + * 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 `listDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDeployments( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse, + ] + >; + listDeployments( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment + >, + ): void; + listDeployments( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment + >, + ): void; + listDeployments( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDeployments request %j', request); + return this.innerApiCalls + .listDeployments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IDeployment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsResponse, + ]) => { + this._log.info('listDeployments values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listDeployments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Deployment|Deployment} 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 `listDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDeploymentsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDeployments stream %j', request); + return this.descriptors.page.listDeployments.createStream( + this.innerApiCalls.listDeployments as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listDeployments`, 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Deployment|Deployment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/deployments.list_deployments.js + * region_tag:dialogflow_v3beta1_generated_Deployments_ListDeployments_async + */ + listDeploymentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDeployments iterate %j', request); + return this.descriptors.page.listDeployments.asyncIterate( + this.innerApiCalls['listDeployments'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.deploymentsStub && !this._terminated) { + return this.deploymentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_client_config.json new file mode 100644 index 000000000000..16ebc1b86d04 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Deployments": { + "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 + } + }, + "methods": { + "ListDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/deployments_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client.ts new file mode 100644 index 000000000000..c837eb00c0db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client.ts @@ -0,0 +1,4497 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/entity_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './entity_types_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType|EntityTypes}. + * @class + * @memberof v3beta1 + */ +export class EntityTypesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + entityTypesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of EntityTypesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 EntityTypesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EntityTypesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listEntityTypes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'entityTypes', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const exportEntityTypesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse', + ) as gax.protobuf.Type; + const exportEntityTypesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata', + ) as gax.protobuf.Type; + const importEntityTypesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse', + ) as gax.protobuf.Type; + const importEntityTypesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportEntityTypes: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportEntityTypesResponse.decode.bind(exportEntityTypesResponse), + exportEntityTypesMetadata.decode.bind(exportEntityTypesMetadata), + ), + importEntityTypes: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importEntityTypesResponse.decode.bind(importEntityTypesResponse), + importEntityTypesMetadata.decode.bind(importEntityTypesMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.EntityTypes', + 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.entityTypesStub) { + return this.entityTypesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.EntityTypes. + this.entityTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.EntityTypes', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.EntityTypes, + 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 entityTypesStubMethods = [ + 'getEntityType', + 'createEntityType', + 'updateEntityType', + 'deleteEntityType', + 'listEntityTypes', + 'exportEntityTypes', + 'importEntityTypes', + ]; + for (const methodName of entityTypesStubMethods) { + const callPromise = this.entityTypesStub.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.entityTypesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type. + * Format: + * `projects//locations//agents//entityTypes/`. + * @param {string} request.languageCode + * The language to retrieve the entity type for. The following fields are + * language dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType|EntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.get_entity_type.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_GetEntityType_async + */ + getEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + getEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an entity type in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a entity type for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType} request.entityType + * Required. The entity type to create. + * @param {string} request.languageCode + * The language of the following fields in `entity_type`: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType|EntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.create_entity_type.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_CreateEntityType_async + */ + createEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + createEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified entity type. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.EntityType} request.entityType + * Required. The entity type to update. + * @param {string} request.languageCode + * The language of the following fields in `entity_type`: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType|EntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.update_entity_type.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_UpdateEntityType_async + */ + updateEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + updateEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | 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({ + 'entity_type.name': request.entityType!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified entity type. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type to delete. + * Format: + * `projects//locations//agents//entityTypes/`. + * @param {boolean} request.force + * This field has no effect for entity type not being used. + * For entity types that are used by intents or pages: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referencing resources. + * * If `force` is set to true, Dialogflow will remove the entity type, as + * well as any references to the entity type (i.e. Page + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Form.Parameter|parameter} of the + * entity type will be changed to + * '@sys.any' and intent + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter|parameter} of the + * entity type will be removed). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.delete_entity_type.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_DeleteEntityType_async + */ + deleteEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + deleteEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Exports the selected entity types. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent agent to export entity types. + * Format: `projects//locations//agents/`. + * @param {string[]} request.entityTypes + * Required. The name of the entity types to export. + * Format: + * `projects//locations//agents//entityTypes/`. + * @param {string} [request.entityTypesUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the entity + * types to. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {boolean} [request.entityTypesContentInline] + * Optional. The option to return the serialized entity types inline. + * @param {google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported entity types. If not specified, + * `BLOB` is assumed. + * @param {string} [request.languageCode] + * Optional. The language to retrieve the entity type for. The following + * fields are language dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, all language dependent fields will be retrieved. + * [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.export_entity_types.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_ExportEntityTypes_async + */ + exportEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportEntityTypes response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportEntityTypes request %j', request); + return this.innerApiCalls + .exportEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportEntityTypes response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportEntityTypes()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.export_entity_types.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_ExportEntityTypes_async + */ + async checkExportEntityTypesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + > + > { + this._log.info('exportEntityTypes long-running'); + 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.exportEntityTypes, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata + >; + } + /** + * Imports the specified entitytypes into the agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the entity types into. + * Format: `projects//locations//agents/`. + * @param {string} request.entityTypesUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import entity types from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3beta1.InlineSource} request.entityTypesContent + * Uncompressed byte content of entity types. + * @param {google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.MergeOption} request.mergeOption + * Required. Merge option for importing entity types. + * @param {string} [request.targetEntityType] + * Optional. The target entity type to import into. + * Format: + * `projects//locations//agents//entity_types/`. + * If set, there should be only one entity type included in + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest.entity_types|entity_types}, + * of which the type should match the type of the target entity type. All + * {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType.entities|entities} in the + * imported entity type will be added to the target entity type. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.import_entity_types.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_ImportEntityTypes_async + */ + importEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importEntityTypes response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importEntityTypes request %j', request); + return this.innerApiCalls + .importEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importEntityTypes response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importEntityTypes()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.import_entity_types.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_ImportEntityTypes_async + */ + async checkImportEntityTypesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + > + > { + this._log.info('importEntityTypes long-running'); + 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.importEntityTypes, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata + >; + } + /** + * Returns the list of all entity types in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all entity types for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list entity types for. The following fields are language + * dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType|EntityType}. + * 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 `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType[], + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse, + ] + >; + listEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType + >, + ): void; + listEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType + >, + ): void; + listEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType[], + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEntityTypes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEntityTypes request %j', request); + return this.innerApiCalls + .listEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IEntityType[], + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesResponse, + ]) => { + this._log.info('listEntityTypes values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listEntityTypes`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all entity types for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list entity types for. The following fields are language + * dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType|EntityType} 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 `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEntityTypesStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + 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['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEntityTypes stream %j', request); + return this.descriptors.page.listEntityTypes.createStream( + this.innerApiCalls.listEntityTypes as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listEntityTypes`, 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 agent to list all entity types for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list entity types for. The following fields are language + * dependent: + * + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.EntityType|EntityType}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/entity_types.list_entity_types.js + * region_tag:dialogflow_v3beta1_generated_EntityTypes_ListEntityTypes_async + */ + listEntityTypesAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEntityTypesRequest, + 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['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEntityTypes iterate %j', request); + return this.descriptors.page.listEntityTypes.asyncIterate( + this.innerApiCalls['listEntityTypes'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.entityTypesStub && !this._terminated) { + return this.entityTypesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client_config.json new file mode 100644 index 000000000000..40236ea12947 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.EntityTypes": { + "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 + } + }, + "methods": { + "GetEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/entity_types_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_client.ts new file mode 100644 index 000000000000..8ec77476219b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_client.ts @@ -0,0 +1,4940 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/environments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './environments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environments}. + * @class + * @memberof v3beta1 + */ +export class EnvironmentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + environmentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of EnvironmentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 EnvironmentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EnvironmentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listEnvironments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'environments', + ), + lookupEnvironmentHistory: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'environments', + ), + listContinuousTestResults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'continuousTestResults', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.Environment', + ) as gax.protobuf.Type; + const createEnvironmentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const updateEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.Environment', + ) as gax.protobuf.Type; + const updateEnvironmentMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const runContinuousTestResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse', + ) as gax.protobuf.Type; + const runContinuousTestMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata', + ) as gax.protobuf.Type; + const deployFlowResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse', + ) as gax.protobuf.Type; + const deployFlowMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEnvironmentResponse.decode.bind(createEnvironmentResponse), + createEnvironmentMetadata.decode.bind(createEnvironmentMetadata), + ), + updateEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), + updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata), + ), + runContinuousTest: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runContinuousTestResponse.decode.bind(runContinuousTestResponse), + runContinuousTestMetadata.decode.bind(runContinuousTestMetadata), + ), + deployFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployFlowResponse.decode.bind(deployFlowResponse), + deployFlowMetadata.decode.bind(deployFlowMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Environments', + 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.environmentsStub) { + return this.environmentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Environments. + this.environmentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Environments', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Environments, + 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 environmentsStubMethods = [ + 'listEnvironments', + 'getEnvironment', + 'createEnvironment', + 'updateEnvironment', + 'deleteEnvironment', + 'lookupEnvironmentHistory', + 'runContinuousTest', + 'listContinuousTestResults', + 'deployFlow', + ]; + for (const methodName of environmentsStubMethods) { + const callPromise = this.environmentsStub.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.environmentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. Format: + * `projects//locations//agents//environments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.get_environment.js + * region_tag:dialogflow_v3beta1_generated_Environments_GetEnvironment_async + */ + getEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | undefined + ), + {} | undefined, + ] + >; + getEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getEnvironment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEnvironment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEnvironment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetEnvironmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEnvironment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} to delete. + * Format: + * `projects//locations//agents//environments/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.delete_environment.js + * region_tag:dialogflow_v3beta1_generated_Environments_DeleteEnvironment_async + */ + deleteEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteEnvironment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEnvironment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteEnvironment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteEnvironmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteEnvironment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates an {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} in + * the specified {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent} to create + * an {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Environment} request.environment + * Required. The environment 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.create_environment.js + * region_tag:dialogflow_v3beta1_generated_Environments_CreateEnvironment_async + */ + createEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createEnvironment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createEnvironment request %j', request); + return this.innerApiCalls + .createEnvironment(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createEnvironment response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createEnvironment()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.create_environment.js + * region_tag:dialogflow_v3beta1_generated_Environments_CreateEnvironment_async + */ + async checkCreateEnvironmentProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.Environment, + protos.google.protobuf.Struct + > + > { + this._log.info('createEnvironment long-running'); + 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.createEnvironment, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.Environment, + protos.google.protobuf.Struct + >; + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Environment} request.environment + * Required. The environment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.update_environment.js + * region_tag:dialogflow_v3beta1_generated_Environments_UpdateEnvironment_async + */ + updateEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateEnvironment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateEnvironment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + 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({ + 'environment.name': request.environment!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateEnvironment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateEnvironment request %j', request); + return this.innerApiCalls + .updateEnvironment(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateEnvironment response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateEnvironment()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.update_environment.js + * region_tag:dialogflow_v3beta1_generated_Environments_UpdateEnvironment_async + */ + async checkUpdateEnvironmentProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.Environment, + protos.google.protobuf.Struct + > + > { + this._log.info('updateEnvironment long-running'); + 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.updateEnvironment, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.Environment, + protos.google.protobuf.Struct + >; + } + /** + * Kicks off a continuous test under the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata|RunContinuousTestMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse|RunContinuousTestResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Required. Format: + * `projects//locations//agents//environments/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.run_continuous_test.js + * region_tag:dialogflow_v3beta1_generated_Environments_RunContinuousTest_async + */ + runContinuousTest( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runContinuousTest( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + 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({ + environment: request.environment ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runContinuousTest response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runContinuousTest request %j', request); + return this.innerApiCalls + .runContinuousTest(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('runContinuousTest response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `runContinuousTest()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.run_continuous_test.js + * region_tag:dialogflow_v3beta1_generated_Environments_RunContinuousTest_async + */ + async checkRunContinuousTestProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + > + > { + this._log.info('runContinuousTest long-running'); + 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.runContinuousTest, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata + >; + } + /** + * Deploys a flow to the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata|DeployFlowMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse|DeployFlowResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Required. The environment to deploy the flow to. + * Format: + * `projects//locations//agents//environments/`. + * @param {string} request.flowVersion + * Required. The flow version to deploy. + * Format: + * `projects//locations//agents//flows//versions/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.deploy_flow.js + * region_tag:dialogflow_v3beta1_generated_Environments_DeployFlow_async + */ + deployFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deployFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deployFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + 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({ + environment: request.environment ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deployFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deployFlow request %j', request); + return this.innerApiCalls + .deployFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deployFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deployFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.deploy_flow.js + * region_tag:dialogflow_v3beta1_generated_Environments_DeployFlow_async + */ + async checkDeployFlowProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + > + > { + this._log.info('deployFlow long-running'); + 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.deployFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata + >; + } + /** + * Returns the list of all environments in the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent} to list all + * environments for. Format: + * `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * 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 `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEnvironments( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse, + ] + >; + listEnvironments( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + ): void; + listEnvironments( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + ): void; + listEnvironments( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEnvironments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEnvironments request %j', request); + return this.innerApiCalls + .listEnvironments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsResponse, + ]) => { + this._log.info('listEnvironments values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listEnvironments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent} to list all + * environments for. Format: + * `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} 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 `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEnvironmentsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + 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['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEnvironments stream %j', request); + return this.descriptors.page.listEnvironments.createStream( + this.innerApiCalls.listEnvironments as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listEnvironments`, 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent} to list all + * environments for. Format: + * `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.list_environments.js + * region_tag:dialogflow_v3beta1_generated_Environments_ListEnvironments_async + */ + listEnvironmentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListEnvironmentsRequest, + 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['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEnvironments iterate %j', request); + return this.descriptors.page.listEnvironments.asyncIterate( + this.innerApiCalls['listEnvironments'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Looks up the history of the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * 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 `lookupEnvironmentHistoryAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + lookupEnvironmentHistory( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse, + ] + >; + lookupEnvironmentHistory( + request: protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + ): void; + lookupEnvironmentHistory( + request: protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + ): void; + lookupEnvironmentHistory( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('lookupEnvironmentHistory values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('lookupEnvironmentHistory request %j', request); + return this.innerApiCalls + .lookupEnvironmentHistory(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[], + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryResponse, + ]) => { + this._log.info('lookupEnvironmentHistory values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `lookupEnvironmentHistory`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} 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 `lookupEnvironmentHistoryAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + lookupEnvironmentHistoryStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('lookupEnvironmentHistory stream %j', request); + return this.descriptors.page.lookupEnvironmentHistory.createStream( + this.innerApiCalls.lookupEnvironmentHistory as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `lookupEnvironmentHistory`, 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.name + * Required. Resource name of the environment to look up the history for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.lookup_environment_history.js + * region_tag:dialogflow_v3beta1_generated_Environments_LookupEnvironmentHistory_async + */ + lookupEnvironmentHistoryAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ILookupEnvironmentHistoryRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('lookupEnvironmentHistory iterate %j', request); + return this.descriptors.page.lookupEnvironmentHistory.asyncIterate( + this.innerApiCalls['lookupEnvironmentHistory'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Fetches a list of continuous test results for a given environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult|ContinuousTestResult}. + * 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 `listContinuousTestResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listContinuousTestResults( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse, + ] + >; + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult + >, + ): void; + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult + >, + ): void; + listContinuousTestResults( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listContinuousTestResults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listContinuousTestResults request %j', request); + return this.innerApiCalls + .listContinuousTestResults(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsResponse, + ]) => { + this._log.info('listContinuousTestResults values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listContinuousTestResults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult|ContinuousTestResult} 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 `listContinuousTestResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listContinuousTestResultsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + 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['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listContinuousTestResults stream %j', request); + return this.descriptors.page.listContinuousTestResults.createStream( + this.innerApiCalls.listContinuousTestResults as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listContinuousTestResults`, 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 environment to list results for. + * Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult|ContinuousTestResult}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/environments.list_continuous_test_results.js + * region_tag:dialogflow_v3beta1_generated_Environments_ListContinuousTestResults_async + */ + listContinuousTestResultsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListContinuousTestResultsRequest, + 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['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listContinuousTestResults iterate %j', request); + return this.descriptors.page.listContinuousTestResults.asyncIterate( + this.innerApiCalls['listContinuousTestResults'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.environmentsStub && !this._terminated) { + return this.environmentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_client_config.json new file mode 100644 index 000000000000..01fb4af8ca5d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Environments": { + "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 + } + }, + "methods": { + "ListEnvironments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "LookupEnvironmentHistory": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RunContinuousTest": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListContinuousTestResults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeployFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/environments_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_client.ts new file mode 100644 index 000000000000..f992914b8259 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_client.ts @@ -0,0 +1,3712 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/examples_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './examples_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Example|Examples}. + * @class + * @memberof v3beta1 + */ +export class ExamplesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + examplesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ExamplesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ExamplesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ExamplesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listExamples: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'examples', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Examples', + 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.examplesStub) { + return this.examplesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Examples. + this.examplesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Examples', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Examples, + 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 examplesStubMethods = [ + 'createExample', + 'deleteExample', + 'listExamples', + 'getExample', + 'updateExample', + ]; + for (const methodName of examplesStubMethods) { + const callPromise = this.examplesStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.examplesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 an example in the specified playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to create an example for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Example} request.example + * Required. The example 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Example|Example}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/examples.create_example.js + * region_tag:dialogflow_v3beta1_generated_Examples_CreateExample_async + */ + createExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | undefined + ), + {} | undefined, + ] + >; + createExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExampleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the example to delete. + * Format: + * `projects//locations//agents//playbooks//examples/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/examples.delete_example.js + * region_tag:dialogflow_v3beta1_generated_Examples_DeleteExample_async + */ + deleteExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | undefined + ), + {} | undefined, + ] + >; + deleteExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExampleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the example. + * Format: + * `projects//locations//agents//playbooks//examples/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Example|Example}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/examples.get_example.js + * region_tag:dialogflow_v3beta1_generated_Examples_GetExample_async + */ + getExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest | undefined, + {} | undefined, + ] + >; + getExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExampleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Example} request.example + * Required. The example to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Example|Example}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/examples.update_example.js + * region_tag:dialogflow_v3beta1_generated_Examples_UpdateExample_async + */ + updateExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | undefined + ), + {} | undefined, + ] + >; + updateExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExample( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExample( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | 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({ + 'example.name': request.example!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateExample request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateExample(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExampleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateExample response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns a list of examples in the specified playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The {@link protos.ListExampleResponse.next_page_token|next_page_token} value + * returned from a previous list request. + * @param {string} [request.languageCode] + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Example|Example}. + * 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 `listExamplesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExamples( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample[], + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse, + ] + >; + listExamples( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExample + >, + ): void; + listExamples( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExample + >, + ): void; + listExamples( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExample + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExample + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample[], + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExample + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExamples values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExamples request %j', request); + return this.innerApiCalls + .listExamples(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExample[], + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesResponse, + ]) => { + this._log.info('listExamples values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listExamples`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The {@link protos.ListExampleResponse.next_page_token|next_page_token} value + * returned from a previous list request. + * @param {string} [request.languageCode] + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Example|Example} 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 `listExamplesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExamplesStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExamples stream %j', request); + return this.descriptors.page.listExamples.createStream( + this.innerApiCalls.listExamples as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listExamples`, 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 playbook to list the examples from. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The {@link protos.ListExampleResponse.next_page_token|next_page_token} value + * returned from a previous list request. + * @param {string} [request.languageCode] + * Optional. The language to list examples for. + * If not specified, list all examples under the playbook. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Example|Example}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/examples.list_examples.js + * region_tag:dialogflow_v3beta1_generated_Examples_ListExamples_async + */ + listExamplesAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExamples iterate %j', request); + return this.descriptors.page.listExamples.asyncIterate( + this.innerApiCalls['listExamples'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.examplesStub && !this._terminated) { + return this.examplesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_client_config.json new file mode 100644 index 000000000000..d50fe0ab6ce1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Examples": { + "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 + } + }, + "methods": { + "CreateExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListExamples": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateExample": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/examples_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_client.ts new file mode 100644 index 000000000000..658dfb6dd56a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_client.ts @@ -0,0 +1,4007 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/experiments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './experiments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiments}. + * @class + * @memberof v3beta1 + */ +export class ExperimentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + experimentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ExperimentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ExperimentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ExperimentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listExperiments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'experiments', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Experiments', + 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.experimentsStub) { + return this.experimentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Experiments. + this.experimentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Experiments', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Experiments, + 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 experimentsStubMethods = [ + 'listExperiments', + 'getExperiment', + 'createExperiment', + 'updateExperiment', + 'deleteExperiment', + 'startExperiment', + 'stopExperiment', + ]; + for (const methodName of experimentsStubMethods) { + const callPromise = this.experimentsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.experimentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/experiments.get_experiment.js + * region_tag:dialogflow_v3beta1_generated_Experiments_GetExperiment_async + */ + getExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | undefined + ), + {} | undefined, + ] + >; + getExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment} in + * the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Agent|Agent} to create + * an {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} for. + * Format: + * `projects//locations//agents//environments/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} request.experiment + * Required. The experiment 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/experiments.create_experiment.js + * region_tag:dialogflow_v3beta1_generated_Experiments_CreateExperiment_async + */ + createExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | undefined + ), + {} | undefined, + ] + >; + createExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Experiment} request.experiment + * Required. The experiment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/experiments.update_experiment.js + * region_tag:dialogflow_v3beta1_generated_Experiments_UpdateExperiment_async + */ + updateExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | undefined + ), + {} | undefined, + ] + >; + updateExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | 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({ + 'experiment.name': request.experiment!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} to delete. + * Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/experiments.delete_experiment.js + * region_tag:dialogflow_v3beta1_generated_Experiments_DeleteExperiment_async + */ + deleteExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Starts the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. This rpc only + * changes the state of experiment from PENDING to RUNNING. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the experiment to start. + * Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/experiments.start_experiment.js + * region_tag:dialogflow_v3beta1_generated_Experiments_StartExperiment_async + */ + startExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | undefined + ), + {} | undefined, + ] + >; + startExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + startExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + startExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('startExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('startExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .startExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IStartExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('startExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Stops the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. This rpc only + * changes the state of experiment from RUNNING to DONE. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the experiment to stop. + * Format: + * `projects//locations//agents//environments//experiments/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/experiments.stop_experiment.js + * region_tag:dialogflow_v3beta1_generated_Experiments_StopExperiment_async + */ + stopExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | undefined + ), + {} | undefined, + ] + >; + stopExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + stopExperiment( + request: protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + stopExperiment( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('stopExperiment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('stopExperiment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .stopExperiment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IStopExperimentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('stopExperiment response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all experiments in the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. + * 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 `listExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExperiments( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse, + ] + >; + listExperiments( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment + >, + ): void; + listExperiments( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment + >, + ): void; + listExperiments( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExperiments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExperiments request %j', request); + return this.innerApiCalls + .listExperiments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IExperiment[], + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsResponse, + ]) => { + this._log.info('listExperiments values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listExperiments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment} 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 `listExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExperimentsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + 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['listExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExperiments stream %j', request); + return this.descriptors.page.listExperiments.createStream( + this.innerApiCalls.listExperiments as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listExperiments`, 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Environment|Environment} + * to list all environments for. Format: + * `projects//locations//agents//environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Experiment|Experiment}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/experiments.list_experiments.js + * region_tag:dialogflow_v3beta1_generated_Experiments_ListExperiments_async + */ + listExperimentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListExperimentsRequest, + 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['listExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExperiments iterate %j', request); + return this.descriptors.page.listExperiments.asyncIterate( + this.innerApiCalls['listExperiments'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.experimentsStub && !this._terminated) { + return this.experimentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_client_config.json new file mode 100644 index 000000000000..c3480c4d1b1f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Experiments": { + "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 + } + }, + "methods": { + "ListExperiments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "StartExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "StopExperiment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/experiments_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_client.ts new file mode 100644 index 000000000000..a96d3bb22512 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_client.ts @@ -0,0 +1,4967 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/flows_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './flows_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flows}. + * @class + * @memberof v3beta1 + */ +export class FlowsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + flowsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of FlowsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 FlowsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FlowsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listFlows: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'flows', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const trainFlowResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const trainFlowMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const importFlowResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse', + ) as gax.protobuf.Type; + const importFlowMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const exportFlowResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse', + ) as gax.protobuf.Type; + const exportFlowMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + trainFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + trainFlowResponse.decode.bind(trainFlowResponse), + trainFlowMetadata.decode.bind(trainFlowMetadata), + ), + importFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importFlowResponse.decode.bind(importFlowResponse), + importFlowMetadata.decode.bind(importFlowMetadata), + ), + exportFlow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportFlowResponse.decode.bind(exportFlowResponse), + exportFlowMetadata.decode.bind(exportFlowMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Flows', + 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.flowsStub) { + return this.flowsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Flows. + this.flowsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Flows', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Flows, + 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 flowsStubMethods = [ + 'createFlow', + 'deleteFlow', + 'listFlows', + 'getFlow', + 'updateFlow', + 'trainFlow', + 'validateFlow', + 'getFlowValidationResult', + 'importFlow', + 'exportFlow', + ]; + for (const methodName of flowsStubMethods) { + const callPromise = this.flowsStub.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.flowsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 flow in the specified agent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a flow for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Flow} request.flow + * Required. The flow to create. + * @param {string} request.languageCode + * The language of the following fields in `flow`: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.create_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_CreateFlow_async + */ + createFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest | undefined, + {} | undefined, + ] + >; + createFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateFlowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the flow to delete. + * Format: + * `projects//locations//agents//flows/`. + * @param {boolean} request.force + * This field has no effect for flows with no incoming transitions. + * For flows with incoming transitions: + * + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the flow, as well as + * any transitions to the flow (i.e. [Target + * flow][EventHandler.target_flow] in event handlers or [Target + * flow][TransitionRoute.target_flow] in transition routes that point to + * this flow will be cleared). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.delete_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_DeleteFlow_async + */ + deleteFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest | undefined, + {} | undefined, + ] + >; + deleteFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteFlowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the flow to get. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to retrieve the flow for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.get_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_GetFlow_async + */ + getFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest | undefined, + {} | undefined, + ] + >; + getFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified flow. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Flow} request.flow + * Required. The flow to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + * @param {string} request.languageCode + * The language of the following fields in `flow`: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.update_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_UpdateFlow_async + */ + updateFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest | undefined, + {} | undefined, + ] + >; + updateFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest | 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({ + 'flow.name': request.flow!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateFlowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Validates the specified flow and creates or updates validation results. + * Please call this API after the training is completed to get the complete + * validation results. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The flow to validate. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult|FlowValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.validate_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_ValidateFlow_async + */ + validateFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | undefined + ), + {} | undefined, + ] + >; + validateFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + validateFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('validateFlow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateFlow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .validateFlow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IValidateFlowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('validateFlow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the latest flow validation result. Flow validation is performed + * when ValidateFlow is called. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The flow name. + * Format: + * `projects//locations//agents//flows//validationResult`. + * @param {string} request.languageCode + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult|FlowValidationResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.get_flow_validation_result.js + * region_tag:dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_async + */ + getFlowValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | undefined + ), + {} | undefined, + ] + >; + getFlowValidationResult( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getFlowValidationResult( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getFlowValidationResult( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getFlowValidationResult request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFlowValidationResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFlowValidationResult(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetFlowValidationResultRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getFlowValidationResult response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Trains the specified flow. Note that only the flow in 'draft' environment + * is trained. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The flow to train. + * Format: + * `projects//locations//agents//flows/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.train_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_TrainFlow_async + */ + trainFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + trainFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + trainFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + trainFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ITrainFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('trainFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('trainFlow request %j', request); + return this.innerApiCalls + .trainFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('trainFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `trainFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.train_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_TrainFlow_async + */ + async checkTrainFlowProgress( + name: string, + ): Promise< + LROperation + > { + this._log.info('trainFlow long-running'); + 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.trainFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } + /** + * Imports the specified flow to the specified agent from a binary file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse|ImportFlowResponse} + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the flow into. + * Format: `projects//locations//agents/`. + * @param {string} request.flowUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import flow from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.flowContent + * Uncompressed raw byte content for flow. + * @param {google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest.ImportOption} request.importOption + * Flow import mode. If not specified, `KEEP` is assumed. + * @param {google.cloud.dialogflow.cx.v3beta1.FlowImportStrategy} [request.flowImportStrategy] + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.import_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_ImportFlow_async + */ + importFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importFlow request %j', request); + return this.innerApiCalls + .importFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.import_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_ImportFlow_async + */ + async checkImportFlowProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('importFlow long-running'); + 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.importFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse, + protos.google.protobuf.Struct + >; + } + /** + * Exports the specified flow to a binary file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse|ExportFlowResponse} + * + * Note that resources (e.g. intents, entities, webhooks) that the flow + * references will also be exported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the flow to export. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} [request.flowUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. + * The format of this URI must be `gs:///`. If left + * unspecified, the serialized flow is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {boolean} [request.includeReferencedFlows] + * Optional. Whether to export flows referenced by the specified flow. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.export_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_ExportFlow_async + */ + exportFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportFlow( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportFlow( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportFlow response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportFlow request %j', request); + return this.innerApiCalls + .exportFlow(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportFlow response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportFlow()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.export_flow.js + * region_tag:dialogflow_v3beta1_generated_Flows_ExportFlow_async + */ + async checkExportFlowProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('exportFlow long-running'); + 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.exportFlow, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse, + protos.google.protobuf.Struct + >; + } + /** + * Returns the list of all flows in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the flows. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list flows for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow}. + * 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 `listFlowsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFlows( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow[], + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse, + ] + >; + listFlows( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IFlow + >, + ): void; + listFlows( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IFlow + >, + ): void; + listFlows( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IFlow + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IFlow + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow[], + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IFlow + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFlows values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFlows request %j', request); + return this.innerApiCalls + .listFlows(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IFlow[], + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsResponse, + ]) => { + this._log.info('listFlows values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listFlows`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent containing the flows. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list flows for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow} 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 `listFlowsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFlowsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + 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['listFlows']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listFlows stream %j', request); + return this.descriptors.page.listFlows.createStream( + this.innerApiCalls.listFlows as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listFlows`, 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 agent containing the flows. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list flows for. The following fields are language + * dependent: + * + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/flows.list_flows.js + * region_tag:dialogflow_v3beta1_generated_Flows_ListFlows_async + */ + listFlowsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListFlowsRequest, + 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['listFlows']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listFlows iterate %j', request); + return this.descriptors.page.listFlows.asyncIterate( + this.innerApiCalls['listFlows'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.flowsStub && !this._terminated) { + return this.flowsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_client_config.json new file mode 100644 index 000000000000..b50d70cc1295 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Flows": { + "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 + } + }, + "methods": { + "CreateFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListFlows": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "TrainFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetFlowValidationResult": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportFlow": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/flows_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/gapic_metadata.json new file mode 100644 index 000000000000..51d8eb01df8e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/gapic_metadata.json @@ -0,0 +1,1803 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.dialogflow.cx.v3beta1", + "libraryPackage": "@google-cloud/dialogflow-cx", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsClient", + "rpcs": { + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "ValidateAgent": { + "methods": [ + "validateAgent" + ] + }, + "GetAgentValidationResult": { + "methods": [ + "getAgentValidationResult" + ] + }, + "GetGenerativeSettings": { + "methods": [ + "getGenerativeSettings" + ] + }, + "UpdateGenerativeSettings": { + "methods": [ + "updateGenerativeSettings" + ] + }, + "ExportAgent": { + "methods": [ + "exportAgent" + ] + }, + "RestoreAgent": { + "methods": [ + "restoreAgent" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AgentsClient", + "rpcs": { + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "ValidateAgent": { + "methods": [ + "validateAgent" + ] + }, + "GetAgentValidationResult": { + "methods": [ + "getAgentValidationResult" + ] + }, + "GetGenerativeSettings": { + "methods": [ + "getGenerativeSettings" + ] + }, + "UpdateGenerativeSettings": { + "methods": [ + "updateGenerativeSettings" + ] + }, + "ExportAgent": { + "methods": [ + "exportAgent" + ] + }, + "RestoreAgent": { + "methods": [ + "restoreAgent" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + } + } + } + } + }, + "Changelogs": { + "clients": { + "grpc": { + "libraryClient": "ChangelogsClient", + "rpcs": { + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ChangelogsClient", + "rpcs": { + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + } + } + }, + "ConversationHistory": { + "clients": { + "grpc": { + "libraryClient": "ConversationHistoryClient", + "rpcs": { + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConversationHistoryClient", + "rpcs": { + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + } + } + } + } + }, + "Deployments": { + "clients": { + "grpc": { + "libraryClient": "DeploymentsClient", + "rpcs": { + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DeploymentsClient", + "rpcs": { + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + } + } + } + } + }, + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "ExportEntityTypes": { + "methods": [ + "exportEntityTypes" + ] + }, + "ImportEntityTypes": { + "methods": [ + "importEntityTypes" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EntityTypesClient", + "rpcs": { + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "ExportEntityTypes": { + "methods": [ + "exportEntityTypes" + ] + }, + "ImportEntityTypes": { + "methods": [ + "importEntityTypes" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + } + } + } + } + }, + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "RunContinuousTest": { + "methods": [ + "runContinuousTest" + ] + }, + "DeployFlow": { + "methods": [ + "deployFlow" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + }, + "LookupEnvironmentHistory": { + "methods": [ + "lookupEnvironmentHistory", + "lookupEnvironmentHistoryStream", + "lookupEnvironmentHistoryAsync" + ] + }, + "ListContinuousTestResults": { + "methods": [ + "listContinuousTestResults", + "listContinuousTestResultsStream", + "listContinuousTestResultsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "RunContinuousTest": { + "methods": [ + "runContinuousTest" + ] + }, + "DeployFlow": { + "methods": [ + "deployFlow" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + }, + "LookupEnvironmentHistory": { + "methods": [ + "lookupEnvironmentHistory", + "lookupEnvironmentHistoryStream", + "lookupEnvironmentHistoryAsync" + ] + }, + "ListContinuousTestResults": { + "methods": [ + "listContinuousTestResults", + "listContinuousTestResultsStream", + "listContinuousTestResultsAsync" + ] + } + } + } + } + }, + "Examples": { + "clients": { + "grpc": { + "libraryClient": "ExamplesClient", + "rpcs": { + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ExamplesClient", + "rpcs": { + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + } + } + } + } + }, + "Experiments": { + "clients": { + "grpc": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "GetExperiment": { + "methods": [ + "getExperiment" + ] + }, + "CreateExperiment": { + "methods": [ + "createExperiment" + ] + }, + "UpdateExperiment": { + "methods": [ + "updateExperiment" + ] + }, + "DeleteExperiment": { + "methods": [ + "deleteExperiment" + ] + }, + "StartExperiment": { + "methods": [ + "startExperiment" + ] + }, + "StopExperiment": { + "methods": [ + "stopExperiment" + ] + }, + "ListExperiments": { + "methods": [ + "listExperiments", + "listExperimentsStream", + "listExperimentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ExperimentsClient", + "rpcs": { + "GetExperiment": { + "methods": [ + "getExperiment" + ] + }, + "CreateExperiment": { + "methods": [ + "createExperiment" + ] + }, + "UpdateExperiment": { + "methods": [ + "updateExperiment" + ] + }, + "DeleteExperiment": { + "methods": [ + "deleteExperiment" + ] + }, + "StartExperiment": { + "methods": [ + "startExperiment" + ] + }, + "StopExperiment": { + "methods": [ + "stopExperiment" + ] + }, + "ListExperiments": { + "methods": [ + "listExperiments", + "listExperimentsStream", + "listExperimentsAsync" + ] + } + } + } + } + }, + "Flows": { + "clients": { + "grpc": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ + "createFlow" + ] + }, + "DeleteFlow": { + "methods": [ + "deleteFlow" + ] + }, + "GetFlow": { + "methods": [ + "getFlow" + ] + }, + "UpdateFlow": { + "methods": [ + "updateFlow" + ] + }, + "ValidateFlow": { + "methods": [ + "validateFlow" + ] + }, + "GetFlowValidationResult": { + "methods": [ + "getFlowValidationResult" + ] + }, + "TrainFlow": { + "methods": [ + "trainFlow" + ] + }, + "ImportFlow": { + "methods": [ + "importFlow" + ] + }, + "ExportFlow": { + "methods": [ + "exportFlow" + ] + }, + "ListFlows": { + "methods": [ + "listFlows", + "listFlowsStream", + "listFlowsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FlowsClient", + "rpcs": { + "CreateFlow": { + "methods": [ + "createFlow" + ] + }, + "DeleteFlow": { + "methods": [ + "deleteFlow" + ] + }, + "GetFlow": { + "methods": [ + "getFlow" + ] + }, + "UpdateFlow": { + "methods": [ + "updateFlow" + ] + }, + "ValidateFlow": { + "methods": [ + "validateFlow" + ] + }, + "GetFlowValidationResult": { + "methods": [ + "getFlowValidationResult" + ] + }, + "TrainFlow": { + "methods": [ + "trainFlow" + ] + }, + "ImportFlow": { + "methods": [ + "importFlow" + ] + }, + "ExportFlow": { + "methods": [ + "exportFlow" + ] + }, + "ListFlows": { + "methods": [ + "listFlows", + "listFlowsStream", + "listFlowsAsync" + ] + } + } + } + } + }, + "Generators": { + "clients": { + "grpc": { + "libraryClient": "GeneratorsClient", + "rpcs": { + "GetGenerator": { + "methods": [ + "getGenerator" + ] + }, + "CreateGenerator": { + "methods": [ + "createGenerator" + ] + }, + "UpdateGenerator": { + "methods": [ + "updateGenerator" + ] + }, + "DeleteGenerator": { + "methods": [ + "deleteGenerator" + ] + }, + "ListGenerators": { + "methods": [ + "listGenerators", + "listGeneratorsStream", + "listGeneratorsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GeneratorsClient", + "rpcs": { + "GetGenerator": { + "methods": [ + "getGenerator" + ] + }, + "CreateGenerator": { + "methods": [ + "createGenerator" + ] + }, + "UpdateGenerator": { + "methods": [ + "updateGenerator" + ] + }, + "DeleteGenerator": { + "methods": [ + "deleteGenerator" + ] + }, + "ListGenerators": { + "methods": [ + "listGenerators", + "listGeneratorsStream", + "listGeneratorsAsync" + ] + } + } + } + } + }, + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsClient", + "rpcs": { + "GetIntent": { + "methods": [ + "getIntent" + ] + }, + "CreateIntent": { + "methods": [ + "createIntent" + ] + }, + "UpdateIntent": { + "methods": [ + "updateIntent" + ] + }, + "DeleteIntent": { + "methods": [ + "deleteIntent" + ] + }, + "ImportIntents": { + "methods": [ + "importIntents" + ] + }, + "ExportIntents": { + "methods": [ + "exportIntents" + ] + }, + "ListIntents": { + "methods": [ + "listIntents", + "listIntentsStream", + "listIntentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IntentsClient", + "rpcs": { + "GetIntent": { + "methods": [ + "getIntent" + ] + }, + "CreateIntent": { + "methods": [ + "createIntent" + ] + }, + "UpdateIntent": { + "methods": [ + "updateIntent" + ] + }, + "DeleteIntent": { + "methods": [ + "deleteIntent" + ] + }, + "ImportIntents": { + "methods": [ + "importIntents" + ] + }, + "ExportIntents": { + "methods": [ + "exportIntents" + ] + }, + "ListIntents": { + "methods": [ + "listIntents", + "listIntentsStream", + "listIntentsAsync" + ] + } + } + } + } + }, + "Pages": { + "clients": { + "grpc": { + "libraryClient": "PagesClient", + "rpcs": { + "GetPage": { + "methods": [ + "getPage" + ] + }, + "CreatePage": { + "methods": [ + "createPage" + ] + }, + "UpdatePage": { + "methods": [ + "updatePage" + ] + }, + "DeletePage": { + "methods": [ + "deletePage" + ] + }, + "ListPages": { + "methods": [ + "listPages", + "listPagesStream", + "listPagesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PagesClient", + "rpcs": { + "GetPage": { + "methods": [ + "getPage" + ] + }, + "CreatePage": { + "methods": [ + "createPage" + ] + }, + "UpdatePage": { + "methods": [ + "updatePage" + ] + }, + "DeletePage": { + "methods": [ + "deletePage" + ] + }, + "ListPages": { + "methods": [ + "listPages", + "listPagesStream", + "listPagesAsync" + ] + } + } + } + } + }, + "Playbooks": { + "clients": { + "grpc": { + "libraryClient": "PlaybooksClient", + "rpcs": { + "CreatePlaybook": { + "methods": [ + "createPlaybook" + ] + }, + "DeletePlaybook": { + "methods": [ + "deletePlaybook" + ] + }, + "GetPlaybook": { + "methods": [ + "getPlaybook" + ] + }, + "UpdatePlaybook": { + "methods": [ + "updatePlaybook" + ] + }, + "CreatePlaybookVersion": { + "methods": [ + "createPlaybookVersion" + ] + }, + "GetPlaybookVersion": { + "methods": [ + "getPlaybookVersion" + ] + }, + "RestorePlaybookVersion": { + "methods": [ + "restorePlaybookVersion" + ] + }, + "DeletePlaybookVersion": { + "methods": [ + "deletePlaybookVersion" + ] + }, + "ExportPlaybook": { + "methods": [ + "exportPlaybook" + ] + }, + "ImportPlaybook": { + "methods": [ + "importPlaybook" + ] + }, + "ListPlaybooks": { + "methods": [ + "listPlaybooks", + "listPlaybooksStream", + "listPlaybooksAsync" + ] + }, + "ListPlaybookVersions": { + "methods": [ + "listPlaybookVersions", + "listPlaybookVersionsStream", + "listPlaybookVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PlaybooksClient", + "rpcs": { + "CreatePlaybook": { + "methods": [ + "createPlaybook" + ] + }, + "DeletePlaybook": { + "methods": [ + "deletePlaybook" + ] + }, + "GetPlaybook": { + "methods": [ + "getPlaybook" + ] + }, + "UpdatePlaybook": { + "methods": [ + "updatePlaybook" + ] + }, + "CreatePlaybookVersion": { + "methods": [ + "createPlaybookVersion" + ] + }, + "GetPlaybookVersion": { + "methods": [ + "getPlaybookVersion" + ] + }, + "RestorePlaybookVersion": { + "methods": [ + "restorePlaybookVersion" + ] + }, + "DeletePlaybookVersion": { + "methods": [ + "deletePlaybookVersion" + ] + }, + "ExportPlaybook": { + "methods": [ + "exportPlaybook" + ] + }, + "ImportPlaybook": { + "methods": [ + "importPlaybook" + ] + }, + "ListPlaybooks": { + "methods": [ + "listPlaybooks", + "listPlaybooksStream", + "listPlaybooksAsync" + ] + }, + "ListPlaybookVersions": { + "methods": [ + "listPlaybookVersions", + "listPlaybookVersionsStream", + "listPlaybookVersionsAsync" + ] + } + } + } + } + }, + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecuritySettingsServiceClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ + "createSecuritySettings" + ] + }, + "GetSecuritySettings": { + "methods": [ + "getSecuritySettings" + ] + }, + "UpdateSecuritySettings": { + "methods": [ + "updateSecuritySettings" + ] + }, + "DeleteSecuritySettings": { + "methods": [ + "deleteSecuritySettings" + ] + }, + "ListSecuritySettings": { + "methods": [ + "listSecuritySettings", + "listSecuritySettingsStream", + "listSecuritySettingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecuritySettingsServiceClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ + "createSecuritySettings" + ] + }, + "GetSecuritySettings": { + "methods": [ + "getSecuritySettings" + ] + }, + "UpdateSecuritySettings": { + "methods": [ + "updateSecuritySettings" + ] + }, + "DeleteSecuritySettings": { + "methods": [ + "deleteSecuritySettings" + ] + }, + "ListSecuritySettings": { + "methods": [ + "listSecuritySettings", + "listSecuritySettingsStream", + "listSecuritySettingsAsync" + ] + } + } + } + } + }, + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "GetSessionEntityType": { + "methods": [ + "getSessionEntityType" + ] + }, + "CreateSessionEntityType": { + "methods": [ + "createSessionEntityType" + ] + }, + "UpdateSessionEntityType": { + "methods": [ + "updateSessionEntityType" + ] + }, + "DeleteSessionEntityType": { + "methods": [ + "deleteSessionEntityType" + ] + }, + "ListSessionEntityTypes": { + "methods": [ + "listSessionEntityTypes", + "listSessionEntityTypesStream", + "listSessionEntityTypesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionEntityTypesClient", + "rpcs": { + "GetSessionEntityType": { + "methods": [ + "getSessionEntityType" + ] + }, + "CreateSessionEntityType": { + "methods": [ + "createSessionEntityType" + ] + }, + "UpdateSessionEntityType": { + "methods": [ + "updateSessionEntityType" + ] + }, + "DeleteSessionEntityType": { + "methods": [ + "deleteSessionEntityType" + ] + }, + "ListSessionEntityTypes": { + "methods": [ + "listSessionEntityTypes", + "listSessionEntityTypesStream", + "listSessionEntityTypesAsync" + ] + } + } + } + } + }, + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ + "detectIntent" + ] + }, + "MatchIntent": { + "methods": [ + "matchIntent" + ] + }, + "FulfillIntent": { + "methods": [ + "fulfillIntent" + ] + }, + "SubmitAnswerFeedback": { + "methods": [ + "submitAnswerFeedback" + ] + }, + "ServerStreamingDetectIntent": { + "methods": [ + "serverStreamingDetectIntent" + ] + }, + "StreamingDetectIntent": { + "methods": [ + "streamingDetectIntent" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionsClient", + "rpcs": { + "DetectIntent": { + "methods": [ + "detectIntent" + ] + }, + "MatchIntent": { + "methods": [ + "matchIntent" + ] + }, + "FulfillIntent": { + "methods": [ + "fulfillIntent" + ] + }, + "SubmitAnswerFeedback": { + "methods": [ + "submitAnswerFeedback" + ] + } + } + } + } + }, + "TestCases": { + "clients": { + "grpc": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ + "batchDeleteTestCases" + ] + }, + "GetTestCase": { + "methods": [ + "getTestCase" + ] + }, + "CreateTestCase": { + "methods": [ + "createTestCase" + ] + }, + "UpdateTestCase": { + "methods": [ + "updateTestCase" + ] + }, + "CalculateCoverage": { + "methods": [ + "calculateCoverage" + ] + }, + "GetTestCaseResult": { + "methods": [ + "getTestCaseResult" + ] + }, + "RunTestCase": { + "methods": [ + "runTestCase" + ] + }, + "BatchRunTestCases": { + "methods": [ + "batchRunTestCases" + ] + }, + "ImportTestCases": { + "methods": [ + "importTestCases" + ] + }, + "ExportTestCases": { + "methods": [ + "exportTestCases" + ] + }, + "ListTestCases": { + "methods": [ + "listTestCases", + "listTestCasesStream", + "listTestCasesAsync" + ] + }, + "ListTestCaseResults": { + "methods": [ + "listTestCaseResults", + "listTestCaseResultsStream", + "listTestCaseResultsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TestCasesClient", + "rpcs": { + "BatchDeleteTestCases": { + "methods": [ + "batchDeleteTestCases" + ] + }, + "GetTestCase": { + "methods": [ + "getTestCase" + ] + }, + "CreateTestCase": { + "methods": [ + "createTestCase" + ] + }, + "UpdateTestCase": { + "methods": [ + "updateTestCase" + ] + }, + "CalculateCoverage": { + "methods": [ + "calculateCoverage" + ] + }, + "GetTestCaseResult": { + "methods": [ + "getTestCaseResult" + ] + }, + "RunTestCase": { + "methods": [ + "runTestCase" + ] + }, + "BatchRunTestCases": { + "methods": [ + "batchRunTestCases" + ] + }, + "ImportTestCases": { + "methods": [ + "importTestCases" + ] + }, + "ExportTestCases": { + "methods": [ + "exportTestCases" + ] + }, + "ListTestCases": { + "methods": [ + "listTestCases", + "listTestCasesStream", + "listTestCasesAsync" + ] + }, + "ListTestCaseResults": { + "methods": [ + "listTestCaseResults", + "listTestCaseResultsStream", + "listTestCaseResultsAsync" + ] + } + } + } + } + }, + "Tools": { + "clients": { + "grpc": { + "libraryClient": "ToolsClient", + "rpcs": { + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "CreateToolVersion": { + "methods": [ + "createToolVersion" + ] + }, + "GetToolVersion": { + "methods": [ + "getToolVersion" + ] + }, + "DeleteToolVersion": { + "methods": [ + "deleteToolVersion" + ] + }, + "RestoreToolVersion": { + "methods": [ + "restoreToolVersion" + ] + }, + "ExportTools": { + "methods": [ + "exportTools" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListToolVersions": { + "methods": [ + "listToolVersions", + "listToolVersionsStream", + "listToolVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ToolsClient", + "rpcs": { + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "CreateToolVersion": { + "methods": [ + "createToolVersion" + ] + }, + "GetToolVersion": { + "methods": [ + "getToolVersion" + ] + }, + "DeleteToolVersion": { + "methods": [ + "deleteToolVersion" + ] + }, + "RestoreToolVersion": { + "methods": [ + "restoreToolVersion" + ] + }, + "ExportTools": { + "methods": [ + "exportTools" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListToolVersions": { + "methods": [ + "listToolVersions", + "listToolVersionsStream", + "listToolVersionsAsync" + ] + } + } + } + } + }, + "TransitionRouteGroups": { + "clients": { + "grpc": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "GetTransitionRouteGroup": { + "methods": [ + "getTransitionRouteGroup" + ] + }, + "CreateTransitionRouteGroup": { + "methods": [ + "createTransitionRouteGroup" + ] + }, + "UpdateTransitionRouteGroup": { + "methods": [ + "updateTransitionRouteGroup" + ] + }, + "DeleteTransitionRouteGroup": { + "methods": [ + "deleteTransitionRouteGroup" + ] + }, + "ListTransitionRouteGroups": { + "methods": [ + "listTransitionRouteGroups", + "listTransitionRouteGroupsStream", + "listTransitionRouteGroupsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TransitionRouteGroupsClient", + "rpcs": { + "GetTransitionRouteGroup": { + "methods": [ + "getTransitionRouteGroup" + ] + }, + "CreateTransitionRouteGroup": { + "methods": [ + "createTransitionRouteGroup" + ] + }, + "UpdateTransitionRouteGroup": { + "methods": [ + "updateTransitionRouteGroup" + ] + }, + "DeleteTransitionRouteGroup": { + "methods": [ + "deleteTransitionRouteGroup" + ] + }, + "ListTransitionRouteGroups": { + "methods": [ + "listTransitionRouteGroups", + "listTransitionRouteGroupsStream", + "listTransitionRouteGroupsAsync" + ] + } + } + } + } + }, + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CompareVersions": { + "methods": [ + "compareVersions" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "LoadVersion": { + "methods": [ + "loadVersion" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VersionsClient", + "rpcs": { + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CompareVersions": { + "methods": [ + "compareVersions" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "LoadVersion": { + "methods": [ + "loadVersion" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + } + } + } + } + }, + "Webhooks": { + "clients": { + "grpc": { + "libraryClient": "WebhooksClient", + "rpcs": { + "GetWebhook": { + "methods": [ + "getWebhook" + ] + }, + "CreateWebhook": { + "methods": [ + "createWebhook" + ] + }, + "UpdateWebhook": { + "methods": [ + "updateWebhook" + ] + }, + "DeleteWebhook": { + "methods": [ + "deleteWebhook" + ] + }, + "ListWebhooks": { + "methods": [ + "listWebhooks", + "listWebhooksStream", + "listWebhooksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WebhooksClient", + "rpcs": { + "GetWebhook": { + "methods": [ + "getWebhook" + ] + }, + "CreateWebhook": { + "methods": [ + "createWebhook" + ] + }, + "UpdateWebhook": { + "methods": [ + "updateWebhook" + ] + }, + "DeleteWebhook": { + "methods": [ + "deleteWebhook" + ] + }, + "ListWebhooks": { + "methods": [ + "listWebhooks", + "listWebhooksStream", + "listWebhooksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_client.ts new file mode 100644 index 000000000000..8355cbe2b141 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_client.ts @@ -0,0 +1,3723 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/generators_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './generators_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Generator|Generators} + * @class + * @memberof v3beta1 + */ +export class GeneratorsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + generatorsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of GeneratorsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 GeneratorsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof GeneratorsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listGenerators: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'generators', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Generators', + 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.generatorsStub) { + return this.generatorsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Generators. + this.generatorsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Generators', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Generators, + 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 generatorsStubMethods = [ + 'listGenerators', + 'getGenerator', + 'createGenerator', + 'updateGenerator', + 'deleteGenerator', + ]; + for (const methodName of generatorsStubMethods) { + const callPromise = this.generatorsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.generatorsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified generator. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the generator. + * Format: + * `projects//locations//agents//generators/`. + * @param {string} request.languageCode + * The language to list generators for. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Generator|Generator}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/generators.get_generator.js + * region_tag:dialogflow_v3beta1_generated_Generators_GetGenerator_async + */ + getGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | undefined + ), + {} | undefined, + ] + >; + getGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetGeneratorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a generator in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a generator for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Generator} request.generator + * Required. The generator to create. + * @param {string} request.languageCode + * The language to create generators for the following fields: + * * `Generator.prompt_text.text` + * If not specified, the agent's default language is used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Generator|Generator}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/generators.create_generator.js + * region_tag:dialogflow_v3beta1_generated_Generators_CreateGenerator_async + */ + createGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | undefined + ), + {} | undefined, + ] + >; + createGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateGeneratorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update the specified generator. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Generator} request.generator + * Required. The generator to update. + * @param {string} request.languageCode + * The language to list generators for. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Generator|Generator}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/generators.update_generator.js + * region_tag:dialogflow_v3beta1_generated_Generators_UpdateGenerator_async + */ + updateGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | undefined + ), + {} | undefined, + ] + >; + updateGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | 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({ + 'generator.name': request.generator!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateGeneratorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified generators. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the generator to delete. + * Format: + * `projects//locations//agents//generators/`. + * @param {boolean} request.force + * This field has no effect for generators not being used. + * For generators that are used by pages/flows/transition route groups: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the generator, as well + * as any references to the generator (i.e. + * {@link protos.Fulfillment.generator|Generator}) in fulfillments. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/generators.delete_generator.js + * region_tag:dialogflow_v3beta1_generated_Generators_DeleteGenerator_async + */ + deleteGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | undefined + ), + {} | undefined, + ] + >; + deleteGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteGenerator( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteGenerator( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteGenerator request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteGenerator response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteGenerator(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteGeneratorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteGenerator response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all generators in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all generators for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list generators for. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Generator|Generator}. + * 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 `listGeneratorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGenerators( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator[], + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse, + ] + >; + listGenerators( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator + >, + ): void; + listGenerators( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator + >, + ): void; + listGenerators( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator[], + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGenerators values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGenerators request %j', request); + return this.innerApiCalls + .listGenerators(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IGenerator[], + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsResponse, + ]) => { + this._log.info('listGenerators values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listGenerators`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all generators for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list generators for. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Generator|Generator} 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 `listGeneratorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGeneratorsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + 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['listGenerators']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listGenerators stream %j', request); + return this.descriptors.page.listGenerators.createStream( + this.innerApiCalls.listGenerators as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listGenerators`, 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 agent to list all generators for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list generators for. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Generator|Generator}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/generators.list_generators.js + * region_tag:dialogflow_v3beta1_generated_Generators_ListGenerators_async + */ + listGeneratorsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListGeneratorsRequest, + 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['listGenerators']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listGenerators iterate %j', request); + return this.descriptors.page.listGenerators.asyncIterate( + this.innerApiCalls['listGenerators'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.generatorsStub && !this._terminated) { + return this.generatorsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_client_config.json new file mode 100644 index 000000000000..a1219057903f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Generators": { + "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 + } + }, + "methods": { + "ListGenerators": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/generators_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/index.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/index.ts new file mode 100644 index 000000000000..37a620393462 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/index.ts @@ -0,0 +1,39 @@ +// Copyright 2026 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 { AgentsClient } from './agents_client'; +export { ChangelogsClient } from './changelogs_client'; +export { ConversationHistoryClient } from './conversation_history_client'; +export { DeploymentsClient } from './deployments_client'; +export { EntityTypesClient } from './entity_types_client'; +export { EnvironmentsClient } from './environments_client'; +export { ExamplesClient } from './examples_client'; +export { ExperimentsClient } from './experiments_client'; +export { FlowsClient } from './flows_client'; +export { GeneratorsClient } from './generators_client'; +export { IntentsClient } from './intents_client'; +export { PagesClient } from './pages_client'; +export { PlaybooksClient } from './playbooks_client'; +export { SecuritySettingsServiceClient } from './security_settings_service_client'; +export { SessionEntityTypesClient } from './session_entity_types_client'; +export { SessionsClient } from './sessions_client'; +export { TestCasesClient } from './test_cases_client'; +export { ToolsClient } from './tools_client'; +export { TransitionRouteGroupsClient } from './transition_route_groups_client'; +export { VersionsClient } from './versions_client'; +export { WebhooksClient } from './webhooks_client'; diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_client.ts new file mode 100644 index 000000000000..3a0bd410a9de --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_client.ts @@ -0,0 +1,4472 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/intents_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './intents_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent|Intents}. + * @class + * @memberof v3beta1 + */ +export class IntentsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + intentsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of IntentsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 IntentsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof IntentsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listIntents: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'intents', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const importIntentsResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse', + ) as gax.protobuf.Type; + const importIntentsMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata', + ) as gax.protobuf.Type; + const exportIntentsResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse', + ) as gax.protobuf.Type; + const exportIntentsMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + importIntents: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importIntentsResponse.decode.bind(importIntentsResponse), + importIntentsMetadata.decode.bind(importIntentsMetadata), + ), + exportIntents: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportIntentsResponse.decode.bind(exportIntentsResponse), + exportIntentsMetadata.decode.bind(exportIntentsMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Intents', + 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.intentsStub) { + return this.intentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Intents. + this.intentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Intents', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Intents, + 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 intentsStubMethods = [ + 'listIntents', + 'getIntent', + 'createIntent', + 'updateIntent', + 'deleteIntent', + 'importIntents', + 'exportIntents', + ]; + for (const methodName of intentsStubMethods) { + const callPromise = this.intentsStub.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.intentsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified intent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent. + * Format: + * `projects//locations//agents//intents/`. + * @param {string} request.languageCode + * The language to retrieve the intent for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent|Intent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.get_intent.js + * region_tag:dialogflow_v3beta1_generated_Intents_GetIntent_async + */ + getIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest | undefined, + {} | undefined, + ] + >; + getIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an intent in the specified agent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create an intent for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Intent} request.intent + * Required. The intent to create. + * @param {string} request.languageCode + * The language of the following fields in `intent`: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent|Intent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.create_intent.js + * region_tag:dialogflow_v3beta1_generated_Intents_CreateIntent_async + */ + createIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | undefined + ), + {} | undefined, + ] + >; + createIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified intent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Intent} request.intent + * Required. The intent to update. + * @param {string} request.languageCode + * The language of the following fields in `intent`: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent|Intent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.update_intent.js + * region_tag:dialogflow_v3beta1_generated_Intents_UpdateIntent_async + */ + updateIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | undefined + ), + {} | undefined, + ] + >; + updateIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | 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({ + 'intent.name': request.intent!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified intent. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent to delete. + * Format: + * `projects//locations//agents//intents/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.delete_intent.js + * region_tag:dialogflow_v3beta1_generated_Intents_DeleteIntent_async + */ + deleteIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Imports the specified intents into the agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata|ImportIntentsMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse|ImportIntentsResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the intents into. + * Format: `projects//locations//agents/`. + * @param {string} request.intentsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import intents from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3beta1.InlineSource} request.intentsContent + * Uncompressed byte content of intents. + * @param {google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest.MergeOption} request.mergeOption + * Merge option for importing intents. If not specified, `REJECT` is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.import_intents.js + * region_tag:dialogflow_v3beta1_generated_Intents_ImportIntents_async + */ + importIntents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importIntents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importIntents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importIntents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importIntents response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importIntents request %j', request); + return this.innerApiCalls + .importIntents(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importIntents response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importIntents()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.import_intents.js + * region_tag:dialogflow_v3beta1_generated_Intents_ImportIntents_async + */ + async checkImportIntentsProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + > + > { + this._log.info('importIntents long-running'); + 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.importIntents, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata + >; + } + /** + * Exports the selected intents. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata|ExportIntentsMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse|ExportIntentsResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent agent to export intents. + * Format: `projects//locations//agents/`. + * @param {string[]} request.intents + * Required. The name of the intents to export. + * Format: + * `projects//locations//agents//intents/`. + * @param {string} [request.intentsUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the + * intents to. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {boolean} [request.intentsContentInline] + * Optional. The option to return the serialized intents inline. + * @param {google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported intents. If not specified, `BLOB` + * is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.export_intents.js + * region_tag:dialogflow_v3beta1_generated_Intents_ExportIntents_async + */ + exportIntents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportIntents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportIntents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportIntents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportIntents response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportIntents request %j', request); + return this.innerApiCalls + .exportIntents(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportIntents response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportIntents()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.export_intents.js + * region_tag:dialogflow_v3beta1_generated_Intents_ExportIntents_async + */ + async checkExportIntentsProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + > + > { + this._log.info('exportIntents long-running'); + 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.exportIntents, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata + >; + } + /** + * Returns the list of all intents in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all intents for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list intents for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.cloud.dialogflow.cx.v3beta1.IntentView} request.intentView + * The resource view to apply to the returned intent. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent|Intent}. + * 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 `listIntentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listIntents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent[], + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse, + ] + >; + listIntents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IIntent + >, + ): void; + listIntents( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IIntent + >, + ): void; + listIntents( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IIntent + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IIntent + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent[], + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IIntent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listIntents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listIntents request %j', request); + return this.innerApiCalls + .listIntents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IIntent[], + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsResponse, + ]) => { + this._log.info('listIntents values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listIntents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all intents for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list intents for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.cloud.dialogflow.cx.v3beta1.IntentView} request.intentView + * The resource view to apply to the returned intent. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent|Intent} 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 `listIntentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listIntentsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + 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['listIntents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listIntents stream %j', request); + return this.descriptors.page.listIntents.createStream( + this.innerApiCalls.listIntents as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listIntents`, 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 agent to list all intents for. + * Format: `projects//locations//agents/`. + * @param {string} request.languageCode + * The language to list intents for. The following fields are language + * dependent: + * + * * `Intent.training_phrases.parts.text` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.cloud.dialogflow.cx.v3beta1.IntentView} request.intentView + * The resource view to apply to the returned intent. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Intent|Intent}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/intents.list_intents.js + * region_tag:dialogflow_v3beta1_generated_Intents_ListIntents_async + */ + listIntentsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListIntentsRequest, + 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['listIntents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listIntents iterate %j', request); + return this.descriptors.page.listIntents.asyncIterate( + this.innerApiCalls['listIntents'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.intentsStub && !this._terminated) { + return this.intentsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_client_config.json new file mode 100644 index 000000000000..62d3d7364bce --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Intents": { + "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 + } + }, + "methods": { + "ListIntents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportIntents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportIntents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/intents_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_client.ts new file mode 100644 index 000000000000..c5fe1ff835d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_client.ts @@ -0,0 +1,3817 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/pages_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './pages_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Page|Pages}. + * @class + * @memberof v3beta1 + */ +export class PagesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + pagesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of PagesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 PagesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PagesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listPages: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'pages', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Pages', + 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.pagesStub) { + return this.pagesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Pages. + this.pagesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Pages', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Pages, + 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 pagesStubMethods = [ + 'listPages', + 'getPage', + 'createPage', + 'updatePage', + 'deletePage', + ]; + for (const methodName of pagesStubMethods) { + const callPromise = this.pagesStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.pagesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified page. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the page. + * Format: + * `projects//locations//agents//flows//pages/`. + * @param {string} request.languageCode + * The language to retrieve the page for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Page|Page}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/pages.get_page.js + * region_tag:dialogflow_v3beta1_generated_Pages_GetPage_async + */ + getPage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest | undefined, + {} | undefined, + ] + >; + getPage( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPage( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getPage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + protos.google.cloud.dialogflow.cx.v3beta1.IGetPageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getPage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a page in the specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to create a page for. + * Format: + * `projects//locations//agents//flows/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Page} request.page + * Required. The page to create. + * @param {string} request.languageCode + * The language of the following fields in `page`: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Page|Page}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/pages.create_page.js + * region_tag:dialogflow_v3beta1_generated_Pages_CreatePage_async + */ + createPage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest | undefined, + {} | undefined, + ] + >; + createPage( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPage( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createPage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified page. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Page} request.page + * Required. The page to update. + * @param {string} request.languageCode + * The language of the following fields in `page`: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Page|Page}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/pages.update_page.js + * region_tag:dialogflow_v3beta1_generated_Pages_UpdatePage_async + */ + updatePage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest | undefined, + {} | undefined, + ] + >; + updatePage( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePage( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest | 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({ + 'page.name': request.page!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updatePage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified page. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the page to delete. + * Format: + * `projects//locations//agents//Flows//pages/`. + * @param {boolean} request.force + * This field has no effect for pages with no incoming transitions. + * For pages with incoming transitions: + * + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the page, as well as + * any transitions to the page (i.e. [Target + * page][EventHandler.target_page] in event handlers or [Target + * page][TransitionRoute.target_page] in transition routes that point to + * this page will be cleared). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/pages.delete_page.js + * region_tag:dialogflow_v3beta1_generated_Pages_DeletePage_async + */ + deletePage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest | undefined, + {} | undefined, + ] + >; + deletePage( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePage( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deletePage request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all pages in the specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to list pages for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Page|Page}. + * 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 `listPagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPages( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse, + ] + >; + listPages( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPage + >, + ): void; + listPages( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPage + >, + ): void; + listPages( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPage + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPage + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPage + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPages values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPages request %j', request); + return this.innerApiCalls + .listPages(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPage[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPagesResponse, + ]) => { + this._log.info('listPages values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listPages`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to list pages for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Page|Page} 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 `listPagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPagesStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + 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['listPages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPages stream %j', request); + return this.descriptors.page.listPages.createStream( + this.innerApiCalls.listPages as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listPages`, 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 flow to list all pages for. + * Format: + * `projects//locations//agents//flows/`. + * @param {string} request.languageCode + * The language to list pages for. The following fields are language + * dependent: + * + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Page|Page}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/pages.list_pages.js + * region_tag:dialogflow_v3beta1_generated_Pages_ListPages_async + */ + listPagesAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPagesRequest, + 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['listPages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPages iterate %j', request); + return this.descriptors.page.listPages.asyncIterate( + this.innerApiCalls['listPages'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.pagesStub && !this._terminated) { + return this.pagesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_client_config.json new file mode 100644 index 000000000000..df5623432a79 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Pages": { + "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 + } + }, + "methods": { + "ListPages": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetPage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreatePage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdatePage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeletePage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/pages_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client.ts new file mode 100644 index 000000000000..c6ec685259e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client.ts @@ -0,0 +1,5188 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/playbooks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './playbooks_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Playbook|Playbooks}. + * @class + * @memberof v3beta1 + */ +export class PlaybooksClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + playbooksStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of PlaybooksClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 PlaybooksClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PlaybooksClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listPlaybooks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'playbooks', + ), + listPlaybookVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'playbookVersions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const exportPlaybookResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse', + ) as gax.protobuf.Type; + const exportPlaybookMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + const importPlaybookResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse', + ) as gax.protobuf.Type; + const importPlaybookMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportPlaybook: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportPlaybookResponse.decode.bind(exportPlaybookResponse), + exportPlaybookMetadata.decode.bind(exportPlaybookMetadata), + ), + importPlaybook: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importPlaybookResponse.decode.bind(importPlaybookResponse), + importPlaybookMetadata.decode.bind(importPlaybookMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Playbooks', + 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.playbooksStub) { + return this.playbooksStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Playbooks. + this.playbooksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Playbooks', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Playbooks, + 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 playbooksStubMethods = [ + 'createPlaybook', + 'deletePlaybook', + 'listPlaybooks', + 'getPlaybook', + 'exportPlaybook', + 'importPlaybook', + 'updatePlaybook', + 'createPlaybookVersion', + 'getPlaybookVersion', + 'restorePlaybookVersion', + 'listPlaybookVersions', + 'deletePlaybookVersion', + ]; + for (const methodName of playbooksStubMethods) { + const callPromise = this.playbooksStub.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.playbooksStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 playbook in a specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a playbook for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook} request.playbook + * Required. The playbook 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Playbook|Playbook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.create_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_CreatePlaybook_async + */ + createPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | undefined + ), + {} | undefined, + ] + >; + createPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createPlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a specified playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook to delete. + * Format: + * `projects//locations//agents//playbooks/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.delete_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_DeletePlaybook_async + */ + deletePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | undefined + ), + {} | undefined, + ] + >; + deletePlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deletePlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook. + * Format: + * `projects//locations//agents//playbooks/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Playbook|Playbook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.get_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_GetPlaybook_async + */ + getPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest | undefined, + {} | undefined, + ] + >; + getPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getPlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook} request.playbook + * Required. The playbook to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Playbook|Playbook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.update_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_UpdatePlaybook_async + */ + updatePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | undefined + ), + {} | undefined, + ] + >; + updatePlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updatePlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | 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({ + 'playbook.name': request.playbook!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updatePlaybook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePlaybook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePlaybook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdatePlaybookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePlaybook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a version for the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to create a version for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookVersion} request.playbookVersion + * Required. The playbook version 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion|PlaybookVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.create_playbook_version.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_CreatePlaybookVersion_async + */ + createPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + createPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createPlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreatePlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion|PlaybookVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.get_playbook_version.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_GetPlaybookVersion_async + */ + getPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + getPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getPlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getPlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetPlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the Playbook and stores it as the + * current playbook draft, returning the playbook with resources updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook version. + * Format: + * `projects//locations//agents//playbooks//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse|RestorePlaybookVersionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.restore_playbook_version.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_RestorePlaybookVersion_async + */ + restorePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + restorePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restorePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restorePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('restorePlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('restorePlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .restorePlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('restorePlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified version of the Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook version to delete. + * Format: + * `projects//locations//agents//playbooks//versions/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.delete_playbook_version.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_DeletePlaybookVersion_async + */ + deletePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | undefined + ), + {} | undefined, + ] + >; + deletePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybookVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deletePlaybookVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deletePlaybookVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePlaybookVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePlaybookVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeletePlaybookVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePlaybookVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Exports the specified playbook to a binary file. + * + * Note that resources (e.g. examples, tools) that the playbook + * references will also be exported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the playbook to export. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {string} [request.playbookUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the playbook + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized playbook is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported agent. If not specified, `BLOB` + * is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.export_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_ExportPlaybook_async + */ + exportPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportPlaybook response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportPlaybook request %j', request); + return this.innerApiCalls + .exportPlaybook(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportPlaybook response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportPlaybook()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.export_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_ExportPlaybook_async + */ + async checkExportPlaybookProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('exportPlaybook long-running'); + 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.exportPlaybook, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookResponse, + protos.google.protobuf.Struct + >; + } + /** + * Imports the specified playbook to the specified agent from a binary file. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import the playbook into. + * Format: `projects//locations//agents/`. + * @param {string} request.playbookUri + * [Dialogflow access + * control] + * (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.playbookContent + * Uncompressed raw byte content for playbook. + * @param {google.cloud.dialogflow.cx.v3beta1.PlaybookImportStrategy} [request.importStrategy] + * Optional. Specifies the import strategy used when resolving resource + * conflicts. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.import_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_ImportPlaybook_async + */ + importPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importPlaybook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importPlaybook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importPlaybook response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importPlaybook request %j', request); + return this.innerApiCalls + .importPlaybook(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importPlaybook response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importPlaybook()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.import_playbook.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_ImportPlaybook_async + */ + async checkImportPlaybookProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse, + protos.google.protobuf.Struct + > + > { + this._log.info('importPlaybook long-running'); + 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.importPlaybook, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookResponse, + protos.google.protobuf.Struct + >; + } + /** + * Returns a list of playbooks in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list playbooks from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Playbook|Playbook}. + * 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 `listPlaybooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybooks( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse, + ] + >; + listPlaybooks( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook + >, + ): void; + listPlaybooks( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook + >, + ): void; + listPlaybooks( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPlaybooks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPlaybooks request %j', request); + return this.innerApiCalls + .listPlaybooks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksResponse, + ]) => { + this._log.info('listPlaybooks values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listPlaybooks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list playbooks from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Playbook|Playbook} 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 `listPlaybooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybooksStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + 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['listPlaybooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybooks stream %j', request); + return this.descriptors.page.listPlaybooks.createStream( + this.innerApiCalls.listPlaybooks as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listPlaybooks`, 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 agent to list playbooks from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Playbook|Playbook}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.list_playbooks.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_ListPlaybooks_async + */ + listPlaybooksAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybooksRequest, + 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['listPlaybooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybooks iterate %j', request); + return this.descriptors.page.listPlaybooks.asyncIterate( + this.innerApiCalls['listPlaybooks'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists versions for the specified Playbook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion|PlaybookVersion}. + * 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 `listPlaybookVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybookVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse, + ] + >; + listPlaybookVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion + >, + ): void; + listPlaybookVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion + >, + ): void; + listPlaybookVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPlaybookVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPlaybookVersions request %j', request); + return this.innerApiCalls + .listPlaybookVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsResponse, + ]) => { + this._log.info('listPlaybookVersions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listPlaybookVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion|PlaybookVersion} 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 `listPlaybookVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPlaybookVersionsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + 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['listPlaybookVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybookVersions stream %j', request); + return this.descriptors.page.listPlaybookVersions.createStream( + this.innerApiCalls.listPlaybookVersions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listPlaybookVersions`, 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 playbook to list versions for. + * Format: + * `projects//locations//agents//playbooks/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion|PlaybookVersion}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/playbooks.list_playbook_versions.js + * region_tag:dialogflow_v3beta1_generated_Playbooks_ListPlaybookVersions_async + */ + listPlaybookVersionsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListPlaybookVersionsRequest, + 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['listPlaybookVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPlaybookVersions iterate %j', request); + return this.descriptors.page.listPlaybookVersions.asyncIterate( + this.innerApiCalls['listPlaybookVersions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.playbooksStub && !this._terminated) { + return this.playbooksStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client_config.json new file mode 100644 index 000000000000..0e1ddb9c9af6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Playbooks": { + "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 + } + }, + "methods": { + "CreatePlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeletePlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListPlaybooks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetPlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportPlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportPlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdatePlaybook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreatePlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetPlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RestorePlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListPlaybookVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeletePlaybookVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/playbooks_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client.ts new file mode 100644 index 000000000000..bf81ea91b157 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client.ts @@ -0,0 +1,3992 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/security_settings_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './security_settings_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing security settings for Dialogflow. + * @class + * @memberof v3beta1 + */ +export class SecuritySettingsServiceClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + securitySettingsServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of SecuritySettingsServiceClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 SecuritySettingsServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof SecuritySettingsServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + organizationLocationDeidentifyTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}', + ), + organizationLocationInspectTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationDeidentifyTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}', + ), + projectLocationInspectTemplatePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/inspectTemplates/{inspect_template}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listSecuritySettings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'securitySettings', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService', + 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.securitySettingsServiceStub) { + return this.securitySettingsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService. + this.securitySettingsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1 + .SecuritySettingsService, + 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 securitySettingsServiceStubMethods = [ + 'createSecuritySettings', + 'getSecuritySettings', + 'updateSecuritySettings', + 'listSecuritySettings', + 'deleteSecuritySettings', + ]; + for (const methodName of securitySettingsServiceStubMethods) { + const callPromise = this.securitySettingsServiceStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securitySettingsServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Create security settings in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to create an + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings} + * for. Format: `projects//locations/`. + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} request.securitySettings + * Required. The security settings 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/security_settings_service.create_security_settings.js + * region_tag:dialogflow_v3beta1_generated_SecuritySettingsService_CreateSecuritySettings_async + */ + createSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * The returned settings may be stale by up to 1 minute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the settings. + * Format: + * `projects//locations//securitySettings/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/security_settings_service.get_security_settings.js + * region_tag:dialogflow_v3beta1_generated_SecuritySettingsService_GetSecuritySettings_async + */ + getSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} request.securitySettings + * Required. [SecuritySettings] object that contains values for each of the + * fields to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/security_settings_service.update_security_settings.js + * region_tag:dialogflow_v3beta1_generated_SecuritySettingsService_UpdateSecuritySettings_async + */ + updateSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | 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({ + 'security_settings.name': request.securitySettings!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings} to + * delete. Format: + * `projects//locations//securitySettings/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/security_settings_service.delete_security_settings.js + * region_tag:dialogflow_v3beta1_generated_SecuritySettingsService_DeleteSecuritySettings_async + */ + deleteSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | undefined + ), + {} | undefined, + ] + >; + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteSecuritySettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSecuritySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSecuritySettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all security settings in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * 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 `listSecuritySettingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse, + ] + >; + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + >, + ): void; + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + >, + ): void; + listSecuritySettings( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSecuritySettings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSecuritySettings request %j', request); + return this.innerApiCalls + .listSecuritySettings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse, + ]) => { + this._log.info('listSecuritySettings values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSecuritySettings`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings} 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 `listSecuritySettingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecuritySettingsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + 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['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSecuritySettings stream %j', request); + return this.descriptors.page.listSecuritySettings.createStream( + this.innerApiCalls.listSecuritySettings as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSecuritySettings`, 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 location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/security_settings_service.list_security_settings.js + * region_tag:dialogflow_v3beta1_generated_SecuritySettingsService_ListSecuritySettings_async + */ + listSecuritySettingsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + 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['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSecuritySettings iterate %j', request); + return this.descriptors.page.listSecuritySettings.asyncIterate( + this.innerApiCalls['listSecuritySettings'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 organizationLocationDeidentifyTemplate resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + organizationLocationDeidentifyTemplatePath( + organization: string, + location: string, + deidentifyTemplate: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render( + { + organization: organization, + location: location, + deidentify_template: deidentifyTemplate, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationDeidentifyTemplateName( + organizationLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match( + organizationLocationDeidentifyTemplateName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationDeidentifyTemplateName( + organizationLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match( + organizationLocationDeidentifyTemplateName, + ).location; + } + + /** + * Parse the deidentify_template from OrganizationLocationDeidentifyTemplate resource. + * + * @param {string} organizationLocationDeidentifyTemplateName + * A fully-qualified path representing organization_location_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName( + organizationLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match( + organizationLocationDeidentifyTemplateName, + ).deidentify_template; + } + + /** + * Return a fully-qualified organizationLocationInspectTemplate resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + organizationLocationInspectTemplatePath( + organization: string, + location: string, + inspectTemplate: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.render( + { + organization: organization, + location: location, + inspect_template: inspectTemplate, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationInspectTemplateName( + organizationLocationInspectTemplateName: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match( + organizationLocationInspectTemplateName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationInspectTemplateName( + organizationLocationInspectTemplateName: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match( + organizationLocationInspectTemplateName, + ).location; + } + + /** + * Parse the inspect_template from OrganizationLocationInspectTemplate resource. + * + * @param {string} organizationLocationInspectTemplateName + * A fully-qualified path representing organization_location_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromOrganizationLocationInspectTemplateName( + organizationLocationInspectTemplateName: string, + ) { + return this.pathTemplates.organizationLocationInspectTemplatePathTemplate.match( + organizationLocationInspectTemplateName, + ).inspect_template; + } + + /** + * Return a fully-qualified page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationDeidentifyTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deidentify_template + * @returns {string} Resource name string. + */ + projectLocationDeidentifyTemplatePath( + project: string, + location: string, + deidentifyTemplate: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render( + { + project: project, + location: location, + deidentify_template: deidentifyTemplate, + }, + ); + } + + /** + * Parse the project from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDeidentifyTemplateName( + projectLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match( + projectLocationDeidentifyTemplateName, + ).project; + } + + /** + * Parse the location from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDeidentifyTemplateName( + projectLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match( + projectLocationDeidentifyTemplateName, + ).location; + } + + /** + * Parse the deidentify_template from ProjectLocationDeidentifyTemplate resource. + * + * @param {string} projectLocationDeidentifyTemplateName + * A fully-qualified path representing project_location_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName( + projectLocationDeidentifyTemplateName: string, + ) { + return this.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match( + projectLocationDeidentifyTemplateName, + ).deidentify_template; + } + + /** + * Return a fully-qualified projectLocationInspectTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} inspect_template + * @returns {string} Resource name string. + */ + projectLocationInspectTemplatePath( + project: string, + location: string, + inspectTemplate: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.render( + { + project: project, + location: location, + inspect_template: inspectTemplate, + }, + ); + } + + /** + * Parse the project from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationInspectTemplateName( + projectLocationInspectTemplateName: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match( + projectLocationInspectTemplateName, + ).project; + } + + /** + * Parse the location from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationInspectTemplateName( + projectLocationInspectTemplateName: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match( + projectLocationInspectTemplateName, + ).location; + } + + /** + * Parse the inspect_template from ProjectLocationInspectTemplate resource. + * + * @param {string} projectLocationInspectTemplateName + * A fully-qualified path representing project_location_inspect_template resource. + * @returns {string} A string representing the inspect_template. + */ + matchInspectTemplateFromProjectLocationInspectTemplateName( + projectLocationInspectTemplateName: string, + ) { + return this.pathTemplates.projectLocationInspectTemplatePathTemplate.match( + projectLocationInspectTemplateName, + ).inspect_template; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.securitySettingsServiceStub && !this._terminated) { + return this.securitySettingsServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client_config.json new file mode 100644 index 000000000000..4227b7ab2b61 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService": { + "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 + } + }, + "methods": { + "CreateSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client.ts new file mode 100644 index 000000000000..a40128935dd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client.ts @@ -0,0 +1,3820 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/session_entity_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './session_entity_types_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType|SessionEntityTypes}. + * @class + * @memberof v3beta1 + */ +export class SessionEntityTypesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + sessionEntityTypesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of SessionEntityTypesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 SessionEntityTypesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SessionEntityTypesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listSessionEntityTypes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sessionEntityTypes', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes', + 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.sessionEntityTypesStub) { + return this.sessionEntityTypesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes. + this.sessionEntityTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1 + .SessionEntityTypes, + 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 sessionEntityTypesStubMethods = [ + 'listSessionEntityTypes', + 'getSessionEntityType', + 'createSessionEntityType', + 'updateSessionEntityType', + 'deleteSessionEntityType', + ]; + for (const methodName of sessionEntityTypesStubMethods) { + const callPromise = this.sessionEntityTypesStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.sessionEntityTypesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session entity type. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType|SessionEntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/session_entity_types.get_session_entity_type.js + * region_tag:dialogflow_v3beta1_generated_SessionEntityTypes_GetSessionEntityType_async + */ + getSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + getSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to create a session entity type for. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} request.sessionEntityType + * Required. The session entity type 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType|SessionEntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/session_entity_types.create_session_entity_type.js + * region_tag:dialogflow_v3beta1_generated_SessionEntityTypes_CreateSessionEntityType_async + */ + createSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + createSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.SessionEntityType} request.sessionEntityType + * Required. The session entity type to update. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType|SessionEntityType}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/session_entity_types.update_session_entity_type.js + * region_tag:dialogflow_v3beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async + */ + updateSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + updateSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | 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({ + 'session_entity_type.name': request.sessionEntityType!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified session entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session entity type to delete. + * Format: + * `projects//locations//agents//sessions//entityTypes/` + * or + * `projects//locations//agents//environments//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js + * region_tag:dialogflow_v3beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async + */ + deleteSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ] + >; + deleteSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSessionEntityType( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSessionEntityType( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteSessionEntityType request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSessionEntityType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSessionEntityType(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSessionEntityTypeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSessionEntityType response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all session entity types in the specified session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType|SessionEntityType}. + * 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 `listSessionEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessionEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse, + ] + >; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType + >, + ): void; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType + >, + ): void; + listSessionEntityTypes( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSessionEntityTypes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSessionEntityTypes request %j', request); + return this.innerApiCalls + .listSessionEntityTypes(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesResponse, + ]) => { + this._log.info('listSessionEntityTypes values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSessionEntityTypes`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType|SessionEntityType} 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 `listSessionEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessionEntityTypesStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + 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['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSessionEntityTypes stream %j', request); + return this.descriptors.page.listSessionEntityTypes.createStream( + this.innerApiCalls.listSessionEntityTypes as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSessionEntityTypes`, 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 session to list all session entity types from. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType|SessionEntityType}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/session_entity_types.list_session_entity_types.js + * region_tag:dialogflow_v3beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async + */ + listSessionEntityTypesAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSessionEntityTypesRequest, + 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['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSessionEntityTypes iterate %j', request); + return this.descriptors.page.listSessionEntityTypes.asyncIterate( + this.innerApiCalls['listSessionEntityTypes'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentSessionPath( + project: string, + location: string, + agent: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.render({ + project: project, + location: location, + agent: agent, + session: session, + }); + } + + /** + * Parse the project from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.sessionEntityTypesStub && !this._terminated) { + return this.sessionEntityTypesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client_config.json new file mode 100644 index 000000000000..a11a7c83b529 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes": { + "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 + } + }, + "methods": { + "ListSessionEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_client.ts new file mode 100644 index 000000000000..1d74a392dabf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_client.ts @@ -0,0 +1,3925 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/sessions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './sessions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A session represents an interaction with a user. You retrieve user input + * and pass it to the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent|DetectIntent} + * method to determine user intent and respond. + * @class + * @memberof v3beta1 + */ +export class SessionsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + sessionsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of SessionsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 SessionsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SessionsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectLocationAgentEnvironmentSessionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationCollectionDataStorePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + ), + projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + serverStreamingDetectIntent: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + streamingDetectIntent: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Sessions', + 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.sessionsStub) { + return this.sessionsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Sessions. + this.sessionsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Sessions', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Sessions, + 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 sessionsStubMethods = [ + 'detectIntent', + 'serverStreamingDetectIntent', + 'streamingDetectIntent', + 'matchIntent', + 'fulfillIntent', + 'submitAnswerFeedback', + ]; + for (const methodName of sessionsStubMethods) { + const callPromise = this.sessionsStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({ objectMode: true }); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.', + ), + ); + }); + return stream; + } + 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.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.sessionsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Processes a natural language query and returns structured, actionable data + * as a result. This method is not idempotent, because it may cause session + * entity types to be updated, which in turn might affect results of future + * queries. + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. It's up to the API caller to choose an appropriate `Session + * ID`. It can be a random number or some type of session identifiers + * (preferably hashed). The length of the `Session ID` must not exceed 36 + * characters. + * + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * @param {google.cloud.dialogflow.cx.v3beta1.QueryParameters} request.queryParams + * The parameters of this query. + * @param {google.cloud.dialogflow.cx.v3beta1.QueryInput} request.queryInput + * Required. The input specification. + * @param {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} request.outputAudioConfig + * Instructs the speech synthesizer how to generate the output audio. + * @param {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView} [request.responseView] + * Optional. Specifies which fields in the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.QueryResult|QueryResult} to return. If + * not set, the default is DETECT_INTENT_RESPONSE_VIEW_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 {@link protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse|DetectIntentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/sessions.detect_intent.js + * region_tag:dialogflow_v3beta1_generated_Sessions_DetectIntent_async + */ + detectIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | undefined + ), + {} | undefined, + ] + >; + detectIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + detectIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + detectIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('detectIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('detectIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .detectIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('detectIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns preliminary intent match results, doesn't change the session + * status. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * @param {google.cloud.dialogflow.cx.v3beta1.QueryParameters} request.queryParams + * The parameters of this query. + * @param {google.cloud.dialogflow.cx.v3beta1.QueryInput} request.queryInput + * Required. The input specification. + * @param {boolean} request.persistParameterChanges + * Persist session parameter changes from `query_params`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse|MatchIntentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/sessions.match_intent.js + * region_tag:dialogflow_v3beta1_generated_Sessions_MatchIntent_async + */ + matchIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest | undefined, + {} | undefined, + ] + >; + matchIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + matchIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + matchIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest | 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('matchIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('matchIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .matchIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('matchIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Fulfills a matched intent returned by + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent|MatchIntent}. + * Must be called after + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent|MatchIntent}, + * with input from + * {@link protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse|MatchIntentResponse}. + * Otherwise, the behavior is undefined. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} request.matchIntentRequest + * Must be same as the corresponding MatchIntent request, otherwise the + * behavior is undefined. + * @param {google.cloud.dialogflow.cx.v3beta1.Match} request.match + * The matched intent/event to fulfill. + * @param {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} request.outputAudioConfig + * Instructs the speech synthesizer how to generate output audio. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse|FulfillIntentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/sessions.fulfill_intent.js + * region_tag:dialogflow_v3beta1_generated_Sessions_FulfillIntent_async + */ + fulfillIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | undefined + ), + {} | undefined, + ] + >; + fulfillIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fulfillIntent( + request: protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fulfillIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | 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({ + 'match_intent_request.session': + request.matchIntentRequest!.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('fulfillIntent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fulfillIntent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .fulfillIntent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('fulfillIntent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the feedback received from the user for a single turn of the bot + * response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session the feedback was sent to. + * @param {string} request.responseId + * Required. ID of the response to update its feedback. This is the same as + * DetectIntentResponse.response_id. + * @param {google.cloud.dialogflow.cx.v3beta1.AnswerFeedback} request.answerFeedback + * Required. Feedback provided for a bot answer. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields to update. If the mask is not + * present, all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback|AnswerFeedback}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/sessions.submit_answer_feedback.js + * region_tag:dialogflow_v3beta1_generated_Sessions_SubmitAnswerFeedback_async + */ + submitAnswerFeedback( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | undefined + ), + {} | undefined, + ] + >; + submitAnswerFeedback( + request: protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + submitAnswerFeedback( + request: protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + submitAnswerFeedback( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('submitAnswerFeedback request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('submitAnswerFeedback response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .submitAnswerFeedback(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ISubmitAnswerFeedbackRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('submitAnswerFeedback response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Processes a natural language query and returns structured, actionable data + * as a result through server-side streaming. Server-side streaming allows + * Dialogflow to send [partial + * responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) + * earlier in a single request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The name of the session this query is sent to. + * Format: + * `projects//locations//agents//sessions/` + * or + * `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. It's up to the API caller to choose an appropriate `Session + * ID`. It can be a random number or some type of session identifiers + * (preferably hashed). The length of the `Session ID` must not exceed 36 + * characters. + * + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * @param {google.cloud.dialogflow.cx.v3beta1.QueryParameters} request.queryParams + * The parameters of this query. + * @param {google.cloud.dialogflow.cx.v3beta1.QueryInput} request.queryInput + * Required. The input specification. + * @param {google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} request.outputAudioConfig + * Instructs the speech synthesizer how to generate the output audio. + * @param {google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseView} [request.responseView] + * Optional. Specifies which fields in the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.QueryResult|QueryResult} to return. If + * not set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse|DetectIntentResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/sessions.server_streaming_detect_intent.js + * region_tag:dialogflow_v3beta1_generated_Sessions_ServerStreamingDetectIntent_async + */ + serverStreamingDetectIntent( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentRequest, + options?: CallOptions, + ): gax.CancellableStream { + 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({ + session: request.session ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('serverStreamingDetectIntent stream %j', options); + return this.innerApiCalls.serverStreamingDetectIntent(request, options); + } + + /** + * Processes a natural language query in audio format in a streaming fashion + * and returns structured, actionable data as a result. This method is only + * available via the gRPC API (not REST). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * + * @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 is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest|StreamingDetectIntentRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse|StreamingDetectIntentResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/sessions.streaming_detect_intent.js + * region_tag:dialogflow_v3beta1_generated_Sessions_StreamingDetectIntent_async + */ + streamingDetectIntent(options?: CallOptions): gax.CancellableStream { + this.initialize().catch((err) => { + throw err; + }); + this._log.info('streamingDetectIntent stream %j', options); + return this.innerApiCalls.streamingDetectIntent(null, options); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionPath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentSessionPath( + project: string, + location: string, + agent: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.render({ + project: project, + location: location, + agent: agent, + session: session, + }); + } + + /** + * Parse the project from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStorePath( + project: string, + location: string, + collection: string, + dataStore: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + }, + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string, + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName, + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStorePath( + project: string, + location: string, + dataStore: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.render({ + project: project, + location: location, + data_store: dataStore, + }); + } + + /** + * Parse the project from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreName( + projectLocationDataStoreName: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName, + ).project; + } + + /** + * Parse the location from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreName( + projectLocationDataStoreName: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName, + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreName( + projectLocationDataStoreName: string, + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName, + ).data_store; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.sessionsStub && !this._terminated) { + return this.sessionsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_client_config.json new file mode 100644 index 000000000000..c8595b798fae --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Sessions": { + "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 + } + }, + "methods": { + "DetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ServerStreamingDetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingDetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MatchIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "FulfillIntent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SubmitAnswerFeedback": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/sessions_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client.ts new file mode 100644 index 000000000000..f628395ddebf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client.ts @@ -0,0 +1,5414 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/test_cases_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './test_cases_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing [Test + * Cases][google.cloud.dialogflow.cx.v3beta1.TestCase] and [Test Case + * Results][google.cloud.dialogflow.cx.v3beta1.TestCaseResult]. + * @class + * @memberof v3beta1 + */ +export class TestCasesClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + testCasesStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of TestCasesClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 TestCasesClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TestCasesClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listTestCases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'testCases', + ), + listTestCaseResults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'testCaseResults', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const runTestCaseResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse', + ) as gax.protobuf.Type; + const runTestCaseMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata', + ) as gax.protobuf.Type; + const batchRunTestCasesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse', + ) as gax.protobuf.Type; + const batchRunTestCasesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata', + ) as gax.protobuf.Type; + const importTestCasesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse', + ) as gax.protobuf.Type; + const importTestCasesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata', + ) as gax.protobuf.Type; + const exportTestCasesResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse', + ) as gax.protobuf.Type; + const exportTestCasesMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + runTestCase: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runTestCaseResponse.decode.bind(runTestCaseResponse), + runTestCaseMetadata.decode.bind(runTestCaseMetadata), + ), + batchRunTestCases: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchRunTestCasesResponse.decode.bind(batchRunTestCasesResponse), + batchRunTestCasesMetadata.decode.bind(batchRunTestCasesMetadata), + ), + importTestCases: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importTestCasesResponse.decode.bind(importTestCasesResponse), + importTestCasesMetadata.decode.bind(importTestCasesMetadata), + ), + exportTestCases: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportTestCasesResponse.decode.bind(exportTestCasesResponse), + exportTestCasesMetadata.decode.bind(exportTestCasesMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.TestCases', + 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.testCasesStub) { + return this.testCasesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.TestCases. + this.testCasesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.TestCases', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.TestCases, + 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 testCasesStubMethods = [ + 'listTestCases', + 'batchDeleteTestCases', + 'getTestCase', + 'createTestCase', + 'updateTestCase', + 'runTestCase', + 'batchRunTestCases', + 'calculateCoverage', + 'importTestCases', + 'exportTestCases', + 'listTestCaseResults', + 'getTestCaseResult', + ]; + for (const methodName of testCasesStubMethods) { + const callPromise = this.testCasesStub.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.testCasesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Batch deletes test cases. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to delete test cases from. + * Format: `projects//locations//agents/`. + * @param {string[]} request.names + * Required. Format of test case names: + * `projects//locations//agents//testCases/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.batch_delete_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_BatchDeleteTestCases_async + */ + batchDeleteTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | undefined + ), + {} | undefined, + ] + >; + batchDeleteTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + batchDeleteTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + batchDeleteTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('batchDeleteTestCases request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchDeleteTestCases response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchDeleteTestCases(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IBatchDeleteTestCasesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchDeleteTestCases response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a test case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the testcase. + * Format: + * `projects//locations//agents//testCases/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase|TestCase}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.get_test_case.js + * region_tag:dialogflow_v3beta1_generated_TestCases_GetTestCase_async + */ + getTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest | undefined, + {} | undefined, + ] + >; + getTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getTestCase request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTestCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTestCase(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTestCase response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a test case for the given agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create the test case for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.TestCase} request.testCase + * Required. The test case 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase|TestCase}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.create_test_case.js + * region_tag:dialogflow_v3beta1_generated_TestCases_CreateTestCase_async + */ + createTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | undefined + ), + {} | undefined, + ] + >; + createTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createTestCase request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTestCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTestCase(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTestCaseRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createTestCase response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified test case. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.TestCase} request.testCase + * Required. The test case to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to specify which fields should be updated. The + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase.creation_time|`creationTime`} + * and + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase.last_test_result|`lastTestResult`} + * cannot 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase|TestCase}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.update_test_case.js + * region_tag:dialogflow_v3beta1_generated_TestCases_UpdateTestCase_async + */ + updateTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | undefined + ), + {} | undefined, + ] + >; + updateTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | 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({ + 'test_case.name': request.testCase!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateTestCase request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTestCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTestCase(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTestCaseRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTestCase response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Calculates the test coverage for an agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.agent + * Required. The agent to calculate coverage for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest.CoverageType} request.type + * Required. The type of coverage requested. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse|CalculateCoverageResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.calculate_coverage.js + * region_tag:dialogflow_v3beta1_generated_TestCases_CalculateCoverage_async + */ + calculateCoverage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | undefined + ), + {} | undefined, + ] + >; + calculateCoverage( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + calculateCoverage( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + calculateCoverage( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | 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({ + agent: request.agent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('calculateCoverage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('calculateCoverage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .calculateCoverage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('calculateCoverage response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a test case result. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the testcase. + * Format: + * `projects//locations//agents//testCases//results/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult|TestCaseResult}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.get_test_case_result.js + * region_tag:dialogflow_v3beta1_generated_TestCases_GetTestCaseResult_async + */ + getTestCaseResult( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | undefined + ), + {} | undefined, + ] + >; + getTestCaseResult( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCaseResult( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTestCaseResult( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getTestCaseResult request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTestCaseResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTestCaseResult(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTestCaseResultRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTestCaseResult response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Kicks off a test case run. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata|RunTestCaseMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse|RunTestCaseResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format of test case name to run: + * `projects//locations//agents//testCases/`. + * @param {string} [request.environment] + * Optional. Environment name. If not set, draft environment is assumed. + * Format: + * `projects//locations//agents//environments/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.run_test_case.js + * region_tag:dialogflow_v3beta1_generated_TestCases_RunTestCase_async + */ + runTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + runTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runTestCase( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + runTestCase( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runTestCase response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runTestCase request %j', request); + return this.innerApiCalls + .runTestCase(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('runTestCase response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `runTestCase()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.run_test_case.js + * region_tag:dialogflow_v3beta1_generated_TestCases_RunTestCase_async + */ + async checkRunTestCaseProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + > + > { + this._log.info('runTestCase long-running'); + 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.runTestCase, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata + >; + } + /** + * Kicks off a batch run of test cases. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata|BatchRunTestCasesMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse|BatchRunTestCasesResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Agent name. Format: + * `projects//locations//agents/`. + * @param {string} [request.environment] + * Optional. If not set, draft environment is assumed. Format: + * `projects//locations//agents//environments/`. + * @param {string[]} request.testCases + * Required. Format: + * `projects//locations//agents//testCases/`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.batch_run_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_async + */ + batchRunTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + batchRunTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + batchRunTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + batchRunTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchRunTestCases response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchRunTestCases request %j', request); + return this.innerApiCalls + .batchRunTestCases(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchRunTestCases response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `batchRunTestCases()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.batch_run_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_async + */ + async checkBatchRunTestCasesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + > + > { + this._log.info('batchRunTestCases long-running'); + 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.batchRunTestCases, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata + >; + } + /** + * Imports the test cases from a Cloud Storage bucket or a local file. It + * always creates new test cases and won't overwrite any existing ones. The + * provided ID in the imported test case is neglected. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata|ImportTestCasesMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse|ImportTestCasesResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to import test cases to. + * Format: `projects//locations//agents/`. + * @param {string} request.gcsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import test cases from. The format of this URI must be + * `gs:///`. + * + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {Buffer} request.content + * Uncompressed raw byte content for test cases. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.import_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_ImportTestCases_async + */ + importTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + importTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importTestCases response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importTestCases request %j', request); + return this.innerApiCalls + .importTestCases(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importTestCases response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `importTestCases()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.import_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_ImportTestCases_async + */ + async checkImportTestCasesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + > + > { + this._log.info('importTestCases long-running'); + 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.importTestCases, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata + >; + } + /** + * Exports the test cases under the agent to a Cloud Storage bucket or a local + * file. Filter can be applied to export a subset of test cases. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata|ExportTestCasesMetadata} + * - `response`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse|ExportTestCasesResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent where to export test cases from. + * Format: `projects//locations//agents/`. + * @param {string} request.gcsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the test cases to. The format of this URI must be + * `gs:///`. If unspecified, the serialized test + * cases is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest.DataFormat} request.dataFormat + * The data format of the exported test cases. If not specified, `BLOB` is + * assumed. + * @param {string} request.filter + * The filter expression used to filter exported test cases, see + * [API Filtering](https://aip.dev/160). The expression is case insensitive + * and supports the following syntax: + * + * name = [OR name = ] ... + * + * For example: + * + * * "name = t1 OR name = t2" matches the test case with the exact resource + * name "t1" or "t2". + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.export_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_ExportTestCases_async + */ + exportTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportTestCases response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportTestCases request %j', request); + return this.innerApiCalls + .exportTestCases(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportTestCases response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportTestCases()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.export_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_ExportTestCases_async + */ + async checkExportTestCasesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + > + > { + this._log.info('exportTestCases long-running'); + 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.exportTestCases, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata + >; + } + /** + * Fetches a list of test cases for a given agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all pages for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView} request.view + * Specifies whether response should include all fields or just the metadata. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase|TestCase}. + * 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 `listTestCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse, + ] + >; + listTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase + >, + ): void; + listTestCases( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase + >, + ): void; + listTestCases( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTestCases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTestCases request %j', request); + return this.innerApiCalls + .listTestCases(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCase[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesResponse, + ]) => { + this._log.info('listTestCases values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTestCases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all pages for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView} request.view + * Specifies whether response should include all fields or just the metadata. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase|TestCase} 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 `listTestCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCasesStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + 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['listTestCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCases stream %j', request); + return this.descriptors.page.listTestCases.createStream( + this.innerApiCalls.listTestCases as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTestCases`, 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 agent to list all pages for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest.TestCaseView} request.view + * Specifies whether response should include all fields or just the metadata. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCase|TestCase}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.list_test_cases.js + * region_tag:dialogflow_v3beta1_generated_TestCases_ListTestCases_async + */ + listTestCasesAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCasesRequest, + 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['listTestCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCases iterate %j', request); + return this.descriptors.page.listTestCases.asyncIterate( + this.innerApiCalls['listTestCases'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Fetches the list of run results for the given test case. A maximum of 100 + * results are kept for each test case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.filter + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * + * [AND ] ... + * [AND latest] + * + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * + * `latest` only returns the latest test result in all results for each test + * case. + * + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult|TestCaseResult}. + * 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 `listTestCaseResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCaseResults( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse, + ] + >; + listTestCaseResults( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult + >, + ): void; + listTestCaseResults( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult + >, + ): void; + listTestCaseResults( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTestCaseResults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTestCaseResults request %j', request); + return this.innerApiCalls + .listTestCaseResults(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsResponse, + ]) => { + this._log.info('listTestCaseResults values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTestCaseResults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.filter + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * + * [AND ] ... + * [AND latest] + * + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * + * `latest` only returns the latest test result in all results for each test + * case. + * + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult|TestCaseResult} 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 `listTestCaseResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTestCaseResultsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + 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['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCaseResults stream %j', request); + return this.descriptors.page.listTestCaseResults.createStream( + this.innerApiCalls.listTestCaseResults as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTestCaseResults`, 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 test case to list results for. + * Format: + * `projects//locations//agents//testCases/`. + * Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.filter + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * + * [AND ] ... + * [AND latest] + * + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * + * `latest` only returns the latest test result in all results for each test + * case. + * + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult|TestCaseResult}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/test_cases.list_test_case_results.js + * region_tag:dialogflow_v3beta1_generated_TestCases_ListTestCaseResults_async + */ + listTestCaseResultsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTestCaseResultsRequest, + 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['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTestCaseResults iterate %j', request); + return this.descriptors.page.listTestCaseResults.asyncIterate( + this.innerApiCalls['listTestCaseResults'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.testCasesStub && !this._terminated) { + return this.testCasesStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client_config.json new file mode 100644 index 000000000000..7f8c43783bee --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.TestCases": { + "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 + } + }, + "methods": { + "ListTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "BatchDeleteTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RunTestCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "BatchRunTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CalculateCoverage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ImportTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportTestCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListTestCaseResults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTestCaseResult": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/test_cases_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_client.ts new file mode 100644 index 000000000000..c95e46144593 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_client.ts @@ -0,0 +1,4998 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/tools_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tools_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tools}. + * @class + * @memberof v3beta1 + */ +export class ToolsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + toolsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ToolsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ToolsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ToolsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listTools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tools', + ), + listToolVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'toolVersions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const exportToolsResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse', + ) as gax.protobuf.Type; + const exportToolsMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportTools: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportToolsResponse.decode.bind(exportToolsResponse), + exportToolsMetadata.decode.bind(exportToolsMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Tools', + 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.toolsStub) { + return this.toolsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Tools. + this.toolsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Tools', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Tools, + 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 toolsStubMethods = [ + 'createTool', + 'listTools', + 'exportTools', + 'getTool', + 'updateTool', + 'deleteTool', + 'listToolVersions', + 'createToolVersion', + 'getToolVersion', + 'deleteToolVersion', + 'restoreToolVersion', + ]; + for (const methodName of toolsStubMethods) { + const callPromise = this.toolsStub.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.toolsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool} in the specified + * agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a Tool for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Tool} request.tool + * Required. The Tool to be created. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.create_tool.js + * region_tag:dialogflow_v3beta1_generated_Tools_CreateTool_async + */ + createTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest | undefined, + {} | undefined, + ] + >; + createTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest | 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().catch((err) => { + throw err; + }); + this._log.info('createTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tool. + * Format: + * `projects//locations//agents//tools/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.get_tool.js + * region_tag:dialogflow_v3beta1_generated_Tools_GetTool_async + */ + getTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest | undefined, + {} | undefined, + ] + >; + getTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + protos.google.cloud.dialogflow.cx.v3beta1.IGetToolRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update the specified {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Tool} request.tool + * Required. The Tool to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.update_tool.js + * region_tag:dialogflow_v3beta1_generated_Tools_UpdateTool_async + */ + updateTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest | undefined, + {} | undefined, + ] + >; + updateTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest | 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({ + 'tool.name': request.tool!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateToolRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a specified {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tool to be deleted. + * Format: + * `projects//locations//agents//tools/`. + * @param {boolean} request.force + * This field has no effect for Tools not being used. + * For Tools that are used: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.delete_tool.js + * region_tag:dialogflow_v3beta1_generated_Tools_DeleteTool_async + */ + deleteTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest | undefined, + {} | undefined, + ] + >; + deleteTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTool( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTool( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest | 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().catch((err) => { + throw err; + }); + this._log.info('deleteTool request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a version for the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The tool to create a version for. + * Format: + * `projects//locations//agents//tools/`. + * @param {google.cloud.dialogflow.cx.v3beta1.ToolVersion} request.toolVersion + * Required. The tool version 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion|ToolVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.create_tool_version.js + * region_tag:dialogflow_v3beta1_generated_Tools_CreateToolVersion_async + */ + createToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | undefined + ), + {} | undefined, + ] + >; + createToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion|ToolVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.get_tool_version.js + * region_tag:dialogflow_v3beta1_generated_Tools_GetToolVersion_async + */ + getToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | undefined + ), + {} | undefined, + ] + >; + getToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified version of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the tool version to delete. + * Format: + * `projects//locations//agents//tools//versions/`. + * @param {boolean} [request.force] + * Optional. This field has no effect for Tools not being used. + * For Tools that are used: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the tool, as well + * as any references to the tool. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.delete_tool_version.js + * region_tag:dialogflow_v3beta1_generated_Tools_DeleteToolVersion_async + */ + deleteToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Retrieves the specified version of the Tool and stores it as the + * current tool draft, returning the tool with resources updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the tool version. + * Format: + * `projects//locations//agents//tools//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse|RestoreToolVersionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.restore_tool_version.js + * region_tag:dialogflow_v3beta1_generated_Tools_RestoreToolVersion_async + */ + restoreToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | undefined + ), + {} | undefined, + ] + >; + restoreToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restoreToolVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + restoreToolVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('restoreToolVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('restoreToolVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .restoreToolVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('restoreToolVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Exports the selected tools. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to export tools from. + * Format: `projects//locations//agents/`. + * @param {string[]} request.tools + * Required. The name of the tools to export. + * Format: + * `projects//locations//agents//tools/`. + * @param {string} [request.toolsUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the tools + * to. The format of this URI must be `gs:///`. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @param {boolean} [request.toolsContentInline] + * Optional. The option to return the serialized tools inline. + * @param {google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest.DataFormat} [request.dataFormat] + * Optional. The data format of the exported tools. If not specified, `BLOB` + * is assumed. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.export_tools.js + * region_tag:dialogflow_v3beta1_generated_Tools_ExportTools_async + */ + exportTools( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportTools( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportTools( + request: protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + exportTools( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportTools response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportTools request %j', request); + return this.innerApiCalls + .exportTools(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportTools response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `exportTools()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.export_tools.js + * region_tag:dialogflow_v3beta1_generated_Tools_ExportTools_async + */ + async checkExportToolsProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + > + > { + this._log.info('exportTools long-running'); + 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.exportTools, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsMetadata + >; + } + /** + * Returns a list of {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tools} in the + * specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list the Tools from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * 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 `listToolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTools( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool[], + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse, + ] + >; + listTools( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITool + >, + ): void; + listTools( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITool + >, + ): void; + listTools( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITool + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITool + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool[], + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITool + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTools values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTools request %j', request); + return this.innerApiCalls + .listTools(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITool[], + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListToolsResponse, + ]) => { + this._log.info('listTools values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTools`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list the Tools from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool} 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 `listToolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listToolsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTools stream %j', request); + return this.descriptors.page.listTools.createStream( + this.innerApiCalls.listTools as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTools`, 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 agent to list the Tools from. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.list_tools.js + * region_tag:dialogflow_v3beta1_generated_Tools_ListTools_async + */ + listToolsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTools iterate %j', request); + return this.descriptors.page.listTools.asyncIterate( + this.innerApiCalls['listTools'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * List versions of the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Tool|Tool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion|ToolVersion}. + * 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 `listToolVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listToolVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse, + ] + >; + listToolVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion + >, + ): void; + listToolVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion + >, + ): void; + listToolVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listToolVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listToolVersions request %j', request); + return this.innerApiCalls + .listToolVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsResponse, + ]) => { + this._log.info('listToolVersions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listToolVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion|ToolVersion} 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 `listToolVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listToolVersionsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + 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['listToolVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listToolVersions stream %j', request); + return this.descriptors.page.listToolVersions.createStream( + this.innerApiCalls.listToolVersions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listToolVersions`, 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 of the tool versions. + * Format: + * `projects//locations//agents//tools/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion|ToolVersion}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/tools.list_tool_versions.js + * region_tag:dialogflow_v3beta1_generated_Tools_ListToolVersions_async + */ + listToolVersionsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListToolVersionsRequest, + 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['listToolVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listToolVersions iterate %j', request); + return this.descriptors.page.listToolVersions.asyncIterate( + this.innerApiCalls['listToolVersions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.toolsStub && !this._terminated) { + return this.toolsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_client_config.json new file mode 100644 index 000000000000..c3cfa88d9e1d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Tools": { + "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 + } + }, + "methods": { + "CreateTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListTools": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportTools": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteTool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListToolVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RestoreToolVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/tools_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client.ts new file mode 100644 index 000000000000..d15f41231db5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client.ts @@ -0,0 +1,3818 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/transition_route_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './transition_route_groups_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroups}. + * @class + * @memberof v3beta1 + */ +export class TransitionRouteGroupsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + transitionRouteGroupsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of TransitionRouteGroupsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 TransitionRouteGroupsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof TransitionRouteGroupsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listTransitionRouteGroups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transitionRouteGroups', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups', + 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.transitionRouteGroupsStub) { + return this.transitionRouteGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups. + this.transitionRouteGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1 + .TransitionRouteGroups, + 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 transitionRouteGroupsStubMethods = [ + 'listTransitionRouteGroups', + 'getTransitionRouteGroup', + 'createTransitionRouteGroup', + 'updateTransitionRouteGroup', + 'deleteTransitionRouteGroup', + ]; + for (const methodName of transitionRouteGroupsStubMethods) { + const callPromise = this.transitionRouteGroupsStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.transitionRouteGroupsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + * @param {string} request.languageCode + * The language to retrieve the transition route group for. The following + * fields are language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js + * region_tag:dialogflow_v3beta1_generated_TransitionRouteGroups_GetTransitionRouteGroup_async + */ + getTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + getTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('getTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup} + * in the specified flow. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to create an + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup} + * for. Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/` + * for agent-level groups. + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} request.transitionRouteGroup + * Required. The transition route group to create. + * @param {string} request.languageCode + * The language of the following fields in `TransitionRouteGroup`: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js + * region_tag:dialogflow_v3beta1_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async + */ + createTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + createTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} request.transitionRouteGroup + * Required. The transition route group to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. + * @param {string} request.languageCode + * The language of the following fields in `TransitionRouteGroup`: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js + * region_tag:dialogflow_v3beta1_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async + */ + updateTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + updateTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | 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({ + 'transition_route_group.name': request.transitionRouteGroup!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup} + * to delete. Format: + * `projects//locations//agents//flows//transitionRouteGroups/` + * or + * `projects//locations//agents//transitionRouteGroups/`. + * @param {boolean} request.force + * This field has no effect for transition route group that no page is using. + * If the transition route group is referenced by any page: + * + * * If `force` is set to false, an error will be returned with message + * indicating pages that reference the transition route group. + * * If `force` is set to true, Dialogflow will remove the transition route + * group, as well as any reference to it. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js + * region_tag:dialogflow_v3beta1_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async + */ + deleteTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ] + >; + deleteTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTransitionRouteGroup( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteTransitionRouteGroup( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteTransitionRouteGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTransitionRouteGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTransitionRouteGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteTransitionRouteGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTransitionRouteGroup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all transition route groups in the specified flow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list transition route groups for. The following fields are + * language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. + * 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 `listTransitionRouteGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTransitionRouteGroups( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse, + ] + >; + listTransitionRouteGroups( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup + >, + ): void; + listTransitionRouteGroups( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup + >, + ): void; + listTransitionRouteGroups( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTransitionRouteGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTransitionRouteGroups request %j', request); + return this.innerApiCalls + .listTransitionRouteGroups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[], + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsResponse, + ]) => { + this._log.info('listTransitionRouteGroups values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTransitionRouteGroups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list transition route groups for. The following fields are + * language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup} 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 `listTransitionRouteGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTransitionRouteGroupsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + 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['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTransitionRouteGroups stream %j', request); + return this.descriptors.page.listTransitionRouteGroups.createStream( + this.innerApiCalls.listTransitionRouteGroups as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTransitionRouteGroups`, 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 flow to list all transition route groups for. + * Format: + * `projects//locations//agents//flows/` + * or `projects//locations//agents/. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {string} request.languageCode + * The language to list transition route groups for. The following fields are + * language dependent: + * + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup|TransitionRouteGroup}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js + * region_tag:dialogflow_v3beta1_generated_TransitionRouteGroups_ListTransitionRouteGroups_async + */ + listTransitionRouteGroupsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListTransitionRouteGroupsRequest, + 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['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTransitionRouteGroups iterate %j', request); + return this.descriptors.page.listTransitionRouteGroups.asyncIterate( + this.innerApiCalls['listTransitionRouteGroups'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.transitionRouteGroupsStub && !this._terminated) { + return this.transitionRouteGroupsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client_config.json new file mode 100644 index 000000000000..a1f47451b7fc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups": { + "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 + } + }, + "methods": { + "ListTransitionRouteGroups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteTransitionRouteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_client.ts new file mode 100644 index 000000000000..c06f3890da50 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_client.ts @@ -0,0 +1,4383 @@ +// Copyright 2026 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/versions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './versions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Versions}. + * @class + * @memberof v3beta1 + */ +export class VersionsClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + versionsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of VersionsClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 VersionsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof VersionsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'versions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/operations/*}', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*}/operations', + additional_bindings: [ + { get: '/v3beta1/{name=projects/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createVersionResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.Version', + ) as gax.protobuf.Type; + const createVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata', + ) as gax.protobuf.Type; + const loadVersionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const loadVersionMetadata = protoFilesRoot.lookup( + '.google.protobuf.Struct', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createVersionResponse.decode.bind(createVersionResponse), + createVersionMetadata.decode.bind(createVersionMetadata), + ), + loadVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + loadVersionResponse.decode.bind(loadVersionResponse), + loadVersionMetadata.decode.bind(loadVersionMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Versions', + 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.versionsStub) { + return this.versionsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Versions. + this.versionsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Versions', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Versions, + 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 versionsStubMethods = [ + 'listVersions', + 'getVersion', + 'createVersion', + 'updateVersion', + 'deleteVersion', + 'loadVersion', + 'compareVersions', + ]; + for (const methodName of versionsStubMethods) { + const callPromise = this.versionsStub.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.versionsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. Format: + * `projects//locations//agents//flows//versions/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.get_version.js + * region_tag:dialogflow_v3beta1_generated_Versions_GetVersion_async + */ + getVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest | undefined, + {} | undefined, + ] + >; + getVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Version} request.version + * Required. The version to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. Currently only + * `description` and `display_name` can 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.update_version.js + * region_tag:dialogflow_v3beta1_generated_Versions_UpdateVersion_async + */ + updateVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | undefined + ), + {} | undefined, + ] + >; + updateVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | 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({ + 'version.name': request.version!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version} to delete. Format: + * `projects//locations//agents//flows//versions/`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.delete_version.js + * region_tag:dialogflow_v3beta1_generated_Versions_DeleteVersion_async + */ + deleteVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteVersion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Compares the specified base version with target version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.baseVersion + * Required. Name of the base flow version to compare with the target version. + * Use version ID `0` to indicate the draft version of the specified flow. + * + * Format: + * `projects//locations//agents//flows//versions/`. + * @param {string} request.targetVersion + * Required. Name of the target flow version to compare with the + * base version. Use version ID `0` to indicate the draft version of the + * specified flow. Format: + * `projects//locations//agents//flows//versions/`. + * @param {string} request.languageCode + * The language to compare the flow versions for. + * + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) are + * supported. Note: languages must be enabled in the agent before they can be + * used. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse|CompareVersionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.compare_versions.js + * region_tag:dialogflow_v3beta1_generated_Versions_CompareVersions_async + */ + compareVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | undefined + ), + {} | undefined, + ] + >; + compareVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + compareVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + compareVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | 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({ + base_version: request.baseVersion ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('compareVersions request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('compareVersions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .compareVersions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('compareVersions response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates a {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version} in the + * specified {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow}. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * {@link protos.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata|CreateVersionOperationMetadata} + * - `response`: {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow} to create an + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version} for. Format: + * `projects//locations//agents//flows/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Version} request.version + * Required. The version 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.create_version.js + * region_tag:dialogflow_v3beta1_generated_Versions_CreateVersion_async + */ + createVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createVersion request %j', request); + return this.innerApiCalls + .createVersion(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createVersion response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createVersion()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.create_version.js + * region_tag:dialogflow_v3beta1_generated_Versions_CreateVersion_async + */ + async checkCreateVersionProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.Version, + protos.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + > + > { + this._log.info('createVersion long-running'); + 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.createVersion, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.Version, + protos.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + >; + } + /** + * Loads resources in the specified version to the draft flow. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version} to be + * loaded to draft flow. Format: + * `projects//locations//agents//flows//versions/`. + * @param {boolean} request.allowOverrideAgentResources + * This field is used to prevent accidental overwrite of other agent + * resources, which can potentially impact other flow's behavior. If + * `allow_override_agent_resources` is false, conflicted agent-level resources + * will not be overridden (i.e. intents, entities, webhooks). + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.load_version.js + * region_tag:dialogflow_v3beta1_generated_Versions_LoadVersion_async + */ + loadVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + loadVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + loadVersion( + request: protos.google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + loadVersion( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ILoadVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('loadVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('loadVersion request %j', request); + return this.innerApiCalls + .loadVersion(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('loadVersion response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `loadVersion()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.load_version.js + * region_tag:dialogflow_v3beta1_generated_Versions_LoadVersion_async + */ + async checkLoadVersionProgress( + name: string, + ): Promise< + LROperation + > { + this._log.info('loadVersion long-running'); + 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.loadVersion, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } + /** + * Returns the list of all versions in the specified + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow} to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. + * 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 `listVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse, + ] + >; + listVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IVersion + >, + ): void; + listVersions( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IVersion + >, + ): void; + listVersions( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IVersion + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IVersion + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listVersions request %j', request); + return this.innerApiCalls + .listVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IVersion[], + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsResponse, + ]) => { + this._log.info('listVersions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow} to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version} 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 `listVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listVersionsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listVersions stream %j', request); + return this.descriptors.page.listVersions.createStream( + this.innerApiCalls.listVersions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listVersions`, 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Flow|Flow} to list all + * versions for. Format: + * `projects//locations//agents//flows/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Version|Version}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/versions.list_versions.js + * region_tag:dialogflow_v3beta1_generated_Versions_ListVersions_async + */ + listVersionsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listVersions iterate %j', request); + return this.descriptors.page.listVersions.asyncIterate( + this.innerApiCalls['listVersions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + 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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.versionsStub && !this._terminated) { + return this.versionsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_client_config.json new file mode 100644 index 000000000000..60da3f63204f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Versions": { + "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 + } + }, + "methods": { + "ListVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "LoadVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CompareVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/versions_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client.ts b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client.ts new file mode 100644 index 000000000000..7c9a736eb87a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client.ts @@ -0,0 +1,3897 @@ +// Copyright 2026 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, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/webhooks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './webhooks_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link protos.google.cloud.dialogflow.cx.v3beta1.Webhook|Webhooks}. + * @class + * @memberof v3beta1 + */ +export class WebhooksClient { + 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 }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('dialogflow-cx'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + webhooksStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of WebhooksClient. + * + * @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://cloud.google.com/docs/authentication/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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 WebhooksClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WebhooksClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'dialogflow.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && '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 { + 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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}', + ), + agentGenerativeSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generativeSettings', + ), + agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/validationResult', + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}', + ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}', + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/conversations/{conversation}', + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}', + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}', + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}', + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}', + ), + experimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}', + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}', + ), + flowValidationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult', + ), + generatorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/generators/{generator}', + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}', + ), + playbookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}', + ), + playbookVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectLocationAgentEnvironmentSessionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}', + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentFlowTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}', + ), + projectLocationAgentSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}', + ), + projectLocationAgentSessionEntityTypePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}', + ), + projectLocationAgentTransitionRouteGroupsPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}', + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + ), + testCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}', + ), + testCaseResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}', + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}', + ), + toolVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}', + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}', + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}', + ), + }; + + // 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 = { + listWebhooks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'webhooks', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.Webhooks', + 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.webhooksStub) { + return this.webhooksStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.Webhooks. + this.webhooksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.Webhooks', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Webhooks, + 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 webhooksStubMethods = [ + 'listWebhooks', + 'getWebhook', + 'createWebhook', + 'updateWebhook', + 'deleteWebhook', + ]; + for (const methodName of webhooksStubMethods) { + const callPromise = this.webhooksStub.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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.webhooksStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the specified webhook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the webhook. + * Format: + * `projects//locations//agents//webhooks/`. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Webhook|Webhook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/webhooks.get_webhook.js + * region_tag:dialogflow_v3beta1_generated_Webhooks_GetWebhook_async + */ + getWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest | undefined, + {} | undefined, + ] + >; + getWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest | 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().catch((err) => { + throw err; + }); + this._log.info('getWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetWebhookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a webhook in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a webhook for. + * Format: `projects//locations//agents/`. + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook} request.webhook + * Required. The webhook 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Webhook|Webhook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/webhooks.create_webhook.js + * region_tag:dialogflow_v3beta1_generated_Webhooks_CreateWebhook_async + */ + createWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | undefined + ), + {} | undefined, + ] + >; + createWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('createWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateWebhookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates the specified webhook. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.Webhook} request.webhook + * Required. The webhook to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The mask to control which fields get updated. If the mask is not present, + * all fields will 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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Webhook|Webhook}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/webhooks.update_webhook.js + * region_tag:dialogflow_v3beta1_generated_Webhooks_UpdateWebhook_async + */ + updateWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | undefined + ), + {} | undefined, + ] + >; + updateWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | 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({ + 'webhook.name': request.webhook!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateWebhookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the specified webhook. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the webhook to delete. + * Format: + * `projects//locations//agents//webhooks/`. + * @param {boolean} request.force + * This field has no effect for webhook not being used. + * For webhooks that are used by pages/flows/transition route groups: + * + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the webhook, as well + * as any references to the webhook (i.e. + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Fulfillment.webhook|Webhook} and + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Fulfillment.tag|tag}in fulfillments + * that point to this webhook will be removed). + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/webhooks.delete_webhook.js + * region_tag:dialogflow_v3beta1_generated_Webhooks_DeleteWebhook_async + */ + deleteWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | undefined + ), + {} | undefined, + ] + >; + deleteWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteWebhook( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteWebhook( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | 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().catch((err) => { + throw err; + }); + this._log.info('deleteWebhook request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteWebhook response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteWebhook(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteWebhookRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteWebhook response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Returns the list of all webhooks in the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all webhooks for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Webhook|Webhook}. + * 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 `listWebhooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listWebhooks( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook[], + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse, + ] + >; + listWebhooks( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook + >, + ): void; + listWebhooks( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook + >, + ): void; + listWebhooks( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook + >, + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook[], + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWebhooks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWebhooks request %j', request); + return this.innerApiCalls + .listWebhooks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.dialogflow.cx.v3beta1.IWebhook[], + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksResponse, + ]) => { + this._log.info('listWebhooks values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listWebhooks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all webhooks for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link protos.google.cloud.dialogflow.cx.v3beta1.Webhook|Webhook} 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 `listWebhooksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listWebhooksStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + 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['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listWebhooks stream %j', request); + return this.descriptors.page.listWebhooks.createStream( + this.innerApiCalls.listWebhooks as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listWebhooks`, 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 agent to list all webhooks for. + * Format: `projects//locations//agents/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.dialogflow.cx.v3beta1.Webhook|Webhook}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v3beta1/webhooks.list_webhooks.js + * region_tag:dialogflow_v3beta1_generated_Webhooks_ListWebhooks_async + */ + listWebhooksAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListWebhooksRequest, + 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['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listWebhooks iterate %j', request); + return this.descriptors.page.listWebhooks.asyncIterate( + this.innerApiCalls['listWebhooks'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified agentGenerativeSettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentGenerativeSettingsPath( + project: string, + location: string, + agent: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).project; + } + + /** + * Parse the location from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).location; + } + + /** + * Parse the agent from AgentGenerativeSettings resource. + * + * @param {string} agentGenerativeSettingsName + * A fully-qualified path representing AgentGenerativeSettings resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentGenerativeSettingsName( + agentGenerativeSettingsName: string, + ) { + return this.pathTemplates.agentGenerativeSettingsPathTemplate.match( + agentGenerativeSettingsName, + ).agent; + } + + /** + * Return a fully-qualified agentValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentValidationResultPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).project; + } + + /** + * Parse the location from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentValidationResultName( + agentValidationResultName: string, + ) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).location; + } + + /** + * Parse the agent from AgentValidationResult resource. + * + * @param {string} agentValidationResultName + * A fully-qualified path representing AgentValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentValidationResultName(agentValidationResultName: string) { + return this.pathTemplates.agentValidationResultPathTemplate.match( + agentValidationResultName, + ).agent; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath( + project: string, + location: string, + agent: string, + changelog: string, + ) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + agent: agent, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .location; + } + + /** + * Parse the agent from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).agent; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName) + .changelog; + } + + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string, + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName, + ).continuous_test_result; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath( + project: string, + location: string, + agent: string, + conversation: string, + ) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + agent: agent, + 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 agent from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName) + .agent; + } + + /** + * 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 deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath( + project: string, + location: string, + agent: string, + environment: string, + deployment: string, + ) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the agent from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .agent; + } + + /** + * Parse the environment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .environment; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string, + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string, + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + location: string, + agent: string, + playbook: string, + example: string, + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the agent from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).agent; + } + + /** + * Parse the playbook from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).playbook; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified experiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} experiment + * @returns {string} Resource name string. + */ + experimentPath( + project: string, + location: string, + agent: string, + environment: string, + experiment: string, + ) { + return this.pathTemplates.experimentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + experiment: experiment, + }); + } + + /** + * Parse the project from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .project; + } + + /** + * Parse the location from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .location; + } + + /** + * Parse the agent from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .agent; + } + + /** + * Parse the environment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .environment; + } + + /** + * Parse the experiment from Experiment resource. + * + * @param {string} experimentName + * A fully-qualified path representing Experiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromExperimentName(experimentName: string) { + return this.pathTemplates.experimentPathTemplate.match(experimentName) + .experiment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified flowValidationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowValidationResultPath( + project: string, + location: string, + agent: string, + flow: string, + ) { + return this.pathTemplates.flowValidationResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).project; + } + + /** + * Parse the location from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).location; + } + + /** + * Parse the agent from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).agent; + } + + /** + * Parse the flow from FlowValidationResult resource. + * + * @param {string} flowValidationResultName + * A fully-qualified path representing FlowValidationResult resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowValidationResultName(flowValidationResultName: string) { + return this.pathTemplates.flowValidationResultPathTemplate.match( + flowValidationResultName, + ).flow; + } + + /** + * Return a fully-qualified generator resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} generator + * @returns {string} Resource name string. + */ + generatorPath( + project: string, + location: string, + agent: string, + generator: string, + ) { + return this.pathTemplates.generatorPathTemplate.render({ + project: project, + location: location, + agent: agent, + generator: generator, + }); + } + + /** + * Parse the project from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .project; + } + + /** + * Parse the location from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .location; + } + + /** + * Parse the agent from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName).agent; + } + + /** + * Parse the generator from Generator resource. + * + * @param {string} generatorName + * A fully-qualified path representing Generator resource. + * @returns {string} A string representing the generator. + */ + matchGeneratorFromGeneratorName(generatorName: string) { + return this.pathTemplates.generatorPathTemplate.match(generatorName) + .generator; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * 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 page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string, + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified playbook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @returns {string} Resource name string. + */ + playbookPath( + project: string, + location: string, + agent: string, + playbook: string, + ) { + return this.pathTemplates.playbookPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + }); + } + + /** + * Parse the project from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).project; + } + + /** + * Parse the location from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).location; + } + + /** + * Parse the agent from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).agent; + } + + /** + * Parse the playbook from Playbook resource. + * + * @param {string} playbookName + * A fully-qualified path representing Playbook resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookName(playbookName: string) { + return this.pathTemplates.playbookPathTemplate.match(playbookName).playbook; + } + + /** + * Return a fully-qualified playbookVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} playbook + * @param {string} version + * @returns {string} Resource name string. + */ + playbookVersionPath( + project: string, + location: string, + agent: string, + playbook: string, + version: string, + ) { + return this.pathTemplates.playbookVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + playbook: playbook, + version: version, + }); + } + + /** + * Parse the project from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).project; + } + + /** + * Parse the location from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).location; + } + + /** + * Parse the agent from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).agent; + } + + /** + * Parse the playbook from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the playbook. + */ + matchPlaybookFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).playbook; + } + + /** + * Parse the version from PlaybookVersion resource. + * + * @param {string} playbookVersionName + * A fully-qualified path representing PlaybookVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromPlaybookVersionName(playbookVersionName: string) { + return this.pathTemplates.playbookVersionPathTemplate.match( + playbookVersionName, + ).version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionPath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSession resource. + * + * @param {string} projectLocationAgentEnvironmentSessionName + * A fully-qualified path representing project_location_agent_environment_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionName( + projectLocationAgentEnvironmentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match( + projectLocationAgentEnvironmentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentFlowTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentFlowTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the flow from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).flow; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentFlowTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentFlowTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_flow_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + projectLocationAgentFlowTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match( + projectLocationAgentFlowTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified projectLocationAgentSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @returns {string} Resource name string. + */ + projectLocationAgentSessionPath( + project: string, + location: string, + agent: string, + session: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.render({ + project: project, + location: location, + agent: agent, + session: session, + }); + } + + /** + * Parse the project from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSession resource. + * + * @param {string} projectLocationAgentSessionName + * A fully-qualified path representing project_location_agent_session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionName( + projectLocationAgentSessionName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionPathTemplate.match( + projectLocationAgentSessionName, + ).session; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string, + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName, + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentTransitionRouteGroups resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + projectLocationAgentTransitionRouteGroupsPath( + project: string, + location: string, + agent: string, + transitionRouteGroup: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render( + { + project: project, + location: location, + agent: agent, + transition_route_group: transitionRouteGroup, + }, + ); + } + + /** + * Parse the project from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).project; + } + + /** + * Parse the location from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).agent; + } + + /** + * Parse the transition_route_group from ProjectLocationAgentTransitionRouteGroups resource. + * + * @param {string} projectLocationAgentTransitionRouteGroupsName + * A fully-qualified path representing project_location_agent_transitionRouteGroups resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + projectLocationAgentTransitionRouteGroupsName: string, + ) { + return this.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match( + projectLocationAgentTransitionRouteGroupsName, + ).transition_route_group; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string, + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName, + ).security_settings; + } + + /** + * Return a fully-qualified testCase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @returns {string} Resource name string. + */ + testCasePath( + project: string, + location: string, + agent: string, + testCase: string, + ) { + return this.pathTemplates.testCasePathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + }); + } + + /** + * Parse the project from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).project; + } + + /** + * Parse the location from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).location; + } + + /** + * Parse the agent from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName).agent; + } + + /** + * Parse the test_case from TestCase resource. + * + * @param {string} testCaseName + * A fully-qualified path representing TestCase resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseName(testCaseName: string) { + return this.pathTemplates.testCasePathTemplate.match(testCaseName) + .test_case; + } + + /** + * Return a fully-qualified testCaseResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} test_case + * @param {string} result + * @returns {string} Resource name string. + */ + testCaseResultPath( + project: string, + location: string, + agent: string, + testCase: string, + result: string, + ) { + return this.pathTemplates.testCaseResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + test_case: testCase, + result: result, + }); + } + + /** + * Parse the project from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).project; + } + + /** + * Parse the location from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).location; + } + + /** + * Parse the agent from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).agent; + } + + /** + * Parse the test_case from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the test_case. + */ + matchTestCaseFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).test_case; + } + + /** + * Parse the result from TestCaseResult resource. + * + * @param {string} testCaseResultName + * A fully-qualified path representing TestCaseResult resource. + * @returns {string} A string representing the result. + */ + matchResultFromTestCaseResultName(testCaseResultName: string) { + return this.pathTemplates.testCaseResultPathTemplate.match( + testCaseResultName, + ).result; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project: string, location: string, agent: string, tool: string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the agent from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).agent; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} tool + * @param {string} version + * @returns {string} Resource name string. + */ + toolVersionPath( + project: string, + location: string, + agent: string, + tool: string, + version: string, + ) { + return this.pathTemplates.toolVersionPathTemplate.render({ + project: project, + location: location, + agent: agent, + tool: tool, + version: version, + }); + } + + /** + * Parse the project from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .project; + } + + /** + * Parse the location from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .location; + } + + /** + * Parse the agent from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .agent; + } + + /** + * Parse the tool from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .tool; + } + + /** + * Parse the version from ToolVersion resource. + * + * @param {string} toolVersionName + * A fully-qualified path representing ToolVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromToolVersionName(toolVersionName: string) { + return this.pathTemplates.toolVersionPathTemplate.match(toolVersionName) + .version; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string, + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string, + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * 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.webhooksStub && !this._terminated) { + return this.webhooksStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client_config.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client_config.json new file mode 100644 index 000000000000..7968ee27fe5b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.Webhooks": { + "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 + } + }, + "methods": { + "ListWebhooks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteWebhook": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_proto_list.json b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_proto_list.json new file mode 100644 index 000000000000..f36b9a11c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/src/v3beta1/webhooks_proto_list.json @@ -0,0 +1,39 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/bigquery_export.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/changelog.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/code_block.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/conversation_history.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/deployment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/example.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/generator.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/inline.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/trace.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/validation_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-dialogflow-cx/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..0b4855890468 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/system-test/fixtures/sample/src/index.js @@ -0,0 +1,46 @@ +// Copyright 2026 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 cx = require('@google-cloud/dialogflow-cx'); + +function main() { + const agentsClient = new cx.AgentsClient(); + const changelogsClient = new cx.ChangelogsClient(); + const deploymentsClient = new cx.DeploymentsClient(); + const entityTypesClient = new cx.EntityTypesClient(); + const environmentsClient = new cx.EnvironmentsClient(); + const examplesClient = new cx.ExamplesClient(); + const experimentsClient = new cx.ExperimentsClient(); + const flowsClient = new cx.FlowsClient(); + const generatorsClient = new cx.GeneratorsClient(); + const intentsClient = new cx.IntentsClient(); + const pagesClient = new cx.PagesClient(); + const playbooksClient = new cx.PlaybooksClient(); + const securitySettingsServiceClient = new cx.SecuritySettingsServiceClient(); + const sessionEntityTypesClient = new cx.SessionEntityTypesClient(); + const sessionsClient = new cx.SessionsClient(); + const testCasesClient = new cx.TestCasesClient(); + const toolsClient = new cx.ToolsClient(); + const transitionRouteGroupsClient = new cx.TransitionRouteGroupsClient(); + const versionsClient = new cx.VersionsClient(); + const webhooksClient = new cx.WebhooksClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-dialogflow-cx/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..1ca7974b3343 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,171 @@ +// Copyright 2026 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 { + AgentsClient, + ChangelogsClient, + DeploymentsClient, + EntityTypesClient, + EnvironmentsClient, + ExamplesClient, + ExperimentsClient, + FlowsClient, + GeneratorsClient, + IntentsClient, + PagesClient, + PlaybooksClient, + SecuritySettingsServiceClient, + SessionEntityTypesClient, + SessionsClient, + TestCasesClient, + ToolsClient, + TransitionRouteGroupsClient, + VersionsClient, + WebhooksClient, +} from '@google-cloud/dialogflow-cx'; + +// check that the client class type name can be used +function doStuffWithAgentsClient(client: AgentsClient) { + client.close(); +} +function doStuffWithChangelogsClient(client: ChangelogsClient) { + client.close(); +} +function doStuffWithDeploymentsClient(client: DeploymentsClient) { + client.close(); +} +function doStuffWithEntityTypesClient(client: EntityTypesClient) { + client.close(); +} +function doStuffWithEnvironmentsClient(client: EnvironmentsClient) { + client.close(); +} +function doStuffWithExamplesClient(client: ExamplesClient) { + client.close(); +} +function doStuffWithExperimentsClient(client: ExperimentsClient) { + client.close(); +} +function doStuffWithFlowsClient(client: FlowsClient) { + client.close(); +} +function doStuffWithGeneratorsClient(client: GeneratorsClient) { + client.close(); +} +function doStuffWithIntentsClient(client: IntentsClient) { + client.close(); +} +function doStuffWithPagesClient(client: PagesClient) { + client.close(); +} +function doStuffWithPlaybooksClient(client: PlaybooksClient) { + client.close(); +} +function doStuffWithSecuritySettingsServiceClient( + client: SecuritySettingsServiceClient, +) { + client.close(); +} +function doStuffWithSessionEntityTypesClient(client: SessionEntityTypesClient) { + client.close(); +} +function doStuffWithSessionsClient(client: SessionsClient) { + client.close(); +} +function doStuffWithTestCasesClient(client: TestCasesClient) { + client.close(); +} +function doStuffWithToolsClient(client: ToolsClient) { + client.close(); +} +function doStuffWithTransitionRouteGroupsClient( + client: TransitionRouteGroupsClient, +) { + client.close(); +} +function doStuffWithVersionsClient(client: VersionsClient) { + client.close(); +} +function doStuffWithWebhooksClient(client: WebhooksClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const agentsClient = new AgentsClient(); + doStuffWithAgentsClient(agentsClient); + // check that the client instance can be created + const changelogsClient = new ChangelogsClient(); + doStuffWithChangelogsClient(changelogsClient); + // check that the client instance can be created + const deploymentsClient = new DeploymentsClient(); + doStuffWithDeploymentsClient(deploymentsClient); + // check that the client instance can be created + const entityTypesClient = new EntityTypesClient(); + doStuffWithEntityTypesClient(entityTypesClient); + // check that the client instance can be created + const environmentsClient = new EnvironmentsClient(); + doStuffWithEnvironmentsClient(environmentsClient); + // check that the client instance can be created + const examplesClient = new ExamplesClient(); + doStuffWithExamplesClient(examplesClient); + // check that the client instance can be created + const experimentsClient = new ExperimentsClient(); + doStuffWithExperimentsClient(experimentsClient); + // check that the client instance can be created + const flowsClient = new FlowsClient(); + doStuffWithFlowsClient(flowsClient); + // check that the client instance can be created + const generatorsClient = new GeneratorsClient(); + doStuffWithGeneratorsClient(generatorsClient); + // check that the client instance can be created + const intentsClient = new IntentsClient(); + doStuffWithIntentsClient(intentsClient); + // check that the client instance can be created + const pagesClient = new PagesClient(); + doStuffWithPagesClient(pagesClient); + // check that the client instance can be created + const playbooksClient = new PlaybooksClient(); + doStuffWithPlaybooksClient(playbooksClient); + // check that the client instance can be created + const securitySettingsServiceClient = new SecuritySettingsServiceClient(); + doStuffWithSecuritySettingsServiceClient(securitySettingsServiceClient); + // check that the client instance can be created + const sessionEntityTypesClient = new SessionEntityTypesClient(); + doStuffWithSessionEntityTypesClient(sessionEntityTypesClient); + // check that the client instance can be created + const sessionsClient = new SessionsClient(); + doStuffWithSessionsClient(sessionsClient); + // check that the client instance can be created + const testCasesClient = new TestCasesClient(); + doStuffWithTestCasesClient(testCasesClient); + // check that the client instance can be created + const toolsClient = new ToolsClient(); + doStuffWithToolsClient(toolsClient); + // check that the client instance can be created + const transitionRouteGroupsClient = new TransitionRouteGroupsClient(); + doStuffWithTransitionRouteGroupsClient(transitionRouteGroupsClient); + // check that the client instance can be created + const versionsClient = new VersionsClient(); + doStuffWithVersionsClient(versionsClient); + // check that the client instance can be created + const webhooksClient = new WebhooksClient(); + doStuffWithWebhooksClient(webhooksClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/system-test/install.ts b/owl-bot-staging/google-cloud-dialogflow-cx/system-test/install.ts new file mode 100644 index 000000000000..ccf167042d2e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2026 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', + cjs: readFileSync( + './system-test/fixtures/sample/src/index.js', + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_agents_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_agents_v3.ts new file mode 100644 index 000000000000..d9e56aa6c02c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_agents_v3.ts @@ -0,0 +1,5185 @@ +// Copyright 2026 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 agentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.AgentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new agentsModule.v3.AgentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new agentsModule.v3.AgentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = agentsModule.v3.AgentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = agentsModule.v3.AgentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new agentsModule.v3.AgentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new agentsModule.v3.AgentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new agentsModule.v3.AgentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new agentsModule.v3.AgentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new agentsModule.v3.AgentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = agentsModule.v3.AgentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new agentsModule.v3.AgentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new agentsModule.v3.AgentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.agentsStub, undefined); + await client.initialize(); + assert(client.agentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.agentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.agentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new agentsModule.v3.AgentsClient({ + 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 agentsModule.v3.AgentsClient({ + 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('getAgent', () => { + it('invokes getAgent without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Agent(), + ); + client.innerApiCalls.getAgent = stubSimpleCall(expectedResponse); + const [response] = await client.getAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Agent(), + ); + client.innerApiCalls.getAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IAgent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getAgent(request), expectedError); + }); + }); + + describe('createAgent', () => { + it('invokes createAgent without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Agent(), + ); + client.innerApiCalls.createAgent = stubSimpleCall(expectedResponse); + const [response] = await client.createAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Agent(), + ); + client.innerApiCalls.createAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IAgent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createAgent(request), expectedError); + }); + }); + + describe('updateAgent', () => { + it('invokes updateAgent without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Agent(), + ); + client.innerApiCalls.updateAgent = stubSimpleCall(expectedResponse); + const [response] = await client.updateAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Agent(), + ); + client.innerApiCalls.updateAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IAgent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateAgent(request), expectedError); + }); + }); + + describe('deleteAgent', () => { + it('invokes deleteAgent without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAgent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAgent( + 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.deleteAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteAgent(request), expectedError); + }); + }); + + describe('validateAgent', () => { + it('invokes validateAgent without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.AgentValidationResult(), + ); + client.innerApiCalls.validateAgent = stubSimpleCall(expectedResponse); + const [response] = await client.validateAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateAgent without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.AgentValidationResult(), + ); + client.innerApiCalls.validateAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateAgent with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.validateAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateAgent with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.validateAgent(request), expectedError); + }); + }); + + describe('getAgentValidationResult', () => { + it('invokes getAgentValidationResult without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.AgentValidationResult(), + ); + client.innerApiCalls.getAgentValidationResult = + stubSimpleCall(expectedResponse); + const [response] = await client.getAgentValidationResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentValidationResult without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.AgentValidationResult(), + ); + client.innerApiCalls.getAgentValidationResult = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgentValidationResult( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IAgentValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentValidationResult with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgentValidationResult = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getAgentValidationResult(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentValidationResult with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getAgentValidationResult(request), + expectedError, + ); + }); + }); + + describe('getGenerativeSettings', () => { + it('invokes getGenerativeSettings without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GenerativeSettings(), + ); + client.innerApiCalls.getGenerativeSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getGenerativeSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerativeSettings without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GenerativeSettings(), + ); + client.innerApiCalls.getGenerativeSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGenerativeSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerativeSettings with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGenerativeSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getGenerativeSettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerativeSettings with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getGenerativeSettings(request), + expectedError, + ); + }); + }); + + describe('updateGenerativeSettings', () => { + it('invokes updateGenerativeSettings without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedHeaderRequestParams = `generative_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GenerativeSettings(), + ); + client.innerApiCalls.updateGenerativeSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateGenerativeSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerativeSettings without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedHeaderRequestParams = `generative_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GenerativeSettings(), + ); + client.innerApiCalls.updateGenerativeSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGenerativeSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IGenerativeSettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerativeSettings with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedHeaderRequestParams = `generative_settings.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGenerativeSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateGenerativeSettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerativeSettings with closed client', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateGenerativeSettings(request), + expectedError, + ); + }); + }); + + describe('exportAgent', () => { + it('invokes exportAgent without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportAgent = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAgent(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAgent without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportAgent = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportAgent( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportAgentResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAgent with call error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAgent = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAgent with LRO error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAgent = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportAgent(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportAgentProgress without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportAgentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAgentProgress with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkExportAgentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restoreAgent', () => { + it('invokes restoreAgent without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreAgent = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreAgent(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAgent without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreAgent = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreAgent( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAgent with call error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAgent = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.restoreAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAgent with LRO error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAgent = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.restoreAgent(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreAgentProgress without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkRestoreAgentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreAgentProgress with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkRestoreAgentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAgents', () => { + it('invokes listAgents without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + ]; + client.innerApiCalls.listAgents = stubSimpleCall(expectedResponse); + const [response] = await client.listAgents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + ]; + client.innerApiCalls.listAgents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAgents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IAgent[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAgents = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listAgents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgentsStream without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + ]; + client.descriptors.page.listAgents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Agent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Agent) => { + 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.listAgents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgents, request), + ); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listAgentsStream with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Agent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Agent) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgents, request), + ); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAgents without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Agent()), + ]; + client.descriptors.page.listAgents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IAgent[] = []; + const iterable = client.listAgentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAgents with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listAgentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IAgent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 agentsModule.v3.AgentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 agentsModule.v3.AgentsClient({ + 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 agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 agentsModule.v3.AgentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 agentsModule.v3.AgentsClient({ + 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 agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 agentsModule.v3.AgentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 agentsModule.v3.AgentsClient({ + 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 agentsModule.v3.AgentsClient({ + 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.IOperation[] = []; + 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 agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_agents_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_agents_v3beta1.ts new file mode 100644 index 000000000000..4bdfac9d3e9d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_agents_v3beta1.ts @@ -0,0 +1,5286 @@ +// Copyright 2026 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 agentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.AgentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new agentsModule.v3beta1.AgentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new agentsModule.v3beta1.AgentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = agentsModule.v3beta1.AgentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = agentsModule.v3beta1.AgentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new agentsModule.v3beta1.AgentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new agentsModule.v3beta1.AgentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new agentsModule.v3beta1.AgentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new agentsModule.v3beta1.AgentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new agentsModule.v3beta1.AgentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = agentsModule.v3beta1.AgentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new agentsModule.v3beta1.AgentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new agentsModule.v3beta1.AgentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.agentsStub, undefined); + await client.initialize(); + assert(client.agentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.agentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.agentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new agentsModule.v3beta1.AgentsClient({ + 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 agentsModule.v3beta1.AgentsClient({ + 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('getAgent', () => { + it('invokes getAgent without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ); + client.innerApiCalls.getAgent = stubSimpleCall(expectedResponse); + const [response] = await client.getAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ); + client.innerApiCalls.getAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IAgent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getAgent(request), expectedError); + }); + }); + + describe('createAgent', () => { + it('invokes createAgent without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ); + client.innerApiCalls.createAgent = stubSimpleCall(expectedResponse); + const [response] = await client.createAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ); + client.innerApiCalls.createAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IAgent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createAgent(request), expectedError); + }); + }); + + describe('updateAgent', () => { + it('invokes updateAgent without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ); + client.innerApiCalls.updateAgent = stubSimpleCall(expectedResponse); + const [response] = await client.updateAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ); + client.innerApiCalls.updateAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IAgent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(), + ); + request.agent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest', + ['agent', 'name'], + ); + request.agent.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateAgent(request), expectedError); + }); + }); + + describe('deleteAgent', () => { + it('invokes deleteAgent without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAgent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAgent( + 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.deleteAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteAgent(request), expectedError); + }); + }); + + describe('validateAgent', () => { + it('invokes validateAgent without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult(), + ); + client.innerApiCalls.validateAgent = stubSimpleCall(expectedResponse); + const [response] = await client.validateAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateAgent without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult(), + ); + client.innerApiCalls.validateAgent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateAgent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateAgent with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateAgent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.validateAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateAgent with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.validateAgent(request), expectedError); + }); + }); + + describe('getAgentValidationResult', () => { + it('invokes getAgentValidationResult without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult(), + ); + client.innerApiCalls.getAgentValidationResult = + stubSimpleCall(expectedResponse); + const [response] = await client.getAgentValidationResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentValidationResult without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.AgentValidationResult(), + ); + client.innerApiCalls.getAgentValidationResult = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgentValidationResult( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IAgentValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentValidationResult with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgentValidationResult = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getAgentValidationResult(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentValidationResult with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetAgentValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getAgentValidationResult(request), + expectedError, + ); + }); + }); + + describe('getGenerativeSettings', () => { + it('invokes getGenerativeSettings without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings(), + ); + client.innerApiCalls.getGenerativeSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getGenerativeSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerativeSettings without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings(), + ); + client.innerApiCalls.getGenerativeSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGenerativeSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerativeSettings with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGenerativeSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getGenerativeSettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerativeSettings with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGenerativeSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getGenerativeSettings(request), + expectedError, + ); + }); + }); + + describe('updateGenerativeSettings', () => { + it('invokes updateGenerativeSettings without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedHeaderRequestParams = `generative_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings(), + ); + client.innerApiCalls.updateGenerativeSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateGenerativeSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerativeSettings without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedHeaderRequestParams = `generative_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GenerativeSettings(), + ); + client.innerApiCalls.updateGenerativeSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGenerativeSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IGenerativeSettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerativeSettings with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedHeaderRequestParams = `generative_settings.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGenerativeSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateGenerativeSettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerativeSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerativeSettings with closed client', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest(), + ); + request.generativeSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGenerativeSettingsRequest', + ['generativeSettings', 'name'], + ); + request.generativeSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateGenerativeSettings(request), + expectedError, + ); + }); + }); + + describe('exportAgent', () => { + it('invokes exportAgent without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportAgent = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAgent(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAgent without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportAgent = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportAgent( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportAgentResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAgent with call error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAgent = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAgent with LRO error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAgent = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportAgent(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportAgentProgress without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportAgentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAgentProgress with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkExportAgentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restoreAgent', () => { + it('invokes restoreAgent without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreAgent = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreAgent(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAgent without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreAgent = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreAgent( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAgent with call error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAgent = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.restoreAgent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAgent with LRO error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAgent = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.restoreAgent(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreAgent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreAgentProgress without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkRestoreAgentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreAgentProgress with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkRestoreAgentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAgents', () => { + it('invokes listAgents without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + ]; + client.innerApiCalls.listAgents = stubSimpleCall(expectedResponse); + const [response] = await client.listAgents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + ]; + client.innerApiCalls.listAgents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAgents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IAgent[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAgents = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listAgents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgentsStream without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + ]; + client.descriptors.page.listAgents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Agent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Agent) => { + 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.listAgents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgents, request), + ); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listAgentsStream with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Agent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Agent) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgents, request), + ); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAgents without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Agent(), + ), + ]; + client.descriptors.page.listAgents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IAgent[] = []; + const iterable = client.listAgentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAgents with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listAgentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IAgent[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 agentsModule.v3beta1.AgentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 agentsModule.v3beta1.AgentsClient({ + 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 agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 agentsModule.v3beta1.AgentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 agentsModule.v3beta1.AgentsClient({ + 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 agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 agentsModule.v3beta1.AgentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 agentsModule.v3beta1.AgentsClient({ + 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 agentsModule.v3beta1.AgentsClient({ + 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.IOperation[] = []; + 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 agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_changelogs_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_changelogs_v3.ts new file mode 100644 index 000000000000..59560d879227 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_changelogs_v3.ts @@ -0,0 +1,3838 @@ +// Copyright 2026 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 changelogsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.ChangelogsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new changelogsModule.v3.ChangelogsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new changelogsModule.v3.ChangelogsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = changelogsModule.v3.ChangelogsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = changelogsModule.v3.ChangelogsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new changelogsModule.v3.ChangelogsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new changelogsModule.v3.ChangelogsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new changelogsModule.v3.ChangelogsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new changelogsModule.v3.ChangelogsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new changelogsModule.v3.ChangelogsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = changelogsModule.v3.ChangelogsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new changelogsModule.v3.ChangelogsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new changelogsModule.v3.ChangelogsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.changelogsStub, undefined); + await client.initialize(); + assert(client.changelogsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.changelogsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.changelogsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new changelogsModule.v3.ChangelogsClient({ + 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 changelogsModule.v3.ChangelogsClient({ + 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('getChangelog', () => { + it('invokes getChangelog without error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ); + client.innerApiCalls.getChangelog = stubSimpleCall(expectedResponse); + const [response] = await client.getChangelog(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog without error using callback', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ); + client.innerApiCalls.getChangelog = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChangelog( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IChangelog | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChangelog = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getChangelog(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with closed client', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getChangelog(request), expectedError); + }); + }); + + describe('listChangelogs', () => { + it('invokes listChangelogs without error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + ]; + client.innerApiCalls.listChangelogs = stubSimpleCall(expectedResponse); + const [response] = await client.listChangelogs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs without error using callback', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + ]; + client.innerApiCalls.listChangelogs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChangelogs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IChangelog[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs with error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChangelogs = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listChangelogs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogsStream without error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + ]; + client.descriptors.page.listChangelogs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Changelog[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Changelog) => { + 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.listChangelogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChangelogs, request), + ); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listChangelogsStream with error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Changelog[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Changelog) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChangelogs, request), + ); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listChangelogs without error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Changelog(), + ), + ]; + client.descriptors.page.listChangelogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IChangelog[] = []; + const iterable = client.listChangelogsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listChangelogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listChangelogs with error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChangelogsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IChangelog[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listChangelogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 changelogsModule.v3.ChangelogsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 changelogsModule.v3.ChangelogsClient({ + 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 changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 changelogsModule.v3.ChangelogsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 changelogsModule.v3.ChangelogsClient({ + 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 changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 changelogsModule.v3.ChangelogsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 changelogsModule.v3.ChangelogsClient({ + 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 changelogsModule.v3.ChangelogsClient({ + 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.IOperation[] = []; + 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 changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new changelogsModule.v3.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_changelogs_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_changelogs_v3beta1.ts new file mode 100644 index 000000000000..8467ecc5f0c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_changelogs_v3beta1.ts @@ -0,0 +1,3607 @@ +// Copyright 2026 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 changelogsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.ChangelogsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new changelogsModule.v3beta1.ChangelogsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new changelogsModule.v3beta1.ChangelogsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + changelogsModule.v3beta1.ChangelogsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + changelogsModule.v3beta1.ChangelogsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new changelogsModule.v3beta1.ChangelogsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new changelogsModule.v3beta1.ChangelogsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = changelogsModule.v3beta1.ChangelogsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new changelogsModule.v3beta1.ChangelogsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.changelogsStub, undefined); + await client.initialize(); + assert(client.changelogsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.changelogsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.changelogsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + 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 changelogsModule.v3beta1.ChangelogsClient({ + 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('getChangelog', () => { + it('invokes getChangelog without error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ); + client.innerApiCalls.getChangelog = stubSimpleCall(expectedResponse); + const [response] = await client.getChangelog(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog without error using callback', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ); + client.innerApiCalls.getChangelog = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChangelog( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IChangelog | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChangelog = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getChangelog(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChangelog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with closed client', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetChangelogRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getChangelog(request), expectedError); + }); + }); + + describe('listChangelogs', () => { + it('invokes listChangelogs without error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + ]; + client.innerApiCalls.listChangelogs = stubSimpleCall(expectedResponse); + const [response] = await client.listChangelogs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs without error using callback', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + ]; + client.innerApiCalls.listChangelogs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChangelogs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IChangelog[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs with error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChangelogs = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listChangelogs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChangelogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogsStream without error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + ]; + client.descriptors.page.listChangelogs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Changelog[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Changelog) => { + 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.listChangelogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChangelogs, request), + ); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listChangelogsStream with error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Changelog[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Changelog) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChangelogs, request), + ); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listChangelogs without error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Changelog(), + ), + ]; + client.descriptors.page.listChangelogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IChangelog[] = + []; + const iterable = client.listChangelogsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listChangelogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listChangelogs with error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListChangelogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChangelogsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IChangelog[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listChangelogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new changelogsModule.v3beta1.ChangelogsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_conversation_history_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_conversation_history_v3beta1.ts new file mode 100644 index 000000000000..e7aac0adc2e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_conversation_history_v3beta1.ts @@ -0,0 +1,3811 @@ +// Copyright 2026 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 conversationhistoryModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.ConversationHistoryClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + conversationhistoryModule.v3beta1.ConversationHistoryClient + .servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + conversationhistoryModule.v3beta1.ConversationHistoryClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + conversationhistoryModule.v3beta1.ConversationHistoryClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.conversationHistoryStub, undefined); + await client.initialize(); + assert(client.conversationHistoryStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.conversationHistoryStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.conversationHistoryStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + 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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + 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('getConversation', () => { + it('invokes getConversation without error', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ); + client.innerApiCalls.getConversation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetConversationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getConversation(request), expectedError); + }); + }); + + describe('deleteConversation', () => { + it('invokes deleteConversation without error', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteConversationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteConversation(request), expectedError); + }); + }); + + describe('listConversations', () => { + it('invokes listConversations without error', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + ]; + client.innerApiCalls.listConversations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + ]; + client.descriptors.page.listConversations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Conversation[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.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.dialogflow.cx.v3beta1.Conversation[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Conversation(), + ), + ]; + client.descriptors.page.listConversations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.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 conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListConversationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.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.dialogflow.cx.v3beta1.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('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = + new conversationhistoryModule.v3beta1.ConversationHistoryClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_deployments_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_deployments_v3.ts new file mode 100644 index 000000000000..7a4bc7f473f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_deployments_v3.ts @@ -0,0 +1,3839 @@ +// Copyright 2026 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 deploymentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.DeploymentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new deploymentsModule.v3.DeploymentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new deploymentsModule.v3.DeploymentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = deploymentsModule.v3.DeploymentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = deploymentsModule.v3.DeploymentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new deploymentsModule.v3.DeploymentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new deploymentsModule.v3.DeploymentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new deploymentsModule.v3.DeploymentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = deploymentsModule.v3.DeploymentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new deploymentsModule.v3.DeploymentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.deploymentsStub, undefined); + await client.initialize(); + assert(client.deploymentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.deploymentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.deploymentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new deploymentsModule.v3.DeploymentsClient({ + 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 deploymentsModule.v3.DeploymentsClient({ + 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('getDeployment', () => { + it('invokes getDeployment without error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ); + client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment without error using callback', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ); + client.innerApiCalls.getDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IDeployment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with closed client', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getDeployment(request), expectedError); + }); + }); + + describe('listDeployments', () => { + it('invokes listDeployments without error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + ]; + client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments without error using callback', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + ]; + client.innerApiCalls.listDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeployments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IDeployment[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments with error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeployments = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listDeployments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentsStream without error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + ]; + client.descriptors.page.listDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Deployment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Deployment) => { + 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.listDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDeployments, request), + ); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listDeploymentsStream with error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Deployment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Deployment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDeployments, request), + ); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDeployments without error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Deployment(), + ), + ]; + client.descriptors.page.listDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IDeployment[] = []; + const iterable = client.listDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDeployments with error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 deploymentsModule.v3.DeploymentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 deploymentsModule.v3.DeploymentsClient({ + 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 deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 deploymentsModule.v3.DeploymentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 deploymentsModule.v3.DeploymentsClient({ + 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 deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 deploymentsModule.v3.DeploymentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 deploymentsModule.v3.DeploymentsClient({ + 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 deploymentsModule.v3.DeploymentsClient({ + 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.IOperation[] = []; + 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 deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new deploymentsModule.v3.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_deployments_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_deployments_v3beta1.ts new file mode 100644 index 000000000000..b6504d2156a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_deployments_v3beta1.ts @@ -0,0 +1,3607 @@ +// Copyright 2026 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 deploymentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.DeploymentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + deploymentsModule.v3beta1.DeploymentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + deploymentsModule.v3beta1.DeploymentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new deploymentsModule.v3beta1.DeploymentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new deploymentsModule.v3beta1.DeploymentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = deploymentsModule.v3beta1.DeploymentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.deploymentsStub, undefined); + await client.initialize(); + assert(client.deploymentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.deploymentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.deploymentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + 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 deploymentsModule.v3beta1.DeploymentsClient({ + 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('getDeployment', () => { + it('invokes getDeployment without error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ); + client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment without error using callback', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ); + client.innerApiCalls.getDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IDeployment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with closed client', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetDeploymentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getDeployment(request), expectedError); + }); + }); + + describe('listDeployments', () => { + it('invokes listDeployments without error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + ]; + client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments without error using callback', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + ]; + client.innerApiCalls.listDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeployments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IDeployment[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments with error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeployments = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listDeployments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentsStream without error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + ]; + client.descriptors.page.listDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Deployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Deployment) => { + 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.listDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDeployments, request), + ); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listDeploymentsStream with error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Deployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Deployment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDeployments, request), + ); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDeployments without error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Deployment(), + ), + ]; + client.descriptors.page.listDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IDeployment[] = + []; + const iterable = client.listDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDeployments with error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListDeploymentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new deploymentsModule.v3beta1.DeploymentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_entity_types_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_entity_types_v3.ts new file mode 100644 index 000000000000..fd34c280a67b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_entity_types_v3.ts @@ -0,0 +1,4664 @@ +// Copyright 2026 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 entitytypesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.EntityTypesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new entitytypesModule.v3.EntityTypesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new entitytypesModule.v3.EntityTypesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = entitytypesModule.v3.EntityTypesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = entitytypesModule.v3.EntityTypesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new entitytypesModule.v3.EntityTypesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new entitytypesModule.v3.EntityTypesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new entitytypesModule.v3.EntityTypesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = entitytypesModule.v3.EntityTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new entitytypesModule.v3.EntityTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.entityTypesStub, undefined); + await client.initialize(); + assert(client.entityTypesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.entityTypesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.entityTypesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new entitytypesModule.v3.EntityTypesClient({ + 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 entitytypesModule.v3.EntityTypesClient({ + 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('getEntityType', () => { + it('invokes getEntityType without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ); + client.innerApiCalls.getEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.getEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntityType without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ); + client.innerApiCalls.getEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntityType with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntityType with closed client', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getEntityType(request), expectedError); + }); + }); + + describe('createEntityType', () => { + it('invokes createEntityType without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ); + client.innerApiCalls.createEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.createEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntityType without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ); + client.innerApiCalls.createEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntityType with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntityType with closed client', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createEntityType(request), expectedError); + }); + }); + + describe('updateEntityType', () => { + it('invokes updateEntityType without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ); + client.innerApiCalls.updateEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.updateEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntityType without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ); + client.innerApiCalls.updateEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntityType with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntityType with closed client', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateEntityType(request), expectedError); + }); + }); + + describe('deleteEntityType', () => { + it('invokes deleteEntityType without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntityType without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEntityType( + 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.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntityType with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntityType with closed client', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteEntityType(request), expectedError); + }); + }); + + describe('exportEntityTypes', () => { + it('invokes exportEntityTypes without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportEntityTypes = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportEntityTypes(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEntityTypes without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportEntityTypes = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportEntityTypes( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportEntityTypesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEntityTypes with call error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEntityTypes = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportEntityTypes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEntityTypes with LRO error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEntityTypes = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportEntityTypes(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportEntityTypesProgress without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportEntityTypesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportEntityTypesProgress with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportEntityTypesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importEntityTypes', () => { + it('invokes importEntityTypes without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importEntityTypes = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importEntityTypes(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEntityTypes without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importEntityTypes = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importEntityTypes( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportEntityTypesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEntityTypes with call error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importEntityTypes = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importEntityTypes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEntityTypes with LRO error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importEntityTypes = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importEntityTypes(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportEntityTypesProgress without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportEntityTypesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportEntityTypesProgress with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportEntityTypesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listEntityTypes', () => { + it('invokes listEntityTypes without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + ]; + client.innerApiCalls.listEntityTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listEntityTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntityTypes without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + ]; + client.innerApiCalls.listEntityTypes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEntityTypes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IEntityType[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntityTypes with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntityTypes = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listEntityTypes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntityTypesStream without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + ]; + client.descriptors.page.listEntityTypes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.EntityType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.EntityType) => { + 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.listEntityTypes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntityTypes, request), + ); + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listEntityTypesStream with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.EntityType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.EntityType) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntityTypes, request), + ); + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEntityTypes without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.EntityType(), + ), + ]; + client.descriptors.page.listEntityTypes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IEntityType[] = []; + const iterable = client.listEntityTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntityTypes.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEntityTypes with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEntityTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IEntityType[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntityTypes.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 entitytypesModule.v3.EntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 entitytypesModule.v3.EntityTypesClient({ + 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 entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 entitytypesModule.v3.EntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 entitytypesModule.v3.EntityTypesClient({ + 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 entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 entitytypesModule.v3.EntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 entitytypesModule.v3.EntityTypesClient({ + 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 entitytypesModule.v3.EntityTypesClient({ + 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.IOperation[] = []; + 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 entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_entity_types_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_entity_types_v3beta1.ts new file mode 100644 index 000000000000..a0dffbfece8f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_entity_types_v3beta1.ts @@ -0,0 +1,4747 @@ +// Copyright 2026 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 entitytypesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.EntityTypesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + entitytypesModule.v3beta1.EntityTypesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + entitytypesModule.v3beta1.EntityTypesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new entitytypesModule.v3beta1.EntityTypesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new entitytypesModule.v3beta1.EntityTypesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = entitytypesModule.v3beta1.EntityTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.entityTypesStub, undefined); + await client.initialize(); + assert(client.entityTypesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.entityTypesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.entityTypesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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('getEntityType', () => { + it('invokes getEntityType without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ); + client.innerApiCalls.getEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.getEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntityType without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ); + client.innerApiCalls.getEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntityType with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntityType with closed client', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getEntityType(request), expectedError); + }); + }); + + describe('createEntityType', () => { + it('invokes createEntityType without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ); + client.innerApiCalls.createEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.createEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntityType without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ); + client.innerApiCalls.createEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntityType with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntityType with closed client', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createEntityType(request), expectedError); + }); + }); + + describe('updateEntityType', () => { + it('invokes updateEntityType without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ); + client.innerApiCalls.updateEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.updateEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntityType without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ); + client.innerApiCalls.updateEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntityType with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntityType with closed client', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(), + ); + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest', + ['entityType', 'name'], + ); + request.entityType.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateEntityType(request), expectedError); + }); + }); + + describe('deleteEntityType', () => { + it('invokes deleteEntityType without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntityType without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEntityType( + 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.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntityType with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntityType with closed client', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteEntityType(request), expectedError); + }); + }); + + describe('exportEntityTypes', () => { + it('invokes exportEntityTypes without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportEntityTypes = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportEntityTypes(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEntityTypes without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportEntityTypes = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportEntityTypes( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportEntityTypesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEntityTypes with call error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEntityTypes = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportEntityTypes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEntityTypes with LRO error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEntityTypes = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportEntityTypes(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportEntityTypesProgress without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportEntityTypesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportEntityTypesProgress with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportEntityTypesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importEntityTypes', () => { + it('invokes importEntityTypes without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importEntityTypes = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importEntityTypes(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEntityTypes without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importEntityTypes = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importEntityTypes( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportEntityTypesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEntityTypes with call error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importEntityTypes = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importEntityTypes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEntityTypes with LRO error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importEntityTypes = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importEntityTypes(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportEntityTypesProgress without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportEntityTypesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportEntityTypesProgress with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportEntityTypesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listEntityTypes', () => { + it('invokes listEntityTypes without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + ]; + client.innerApiCalls.listEntityTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listEntityTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntityTypes without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + ]; + client.innerApiCalls.listEntityTypes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEntityTypes( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IEntityType[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntityTypes with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntityTypes = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listEntityTypes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntityTypesStream without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + ]; + client.descriptors.page.listEntityTypes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.EntityType[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.EntityType) => { + 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.listEntityTypes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntityTypes, request), + ); + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listEntityTypesStream with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.EntityType[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.EntityType) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntityTypes, request), + ); + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEntityTypes without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.EntityType(), + ), + ]; + client.descriptors.page.listEntityTypes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IEntityType[] = + []; + const iterable = client.listEntityTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntityTypes.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEntityTypes with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEntityTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IEntityType[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntityTypes.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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 entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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 entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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 entitytypesModule.v3beta1.EntityTypesClient({ + 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.IOperation[] = []; + 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 entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_environments_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_environments_v3.ts new file mode 100644 index 000000000000..48932136bc3d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_environments_v3.ts @@ -0,0 +1,5499 @@ +// Copyright 2026 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 environmentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.EnvironmentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new environmentsModule.v3.EnvironmentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new environmentsModule.v3.EnvironmentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + environmentsModule.v3.EnvironmentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + environmentsModule.v3.EnvironmentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new environmentsModule.v3.EnvironmentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new environmentsModule.v3.EnvironmentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new environmentsModule.v3.EnvironmentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = environmentsModule.v3.EnvironmentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new environmentsModule.v3.EnvironmentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + await client.initialize(); + assert(client.environmentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.environmentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new environmentsModule.v3.EnvironmentsClient({ + 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 environmentsModule.v3.EnvironmentsClient({ + 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('getEnvironment', () => { + it('invokes getEnvironment without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ); + client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.getEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ); + client.innerApiCalls.getEnvironment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEnvironment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IEnvironment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEnvironment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with closed client', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getEnvironment(request), expectedError); + }); + }); + + describe('deleteEnvironment', () => { + it('invokes deleteEnvironment without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEnvironment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEnvironment( + 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.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with closed client', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteEnvironment(request), expectedError); + }); + }); + + describe('createEnvironment', () => { + it('invokes createEnvironment without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with call error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with LRO error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkCreateEnvironmentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateEnvironmentProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateEnvironment', () => { + it('invokes updateEnvironment without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IEnvironment, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with call error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with LRO error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkUpdateEnvironmentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateEnvironmentProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('runContinuousTest', () => { + it('invokes runContinuousTest without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runContinuousTest = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runContinuousTest(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runContinuousTest without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runContinuousTest = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runContinuousTest( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runContinuousTest with call error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runContinuousTest = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.runContinuousTest(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runContinuousTest with LRO error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runContinuousTest = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.runContinuousTest(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunContinuousTestProgress without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkRunContinuousTestProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunContinuousTestProgress with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkRunContinuousTestProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deployFlow', () => { + it('invokes deployFlow without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deployFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployFlow without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deployFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3.IDeployFlowMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployFlow with call error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deployFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployFlow with LRO error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deployFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployFlowProgress without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkDeployFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployFlowProgress with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeployFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listEnvironments', () => { + it('invokes listEnvironments without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.innerApiCalls.listEnvironments = stubSimpleCall(expectedResponse); + const [response] = await client.listEnvironments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.innerApiCalls.listEnvironments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEnvironments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IEnvironment[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEnvironments = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listEnvironments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironmentsStream without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.descriptors.page.listEnvironments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Environment) => { + 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.listEnvironments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEnvironments, request), + ); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listEnvironmentsStream with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Environment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEnvironments, request), + ); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEnvironments without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.descriptors.page.listEnvironments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IEnvironment[] = []; + const iterable = client.listEnvironmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEnvironments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEnvironments with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEnvironmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IEnvironment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEnvironments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('lookupEnvironmentHistory', () => { + it('invokes lookupEnvironmentHistory without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.innerApiCalls.lookupEnvironmentHistory = + stubSimpleCall(expectedResponse); + const [response] = await client.lookupEnvironmentHistory(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupEnvironmentHistory without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.innerApiCalls.lookupEnvironmentHistory = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupEnvironmentHistory( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IEnvironment[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupEnvironmentHistory with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupEnvironmentHistory = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.lookupEnvironmentHistory(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupEnvironmentHistoryStream without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.descriptors.page.lookupEnvironmentHistory.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.lookupEnvironmentHistoryStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Environment) => { + 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.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.lookupEnvironmentHistory, request), + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes lookupEnvironmentHistoryStream with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.lookupEnvironmentHistory.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.lookupEnvironmentHistoryStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Environment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.lookupEnvironmentHistory, request), + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with lookupEnvironmentHistory without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Environment(), + ), + ]; + client.descriptors.page.lookupEnvironmentHistory.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IEnvironment[] = []; + const iterable = client.lookupEnvironmentHistoryAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with lookupEnvironmentHistory with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.lookupEnvironmentHistory.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.lookupEnvironmentHistoryAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IEnvironment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('listContinuousTestResults', () => { + it('invokes listContinuousTestResults without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + ]; + client.innerApiCalls.listContinuousTestResults = + stubSimpleCall(expectedResponse); + const [response] = await client.listContinuousTestResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContinuousTestResults without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + ]; + client.innerApiCalls.listContinuousTestResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listContinuousTestResults( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContinuousTestResults with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listContinuousTestResults = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listContinuousTestResults(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContinuousTestResultsStream without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + ]; + client.descriptors.page.listContinuousTestResults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listContinuousTestResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult, + ) => { + 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.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listContinuousTestResults, request), + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listContinuousTestResultsStream with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listContinuousTestResults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listContinuousTestResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listContinuousTestResults, request), + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listContinuousTestResults without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult(), + ), + ]; + client.descriptors.page.listContinuousTestResults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[] = + []; + const iterable = client.listContinuousTestResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listContinuousTestResults with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listContinuousTestResults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listContinuousTestResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 environmentsModule.v3.EnvironmentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 environmentsModule.v3.EnvironmentsClient({ + 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 environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 environmentsModule.v3.EnvironmentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 environmentsModule.v3.EnvironmentsClient({ + 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 environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 environmentsModule.v3.EnvironmentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 environmentsModule.v3.EnvironmentsClient({ + 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 environmentsModule.v3.EnvironmentsClient({ + 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.IOperation[] = []; + 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 environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_environments_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_environments_v3beta1.ts new file mode 100644 index 000000000000..c2f28c1ff224 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_environments_v3beta1.ts @@ -0,0 +1,5581 @@ +// Copyright 2026 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 environmentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.EnvironmentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + environmentsModule.v3beta1.EnvironmentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + environmentsModule.v3beta1.EnvironmentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new environmentsModule.v3beta1.EnvironmentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new environmentsModule.v3beta1.EnvironmentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = environmentsModule.v3beta1.EnvironmentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + await client.initialize(); + assert(client.environmentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.environmentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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('getEnvironment', () => { + it('invokes getEnvironment without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ); + client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.getEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ); + client.innerApiCalls.getEnvironment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEnvironment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEnvironment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with closed client', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getEnvironment(request), expectedError); + }); + }); + + describe('deleteEnvironment', () => { + it('invokes deleteEnvironment without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteEnvironment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEnvironment( + 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.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with closed client', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteEnvironment(request), expectedError); + }); + }); + + describe('createEnvironment', () => { + it('invokes createEnvironment without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with call error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with LRO error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkCreateEnvironmentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateEnvironmentProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateEnvironment', () => { + it('invokes updateEnvironment without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with call error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with LRO error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(), + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest', + ['environment', 'name'], + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkUpdateEnvironmentProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateEnvironmentProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('runContinuousTest', () => { + it('invokes runContinuousTest without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runContinuousTest = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runContinuousTest(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runContinuousTest without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runContinuousTest = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runContinuousTest( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunContinuousTestMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runContinuousTest with call error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runContinuousTest = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.runContinuousTest(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runContinuousTest with LRO error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunContinuousTestRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runContinuousTest = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.runContinuousTest(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runContinuousTest as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunContinuousTestProgress without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkRunContinuousTestProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunContinuousTestProgress with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkRunContinuousTestProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deployFlow', () => { + it('invokes deployFlow without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deployFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployFlow without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deployFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IDeployFlowMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployFlow with call error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deployFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployFlow with LRO error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeployFlowRequest', + ['environment'], + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deployFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployFlowProgress without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkDeployFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployFlowProgress with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeployFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listEnvironments', () => { + it('invokes listEnvironments without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.innerApiCalls.listEnvironments = stubSimpleCall(expectedResponse); + const [response] = await client.listEnvironments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.innerApiCalls.listEnvironments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEnvironments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEnvironments = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listEnvironments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironmentsStream without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.descriptors.page.listEnvironments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Environment) => { + 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.listEnvironments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEnvironments, request), + ); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listEnvironmentsStream with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Environment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEnvironments, request), + ); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEnvironments without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.descriptors.page.listEnvironments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[] = + []; + const iterable = client.listEnvironmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEnvironments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEnvironments with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEnvironmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEnvironments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('lookupEnvironmentHistory', () => { + it('invokes lookupEnvironmentHistory without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.innerApiCalls.lookupEnvironmentHistory = + stubSimpleCall(expectedResponse); + const [response] = await client.lookupEnvironmentHistory(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupEnvironmentHistory without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.innerApiCalls.lookupEnvironmentHistory = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupEnvironmentHistory( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupEnvironmentHistory with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupEnvironmentHistory = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.lookupEnvironmentHistory(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupEnvironmentHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupEnvironmentHistoryStream without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.descriptors.page.lookupEnvironmentHistory.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.lookupEnvironmentHistoryStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Environment) => { + 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.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.lookupEnvironmentHistory, request), + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes lookupEnvironmentHistoryStream with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.lookupEnvironmentHistory.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.lookupEnvironmentHistoryStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Environment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Environment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.lookupEnvironmentHistory, request), + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with lookupEnvironmentHistory without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Environment(), + ), + ]; + client.descriptors.page.lookupEnvironmentHistory.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[] = + []; + const iterable = client.lookupEnvironmentHistoryAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with lookupEnvironmentHistory with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.lookupEnvironmentHistory.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.lookupEnvironmentHistoryAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IEnvironment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.lookupEnvironmentHistory + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('listContinuousTestResults', () => { + it('invokes listContinuousTestResults without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + ]; + client.innerApiCalls.listContinuousTestResults = + stubSimpleCall(expectedResponse); + const [response] = await client.listContinuousTestResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContinuousTestResults without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + ]; + client.innerApiCalls.listContinuousTestResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listContinuousTestResults( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContinuousTestResults with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listContinuousTestResults = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listContinuousTestResults(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContinuousTestResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContinuousTestResultsStream without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + ]; + client.descriptors.page.listContinuousTestResults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listContinuousTestResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult, + ) => { + 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.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listContinuousTestResults, request), + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listContinuousTestResultsStream with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listContinuousTestResults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listContinuousTestResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listContinuousTestResults, request), + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listContinuousTestResults without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ContinuousTestResult(), + ), + ]; + client.descriptors.page.listContinuousTestResults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[] = + []; + const iterable = client.listContinuousTestResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listContinuousTestResults with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListContinuousTestResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listContinuousTestResults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listContinuousTestResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IContinuousTestResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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 environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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 environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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 environmentsModule.v3beta1.EnvironmentsClient({ + 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.IOperation[] = []; + 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 environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_examples_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_examples_v3.ts new file mode 100644 index 000000000000..49cc5099dd4c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_examples_v3.ts @@ -0,0 +1,4240 @@ +// Copyright 2026 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 examplesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.ExamplesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new examplesModule.v3.ExamplesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new examplesModule.v3.ExamplesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = examplesModule.v3.ExamplesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = examplesModule.v3.ExamplesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new examplesModule.v3.ExamplesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new examplesModule.v3.ExamplesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new examplesModule.v3.ExamplesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new examplesModule.v3.ExamplesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new examplesModule.v3.ExamplesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = examplesModule.v3.ExamplesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new examplesModule.v3.ExamplesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new examplesModule.v3.ExamplesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.examplesStub, undefined); + await client.initialize(); + assert(client.examplesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.examplesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.examplesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new examplesModule.v3.ExamplesClient({ + 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 examplesModule.v3.ExamplesClient({ + 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('createExample', () => { + it('invokes createExample without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ); + client.innerApiCalls.createExample = stubSimpleCall(expectedResponse); + const [response] = await client.createExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample without error using callback', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ); + client.innerApiCalls.createExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExample( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExample | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with closed client', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createExample(request), expectedError); + }); + }); + + describe('deleteExample', () => { + it('invokes deleteExample without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExample = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample without error using callback', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExample( + 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.deleteExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with closed client', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteExample(request), expectedError); + }); + }); + + describe('getExample', () => { + it('invokes getExample without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ); + client.innerApiCalls.getExample = stubSimpleCall(expectedResponse); + const [response] = await client.getExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample without error using callback', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ); + client.innerApiCalls.getExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExample( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExample | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with closed client', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getExample(request), expectedError); + }); + }); + + describe('updateExample', () => { + it('invokes updateExample without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ); + client.innerApiCalls.updateExample = stubSimpleCall(expectedResponse); + const [response] = await client.updateExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample without error using callback', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ); + client.innerApiCalls.updateExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExample( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExample | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with closed client', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateExample(request), expectedError); + }); + }); + + describe('listExamples', () => { + it('invokes listExamples without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + ]; + client.innerApiCalls.listExamples = stubSimpleCall(expectedResponse); + const [response] = await client.listExamples(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples without error using callback', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + ]; + client.innerApiCalls.listExamples = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExamples( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExample[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExamples = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listExamples(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamplesStream without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + ]; + client.descriptors.page.listExamples.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Example[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Example) => { + 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.listExamples.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExamples, request), + ); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listExamplesStream with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Example[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Example) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExamples, request), + ); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExamples without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Example(), + ), + ]; + client.descriptors.page.listExamples.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IExample[] = []; + const iterable = client.listExamplesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExamples.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExamples with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExamplesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IExample[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExamples.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 examplesModule.v3.ExamplesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 examplesModule.v3.ExamplesClient({ + 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 examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 examplesModule.v3.ExamplesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 examplesModule.v3.ExamplesClient({ + 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 examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 examplesModule.v3.ExamplesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 examplesModule.v3.ExamplesClient({ + 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 examplesModule.v3.ExamplesClient({ + 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.IOperation[] = []; + 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 examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new examplesModule.v3.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_examples_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_examples_v3beta1.ts new file mode 100644 index 000000000000..216b1965ee40 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_examples_v3beta1.ts @@ -0,0 +1,4007 @@ +// Copyright 2026 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 examplesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.ExamplesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new examplesModule.v3beta1.ExamplesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new examplesModule.v3beta1.ExamplesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = examplesModule.v3beta1.ExamplesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = examplesModule.v3beta1.ExamplesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new examplesModule.v3beta1.ExamplesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new examplesModule.v3beta1.ExamplesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new examplesModule.v3beta1.ExamplesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = examplesModule.v3beta1.ExamplesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new examplesModule.v3beta1.ExamplesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.examplesStub, undefined); + await client.initialize(); + assert(client.examplesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.examplesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.examplesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new examplesModule.v3beta1.ExamplesClient({ + 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 examplesModule.v3beta1.ExamplesClient({ + 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('createExample', () => { + it('invokes createExample without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ); + client.innerApiCalls.createExample = stubSimpleCall(expectedResponse); + const [response] = await client.createExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample without error using callback', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ); + client.innerApiCalls.createExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExample( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExample | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with closed client', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExampleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createExample(request), expectedError); + }); + }); + + describe('deleteExample', () => { + it('invokes deleteExample without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExample = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample without error using callback', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExample( + 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.deleteExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with closed client', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteExample(request), expectedError); + }); + }); + + describe('getExample', () => { + it('invokes getExample without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ); + client.innerApiCalls.getExample = stubSimpleCall(expectedResponse); + const [response] = await client.getExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample without error using callback', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ); + client.innerApiCalls.getExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExample( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExample | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with closed client', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExampleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getExample(request), expectedError); + }); + }); + + describe('updateExample', () => { + it('invokes updateExample without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ); + client.innerApiCalls.updateExample = stubSimpleCall(expectedResponse); + const [response] = await client.updateExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample without error using callback', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ); + client.innerApiCalls.updateExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExample( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExample | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExample = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with closed client', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest(), + ); + request.example ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExampleRequest', + ['example', 'name'], + ); + request.example.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateExample(request), expectedError); + }); + }); + + describe('listExamples', () => { + it('invokes listExamples without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + ]; + client.innerApiCalls.listExamples = stubSimpleCall(expectedResponse); + const [response] = await client.listExamples(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples without error using callback', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + ]; + client.innerApiCalls.listExamples = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExamples( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IExample[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExamples = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listExamples(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamplesStream without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + ]; + client.descriptors.page.listExamples.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Example[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Example) => { + 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.listExamples.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExamples, request), + ); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listExamplesStream with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Example[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Example) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExamples, request), + ); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExamples without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Example(), + ), + ]; + client.descriptors.page.listExamples.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IExample[] = + []; + const iterable = client.listExamplesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExamples.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExamples with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExamplesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExamplesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IExample[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExamples.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new examplesModule.v3beta1.ExamplesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_experiments_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_experiments_v3.ts new file mode 100644 index 000000000000..3f273f553fc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_experiments_v3.ts @@ -0,0 +1,4503 @@ +// Copyright 2026 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 experimentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.ExperimentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new experimentsModule.v3.ExperimentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new experimentsModule.v3.ExperimentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = experimentsModule.v3.ExperimentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = experimentsModule.v3.ExperimentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new experimentsModule.v3.ExperimentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new experimentsModule.v3.ExperimentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new experimentsModule.v3.ExperimentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new experimentsModule.v3.ExperimentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new experimentsModule.v3.ExperimentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = experimentsModule.v3.ExperimentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new experimentsModule.v3.ExperimentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new experimentsModule.v3.ExperimentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.experimentsStub, undefined); + await client.initialize(); + assert(client.experimentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.experimentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.experimentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new experimentsModule.v3.ExperimentsClient({ + 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 experimentsModule.v3.ExperimentsClient({ + 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('getExperiment', () => { + it('invokes getExperiment without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.getExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.getExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExperiment without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.getExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExperiment with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExperiment with closed client', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getExperiment(request), expectedError); + }); + }); + + describe('createExperiment', () => { + it('invokes createExperiment without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.createExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.createExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExperiment without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.createExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExperiment with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExperiment with closed client', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createExperiment(request), expectedError); + }); + }); + + describe('updateExperiment', () => { + it('invokes updateExperiment without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedHeaderRequestParams = `experiment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.updateExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.updateExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExperiment without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedHeaderRequestParams = `experiment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.updateExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExperiment with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedHeaderRequestParams = `experiment.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExperiment with closed client', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateExperiment(request), expectedError); + }); + }); + + describe('deleteExperiment', () => { + it('invokes deleteExperiment without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExperiment without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExperiment( + 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.deleteExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExperiment with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExperiment with closed client', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteExperiment(request), expectedError); + }); + }); + + describe('startExperiment', () => { + it('invokes startExperiment without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.startExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.startExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startExperiment without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.startExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startExperiment with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.startExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startExperiment with closed client', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.startExperiment(request), expectedError); + }); + }); + + describe('stopExperiment', () => { + it('invokes stopExperiment without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.stopExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.stopExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopExperiment without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ); + client.innerApiCalls.stopExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopExperiment with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.stopExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopExperiment with closed client', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.stopExperiment(request), expectedError); + }); + }); + + describe('listExperiments', () => { + it('invokes listExperiments without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + ]; + client.innerApiCalls.listExperiments = stubSimpleCall(expectedResponse); + const [response] = await client.listExperiments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExperiments without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + ]; + client.innerApiCalls.listExperiments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExperiments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IExperiment[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExperiments with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExperiments = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listExperiments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExperimentsStream without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + ]; + client.descriptors.page.listExperiments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Experiment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Experiment) => { + 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.listExperiments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExperiments, request), + ); + assert( + (client.descriptors.page.listExperiments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listExperimentsStream with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExperiments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Experiment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Experiment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExperiments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExperiments, request), + ); + assert( + (client.descriptors.page.listExperiments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExperiments without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Experiment(), + ), + ]; + client.descriptors.page.listExperiments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IExperiment[] = []; + const iterable = client.listExperimentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExperiments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExperiments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExperiments with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExperiments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExperimentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IExperiment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExperiments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExperiments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 experimentsModule.v3.ExperimentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 experimentsModule.v3.ExperimentsClient({ + 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 experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 experimentsModule.v3.ExperimentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 experimentsModule.v3.ExperimentsClient({ + 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 experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 experimentsModule.v3.ExperimentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 experimentsModule.v3.ExperimentsClient({ + 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 experimentsModule.v3.ExperimentsClient({ + 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.IOperation[] = []; + 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 experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_experiments_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_experiments_v3beta1.ts new file mode 100644 index 000000000000..5aec5e29d5df --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_experiments_v3beta1.ts @@ -0,0 +1,4271 @@ +// Copyright 2026 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 experimentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.ExperimentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new experimentsModule.v3beta1.ExperimentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new experimentsModule.v3beta1.ExperimentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + experimentsModule.v3beta1.ExperimentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + experimentsModule.v3beta1.ExperimentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new experimentsModule.v3beta1.ExperimentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new experimentsModule.v3beta1.ExperimentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = experimentsModule.v3beta1.ExperimentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new experimentsModule.v3beta1.ExperimentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.experimentsStub, undefined); + await client.initialize(); + assert(client.experimentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.experimentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.experimentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + 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 experimentsModule.v3beta1.ExperimentsClient({ + 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('getExperiment', () => { + it('invokes getExperiment without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.getExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.getExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExperiment without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.getExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExperiment with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExperiment with closed client', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getExperiment(request), expectedError); + }); + }); + + describe('createExperiment', () => { + it('invokes createExperiment without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.createExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.createExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExperiment without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.createExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExperiment with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExperiment with closed client', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateExperimentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createExperiment(request), expectedError); + }); + }); + + describe('updateExperiment', () => { + it('invokes updateExperiment without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedHeaderRequestParams = `experiment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.updateExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.updateExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExperiment without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedHeaderRequestParams = `experiment.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.updateExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExperiment with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedHeaderRequestParams = `experiment.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExperiment with closed client', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest(), + ); + request.experiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateExperimentRequest', + ['experiment', 'name'], + ); + request.experiment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateExperiment(request), expectedError); + }); + }); + + describe('deleteExperiment', () => { + it('invokes deleteExperiment without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExperiment without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExperiment( + 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.deleteExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExperiment with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExperiment with closed client', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteExperiment(request), expectedError); + }); + }); + + describe('startExperiment', () => { + it('invokes startExperiment without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.startExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.startExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startExperiment without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.startExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startExperiment with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.startExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startExperiment with closed client', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StartExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.startExperiment(request), expectedError); + }); + }); + + describe('stopExperiment', () => { + it('invokes stopExperiment without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.stopExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.stopExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopExperiment without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ); + client.innerApiCalls.stopExperiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopExperiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IExperiment | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopExperiment with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopExperiment = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.stopExperiment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopExperiment with closed client', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.StopExperimentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.stopExperiment(request), expectedError); + }); + }); + + describe('listExperiments', () => { + it('invokes listExperiments without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + ]; + client.innerApiCalls.listExperiments = stubSimpleCall(expectedResponse); + const [response] = await client.listExperiments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExperiments without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + ]; + client.innerApiCalls.listExperiments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExperiments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IExperiment[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExperiments with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExperiments = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listExperiments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExperimentsStream without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + ]; + client.descriptors.page.listExperiments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Experiment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Experiment) => { + 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.listExperiments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExperiments, request), + ); + assert( + (client.descriptors.page.listExperiments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listExperimentsStream with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExperiments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Experiment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Experiment) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExperiments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExperiments, request), + ); + assert( + (client.descriptors.page.listExperiments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExperiments without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Experiment(), + ), + ]; + client.descriptors.page.listExperiments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IExperiment[] = + []; + const iterable = client.listExperimentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExperiments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExperiments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExperiments with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListExperimentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExperiments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExperimentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IExperiment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExperiments.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExperiments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new experimentsModule.v3beta1.ExperimentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_flows_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_flows_v3.ts new file mode 100644 index 000000000000..413d71cd2d29 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_flows_v3.ts @@ -0,0 +1,5088 @@ +// Copyright 2026 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 flowsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.FlowsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new flowsModule.v3.FlowsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new flowsModule.v3.FlowsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = flowsModule.v3.FlowsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = flowsModule.v3.FlowsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new flowsModule.v3.FlowsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new flowsModule.v3.FlowsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new flowsModule.v3.FlowsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new flowsModule.v3.FlowsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new flowsModule.v3.FlowsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = flowsModule.v3.FlowsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new flowsModule.v3.FlowsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new flowsModule.v3.FlowsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.flowsStub, undefined); + await client.initialize(); + assert(client.flowsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.flowsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.flowsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new flowsModule.v3.FlowsClient({ + 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 flowsModule.v3.FlowsClient({ + 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('createFlow', () => { + it('invokes createFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Flow(), + ); + client.innerApiCalls.createFlow = stubSimpleCall(expectedResponse); + const [response] = await client.createFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Flow(), + ); + client.innerApiCalls.createFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IFlow | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFlow with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFlow with closed client', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createFlow(request), expectedError); + }); + }); + + describe('deleteFlow', () => { + it('invokes deleteFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteFlow = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFlow( + 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.deleteFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFlow with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFlow with closed client', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteFlow(request), expectedError); + }); + }); + + describe('getFlow', () => { + it('invokes getFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Flow(), + ); + client.innerApiCalls.getFlow = stubSimpleCall(expectedResponse); + const [response] = await client.getFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFlow as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Flow(), + ); + client.innerApiCalls.getFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IFlow | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFlow as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlow with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFlow = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFlow(request), expectedError); + const actualRequest = (client.innerApiCalls.getFlow as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlow with closed client', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getFlow(request), expectedError); + }); + }); + + describe('updateFlow', () => { + it('invokes updateFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedHeaderRequestParams = `flow.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Flow(), + ); + client.innerApiCalls.updateFlow = stubSimpleCall(expectedResponse); + const [response] = await client.updateFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedHeaderRequestParams = `flow.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Flow(), + ); + client.innerApiCalls.updateFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IFlow | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFlow with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedHeaderRequestParams = `flow.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFlow with closed client', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateFlow(request), expectedError); + }); + }); + + describe('validateFlow', () => { + it('invokes validateFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FlowValidationResult(), + ); + client.innerApiCalls.validateFlow = stubSimpleCall(expectedResponse); + const [response] = await client.validateFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FlowValidationResult(), + ); + client.innerApiCalls.validateFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateFlow with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.validateFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateFlow with closed client', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.validateFlow(request), expectedError); + }); + }); + + describe('getFlowValidationResult', () => { + it('invokes getFlowValidationResult without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FlowValidationResult(), + ); + client.innerApiCalls.getFlowValidationResult = + stubSimpleCall(expectedResponse); + const [response] = await client.getFlowValidationResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlowValidationResult without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FlowValidationResult(), + ); + client.innerApiCalls.getFlowValidationResult = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFlowValidationResult( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IFlowValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlowValidationResult with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFlowValidationResult = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getFlowValidationResult(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlowValidationResult with closed client', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getFlowValidationResult(request), + expectedError, + ); + }); + }); + + describe('trainFlow', () => { + it('invokes trainFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.trainFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.trainFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.trainFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.trainFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainFlow with call error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.trainFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainFlow with LRO error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.trainFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTrainFlowProgress without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkTrainFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTrainFlowProgress with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkTrainFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importFlow', () => { + it('invokes importFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.importFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportFlowResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importFlow with call error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importFlow with LRO error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportFlowProgress without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportFlowProgress with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkImportFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportFlow', () => { + it('invokes exportFlow without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportFlow without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportFlowResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportFlow with call error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportFlow with LRO error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportFlowProgress without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportFlowProgress with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkExportFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listFlows', () => { + it('invokes listFlows without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + ]; + client.innerApiCalls.listFlows = stubSimpleCall(expectedResponse); + const [response] = await client.listFlows(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFlows without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + ]; + client.innerApiCalls.listFlows = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFlows( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IFlow[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFlows with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFlows = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFlows(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFlowsStream without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + ]; + client.descriptors.page.listFlows.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFlowsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Flow[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Flow) => { + 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.listFlows.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFlows, request), + ); + assert( + (client.descriptors.page.listFlows.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listFlowsStream with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFlows.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listFlowsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Flow[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Flow) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listFlows.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFlows, request), + ); + assert( + (client.descriptors.page.listFlows.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listFlows without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Flow()), + ]; + client.descriptors.page.listFlows.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IFlow[] = []; + const iterable = client.listFlowsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFlows.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listFlows.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listFlows with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFlows.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listFlowsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IFlow[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFlows.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listFlows.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 flowsModule.v3.FlowsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 flowsModule.v3.FlowsClient({ + 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 flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 flowsModule.v3.FlowsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 flowsModule.v3.FlowsClient({ + 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 flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 flowsModule.v3.FlowsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 flowsModule.v3.FlowsClient({ + 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 flowsModule.v3.FlowsClient({ + 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.IOperation[] = []; + 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 flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_flows_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_flows_v3beta1.ts new file mode 100644 index 000000000000..9cf335d441c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_flows_v3beta1.ts @@ -0,0 +1,5188 @@ +// Copyright 2026 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 flowsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.FlowsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new flowsModule.v3beta1.FlowsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new flowsModule.v3beta1.FlowsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = flowsModule.v3beta1.FlowsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = flowsModule.v3beta1.FlowsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new flowsModule.v3beta1.FlowsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new flowsModule.v3beta1.FlowsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new flowsModule.v3beta1.FlowsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new flowsModule.v3beta1.FlowsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new flowsModule.v3beta1.FlowsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = flowsModule.v3beta1.FlowsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new flowsModule.v3beta1.FlowsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new flowsModule.v3beta1.FlowsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.flowsStub, undefined); + await client.initialize(); + assert(client.flowsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.flowsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.flowsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new flowsModule.v3beta1.FlowsClient({ + 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 flowsModule.v3beta1.FlowsClient({ + 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('createFlow', () => { + it('invokes createFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ); + client.innerApiCalls.createFlow = stubSimpleCall(expectedResponse); + const [response] = await client.createFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ); + client.innerApiCalls.createFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IFlow | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFlow with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFlow with closed client', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createFlow(request), expectedError); + }); + }); + + describe('deleteFlow', () => { + it('invokes deleteFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteFlow = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFlow( + 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.deleteFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFlow with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFlow with closed client', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteFlow(request), expectedError); + }); + }); + + describe('getFlow', () => { + it('invokes getFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ); + client.innerApiCalls.getFlow = stubSimpleCall(expectedResponse); + const [response] = await client.getFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFlow as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ); + client.innerApiCalls.getFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IFlow | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFlow as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlow with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFlow = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFlow(request), expectedError); + const actualRequest = (client.innerApiCalls.getFlow as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlow with closed client', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getFlow(request), expectedError); + }); + }); + + describe('updateFlow', () => { + it('invokes updateFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedHeaderRequestParams = `flow.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ); + client.innerApiCalls.updateFlow = stubSimpleCall(expectedResponse); + const [response] = await client.updateFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedHeaderRequestParams = `flow.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ); + client.innerApiCalls.updateFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IFlow | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFlow with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedHeaderRequestParams = `flow.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFlow with closed client', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(), + ); + request.flow ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest', + ['flow', 'name'], + ); + request.flow.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateFlow(request), expectedError); + }); + }); + + describe('validateFlow', () => { + it('invokes validateFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult(), + ); + client.innerApiCalls.validateFlow = stubSimpleCall(expectedResponse); + const [response] = await client.validateFlow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult(), + ); + client.innerApiCalls.validateFlow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateFlow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateFlow with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateFlow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.validateFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateFlow with closed client', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.validateFlow(request), expectedError); + }); + }); + + describe('getFlowValidationResult', () => { + it('invokes getFlowValidationResult without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult(), + ); + client.innerApiCalls.getFlowValidationResult = + stubSimpleCall(expectedResponse); + const [response] = await client.getFlowValidationResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlowValidationResult without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult(), + ); + client.innerApiCalls.getFlowValidationResult = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFlowValidationResult( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IFlowValidationResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlowValidationResult with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFlowValidationResult = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getFlowValidationResult(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFlowValidationResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFlowValidationResult with closed client', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getFlowValidationResult(request), + expectedError, + ); + }); + }); + + describe('trainFlow', () => { + it('invokes trainFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.trainFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.trainFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.trainFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.trainFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainFlow with call error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.trainFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainFlow with LRO error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.trainFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.trainFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTrainFlowProgress without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkTrainFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTrainFlowProgress with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkTrainFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importFlow', () => { + it('invokes importFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.importFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportFlowResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importFlow with call error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importFlow with LRO error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportFlowProgress without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportFlowProgress with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkImportFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportFlow', () => { + it('invokes exportFlow without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportFlow = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportFlow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportFlow without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportFlow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportFlow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportFlowResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportFlow with call error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFlow = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportFlow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportFlow with LRO error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFlow = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportFlow(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFlow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportFlowProgress without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportFlowProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportFlowProgress with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkExportFlowProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listFlows', () => { + it('invokes listFlows without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + ]; + client.innerApiCalls.listFlows = stubSimpleCall(expectedResponse); + const [response] = await client.listFlows(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFlows without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + ]; + client.innerApiCalls.listFlows = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFlows( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IFlow[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFlows with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFlows = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFlows(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFlows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFlowsStream without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + ]; + client.descriptors.page.listFlows.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFlowsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Flow[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Flow) => { + 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.listFlows.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFlows, request), + ); + assert( + (client.descriptors.page.listFlows.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listFlowsStream with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFlows.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listFlowsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Flow[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Flow) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listFlows.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFlows, request), + ); + assert( + (client.descriptors.page.listFlows.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listFlows without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Flow(), + ), + ]; + client.descriptors.page.listFlows.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IFlow[] = []; + const iterable = client.listFlowsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFlows.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listFlows.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listFlows with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFlows.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listFlowsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IFlow[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFlows.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listFlows.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 flowsModule.v3beta1.FlowsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 flowsModule.v3beta1.FlowsClient({ + 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 flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 flowsModule.v3beta1.FlowsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 flowsModule.v3beta1.FlowsClient({ + 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 flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 flowsModule.v3beta1.FlowsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 flowsModule.v3beta1.FlowsClient({ + 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 flowsModule.v3beta1.FlowsClient({ + 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.IOperation[] = []; + 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 flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_generators_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_generators_v3.ts new file mode 100644 index 000000000000..745984b2049f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_generators_v3.ts @@ -0,0 +1,4238 @@ +// Copyright 2026 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 generatorsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.GeneratorsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new generatorsModule.v3.GeneratorsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new generatorsModule.v3.GeneratorsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = generatorsModule.v3.GeneratorsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = generatorsModule.v3.GeneratorsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new generatorsModule.v3.GeneratorsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new generatorsModule.v3.GeneratorsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new generatorsModule.v3.GeneratorsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new generatorsModule.v3.GeneratorsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new generatorsModule.v3.GeneratorsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = generatorsModule.v3.GeneratorsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new generatorsModule.v3.GeneratorsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new generatorsModule.v3.GeneratorsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.generatorsStub, undefined); + await client.initialize(); + assert(client.generatorsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.generatorsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.generatorsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new generatorsModule.v3.GeneratorsClient({ + 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 generatorsModule.v3.GeneratorsClient({ + 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('getGenerator', () => { + it('invokes getGenerator without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ); + client.innerApiCalls.getGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.getGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerator without error using callback', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ); + client.innerApiCalls.getGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGenerator( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IGenerator | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerator with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerator with closed client', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getGenerator(request), expectedError); + }); + }); + + describe('createGenerator', () => { + it('invokes createGenerator without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ); + client.innerApiCalls.createGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.createGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGenerator without error using callback', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ); + client.innerApiCalls.createGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGenerator( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IGenerator | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGenerator with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGenerator with closed client', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createGenerator(request), expectedError); + }); + }); + + describe('updateGenerator', () => { + it('invokes updateGenerator without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedHeaderRequestParams = `generator.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ); + client.innerApiCalls.updateGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.updateGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerator without error using callback', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedHeaderRequestParams = `generator.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ); + client.innerApiCalls.updateGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGenerator( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IGenerator | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerator with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedHeaderRequestParams = `generator.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerator with closed client', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateGenerator(request), expectedError); + }); + }); + + describe('deleteGenerator', () => { + it('invokes deleteGenerator without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.deleteGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGenerator without error using callback', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGenerator( + 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.deleteGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGenerator with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGenerator with closed client', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteGenerator(request), expectedError); + }); + }); + + describe('listGenerators', () => { + it('invokes listGenerators without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + ]; + client.innerApiCalls.listGenerators = stubSimpleCall(expectedResponse); + const [response] = await client.listGenerators(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGenerators without error using callback', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + ]; + client.innerApiCalls.listGenerators = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGenerators( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IGenerator[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGenerators with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGenerators = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listGenerators(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGeneratorsStream without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + ]; + client.descriptors.page.listGenerators.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGeneratorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Generator[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Generator) => { + 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.listGenerators.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGenerators, request), + ); + assert( + (client.descriptors.page.listGenerators.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listGeneratorsStream with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGenerators.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGeneratorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Generator[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Generator) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listGenerators.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGenerators, request), + ); + assert( + (client.descriptors.page.listGenerators.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listGenerators without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Generator(), + ), + ]; + client.descriptors.page.listGenerators.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IGenerator[] = []; + const iterable = client.listGeneratorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGenerators.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listGenerators.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listGenerators with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGenerators.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGeneratorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IGenerator[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGenerators.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listGenerators.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 generatorsModule.v3.GeneratorsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 generatorsModule.v3.GeneratorsClient({ + 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 generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 generatorsModule.v3.GeneratorsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 generatorsModule.v3.GeneratorsClient({ + 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 generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 generatorsModule.v3.GeneratorsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 generatorsModule.v3.GeneratorsClient({ + 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 generatorsModule.v3.GeneratorsClient({ + 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.IOperation[] = []; + 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 generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new generatorsModule.v3.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_generators_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_generators_v3beta1.ts new file mode 100644 index 000000000000..3a6ae3af3f25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_generators_v3beta1.ts @@ -0,0 +1,4007 @@ +// Copyright 2026 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 generatorsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.GeneratorsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new generatorsModule.v3beta1.GeneratorsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new generatorsModule.v3beta1.GeneratorsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + generatorsModule.v3beta1.GeneratorsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + generatorsModule.v3beta1.GeneratorsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new generatorsModule.v3beta1.GeneratorsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new generatorsModule.v3beta1.GeneratorsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = generatorsModule.v3beta1.GeneratorsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new generatorsModule.v3beta1.GeneratorsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.generatorsStub, undefined); + await client.initialize(); + assert(client.generatorsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.generatorsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.generatorsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + 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 generatorsModule.v3beta1.GeneratorsClient({ + 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('getGenerator', () => { + it('invokes getGenerator without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ); + client.innerApiCalls.getGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.getGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerator without error using callback', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ); + client.innerApiCalls.getGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGenerator( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IGenerator | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerator with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGenerator with closed client', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getGenerator(request), expectedError); + }); + }); + + describe('createGenerator', () => { + it('invokes createGenerator without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ); + client.innerApiCalls.createGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.createGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGenerator without error using callback', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ); + client.innerApiCalls.createGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGenerator( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IGenerator | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGenerator with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGenerator with closed client', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createGenerator(request), expectedError); + }); + }); + + describe('updateGenerator', () => { + it('invokes updateGenerator without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedHeaderRequestParams = `generator.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ); + client.innerApiCalls.updateGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.updateGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerator without error using callback', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedHeaderRequestParams = `generator.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ); + client.innerApiCalls.updateGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGenerator( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IGenerator | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerator with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedHeaderRequestParams = `generator.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGenerator with closed client', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest(), + ); + request.generator ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest', + ['generator', 'name'], + ); + request.generator.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateGenerator(request), expectedError); + }); + }); + + describe('deleteGenerator', () => { + it('invokes deleteGenerator without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteGenerator = stubSimpleCall(expectedResponse); + const [response] = await client.deleteGenerator(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGenerator without error using callback', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteGenerator = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGenerator( + 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.deleteGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGenerator with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGenerator = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteGenerator(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGenerator as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGenerator with closed client', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteGenerator(request), expectedError); + }); + }); + + describe('listGenerators', () => { + it('invokes listGenerators without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + ]; + client.innerApiCalls.listGenerators = stubSimpleCall(expectedResponse); + const [response] = await client.listGenerators(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGenerators without error using callback', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + ]; + client.innerApiCalls.listGenerators = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGenerators( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IGenerator[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGenerators with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGenerators = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listGenerators(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGenerators as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGeneratorsStream without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + ]; + client.descriptors.page.listGenerators.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGeneratorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Generator[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Generator) => { + 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.listGenerators.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGenerators, request), + ); + assert( + (client.descriptors.page.listGenerators.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listGeneratorsStream with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGenerators.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGeneratorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Generator[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Generator) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listGenerators.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGenerators, request), + ); + assert( + (client.descriptors.page.listGenerators.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listGenerators without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Generator(), + ), + ]; + client.descriptors.page.listGenerators.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IGenerator[] = + []; + const iterable = client.listGeneratorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGenerators.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listGenerators.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listGenerators with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGenerators.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGeneratorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IGenerator[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGenerators.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listGenerators.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new generatorsModule.v3beta1.GeneratorsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_intents_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_intents_v3.ts new file mode 100644 index 000000000000..b66a69cc7536 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_intents_v3.ts @@ -0,0 +1,4664 @@ +// Copyright 2026 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 intentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.IntentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new intentsModule.v3.IntentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new intentsModule.v3.IntentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = intentsModule.v3.IntentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = intentsModule.v3.IntentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new intentsModule.v3.IntentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new intentsModule.v3.IntentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new intentsModule.v3.IntentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new intentsModule.v3.IntentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new intentsModule.v3.IntentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = intentsModule.v3.IntentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new intentsModule.v3.IntentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new intentsModule.v3.IntentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.intentsStub, undefined); + await client.initialize(); + assert(client.intentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.intentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.intentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new intentsModule.v3.IntentsClient({ + 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 intentsModule.v3.IntentsClient({ + 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('getIntent', () => { + it('invokes getIntent without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ); + client.innerApiCalls.getIntent = stubSimpleCall(expectedResponse); + const [response] = await client.getIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIntent without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ); + client.innerApiCalls.getIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IIntent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIntent with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIntent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIntent with closed client', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getIntent(request), expectedError); + }); + }); + + describe('createIntent', () => { + it('invokes createIntent without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ); + client.innerApiCalls.createIntent = stubSimpleCall(expectedResponse); + const [response] = await client.createIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIntent without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ); + client.innerApiCalls.createIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IIntent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIntent with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIntent with closed client', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createIntent(request), expectedError); + }); + }); + + describe('updateIntent', () => { + it('invokes updateIntent without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedHeaderRequestParams = `intent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ); + client.innerApiCalls.updateIntent = stubSimpleCall(expectedResponse); + const [response] = await client.updateIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIntent without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedHeaderRequestParams = `intent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ); + client.innerApiCalls.updateIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IIntent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIntent with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedHeaderRequestParams = `intent.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIntent with closed client', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateIntent(request), expectedError); + }); + }); + + describe('deleteIntent', () => { + it('invokes deleteIntent without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteIntent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIntent without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIntent( + 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.deleteIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIntent with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIntent with closed client', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteIntent(request), expectedError); + }); + }); + + describe('importIntents', () => { + it('invokes importIntents without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importIntents = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importIntents(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importIntents without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importIntents = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importIntents( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IImportIntentsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importIntents with call error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importIntents = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importIntents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importIntents with LRO error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importIntents = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importIntents(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportIntentsProgress without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportIntentsProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportIntentsProgress with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportIntentsProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportIntents', () => { + it('invokes exportIntents without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportIntents = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportIntents(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportIntents without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportIntents = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportIntents( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3.IExportIntentsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportIntents with call error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIntents = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportIntents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportIntents with LRO error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIntents = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportIntents(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportIntentsProgress without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportIntentsProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportIntentsProgress with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportIntentsProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listIntents', () => { + it('invokes listIntents without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + ]; + client.innerApiCalls.listIntents = stubSimpleCall(expectedResponse); + const [response] = await client.listIntents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIntents without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + ]; + client.innerApiCalls.listIntents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIntents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IIntent[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIntents with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIntents = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listIntents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIntentsStream without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + ]; + client.descriptors.page.listIntents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listIntentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Intent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Intent) => { + 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.listIntents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listIntents, request), + ); + assert( + (client.descriptors.page.listIntents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listIntentsStream with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listIntents.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listIntentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Intent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Intent) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listIntents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listIntents, request), + ); + assert( + (client.descriptors.page.listIntents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listIntents without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Intent(), + ), + ]; + client.descriptors.page.listIntents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IIntent[] = []; + const iterable = client.listIntentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listIntents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listIntents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listIntents with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listIntents.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listIntentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IIntent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listIntents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listIntents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 intentsModule.v3.IntentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 intentsModule.v3.IntentsClient({ + 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 intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 intentsModule.v3.IntentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 intentsModule.v3.IntentsClient({ + 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 intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 intentsModule.v3.IntentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 intentsModule.v3.IntentsClient({ + 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 intentsModule.v3.IntentsClient({ + 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.IOperation[] = []; + 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 intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_intents_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_intents_v3beta1.ts new file mode 100644 index 000000000000..d5820f7f88c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_intents_v3beta1.ts @@ -0,0 +1,4743 @@ +// Copyright 2026 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 intentsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.IntentsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new intentsModule.v3beta1.IntentsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new intentsModule.v3beta1.IntentsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = intentsModule.v3beta1.IntentsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = intentsModule.v3beta1.IntentsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new intentsModule.v3beta1.IntentsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new intentsModule.v3beta1.IntentsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new intentsModule.v3beta1.IntentsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new intentsModule.v3beta1.IntentsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new intentsModule.v3beta1.IntentsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = intentsModule.v3beta1.IntentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new intentsModule.v3beta1.IntentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new intentsModule.v3beta1.IntentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.intentsStub, undefined); + await client.initialize(); + assert(client.intentsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.intentsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.intentsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new intentsModule.v3beta1.IntentsClient({ + 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 intentsModule.v3beta1.IntentsClient({ + 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('getIntent', () => { + it('invokes getIntent without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ); + client.innerApiCalls.getIntent = stubSimpleCall(expectedResponse); + const [response] = await client.getIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIntent without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ); + client.innerApiCalls.getIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IIntent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIntent with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIntent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIntent with closed client', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getIntent(request), expectedError); + }); + }); + + describe('createIntent', () => { + it('invokes createIntent without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ); + client.innerApiCalls.createIntent = stubSimpleCall(expectedResponse); + const [response] = await client.createIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIntent without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ); + client.innerApiCalls.createIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IIntent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIntent with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIntent with closed client', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createIntent(request), expectedError); + }); + }); + + describe('updateIntent', () => { + it('invokes updateIntent without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedHeaderRequestParams = `intent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ); + client.innerApiCalls.updateIntent = stubSimpleCall(expectedResponse); + const [response] = await client.updateIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIntent without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedHeaderRequestParams = `intent.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ); + client.innerApiCalls.updateIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IIntent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIntent with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedHeaderRequestParams = `intent.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIntent with closed client', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(), + ); + request.intent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest', + ['intent', 'name'], + ); + request.intent.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateIntent(request), expectedError); + }); + }); + + describe('deleteIntent', () => { + it('invokes deleteIntent without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteIntent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIntent without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIntent( + 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.deleteIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIntent with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIntent with closed client', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteIntent(request), expectedError); + }); + }); + + describe('importIntents', () => { + it('invokes importIntents without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importIntents = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importIntents(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importIntents without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importIntents = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importIntents( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportIntentsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importIntents with call error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importIntents = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importIntents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importIntents with LRO error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importIntents = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importIntents(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportIntentsProgress without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportIntentsProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportIntentsProgress with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportIntentsProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportIntents', () => { + it('invokes exportIntents without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportIntents = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportIntents(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportIntents without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportIntents = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportIntents( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportIntentsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportIntents with call error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIntents = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportIntents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportIntents with LRO error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIntents = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportIntents(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportIntentsProgress without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportIntentsProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportIntentsProgress with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportIntentsProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listIntents', () => { + it('invokes listIntents without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + ]; + client.innerApiCalls.listIntents = stubSimpleCall(expectedResponse); + const [response] = await client.listIntents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIntents without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + ]; + client.innerApiCalls.listIntents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIntents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IIntent[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIntents with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIntents = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listIntents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIntents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIntentsStream without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + ]; + client.descriptors.page.listIntents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listIntentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Intent[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Intent) => { + 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.listIntents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listIntents, request), + ); + assert( + (client.descriptors.page.listIntents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listIntentsStream with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listIntents.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listIntentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Intent[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Intent) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listIntents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listIntents, request), + ); + assert( + (client.descriptors.page.listIntents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listIntents without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Intent(), + ), + ]; + client.descriptors.page.listIntents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IIntent[] = []; + const iterable = client.listIntentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listIntents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listIntents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listIntents with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listIntents.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listIntentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IIntent[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listIntents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listIntents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 intentsModule.v3beta1.IntentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 intentsModule.v3beta1.IntentsClient({ + 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 intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 intentsModule.v3beta1.IntentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 intentsModule.v3beta1.IntentsClient({ + 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 intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 intentsModule.v3beta1.IntentsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 intentsModule.v3beta1.IntentsClient({ + 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 intentsModule.v3beta1.IntentsClient({ + 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.IOperation[] = []; + 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 intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_pages_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_pages_v3.ts new file mode 100644 index 000000000000..ce38fa9c9865 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_pages_v3.ts @@ -0,0 +1,4210 @@ +// Copyright 2026 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 pagesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.PagesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new pagesModule.v3.PagesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new pagesModule.v3.PagesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = pagesModule.v3.PagesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = pagesModule.v3.PagesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new pagesModule.v3.PagesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new pagesModule.v3.PagesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new pagesModule.v3.PagesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new pagesModule.v3.PagesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new pagesModule.v3.PagesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = pagesModule.v3.PagesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new pagesModule.v3.PagesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new pagesModule.v3.PagesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.pagesStub, undefined); + await client.initialize(); + assert(client.pagesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.pagesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.pagesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new pagesModule.v3.PagesClient({ + 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 pagesModule.v3.PagesClient({ + 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('getPage', () => { + it('invokes getPage without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Page(), + ); + client.innerApiCalls.getPage = stubSimpleCall(expectedResponse); + const [response] = await client.getPage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPage as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPage without error using callback', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Page(), + ); + client.innerApiCalls.getPage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPage | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPage as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPage with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPage(request), expectedError); + const actualRequest = (client.innerApiCalls.getPage as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPage with closed client', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getPage(request), expectedError); + }); + }); + + describe('createPage', () => { + it('invokes createPage without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Page(), + ); + client.innerApiCalls.createPage = stubSimpleCall(expectedResponse); + const [response] = await client.createPage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPage without error using callback', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Page(), + ); + client.innerApiCalls.createPage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPage | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPage with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createPage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPage with closed client', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createPage(request), expectedError); + }); + }); + + describe('updatePage', () => { + it('invokes updatePage without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedHeaderRequestParams = `page.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Page(), + ); + client.innerApiCalls.updatePage = stubSimpleCall(expectedResponse); + const [response] = await client.updatePage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePage without error using callback', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedHeaderRequestParams = `page.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Page(), + ); + client.innerApiCalls.updatePage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPage | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePage with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedHeaderRequestParams = `page.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updatePage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePage with closed client', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updatePage(request), expectedError); + }); + }); + + describe('deletePage', () => { + it('invokes deletePage without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePage = stubSimpleCall(expectedResponse); + const [response] = await client.deletePage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePage without error using callback', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePage( + 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.deletePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePage with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deletePage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePage with closed client', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deletePage(request), expectedError); + }); + }); + + describe('listPages', () => { + it('invokes listPages without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + ]; + client.innerApiCalls.listPages = stubSimpleCall(expectedResponse); + const [response] = await client.listPages(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPages without error using callback', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + ]; + client.innerApiCalls.listPages = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPage[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPages with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPages = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPages(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPagesStream without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + ]; + client.descriptors.page.listPages.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Page[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Page) => { + 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.listPages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPages, request), + ); + assert( + (client.descriptors.page.listPages.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listPagesStream with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPages.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listPagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Page[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Page) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPages, request), + ); + assert( + (client.descriptors.page.listPages.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPages without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Page()), + ]; + client.descriptors.page.listPages.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IPage[] = []; + const iterable = client.listPagesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPages.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listPages.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPages with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPages.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listPagesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IPage[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPages.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listPages.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 pagesModule.v3.PagesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 pagesModule.v3.PagesClient({ + 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 pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 pagesModule.v3.PagesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 pagesModule.v3.PagesClient({ + 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 pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 pagesModule.v3.PagesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 pagesModule.v3.PagesClient({ + 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 pagesModule.v3.PagesClient({ + 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.IOperation[] = []; + 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 pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_pages_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_pages_v3beta1.ts new file mode 100644 index 000000000000..7a8d74f3168a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_pages_v3beta1.ts @@ -0,0 +1,3995 @@ +// Copyright 2026 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 pagesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.PagesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new pagesModule.v3beta1.PagesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new pagesModule.v3beta1.PagesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = pagesModule.v3beta1.PagesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = pagesModule.v3beta1.PagesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new pagesModule.v3beta1.PagesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new pagesModule.v3beta1.PagesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new pagesModule.v3beta1.PagesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new pagesModule.v3beta1.PagesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new pagesModule.v3beta1.PagesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = pagesModule.v3beta1.PagesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new pagesModule.v3beta1.PagesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new pagesModule.v3beta1.PagesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.pagesStub, undefined); + await client.initialize(); + assert(client.pagesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.pagesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.pagesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new pagesModule.v3beta1.PagesClient({ + 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 pagesModule.v3beta1.PagesClient({ + 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('getPage', () => { + it('invokes getPage without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ); + client.innerApiCalls.getPage = stubSimpleCall(expectedResponse); + const [response] = await client.getPage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPage as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPage without error using callback', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ); + client.innerApiCalls.getPage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPage | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPage as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPage with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPage(request), expectedError); + const actualRequest = (client.innerApiCalls.getPage as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPage with closed client', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getPage(request), expectedError); + }); + }); + + describe('createPage', () => { + it('invokes createPage without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ); + client.innerApiCalls.createPage = stubSimpleCall(expectedResponse); + const [response] = await client.createPage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPage without error using callback', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ); + client.innerApiCalls.createPage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPage | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPage with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createPage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPage with closed client', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createPage(request), expectedError); + }); + }); + + describe('updatePage', () => { + it('invokes updatePage without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedHeaderRequestParams = `page.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ); + client.innerApiCalls.updatePage = stubSimpleCall(expectedResponse); + const [response] = await client.updatePage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePage without error using callback', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedHeaderRequestParams = `page.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ); + client.innerApiCalls.updatePage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPage | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePage with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedHeaderRequestParams = `page.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updatePage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePage with closed client', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(), + ); + request.page ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest', + ['page', 'name'], + ); + request.page.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updatePage(request), expectedError); + }); + }); + + describe('deletePage', () => { + it('invokes deletePage without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePage = stubSimpleCall(expectedResponse); + const [response] = await client.deletePage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePage without error using callback', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePage( + 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.deletePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePage with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deletePage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePage with closed client', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deletePage(request), expectedError); + }); + }); + + describe('listPages', () => { + it('invokes listPages without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + ]; + client.innerApiCalls.listPages = stubSimpleCall(expectedResponse); + const [response] = await client.listPages(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPages without error using callback', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + ]; + client.innerApiCalls.listPages = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPage[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPages with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPages = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPages(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPagesStream without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + ]; + client.descriptors.page.listPages.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Page[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Page) => { + 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.listPages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPages, request), + ); + assert( + (client.descriptors.page.listPages.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listPagesStream with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPages.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listPagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Page[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Page) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPages, request), + ); + assert( + (client.descriptors.page.listPages.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPages without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Page(), + ), + ]; + client.descriptors.page.listPages.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IPage[] = []; + const iterable = client.listPagesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPages.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listPages.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPages with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPages.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listPagesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IPage[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPages.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listPages.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_playbooks_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_playbooks_v3.ts new file mode 100644 index 000000000000..3871166ab804 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_playbooks_v3.ts @@ -0,0 +1,5545 @@ +// Copyright 2026 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 playbooksModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.PlaybooksClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new playbooksModule.v3.PlaybooksClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new playbooksModule.v3.PlaybooksClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = playbooksModule.v3.PlaybooksClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = playbooksModule.v3.PlaybooksClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new playbooksModule.v3.PlaybooksClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new playbooksModule.v3.PlaybooksClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new playbooksModule.v3.PlaybooksClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new playbooksModule.v3.PlaybooksClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new playbooksModule.v3.PlaybooksClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = playbooksModule.v3.PlaybooksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new playbooksModule.v3.PlaybooksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new playbooksModule.v3.PlaybooksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.playbooksStub, undefined); + await client.initialize(); + assert(client.playbooksStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.playbooksStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.playbooksStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new playbooksModule.v3.PlaybooksClient({ + 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 playbooksModule.v3.PlaybooksClient({ + 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('createPlaybook', () => { + it('invokes createPlaybook without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ); + client.innerApiCalls.createPlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.createPlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybook without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ); + client.innerApiCalls.createPlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPlaybook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPlaybook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybook with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybook with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createPlaybook(request), expectedError); + }); + }); + + describe('deletePlaybook', () => { + it('invokes deletePlaybook without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.deletePlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybook without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePlaybook( + 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.deletePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybook with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deletePlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybook with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deletePlaybook(request), expectedError); + }); + }); + + describe('getPlaybook', () => { + it('invokes getPlaybook without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ); + client.innerApiCalls.getPlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.getPlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybook without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ); + client.innerApiCalls.getPlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPlaybook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPlaybook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybook with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybook with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getPlaybook(request), expectedError); + }); + }); + + describe('updatePlaybook', () => { + it('invokes updatePlaybook without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedHeaderRequestParams = `playbook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ); + client.innerApiCalls.updatePlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.updatePlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePlaybook without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedHeaderRequestParams = `playbook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ); + client.innerApiCalls.updatePlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePlaybook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPlaybook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePlaybook with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedHeaderRequestParams = `playbook.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updatePlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePlaybook with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updatePlaybook(request), expectedError); + }); + }); + + describe('createPlaybookVersion', () => { + it('invokes createPlaybookVersion without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ); + client.innerApiCalls.createPlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.createPlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ); + client.innerApiCalls.createPlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPlaybookVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybookVersion with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createPlaybookVersion(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createPlaybookVersion(request), + expectedError, + ); + }); + }); + + describe('getPlaybookVersion', () => { + it('invokes getPlaybookVersion without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ); + client.innerApiCalls.getPlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.getPlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ); + client.innerApiCalls.getPlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPlaybookVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybookVersion with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getPlaybookVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getPlaybookVersion(request), expectedError); + }); + }); + + describe('restorePlaybookVersion', () => { + it('invokes restorePlaybookVersion without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse(), + ); + client.innerApiCalls.restorePlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.restorePlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restorePlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse(), + ); + client.innerApiCalls.restorePlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restorePlaybookVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IRestorePlaybookVersionResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restorePlaybookVersion with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restorePlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.restorePlaybookVersion(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restorePlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.restorePlaybookVersion(request), + expectedError, + ); + }); + }); + + describe('deletePlaybookVersion', () => { + it('invokes deletePlaybookVersion without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.deletePlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePlaybookVersion( + 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.deletePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybookVersion with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deletePlaybookVersion(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deletePlaybookVersion(request), + expectedError, + ); + }); + }); + + describe('exportPlaybook', () => { + it('invokes exportPlaybook without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportPlaybook = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportPlaybook(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportPlaybook without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportPlaybook = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportPlaybook( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportPlaybook with call error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportPlaybook = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportPlaybook with LRO error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportPlaybook = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportPlaybook(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportPlaybookProgress without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportPlaybookProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportPlaybookProgress with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportPlaybookProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importPlaybook', () => { + it('invokes importPlaybook without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importPlaybook = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importPlaybook(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importPlaybook without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importPlaybook = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importPlaybook( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importPlaybook with call error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importPlaybook = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importPlaybook with LRO error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importPlaybook = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importPlaybook(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportPlaybookProgress without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportPlaybookProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportPlaybookProgress with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportPlaybookProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listPlaybooks', () => { + it('invokes listPlaybooks without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + ]; + client.innerApiCalls.listPlaybooks = stubSimpleCall(expectedResponse); + const [response] = await client.listPlaybooks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybooks without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + ]; + client.innerApiCalls.listPlaybooks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPlaybooks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IPlaybook[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybooks with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPlaybooks = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listPlaybooks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybooksStream without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + ]; + client.descriptors.page.listPlaybooks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPlaybooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Playbook[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Playbook) => { + 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.listPlaybooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybooks, request), + ); + assert( + (client.descriptors.page.listPlaybooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listPlaybooksStream with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybooks.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPlaybooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Playbook[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Playbook) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPlaybooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybooks, request), + ); + assert( + (client.descriptors.page.listPlaybooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybooks without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Playbook(), + ), + ]; + client.descriptors.page.listPlaybooks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IPlaybook[] = []; + const iterable = client.listPlaybooksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybooks with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybooks.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPlaybooksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IPlaybook[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listPlaybookVersions', () => { + it('invokes listPlaybookVersions without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + ]; + client.innerApiCalls.listPlaybookVersions = + stubSimpleCall(expectedResponse); + const [response] = await client.listPlaybookVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybookVersions without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + ]; + client.innerApiCalls.listPlaybookVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPlaybookVersions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybookVersions with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPlaybookVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listPlaybookVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybookVersionsStream without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + ]; + client.descriptors.page.listPlaybookVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPlaybookVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.PlaybookVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.PlaybookVersion) => { + 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.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybookVersions, request), + ); + assert( + (client.descriptors.page.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listPlaybookVersionsStream with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybookVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPlaybookVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.PlaybookVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.PlaybookVersion) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybookVersions, request), + ); + assert( + (client.descriptors.page.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybookVersions without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.PlaybookVersion(), + ), + ]; + client.descriptors.page.listPlaybookVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion[] = + []; + const iterable = client.listPlaybookVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybookVersions with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybookVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPlaybookVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IPlaybookVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 playbooksModule.v3.PlaybooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 playbooksModule.v3.PlaybooksClient({ + 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 playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 playbooksModule.v3.PlaybooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 playbooksModule.v3.PlaybooksClient({ + 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 playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 playbooksModule.v3.PlaybooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 playbooksModule.v3.PlaybooksClient({ + 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 playbooksModule.v3.PlaybooksClient({ + 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.IOperation[] = []; + 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 playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new playbooksModule.v3.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_playbooks_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_playbooks_v3beta1.ts new file mode 100644 index 000000000000..1e478c92e018 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_playbooks_v3beta1.ts @@ -0,0 +1,5631 @@ +// Copyright 2026 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 playbooksModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.PlaybooksClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new playbooksModule.v3beta1.PlaybooksClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new playbooksModule.v3beta1.PlaybooksClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = playbooksModule.v3beta1.PlaybooksClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = playbooksModule.v3beta1.PlaybooksClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new playbooksModule.v3beta1.PlaybooksClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new playbooksModule.v3beta1.PlaybooksClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = playbooksModule.v3beta1.PlaybooksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new playbooksModule.v3beta1.PlaybooksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.playbooksStub, undefined); + await client.initialize(); + assert(client.playbooksStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.playbooksStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.playbooksStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + 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 playbooksModule.v3beta1.PlaybooksClient({ + 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('createPlaybook', () => { + it('invokes createPlaybook without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ); + client.innerApiCalls.createPlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.createPlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybook without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ); + client.innerApiCalls.createPlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPlaybook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybook with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybook with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createPlaybook(request), expectedError); + }); + }); + + describe('deletePlaybook', () => { + it('invokes deletePlaybook without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.deletePlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybook without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePlaybook( + 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.deletePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybook with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deletePlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybook with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deletePlaybook(request), expectedError); + }); + }); + + describe('getPlaybook', () => { + it('invokes getPlaybook without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ); + client.innerApiCalls.getPlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.getPlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybook without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ); + client.innerApiCalls.getPlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPlaybook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybook with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybook with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getPlaybook(request), expectedError); + }); + }); + + describe('updatePlaybook', () => { + it('invokes updatePlaybook without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedHeaderRequestParams = `playbook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ); + client.innerApiCalls.updatePlaybook = stubSimpleCall(expectedResponse); + const [response] = await client.updatePlaybook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePlaybook without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedHeaderRequestParams = `playbook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ); + client.innerApiCalls.updatePlaybook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePlaybook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePlaybook with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedHeaderRequestParams = `playbook.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePlaybook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updatePlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePlaybook with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest(), + ); + request.playbook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdatePlaybookRequest', + ['playbook', 'name'], + ); + request.playbook.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updatePlaybook(request), expectedError); + }); + }); + + describe('createPlaybookVersion', () => { + it('invokes createPlaybookVersion without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ); + client.innerApiCalls.createPlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.createPlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ); + client.innerApiCalls.createPlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPlaybookVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybookVersion with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createPlaybookVersion(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreatePlaybookVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createPlaybookVersion(request), + expectedError, + ); + }); + }); + + describe('getPlaybookVersion', () => { + it('invokes getPlaybookVersion without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ); + client.innerApiCalls.getPlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.getPlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ); + client.innerApiCalls.getPlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPlaybookVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybookVersion with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getPlaybookVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetPlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getPlaybookVersion(request), expectedError); + }); + }); + + describe('restorePlaybookVersion', () => { + it('invokes restorePlaybookVersion without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse(), + ); + client.innerApiCalls.restorePlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.restorePlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restorePlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionResponse(), + ); + client.innerApiCalls.restorePlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restorePlaybookVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IRestorePlaybookVersionResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restorePlaybookVersion with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restorePlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.restorePlaybookVersion(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restorePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restorePlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestorePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.restorePlaybookVersion(request), + expectedError, + ); + }); + }); + + describe('deletePlaybookVersion', () => { + it('invokes deletePlaybookVersion without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybookVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.deletePlaybookVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybookVersion without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deletePlaybookVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePlaybookVersion( + 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.deletePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybookVersion with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePlaybookVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deletePlaybookVersion(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePlaybookVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePlaybookVersion with closed client', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeletePlaybookVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deletePlaybookVersion(request), + expectedError, + ); + }); + }); + + describe('exportPlaybook', () => { + it('invokes exportPlaybook without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportPlaybook = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportPlaybook(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportPlaybook without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportPlaybook = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportPlaybook( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportPlaybookResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportPlaybook with call error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportPlaybook = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportPlaybook with LRO error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportPlaybookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportPlaybook = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportPlaybook(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportPlaybookProgress without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportPlaybookProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportPlaybookProgress with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportPlaybookProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importPlaybook', () => { + it('invokes importPlaybook without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importPlaybook = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importPlaybook(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importPlaybook without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importPlaybook = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importPlaybook( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportPlaybookResponse, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importPlaybook with call error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importPlaybook = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importPlaybook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importPlaybook with LRO error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportPlaybookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importPlaybook = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importPlaybook(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importPlaybook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportPlaybookProgress without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportPlaybookProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportPlaybookProgress with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportPlaybookProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listPlaybooks', () => { + it('invokes listPlaybooks without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + ]; + client.innerApiCalls.listPlaybooks = stubSimpleCall(expectedResponse); + const [response] = await client.listPlaybooks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybooks without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + ]; + client.innerApiCalls.listPlaybooks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPlaybooks( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybooks with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPlaybooks = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listPlaybooks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybooksStream without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + ]; + client.descriptors.page.listPlaybooks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPlaybooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Playbook[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Playbook) => { + 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.listPlaybooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybooks, request), + ); + assert( + (client.descriptors.page.listPlaybooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listPlaybooksStream with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybooks.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPlaybooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Playbook[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Playbook) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPlaybooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybooks, request), + ); + assert( + (client.descriptors.page.listPlaybooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybooks without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Playbook(), + ), + ]; + client.descriptors.page.listPlaybooks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook[] = + []; + const iterable = client.listPlaybooksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybooks with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybooks.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPlaybooksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybook[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listPlaybookVersions', () => { + it('invokes listPlaybookVersions without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + ]; + client.innerApiCalls.listPlaybookVersions = + stubSimpleCall(expectedResponse); + const [response] = await client.listPlaybookVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybookVersions without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + ]; + client.innerApiCalls.listPlaybookVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPlaybookVersions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybookVersions with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPlaybookVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listPlaybookVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPlaybookVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPlaybookVersionsStream without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + ]; + client.descriptors.page.listPlaybookVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPlaybookVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion, + ) => { + 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.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybookVersions, request), + ); + assert( + (client.descriptors.page.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listPlaybookVersionsStream with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybookVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPlaybookVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPlaybookVersions, request), + ); + assert( + (client.descriptors.page.listPlaybookVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybookVersions without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.PlaybookVersion(), + ), + ]; + client.descriptors.page.listPlaybookVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[] = + []; + const iterable = client.listPlaybookVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listPlaybookVersions with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListPlaybookVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPlaybookVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPlaybookVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IPlaybookVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listPlaybookVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 playbooksModule.v3beta1.PlaybooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 playbooksModule.v3beta1.PlaybooksClient({ + 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 playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 playbooksModule.v3beta1.PlaybooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 playbooksModule.v3beta1.PlaybooksClient({ + 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 playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 playbooksModule.v3beta1.PlaybooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 playbooksModule.v3beta1.PlaybooksClient({ + 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 playbooksModule.v3beta1.PlaybooksClient({ + 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.IOperation[] = []; + 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 playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new playbooksModule.v3beta1.PlaybooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_security_settings_service_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_security_settings_service_v3.ts new file mode 100644 index 000000000000..03354b11fac5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_security_settings_service_v3.ts @@ -0,0 +1,4690 @@ +// Copyright 2026 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 securitysettingsserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.SecuritySettingsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + securitysettingsserviceModule.v3.SecuritySettingsServiceClient + .servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + securitysettingsserviceModule.v3.SecuritySettingsServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + securitysettingsserviceModule.v3.SecuritySettingsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.securitySettingsServiceStub, undefined); + await client.initialize(); + assert(client.securitySettingsServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.securitySettingsServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.securitySettingsServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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('createSecuritySettings', () => { + it('invokes createSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ); + client.innerApiCalls.createSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.createSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ); + client.innerApiCalls.createSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ISecuritySettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createSecuritySettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createSecuritySettings(request), + expectedError, + ); + }); + }); + + describe('getSecuritySettings', () => { + it('invokes getSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ); + client.innerApiCalls.getSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ); + client.innerApiCalls.getSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ISecuritySettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSecuritySettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSecuritySettings(request), expectedError); + }); + }); + + describe('updateSecuritySettings', () => { + it('invokes updateSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedHeaderRequestParams = `security_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ); + client.innerApiCalls.updateSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedHeaderRequestParams = `security_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ); + client.innerApiCalls.updateSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ISecuritySettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedHeaderRequestParams = `security_settings.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateSecuritySettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateSecuritySettings(request), + expectedError, + ); + }); + }); + + describe('deleteSecuritySettings', () => { + it('invokes deleteSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSecuritySettings( + 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.deleteSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteSecuritySettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deleteSecuritySettings(request), + expectedError, + ); + }); + }); + + describe('listSecuritySettings', () => { + it('invokes listSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + ]; + client.innerApiCalls.listSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.listSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + ]; + client.innerApiCalls.listSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSecuritySettings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3.ISecuritySettings[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSecuritySettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecuritySettingsStream without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + ]; + client.descriptors.page.listSecuritySettings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSecuritySettingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.SecuritySettings[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.SecuritySettings) => { + 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.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecuritySettings, request), + ); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSecuritySettingsStream with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecuritySettings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSecuritySettingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.SecuritySettings[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.SecuritySettings) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecuritySettings, request), + ); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SecuritySettings(), + ), + ]; + client.descriptors.page.listSecuritySettings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.ISecuritySettings[] = + []; + const iterable = client.listSecuritySettingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecuritySettings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSecuritySettingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.ISecuritySettings[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + 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.IOperation[] = []; + 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 securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('organizationLocationDeidentifyTemplate', async () => { + const fakePath = '/rendered/path/organizationLocationDeidentifyTemplate'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + deidentify_template: 'deidentifyTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationDeidentifyTemplatePath', () => { + const result = client.organizationLocationDeidentifyTemplatePath( + 'organizationValue', + 'locationValue', + 'deidentifyTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationDeidentifyTemplateName', () => { + const result = + client.matchOrganizationFromOrganizationLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationDeidentifyTemplateName', () => { + const result = + client.matchLocationFromOrganizationLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName', () => { + const result = + client.matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'deidentifyTemplateValue'); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationInspectTemplate', async () => { + const fakePath = '/rendered/path/organizationLocationInspectTemplate'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + inspect_template: 'inspectTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationInspectTemplatePath', () => { + const result = client.organizationLocationInspectTemplatePath( + 'organizationValue', + 'locationValue', + 'inspectTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationInspectTemplateName', () => { + const result = + client.matchOrganizationFromOrganizationLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationInspectTemplateName', () => { + const result = + client.matchLocationFromOrganizationLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInspectTemplateFromOrganizationLocationInspectTemplateName', () => { + const result = + client.matchInspectTemplateFromOrganizationLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'inspectTemplateValue'); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationDeidentifyTemplate', async () => { + const fakePath = '/rendered/path/projectLocationDeidentifyTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deidentify_template: 'deidentifyTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDeidentifyTemplatePath', () => { + const result = client.projectLocationDeidentifyTemplatePath( + 'projectValue', + 'locationValue', + 'deidentifyTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationDeidentifyTemplateName', () => { + const result = + client.matchProjectFromProjectLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationDeidentifyTemplateName', () => { + const result = + client.matchLocationFromProjectLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName', () => { + const result = + client.matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'deidentifyTemplateValue'); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationInspectTemplate', async () => { + const fakePath = '/rendered/path/projectLocationInspectTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + inspect_template: 'inspectTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationInspectTemplatePath', () => { + const result = client.projectLocationInspectTemplatePath( + 'projectValue', + 'locationValue', + 'inspectTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationInspectTemplateName', () => { + const result = + client.matchProjectFromProjectLocationInspectTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationInspectTemplateName', () => { + const result = + client.matchLocationFromProjectLocationInspectTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInspectTemplateFromProjectLocationInspectTemplateName', () => { + const result = + client.matchInspectTemplateFromProjectLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'inspectTemplateValue'); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_security_settings_service_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_security_settings_service_v3beta1.ts new file mode 100644 index 000000000000..ca251dd45291 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_security_settings_service_v3beta1.ts @@ -0,0 +1,4583 @@ +// Copyright 2026 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 securitysettingsserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.SecuritySettingsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient + .servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { universeDomain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { universe_domain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { universeDomain: 'configured.example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { universe_domain: 'example.com', universeDomain: 'example.net' }, + ); + }); + }); + + it('has port', () => { + const port = + securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + fallback: true, + }, + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.securitySettingsServiceStub, undefined); + await client.initialize(); + assert(client.securitySettingsServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.initialize().catch((err) => { + throw err; + }); + assert(client.securitySettingsServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.securitySettingsServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + 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 securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + 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('createSecuritySettings', () => { + it('invokes createSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ); + client.innerApiCalls.createSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.createSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ); + client.innerApiCalls.createSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createSecuritySettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createSecuritySettings(request), + expectedError, + ); + }); + }); + + describe('getSecuritySettings', () => { + it('invokes getSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ); + client.innerApiCalls.getSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ); + client.innerApiCalls.getSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSecuritySettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSecuritySettings(request), expectedError); + }); + }); + + describe('updateSecuritySettings', () => { + it('invokes updateSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedHeaderRequestParams = `security_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ); + client.innerApiCalls.updateSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedHeaderRequestParams = `security_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ); + client.innerApiCalls.updateSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedHeaderRequestParams = `security_settings.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateSecuritySettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(), + ); + request.securitySettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest', + ['securitySettings', 'name'], + ); + request.securitySettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateSecuritySettings(request), + expectedError, + ); + }); + }); + + describe('deleteSecuritySettings', () => { + it('invokes deleteSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSecuritySettings( + 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.deleteSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteSecuritySettings(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecuritySettings with closed client', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deleteSecuritySettings(request), + expectedError, + ); + }); + }); + + describe('listSecuritySettings', () => { + it('invokes listSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + ]; + client.innerApiCalls.listSecuritySettings = + stubSimpleCall(expectedResponse); + const [response] = await client.listSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecuritySettings without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + ]; + client.innerApiCalls.listSecuritySettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSecuritySettings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecuritySettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSecuritySettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSecuritySettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecuritySettingsStream without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + ]; + client.descriptors.page.listSecuritySettings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSecuritySettingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, + ) => { + 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.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecuritySettings, request), + ); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSecuritySettingsStream with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecuritySettings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSecuritySettingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecuritySettings, request), + ); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSecuritySettings without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(), + ), + ]; + client.descriptors.page.listSecuritySettings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[] = + []; + const iterable = client.listSecuritySettingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSecuritySettings with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecuritySettings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSecuritySettingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSecuritySettings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await 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('organizationLocationDeidentifyTemplate', async () => { + const fakePath = '/rendered/path/organizationLocationDeidentifyTemplate'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + deidentify_template: 'deidentifyTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationDeidentifyTemplatePath', () => { + const result = client.organizationLocationDeidentifyTemplatePath( + 'organizationValue', + 'locationValue', + 'deidentifyTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationDeidentifyTemplateName', () => { + const result = + client.matchOrganizationFromOrganizationLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationDeidentifyTemplateName', () => { + const result = + client.matchLocationFromOrganizationLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName', () => { + const result = + client.matchDeidentifyTemplateFromOrganizationLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'deidentifyTemplateValue'); + assert( + ( + client.pathTemplates + .organizationLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationInspectTemplate', async () => { + const fakePath = '/rendered/path/organizationLocationInspectTemplate'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + inspect_template: 'inspectTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.organizationLocationInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationInspectTemplatePath', () => { + const result = client.organizationLocationInspectTemplatePath( + 'organizationValue', + 'locationValue', + 'inspectTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationInspectTemplateName', () => { + const result = + client.matchOrganizationFromOrganizationLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationInspectTemplateName', () => { + const result = + client.matchLocationFromOrganizationLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInspectTemplateFromOrganizationLocationInspectTemplateName', () => { + const result = + client.matchInspectTemplateFromOrganizationLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'inspectTemplateValue'); + assert( + ( + client.pathTemplates.organizationLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationDeidentifyTemplate', async () => { + const fakePath = '/rendered/path/projectLocationDeidentifyTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deidentify_template: 'deidentifyTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDeidentifyTemplatePath', () => { + const result = client.projectLocationDeidentifyTemplatePath( + 'projectValue', + 'locationValue', + 'deidentifyTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationDeidentifyTemplateName', () => { + const result = + client.matchProjectFromProjectLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationDeidentifyTemplateName', () => { + const result = + client.matchLocationFromProjectLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName', () => { + const result = + client.matchDeidentifyTemplateFromProjectLocationDeidentifyTemplateName( + fakePath, + ); + assert.strictEqual(result, 'deidentifyTemplateValue'); + assert( + ( + client.pathTemplates.projectLocationDeidentifyTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationInspectTemplate', async () => { + const fakePath = '/rendered/path/projectLocationInspectTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + inspect_template: 'inspectTemplateValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.projectLocationInspectTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationInspectTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationInspectTemplatePath', () => { + const result = client.projectLocationInspectTemplatePath( + 'projectValue', + 'locationValue', + 'inspectTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationInspectTemplateName', () => { + const result = + client.matchProjectFromProjectLocationInspectTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationInspectTemplateName', () => { + const result = + client.matchLocationFromProjectLocationInspectTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInspectTemplateFromProjectLocationInspectTemplateName', () => { + const result = + client.matchInspectTemplateFromProjectLocationInspectTemplateName( + fakePath, + ); + assert.strictEqual(result, 'inspectTemplateValue'); + assert( + ( + client.pathTemplates.projectLocationInspectTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = + new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_session_entity_types_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_session_entity_types_v3.ts new file mode 100644 index 000000000000..18ea60615bd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_session_entity_types_v3.ts @@ -0,0 +1,4392 @@ +// Copyright 2026 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 sessionentitytypesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.SessionEntityTypesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + sessionentitytypesModule.v3.SessionEntityTypesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + sessionentitytypesModule.v3.SessionEntityTypesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sessionentitytypesModule.v3.SessionEntityTypesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sessionentitytypesModule.v3.SessionEntityTypesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new sessionentitytypesModule.v3.SessionEntityTypesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = sessionentitytypesModule.v3.SessionEntityTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionEntityTypesStub, undefined); + await client.initialize(); + assert(client.sessionEntityTypesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.sessionEntityTypesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionEntityTypesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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('getSessionEntityType', () => { + it('invokes getSessionEntityType without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ); + client.innerApiCalls.getSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.getSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionEntityType without error using callback', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ); + client.innerApiCalls.getSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSessionEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ISessionEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionEntityType with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSessionEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionEntityType with closed client', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSessionEntityType(request), expectedError); + }); + }); + + describe('createSessionEntityType', () => { + it('invokes createSessionEntityType without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ); + client.innerApiCalls.createSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.createSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionEntityType without error using callback', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ); + client.innerApiCalls.createSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSessionEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ISessionEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionEntityType with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createSessionEntityType(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionEntityType with closed client', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createSessionEntityType(request), + expectedError, + ); + }); + }); + + describe('updateSessionEntityType', () => { + it('invokes updateSessionEntityType without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedHeaderRequestParams = `session_entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ); + client.innerApiCalls.updateSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionEntityType without error using callback', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedHeaderRequestParams = `session_entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ); + client.innerApiCalls.updateSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSessionEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ISessionEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionEntityType with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedHeaderRequestParams = `session_entity_type.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateSessionEntityType(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionEntityType with closed client', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateSessionEntityType(request), + expectedError, + ); + }); + }); + + describe('deleteSessionEntityType', () => { + it('invokes deleteSessionEntityType without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionEntityType without error using callback', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSessionEntityType( + 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.deleteSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionEntityType with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteSessionEntityType(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionEntityType with closed client', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deleteSessionEntityType(request), + expectedError, + ); + }); + }); + + describe('listSessionEntityTypes', () => { + it('invokes listSessionEntityTypes without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + ]; + client.innerApiCalls.listSessionEntityTypes = + stubSimpleCall(expectedResponse); + const [response] = await client.listSessionEntityTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionEntityTypes without error using callback', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + ]; + client.innerApiCalls.listSessionEntityTypes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSessionEntityTypes( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3.ISessionEntityType[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionEntityTypes with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSessionEntityTypes = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listSessionEntityTypes(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionEntityTypesStream without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + ]; + client.descriptors.page.listSessionEntityTypes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSessionEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.SessionEntityType[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.SessionEntityType, + ) => { + 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.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listSessionEntityTypes, request), + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listSessionEntityTypesStream with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessionEntityTypes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSessionEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.SessionEntityType[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.SessionEntityType, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listSessionEntityTypes, request), + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listSessionEntityTypes without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SessionEntityType(), + ), + ]; + client.descriptors.page.listSessionEntityTypes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.ISessionEntityType[] = + []; + const iterable = client.listSessionEntityTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listSessionEntityTypes with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessionEntityTypes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSessionEntityTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.ISessionEntityType[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + 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.IOperation[] = []; + 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 sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionPath', () => { + const result = client.projectLocationAgentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_session_entity_types_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_session_entity_types_v3beta1.ts new file mode 100644 index 000000000000..5f6f4f38e76a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_session_entity_types_v3beta1.ts @@ -0,0 +1,4225 @@ +// Copyright 2026 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 sessionentitytypesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.SessionEntityTypesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + sessionentitytypesModule.v3beta1.SessionEntityTypesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + sessionentitytypesModule.v3beta1.SessionEntityTypesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + sessionentitytypesModule.v3beta1.SessionEntityTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionEntityTypesStub, undefined); + await client.initialize(); + assert(client.sessionEntityTypesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.sessionEntityTypesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionEntityTypesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + 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 sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + 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('getSessionEntityType', () => { + it('invokes getSessionEntityType without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ); + client.innerApiCalls.getSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.getSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionEntityType without error using callback', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ); + client.innerApiCalls.getSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSessionEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionEntityType with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSessionEntityType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionEntityType with closed client', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSessionEntityType(request), expectedError); + }); + }); + + describe('createSessionEntityType', () => { + it('invokes createSessionEntityType without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ); + client.innerApiCalls.createSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.createSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionEntityType without error using callback', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ); + client.innerApiCalls.createSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSessionEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionEntityType with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createSessionEntityType(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionEntityType with closed client', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createSessionEntityType(request), + expectedError, + ); + }); + }); + + describe('updateSessionEntityType', () => { + it('invokes updateSessionEntityType without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedHeaderRequestParams = `session_entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ); + client.innerApiCalls.updateSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionEntityType without error using callback', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedHeaderRequestParams = `session_entity_type.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ); + client.innerApiCalls.updateSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSessionEntityType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionEntityType with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedHeaderRequestParams = `session_entity_type.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateSessionEntityType(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionEntityType with closed client', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(), + ); + request.sessionEntityType ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest', + ['sessionEntityType', 'name'], + ); + request.sessionEntityType.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateSessionEntityType(request), + expectedError, + ); + }); + }); + + describe('deleteSessionEntityType', () => { + it('invokes deleteSessionEntityType without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSessionEntityType = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSessionEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionEntityType without error using callback', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSessionEntityType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSessionEntityType( + 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.deleteSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionEntityType with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSessionEntityType = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteSessionEntityType(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSessionEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionEntityType with closed client', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deleteSessionEntityType(request), + expectedError, + ); + }); + }); + + describe('listSessionEntityTypes', () => { + it('invokes listSessionEntityTypes without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + ]; + client.innerApiCalls.listSessionEntityTypes = + stubSimpleCall(expectedResponse); + const [response] = await client.listSessionEntityTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionEntityTypes without error using callback', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + ]; + client.innerApiCalls.listSessionEntityTypes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSessionEntityTypes( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionEntityTypes with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSessionEntityTypes = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listSessionEntityTypes(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessionEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionEntityTypesStream without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + ]; + client.descriptors.page.listSessionEntityTypes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSessionEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + ) => { + 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.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listSessionEntityTypes, request), + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listSessionEntityTypesStream with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessionEntityTypes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSessionEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listSessionEntityTypes, request), + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listSessionEntityTypes without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(), + ), + ]; + client.descriptors.page.listSessionEntityTypes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[] = + []; + const iterable = client.listSessionEntityTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listSessionEntityTypes with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessionEntityTypes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSessionEntityTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ISessionEntityType[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listSessionEntityTypes + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionPath', () => { + const result = client.projectLocationAgentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = + new sessionentitytypesModule.v3beta1.SessionEntityTypesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_sessions_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_sessions_v3.ts new file mode 100644 index 000000000000..4d03731fef35 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_sessions_v3.ts @@ -0,0 +1,4494 @@ +// Copyright 2026 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 sessionsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 stubServerStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + 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('v3.SessionsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new sessionsModule.v3.SessionsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new sessionsModule.v3.SessionsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = sessionsModule.v3.SessionsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = sessionsModule.v3.SessionsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new sessionsModule.v3.SessionsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new sessionsModule.v3.SessionsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new sessionsModule.v3.SessionsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new sessionsModule.v3.SessionsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new sessionsModule.v3.SessionsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = sessionsModule.v3.SessionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sessionsModule.v3.SessionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sessionsModule.v3.SessionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionsStub, undefined); + await client.initialize(); + assert(client.sessionsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.sessionsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sessionsModule.v3.SessionsClient({ + 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 sessionsModule.v3.SessionsClient({ + 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('detectIntent', () => { + it('invokes detectIntent without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse(), + ); + client.innerApiCalls.detectIntent = stubSimpleCall(expectedResponse); + const [response] = await client.detectIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detectIntent without error using callback', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse(), + ); + client.innerApiCalls.detectIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detectIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IDetectIntentResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detectIntent with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.detectIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.detectIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detectIntent with closed client', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.detectIntent(request), expectedError); + }); + }); + + describe('matchIntent', () => { + it('invokes matchIntent without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.MatchIntentResponse(), + ); + client.innerApiCalls.matchIntent = stubSimpleCall(expectedResponse); + const [response] = await client.matchIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes matchIntent without error using callback', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.MatchIntentResponse(), + ); + client.innerApiCalls.matchIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.matchIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IMatchIntentResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes matchIntent with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.matchIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.matchIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes matchIntent with closed client', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.matchIntent(request), expectedError); + }); + }); + + describe('fulfillIntent', () => { + it('invokes fulfillIntent without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedHeaderRequestParams = `match_intent_request.session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FulfillIntentResponse(), + ); + client.innerApiCalls.fulfillIntent = stubSimpleCall(expectedResponse); + const [response] = await client.fulfillIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fulfillIntent without error using callback', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedHeaderRequestParams = `match_intent_request.session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FulfillIntentResponse(), + ); + client.innerApiCalls.fulfillIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fulfillIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IFulfillIntentResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fulfillIntent with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedHeaderRequestParams = `match_intent_request.session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fulfillIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.fulfillIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fulfillIntent with closed client', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.fulfillIntent(request), expectedError); + }); + }); + + describe('submitAnswerFeedback', () => { + it('invokes submitAnswerFeedback without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.AnswerFeedback(), + ); + client.innerApiCalls.submitAnswerFeedback = + stubSimpleCall(expectedResponse); + const [response] = await client.submitAnswerFeedback(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitAnswerFeedback without error using callback', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.AnswerFeedback(), + ); + client.innerApiCalls.submitAnswerFeedback = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.submitAnswerFeedback( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IAnswerFeedback | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitAnswerFeedback with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitAnswerFeedback = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.submitAnswerFeedback(request), expectedError); + const actualRequest = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitAnswerFeedback with closed client', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.submitAnswerFeedback(request), expectedError); + }); + }); + + describe('serverStreamingDetectIntent', () => { + it('invokes serverStreamingDetectIntent without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse(), + ); + client.innerApiCalls.serverStreamingDetectIntent = + stubServerStreamingCall(expectedResponse); + const stream = client.serverStreamingDetectIntent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes serverStreamingDetectIntent without error and gaxServerStreamingRetries enabled', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse(), + ); + client.innerApiCalls.serverStreamingDetectIntent = + stubServerStreamingCall(expectedResponse); + const stream = client.serverStreamingDetectIntent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes serverStreamingDetectIntent with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.serverStreamingDetectIntent = + stubServerStreamingCall(undefined, expectedError); + const stream = client.serverStreamingDetectIntent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes serverStreamingDetectIntent with closed client', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + const stream = client.serverStreamingDetectIntent(request, { + retryRequestOptions: { noResponseRetries: 0 }, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new sessionsModule.v3.SessionsClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('streamingDetectIntent', () => { + it('invokes streamingDetectIntent without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse(), + ); + client.innerApiCalls.streamingDetectIntent = + stubBidiStreamingCall(expectedResponse); + const stream = client.streamingDetectIntent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingDetectIntent as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes streamingDetectIntent with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingDetectIntent = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.streamingDetectIntent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.streamingDetectIntent as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 sessionsModule.v3.SessionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 sessionsModule.v3.SessionsClient({ + 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 sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 sessionsModule.v3.SessionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 sessionsModule.v3.SessionsClient({ + 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 sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 sessionsModule.v3.SessionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 sessionsModule.v3.SessionsClient({ + 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 sessionsModule.v3.SessionsClient({ + 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.IOperation[] = []; + 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 sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironmentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionPath', () => { + const result = client.projectLocationAgentEnvironmentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionPath', () => { + const result = client.projectLocationAgentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationCollectionDataStore', async () => { + const fakePath = '/rendered/path/projectLocationCollectionDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStorePath', () => { + const result = client.projectLocationCollectionDataStorePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationDataStore', async () => { + const fakePath = '/rendered/path/projectLocationDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataStorePath', () => { + const result = client.projectLocationDataStorePath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_sessions_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_sessions_v3beta1.ts new file mode 100644 index 000000000000..50098395d2eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_sessions_v3beta1.ts @@ -0,0 +1,4255 @@ +// Copyright 2026 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 sessionsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 stubServerStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + 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('v3beta1.SessionsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new sessionsModule.v3beta1.SessionsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new sessionsModule.v3beta1.SessionsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = sessionsModule.v3beta1.SessionsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = sessionsModule.v3beta1.SessionsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new sessionsModule.v3beta1.SessionsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new sessionsModule.v3beta1.SessionsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new sessionsModule.v3beta1.SessionsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = sessionsModule.v3beta1.SessionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sessionsModule.v3beta1.SessionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionsStub, undefined); + await client.initialize(); + assert(client.sessionsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.sessionsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sessionsModule.v3beta1.SessionsClient({ + 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 sessionsModule.v3beta1.SessionsClient({ + 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('detectIntent', () => { + it('invokes detectIntent without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(), + ); + client.innerApiCalls.detectIntent = stubSimpleCall(expectedResponse); + const [response] = await client.detectIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detectIntent without error using callback', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(), + ); + client.innerApiCalls.detectIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detectIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IDetectIntentResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detectIntent with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.detectIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.detectIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detectIntent with closed client', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.detectIntent(request), expectedError); + }); + }); + + describe('matchIntent', () => { + it('invokes matchIntent without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse(), + ); + client.innerApiCalls.matchIntent = stubSimpleCall(expectedResponse); + const [response] = await client.matchIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes matchIntent without error using callback', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse(), + ); + client.innerApiCalls.matchIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.matchIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IMatchIntentResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes matchIntent with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.matchIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.matchIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.matchIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes matchIntent with closed client', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.matchIntent(request), expectedError); + }); + }); + + describe('fulfillIntent', () => { + it('invokes fulfillIntent without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedHeaderRequestParams = `match_intent_request.session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse(), + ); + client.innerApiCalls.fulfillIntent = stubSimpleCall(expectedResponse); + const [response] = await client.fulfillIntent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fulfillIntent without error using callback', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedHeaderRequestParams = `match_intent_request.session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse(), + ); + client.innerApiCalls.fulfillIntent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fulfillIntent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IFulfillIntentResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fulfillIntent with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedHeaderRequestParams = `match_intent_request.session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fulfillIntent = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.fulfillIntent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fulfillIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fulfillIntent with closed client', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(), + ); + request.matchIntentRequest ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest', + ['matchIntentRequest', 'session'], + ); + request.matchIntentRequest.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.fulfillIntent(request), expectedError); + }); + }); + + describe('submitAnswerFeedback', () => { + it('invokes submitAnswerFeedback without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback(), + ); + client.innerApiCalls.submitAnswerFeedback = + stubSimpleCall(expectedResponse); + const [response] = await client.submitAnswerFeedback(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitAnswerFeedback without error using callback', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.AnswerFeedback(), + ); + client.innerApiCalls.submitAnswerFeedback = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.submitAnswerFeedback( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IAnswerFeedback | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitAnswerFeedback with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitAnswerFeedback = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.submitAnswerFeedback(request), expectedError); + const actualRequest = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitAnswerFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitAnswerFeedback with closed client', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.SubmitAnswerFeedbackRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.submitAnswerFeedback(request), expectedError); + }); + }); + + describe('serverStreamingDetectIntent', () => { + it('invokes serverStreamingDetectIntent without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(), + ); + client.innerApiCalls.serverStreamingDetectIntent = + stubServerStreamingCall(expectedResponse); + const stream = client.serverStreamingDetectIntent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes serverStreamingDetectIntent without error and gaxServerStreamingRetries enabled', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(), + ); + client.innerApiCalls.serverStreamingDetectIntent = + stubServerStreamingCall(expectedResponse); + const stream = client.serverStreamingDetectIntent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes serverStreamingDetectIntent with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.serverStreamingDetectIntent = + stubServerStreamingCall(undefined, expectedError); + const stream = client.serverStreamingDetectIntent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingDetectIntent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes serverStreamingDetectIntent with closed client', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest', + ['session'], + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + const stream = client.serverStreamingDetectIntent(request, { + retryRequestOptions: { noResponseRetries: 0 }, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('streamingDetectIntent', () => { + it('invokes streamingDetectIntent without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse(), + ); + client.innerApiCalls.streamingDetectIntent = + stubBidiStreamingCall(expectedResponse); + const stream = client.streamingDetectIntent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingDetectIntent as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes streamingDetectIntent with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingDetectIntent = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.streamingDetectIntent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.streamingDetectIntent as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironmentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionPath', () => { + const result = client.projectLocationAgentEnvironmentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionPath', () => { + const result = client.projectLocationAgentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationCollectionDataStore', async () => { + const fakePath = '/rendered/path/projectLocationCollectionDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStorePath', () => { + const result = client.projectLocationCollectionDataStorePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreName( + fakePath, + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationDataStore', async () => { + const fakePath = '/rendered/path/projectLocationDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataStorePath', () => { + const result = client.projectLocationDataStorePath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_test_cases_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_test_cases_v3.ts new file mode 100644 index 000000000000..6ad898d3187d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_test_cases_v3.ts @@ -0,0 +1,5644 @@ +// Copyright 2026 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 testcasesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.TestCasesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new testcasesModule.v3.TestCasesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new testcasesModule.v3.TestCasesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = testcasesModule.v3.TestCasesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = testcasesModule.v3.TestCasesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new testcasesModule.v3.TestCasesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new testcasesModule.v3.TestCasesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new testcasesModule.v3.TestCasesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new testcasesModule.v3.TestCasesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new testcasesModule.v3.TestCasesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = testcasesModule.v3.TestCasesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new testcasesModule.v3.TestCasesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new testcasesModule.v3.TestCasesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.testCasesStub, undefined); + await client.initialize(); + assert(client.testCasesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.testCasesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.testCasesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new testcasesModule.v3.TestCasesClient({ + 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 testcasesModule.v3.TestCasesClient({ + 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('batchDeleteTestCases', () => { + it('invokes batchDeleteTestCases without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.batchDeleteTestCases = + stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteTestCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteTestCases without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.batchDeleteTestCases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteTestCases( + 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.batchDeleteTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteTestCases with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteTestCases = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.batchDeleteTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteTestCases with closed client', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.batchDeleteTestCases(request), expectedError); + }); + }); + + describe('getTestCase', () => { + it('invokes getTestCase without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ); + client.innerApiCalls.getTestCase = stubSimpleCall(expectedResponse); + const [response] = await client.getTestCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCase without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ); + client.innerApiCalls.getTestCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTestCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITestCase | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCase with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTestCase = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCase with closed client', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getTestCase(request), expectedError); + }); + }); + + describe('createTestCase', () => { + it('invokes createTestCase without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ); + client.innerApiCalls.createTestCase = stubSimpleCall(expectedResponse); + const [response] = await client.createTestCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTestCase without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ); + client.innerApiCalls.createTestCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTestCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITestCase | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTestCase with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTestCase = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTestCase with closed client', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createTestCase(request), expectedError); + }); + }); + + describe('updateTestCase', () => { + it('invokes updateTestCase without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedHeaderRequestParams = `test_case.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ); + client.innerApiCalls.updateTestCase = stubSimpleCall(expectedResponse); + const [response] = await client.updateTestCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTestCase without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedHeaderRequestParams = `test_case.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ); + client.innerApiCalls.updateTestCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTestCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITestCase | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTestCase with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedHeaderRequestParams = `test_case.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTestCase = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTestCase with closed client', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateTestCase(request), expectedError); + }); + }); + + describe('calculateCoverage', () => { + it('invokes calculateCoverage without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedHeaderRequestParams = `agent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse(), + ); + client.innerApiCalls.calculateCoverage = stubSimpleCall(expectedResponse); + const [response] = await client.calculateCoverage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateCoverage without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedHeaderRequestParams = `agent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse(), + ); + client.innerApiCalls.calculateCoverage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.calculateCoverage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ICalculateCoverageResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateCoverage with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedHeaderRequestParams = `agent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.calculateCoverage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.calculateCoverage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateCoverage with closed client', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.calculateCoverage(request), expectedError); + }); + }); + + describe('getTestCaseResult', () => { + it('invokes getTestCaseResult without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ); + client.innerApiCalls.getTestCaseResult = stubSimpleCall(expectedResponse); + const [response] = await client.getTestCaseResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCaseResult without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ); + client.innerApiCalls.getTestCaseResult = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTestCaseResult( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITestCaseResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCaseResult with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTestCaseResult = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getTestCaseResult(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCaseResult with closed client', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getTestCaseResult(request), expectedError); + }); + }); + + describe('runTestCase', () => { + it('invokes runTestCase without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runTestCase = stubLongRunningCall(expectedResponse); + const [operation] = await client.runTestCase(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTestCase without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runTestCase = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runTestCase( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3.IRunTestCaseMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTestCase with call error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runTestCase = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.runTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTestCase with LRO error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runTestCase = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.runTestCase(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunTestCaseProgress without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkRunTestCaseProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunTestCaseProgress with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkRunTestCaseProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('batchRunTestCases', () => { + it('invokes batchRunTestCases without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.batchRunTestCases = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchRunTestCases(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunTestCases without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.batchRunTestCases = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRunTestCases( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IBatchRunTestCasesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunTestCases with call error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunTestCases = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.batchRunTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunTestCases with LRO error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunTestCases = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.batchRunTestCases(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchRunTestCasesProgress without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkBatchRunTestCasesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchRunTestCasesProgress with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkBatchRunTestCasesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importTestCases', () => { + it('invokes importTestCases without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importTestCases = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importTestCases(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importTestCases without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importTestCases = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importTestCases( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IImportTestCasesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importTestCases with call error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importTestCases = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importTestCases with LRO error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importTestCases = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importTestCases(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportTestCasesProgress without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportTestCasesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportTestCasesProgress with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportTestCasesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportTestCases', () => { + it('invokes exportTestCases without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportTestCases = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportTestCases(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTestCases without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportTestCases = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportTestCases( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3.IExportTestCasesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTestCases with call error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTestCases = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTestCases with LRO error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTestCases = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportTestCases(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportTestCasesProgress without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportTestCasesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportTestCasesProgress with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportTestCasesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTestCases', () => { + it('invokes listTestCases without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + ]; + client.innerApiCalls.listTestCases = stubSimpleCall(expectedResponse); + const [response] = await client.listTestCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCases without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + ]; + client.innerApiCalls.listTestCases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTestCases( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITestCase[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCases with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTestCases = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCasesStream without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + ]; + client.descriptors.page.listTestCases.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTestCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.TestCase[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.TestCase) => { + 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.listTestCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCases, request), + ); + assert( + (client.descriptors.page.listTestCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTestCasesStream with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCases.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTestCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.TestCase[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.TestCase) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTestCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCases, request), + ); + assert( + (client.descriptors.page.listTestCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCases without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCase(), + ), + ]; + client.descriptors.page.listTestCases.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.ITestCase[] = []; + const iterable = client.listTestCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCases.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCases with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCases.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTestCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.ITestCase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCases.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listTestCaseResults', () => { + it('invokes listTestCaseResults without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + ]; + client.innerApiCalls.listTestCaseResults = + stubSimpleCall(expectedResponse); + const [response] = await client.listTestCaseResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCaseResults without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + ]; + client.innerApiCalls.listTestCaseResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTestCaseResults( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3.ITestCaseResult[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCaseResults with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTestCaseResults = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTestCaseResults(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCaseResultsStream without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + ]; + client.descriptors.page.listTestCaseResults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTestCaseResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.TestCaseResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.TestCaseResult) => { + 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.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCaseResults, request), + ); + assert( + (client.descriptors.page.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTestCaseResultsStream with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCaseResults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTestCaseResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.TestCaseResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.TestCaseResult) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCaseResults, request), + ); + assert( + (client.descriptors.page.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCaseResults without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TestCaseResult(), + ), + ]; + client.descriptors.page.listTestCaseResults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.ITestCaseResult[] = + []; + const iterable = client.listTestCaseResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCaseResults with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCaseResults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTestCaseResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.ITestCaseResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 testcasesModule.v3.TestCasesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 testcasesModule.v3.TestCasesClient({ + 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 testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 testcasesModule.v3.TestCasesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 testcasesModule.v3.TestCasesClient({ + 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 testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 testcasesModule.v3.TestCasesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 testcasesModule.v3.TestCasesClient({ + 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 testcasesModule.v3.TestCasesClient({ + 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.IOperation[] = []; + 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 testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_test_cases_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_test_cases_v3beta1.ts new file mode 100644 index 000000000000..5fa02a81f82f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_test_cases_v3beta1.ts @@ -0,0 +1,5730 @@ +// Copyright 2026 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 testcasesModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.TestCasesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new testcasesModule.v3beta1.TestCasesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new testcasesModule.v3beta1.TestCasesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = testcasesModule.v3beta1.TestCasesClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = testcasesModule.v3beta1.TestCasesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new testcasesModule.v3beta1.TestCasesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new testcasesModule.v3beta1.TestCasesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new testcasesModule.v3beta1.TestCasesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = testcasesModule.v3beta1.TestCasesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new testcasesModule.v3beta1.TestCasesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.testCasesStub, undefined); + await client.initialize(); + assert(client.testCasesStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.testCasesStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.testCasesStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new testcasesModule.v3beta1.TestCasesClient({ + 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 testcasesModule.v3beta1.TestCasesClient({ + 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('batchDeleteTestCases', () => { + it('invokes batchDeleteTestCases without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.batchDeleteTestCases = + stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteTestCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteTestCases without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.batchDeleteTestCases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteTestCases( + 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.batchDeleteTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteTestCases with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteTestCases = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.batchDeleteTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteTestCases with closed client', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchDeleteTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.batchDeleteTestCases(request), expectedError); + }); + }); + + describe('getTestCase', () => { + it('invokes getTestCase without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ); + client.innerApiCalls.getTestCase = stubSimpleCall(expectedResponse); + const [response] = await client.getTestCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCase without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ); + client.innerApiCalls.getTestCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTestCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITestCase | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCase with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTestCase = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCase with closed client', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getTestCase(request), expectedError); + }); + }); + + describe('createTestCase', () => { + it('invokes createTestCase without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ); + client.innerApiCalls.createTestCase = stubSimpleCall(expectedResponse); + const [response] = await client.createTestCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTestCase without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ); + client.innerApiCalls.createTestCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTestCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITestCase | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTestCase with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTestCase = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTestCase with closed client', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTestCaseRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createTestCase(request), expectedError); + }); + }); + + describe('updateTestCase', () => { + it('invokes updateTestCase without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedHeaderRequestParams = `test_case.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ); + client.innerApiCalls.updateTestCase = stubSimpleCall(expectedResponse); + const [response] = await client.updateTestCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTestCase without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedHeaderRequestParams = `test_case.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ); + client.innerApiCalls.updateTestCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTestCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITestCase | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTestCase with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedHeaderRequestParams = `test_case.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTestCase = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTestCase with closed client', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest(), + ); + request.testCase ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTestCaseRequest', + ['testCase', 'name'], + ); + request.testCase.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateTestCase(request), expectedError); + }); + }); + + describe('calculateCoverage', () => { + it('invokes calculateCoverage without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedHeaderRequestParams = `agent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse(), + ); + client.innerApiCalls.calculateCoverage = stubSimpleCall(expectedResponse); + const [response] = await client.calculateCoverage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateCoverage without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedHeaderRequestParams = `agent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageResponse(), + ); + client.innerApiCalls.calculateCoverage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.calculateCoverage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ICalculateCoverageResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateCoverage with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedHeaderRequestParams = `agent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.calculateCoverage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.calculateCoverage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.calculateCoverage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateCoverage with closed client', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CalculateCoverageRequest', + ['agent'], + ); + request.agent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.calculateCoverage(request), expectedError); + }); + }); + + describe('getTestCaseResult', () => { + it('invokes getTestCaseResult without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ); + client.innerApiCalls.getTestCaseResult = stubSimpleCall(expectedResponse); + const [response] = await client.getTestCaseResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCaseResult without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ); + client.innerApiCalls.getTestCaseResult = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTestCaseResult( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCaseResult with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTestCaseResult = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getTestCaseResult(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTestCaseResult as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTestCaseResult with closed client', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTestCaseResultRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getTestCaseResult(request), expectedError); + }); + }); + + describe('runTestCase', () => { + it('invokes runTestCase without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runTestCase = stubLongRunningCall(expectedResponse); + const [operation] = await client.runTestCase(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTestCase without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.runTestCase = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runTestCase( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IRunTestCaseMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTestCase with call error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runTestCase = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.runTestCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTestCase with LRO error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RunTestCaseRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runTestCase = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.runTestCase(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTestCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunTestCaseProgress without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkRunTestCaseProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunTestCaseProgress with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkRunTestCaseProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('batchRunTestCases', () => { + it('invokes batchRunTestCases without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.batchRunTestCases = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchRunTestCases(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunTestCases without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.batchRunTestCases = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRunTestCases( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IBatchRunTestCasesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunTestCases with call error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunTestCases = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.batchRunTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunTestCases with LRO error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunTestCases = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.batchRunTestCases(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchRunTestCasesProgress without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkBatchRunTestCasesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchRunTestCasesProgress with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkBatchRunTestCasesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importTestCases', () => { + it('invokes importTestCases without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importTestCases = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importTestCases(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importTestCases without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.importTestCases = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importTestCases( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IImportTestCasesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importTestCases with call error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importTestCases = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.importTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importTestCases with LRO error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ImportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importTestCases = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.importTestCases(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportTestCasesProgress without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkImportTestCasesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportTestCasesProgress with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkImportTestCasesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportTestCases', () => { + it('invokes exportTestCases without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportTestCases = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportTestCases(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTestCases without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportTestCases = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportTestCases( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportTestCasesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTestCases with call error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTestCases = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTestCases with LRO error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTestCases = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportTestCases(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportTestCasesProgress without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportTestCasesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportTestCasesProgress with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkExportTestCasesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTestCases', () => { + it('invokes listTestCases without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + ]; + client.innerApiCalls.listTestCases = stubSimpleCall(expectedResponse); + const [response] = await client.listTestCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCases without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + ]; + client.innerApiCalls.listTestCases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTestCases( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.ITestCase[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCases with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTestCases = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTestCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCasesStream without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + ]; + client.descriptors.page.listTestCases.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTestCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.TestCase[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.TestCase) => { + 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.listTestCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCases, request), + ); + assert( + (client.descriptors.page.listTestCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTestCasesStream with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCases.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTestCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.TestCase[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.TestCase) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTestCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCases, request), + ); + assert( + (client.descriptors.page.listTestCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCases without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCase(), + ), + ]; + client.descriptors.page.listTestCases.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITestCase[] = + []; + const iterable = client.listTestCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCases.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCases with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCasesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCases.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTestCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITestCase[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCases.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listTestCaseResults', () => { + it('invokes listTestCaseResults without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + ]; + client.innerApiCalls.listTestCaseResults = + stubSimpleCall(expectedResponse); + const [response] = await client.listTestCaseResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCaseResults without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + ]; + client.innerApiCalls.listTestCaseResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTestCaseResults( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCaseResults with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTestCaseResults = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTestCaseResults(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTestCaseResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTestCaseResultsStream without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + ]; + client.descriptors.page.listTestCaseResults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTestCaseResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult, + ) => { + 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.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCaseResults, request), + ); + assert( + (client.descriptors.page.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTestCaseResultsStream with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCaseResults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTestCaseResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTestCaseResults, request), + ); + assert( + (client.descriptors.page.listTestCaseResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCaseResults without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TestCaseResult(), + ), + ]; + client.descriptors.page.listTestCaseResults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[] = + []; + const iterable = client.listTestCaseResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTestCaseResults with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTestCaseResultsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTestCaseResults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTestCaseResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITestCaseResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTestCaseResults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 testcasesModule.v3beta1.TestCasesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 testcasesModule.v3beta1.TestCasesClient({ + 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 testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 testcasesModule.v3beta1.TestCasesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 testcasesModule.v3beta1.TestCasesClient({ + 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 testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 testcasesModule.v3beta1.TestCasesClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 testcasesModule.v3beta1.TestCasesClient({ + 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 testcasesModule.v3beta1.TestCasesClient({ + 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.IOperation[] = []; + 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 testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new testcasesModule.v3beta1.TestCasesClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_tools_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_tools_v3.ts new file mode 100644 index 000000000000..a8c8e5fc36df --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_tools_v3.ts @@ -0,0 +1,5067 @@ +// Copyright 2026 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 toolsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.ToolsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new toolsModule.v3.ToolsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new toolsModule.v3.ToolsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = toolsModule.v3.ToolsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = toolsModule.v3.ToolsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new toolsModule.v3.ToolsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new toolsModule.v3.ToolsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new toolsModule.v3.ToolsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new toolsModule.v3.ToolsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new toolsModule.v3.ToolsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = toolsModule.v3.ToolsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new toolsModule.v3.ToolsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new toolsModule.v3.ToolsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.toolsStub, undefined); + await client.initialize(); + assert(client.toolsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.toolsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.toolsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new toolsModule.v3.ToolsClient({ + 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 toolsModule.v3.ToolsClient({ + 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('createTool', () => { + it('invokes createTool without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Tool(), + ); + client.innerApiCalls.createTool = stubSimpleCall(expectedResponse); + const [response] = await client.createTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Tool(), + ); + client.innerApiCalls.createTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITool | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTool = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createTool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createTool(request), expectedError); + }); + }); + + describe('getTool', () => { + it('invokes getTool without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Tool(), + ); + client.innerApiCalls.getTool = stubSimpleCall(expectedResponse); + const [response] = await client.getTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Tool(), + ); + client.innerApiCalls.getTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITool | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTool(request), expectedError); + const actualRequest = (client.innerApiCalls.getTool as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getTool(request), expectedError); + }); + }); + + describe('updateTool', () => { + it('invokes updateTool without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Tool(), + ); + client.innerApiCalls.updateTool = stubSimpleCall(expectedResponse); + const [response] = await client.updateTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Tool(), + ); + client.innerApiCalls.updateTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITool | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTool = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateTool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateTool(request), expectedError); + }); + }); + + describe('deleteTool', () => { + it('invokes deleteTool without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTool( + 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.deleteTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTool = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteTool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteTool(request), expectedError); + }); + }); + + describe('createToolVersion', () => { + it('invokes createToolVersion without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ); + client.innerApiCalls.createToolVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolVersion without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ); + client.innerApiCalls.createToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createToolVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IToolVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolVersion with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolVersion with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createToolVersion(request), expectedError); + }); + }); + + describe('getToolVersion', () => { + it('invokes getToolVersion without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ); + client.innerApiCalls.getToolVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolVersion without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ); + client.innerApiCalls.getToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getToolVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IToolVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolVersion with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolVersion with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getToolVersion(request), expectedError); + }); + }); + + describe('deleteToolVersion', () => { + it('invokes deleteToolVersion without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteToolVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolVersion without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteToolVersion( + 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.deleteToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolVersion with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolVersion with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteToolVersion(request), expectedError); + }); + }); + + describe('restoreToolVersion', () => { + it('invokes restoreToolVersion without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse(), + ); + client.innerApiCalls.restoreToolVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.restoreToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreToolVersion without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse(), + ); + client.innerApiCalls.restoreToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreToolVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IRestoreToolVersionResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreToolVersion with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.restoreToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreToolVersion with closed client', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.restoreToolVersion(request), expectedError); + }); + }); + + describe('listTools', () => { + it('invokes listTools without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + ]; + client.innerApiCalls.listTools = stubSimpleCall(expectedResponse); + const [response] = await client.listTools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + ]; + client.innerApiCalls.listTools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTools( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITool[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTools(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsStream without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + ]; + client.descriptors.page.listTools.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Tool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Tool) => { + 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.listTools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTools, request), + ); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listToolsStream with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Tool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Tool) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTools, request), + ); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTools without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + generateSampleMessage(new protos.google.cloud.dialogflow.cx.v3.Tool()), + ]; + client.descriptors.page.listTools.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.ITool[] = []; + const iterable = client.listToolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTools with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listToolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.ITool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listToolVersions', () => { + it('invokes listToolVersions without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + ]; + client.innerApiCalls.listToolVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listToolVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolVersions without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + ]; + client.innerApiCalls.listToolVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listToolVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IToolVersion[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolVersions with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listToolVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listToolVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolVersionsStream without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + ]; + client.descriptors.page.listToolVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listToolVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.ToolVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.ToolVersion) => { + 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.listToolVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listToolVersions, request), + ); + assert( + (client.descriptors.page.listToolVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listToolVersionsStream with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listToolVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.ToolVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.ToolVersion) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listToolVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listToolVersions, request), + ); + assert( + (client.descriptors.page.listToolVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listToolVersions without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ToolVersion(), + ), + ]; + client.descriptors.page.listToolVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IToolVersion[] = []; + const iterable = client.listToolVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listToolVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listToolVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listToolVersions with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listToolVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IToolVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listToolVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listToolVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 toolsModule.v3.ToolsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 toolsModule.v3.ToolsClient({ + 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 toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 toolsModule.v3.ToolsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 toolsModule.v3.ToolsClient({ + 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 toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 toolsModule.v3.ToolsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 toolsModule.v3.ToolsClient({ + 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 toolsModule.v3.ToolsClient({ + 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.IOperation[] = []; + 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 toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new toolsModule.v3.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_tools_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_tools_v3beta1.ts new file mode 100644 index 000000000000..0de1d327a37c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_tools_v3beta1.ts @@ -0,0 +1,5397 @@ +// Copyright 2026 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 toolsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.ToolsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new toolsModule.v3beta1.ToolsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new toolsModule.v3beta1.ToolsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = toolsModule.v3beta1.ToolsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = toolsModule.v3beta1.ToolsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new toolsModule.v3beta1.ToolsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new toolsModule.v3beta1.ToolsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new toolsModule.v3beta1.ToolsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new toolsModule.v3beta1.ToolsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new toolsModule.v3beta1.ToolsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = toolsModule.v3beta1.ToolsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new toolsModule.v3beta1.ToolsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new toolsModule.v3beta1.ToolsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.toolsStub, undefined); + await client.initialize(); + assert(client.toolsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.toolsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.toolsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new toolsModule.v3beta1.ToolsClient({ + 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 toolsModule.v3beta1.ToolsClient({ + 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('createTool', () => { + it('invokes createTool without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ); + client.innerApiCalls.createTool = stubSimpleCall(expectedResponse); + const [response] = await client.createTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ); + client.innerApiCalls.createTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITool | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTool = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createTool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createTool(request), expectedError); + }); + }); + + describe('getTool', () => { + it('invokes getTool without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ); + client.innerApiCalls.getTool = stubSimpleCall(expectedResponse); + const [response] = await client.getTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ); + client.innerApiCalls.getTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITool | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTool(request), expectedError); + const actualRequest = (client.innerApiCalls.getTool as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getTool(request), expectedError); + }); + }); + + describe('updateTool', () => { + it('invokes updateTool without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ); + client.innerApiCalls.updateTool = stubSimpleCall(expectedResponse); + const [response] = await client.updateTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ); + client.innerApiCalls.updateTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITool | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTool = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateTool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest(), + ); + request.tool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateToolRequest', + ['tool', 'name'], + ); + request.tool.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateTool(request), expectedError); + }); + }); + + describe('deleteTool', () => { + it('invokes deleteTool without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTool( + 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.deleteTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTool = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteTool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteTool(request), expectedError); + }); + }); + + describe('createToolVersion', () => { + it('invokes createToolVersion without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ); + client.innerApiCalls.createToolVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolVersion without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ); + client.innerApiCalls.createToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createToolVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolVersion with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolVersion with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateToolVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createToolVersion(request), expectedError); + }); + }); + + describe('getToolVersion', () => { + it('invokes getToolVersion without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ); + client.innerApiCalls.getToolVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolVersion without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ); + client.innerApiCalls.getToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getToolVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolVersion with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolVersion with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getToolVersion(request), expectedError); + }); + }); + + describe('deleteToolVersion', () => { + it('invokes deleteToolVersion without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteToolVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolVersion without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteToolVersion( + 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.deleteToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolVersion with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolVersion with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteToolVersion(request), expectedError); + }); + }); + + describe('restoreToolVersion', () => { + it('invokes restoreToolVersion without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse(), + ); + client.innerApiCalls.restoreToolVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.restoreToolVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreToolVersion without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionResponse(), + ); + client.innerApiCalls.restoreToolVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreToolVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IRestoreToolVersionResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreToolVersion with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreToolVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.restoreToolVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreToolVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreToolVersion with closed client', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.RestoreToolVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.restoreToolVersion(request), expectedError); + }); + }); + + describe('exportTools', () => { + it('invokes exportTools without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportTools = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportTools(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTools without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.exportTools = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportTools( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsResponse, + protos.google.cloud.dialogflow.cx.v3beta1.IExportToolsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTools with call error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTools = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.exportTools(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportTools with LRO error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ExportToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTools = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.exportTools(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportToolsProgress without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkExportToolsProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportToolsProgress with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkExportToolsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTools', () => { + it('invokes listTools without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + ]; + client.innerApiCalls.listTools = stubSimpleCall(expectedResponse); + const [response] = await client.listTools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + ]; + client.innerApiCalls.listTools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTools( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITool[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTools(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsStream without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + ]; + client.descriptors.page.listTools.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Tool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Tool) => { + 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.listTools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTools, request), + ); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listToolsStream with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Tool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Tool) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTools, request), + ); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTools without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Tool(), + ), + ]; + client.descriptors.page.listTools.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITool[] = []; + const iterable = client.listToolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTools with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listToolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listToolVersions', () => { + it('invokes listToolVersions without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + ]; + client.innerApiCalls.listToolVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listToolVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolVersions without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + ]; + client.innerApiCalls.listToolVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listToolVersions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolVersions with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listToolVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listToolVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listToolVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolVersionsStream without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + ]; + client.descriptors.page.listToolVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listToolVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion) => { + 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.listToolVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listToolVersions, request), + ); + assert( + (client.descriptors.page.listToolVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listToolVersionsStream with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listToolVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listToolVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listToolVersions, request), + ); + assert( + (client.descriptors.page.listToolVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listToolVersions without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ToolVersion(), + ), + ]; + client.descriptors.page.listToolVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion[] = + []; + const iterable = client.listToolVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listToolVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listToolVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listToolVersions with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListToolVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listToolVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IToolVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listToolVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listToolVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 toolsModule.v3beta1.ToolsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 toolsModule.v3beta1.ToolsClient({ + 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 toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 toolsModule.v3beta1.ToolsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 toolsModule.v3beta1.ToolsClient({ + 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 toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 toolsModule.v3beta1.ToolsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 toolsModule.v3beta1.ToolsClient({ + 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 toolsModule.v3beta1.ToolsClient({ + 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.IOperation[] = []; + 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 toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new toolsModule.v3beta1.ToolsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_transition_route_groups_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_transition_route_groups_v3.ts new file mode 100644 index 000000000000..e66b485dbdf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_transition_route_groups_v3.ts @@ -0,0 +1,4387 @@ +// Copyright 2026 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 transitionroutegroupsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.TransitionRouteGroupsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + transitionroutegroupsModule.v3.TransitionRouteGroupsClient + .servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + transitionroutegroupsModule.v3.TransitionRouteGroupsClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + transitionroutegroupsModule.v3.TransitionRouteGroupsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.transitionRouteGroupsStub, undefined); + await client.initialize(); + assert(client.transitionRouteGroupsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.transitionRouteGroupsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.transitionRouteGroupsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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('getTransitionRouteGroup', () => { + it('invokes getTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ); + client.innerApiCalls.getTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.getTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ); + client.innerApiCalls.getTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransitionRouteGroup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('createTransitionRouteGroup', () => { + it('invokes createTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ); + client.innerApiCalls.createTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.createTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ); + client.innerApiCalls.createTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTransitionRouteGroup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('updateTransitionRouteGroup', () => { + it('invokes updateTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedHeaderRequestParams = `transition_route_group.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ); + client.innerApiCalls.updateTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.updateTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedHeaderRequestParams = `transition_route_group.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ); + client.innerApiCalls.updateTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTransitionRouteGroup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedHeaderRequestParams = `transition_route_group.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('deleteTransitionRouteGroup', () => { + it('invokes deleteTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTransitionRouteGroup( + 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.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deleteTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('listTransitionRouteGroups', () => { + it('invokes listTransitionRouteGroups without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + ]; + client.innerApiCalls.listTransitionRouteGroups = + stubSimpleCall(expectedResponse); + const [response] = await client.listTransitionRouteGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransitionRouteGroups without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + ]; + client.innerApiCalls.listTransitionRouteGroups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransitionRouteGroups( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransitionRouteGroups with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransitionRouteGroups = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listTransitionRouteGroups(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransitionRouteGroupsStream without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + ]; + client.descriptors.page.listTransitionRouteGroups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransitionRouteGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup, + ) => { + 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.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTransitionRouteGroups, request), + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listTransitionRouteGroupsStream with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransitionRouteGroups.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransitionRouteGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTransitionRouteGroups, request), + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listTransitionRouteGroups without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.TransitionRouteGroup(), + ), + ]; + client.descriptors.page.listTransitionRouteGroups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[] = + []; + const iterable = client.listTransitionRouteGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listTransitionRouteGroups with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransitionRouteGroups.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransitionRouteGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.ITransitionRouteGroup[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + 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.IOperation[] = []; + 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 transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_transition_route_groups_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_transition_route_groups_v3beta1.ts new file mode 100644 index 000000000000..38cadb2de32e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_transition_route_groups_v3beta1.ts @@ -0,0 +1,4138 @@ +// Copyright 2026 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 transitionroutegroupsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.TransitionRouteGroupsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient + .servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient( + { universeDomain: 'configured.example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.transitionRouteGroupsStub, undefined); + await client.initialize(); + assert(client.transitionRouteGroupsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.transitionRouteGroupsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.transitionRouteGroupsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + 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 transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + 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('getTransitionRouteGroup', () => { + it('invokes getTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ); + client.innerApiCalls.getTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.getTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ); + client.innerApiCalls.getTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransitionRouteGroup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('createTransitionRouteGroup', () => { + it('invokes createTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ); + client.innerApiCalls.createTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.createTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ); + client.innerApiCalls.createTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTransitionRouteGroup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('updateTransitionRouteGroup', () => { + it('invokes updateTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedHeaderRequestParams = `transition_route_group.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ); + client.innerApiCalls.updateTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.updateTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedHeaderRequestParams = `transition_route_group.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ); + client.innerApiCalls.updateTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTransitionRouteGroup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedHeaderRequestParams = `transition_route_group.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(), + ); + request.transitionRouteGroup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest', + ['transitionRouteGroup', 'name'], + ); + request.transitionRouteGroup.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('deleteTransitionRouteGroup', () => { + it('invokes deleteTransitionRouteGroup without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTransitionRouteGroup = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteTransitionRouteGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransitionRouteGroup without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTransitionRouteGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTransitionRouteGroup( + 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.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransitionRouteGroup with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTransitionRouteGroup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteTransitionRouteGroup(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransitionRouteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransitionRouteGroup with closed client', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deleteTransitionRouteGroup(request), + expectedError, + ); + }); + }); + + describe('listTransitionRouteGroups', () => { + it('invokes listTransitionRouteGroups without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + ]; + client.innerApiCalls.listTransitionRouteGroups = + stubSimpleCall(expectedResponse); + const [response] = await client.listTransitionRouteGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransitionRouteGroups without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + ]; + client.innerApiCalls.listTransitionRouteGroups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransitionRouteGroups( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransitionRouteGroups with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransitionRouteGroups = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listTransitionRouteGroups(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransitionRouteGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransitionRouteGroupsStream without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + ]; + client.descriptors.page.listTransitionRouteGroups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransitionRouteGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + ) => { + 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.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTransitionRouteGroups, request), + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listTransitionRouteGroupsStream with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransitionRouteGroups.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransitionRouteGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTransitionRouteGroups, request), + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listTransitionRouteGroups without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(), + ), + ]; + client.descriptors.page.listTransitionRouteGroups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[] = + []; + const iterable = client.listTransitionRouteGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listTransitionRouteGroups with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransitionRouteGroups.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransitionRouteGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ITransitionRouteGroup[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listTransitionRouteGroups + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = + new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_versions_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_versions_v3.ts new file mode 100644 index 000000000000..72ec3dbd2282 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_versions_v3.ts @@ -0,0 +1,4661 @@ +// Copyright 2026 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 versionsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3.VersionsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new versionsModule.v3.VersionsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new versionsModule.v3.VersionsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = versionsModule.v3.VersionsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = versionsModule.v3.VersionsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new versionsModule.v3.VersionsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new versionsModule.v3.VersionsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new versionsModule.v3.VersionsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new versionsModule.v3.VersionsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new versionsModule.v3.VersionsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = versionsModule.v3.VersionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new versionsModule.v3.VersionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new versionsModule.v3.VersionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.versionsStub, undefined); + await client.initialize(); + assert(client.versionsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.versionsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.versionsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new versionsModule.v3.VersionsClient({ + 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 versionsModule.v3.VersionsClient({ + 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('getVersion', () => { + it('invokes getVersion without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ); + client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ); + client.innerApiCalls.getVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with closed client', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getVersion(request), expectedError); + }); + }); + + describe('updateVersion', () => { + it('invokes updateVersion without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ); + client.innerApiCalls.updateVersion = stubSimpleCall(expectedResponse); + const [response] = await client.updateVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ); + client.innerApiCalls.updateVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with closed client', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateVersion(request), expectedError); + }); + }); + + describe('deleteVersion', () => { + it('invokes deleteVersion without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVersion( + 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.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with closed client', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteVersion(request), expectedError); + }); + }); + + describe('compareVersions', () => { + it('invokes compareVersions without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedHeaderRequestParams = `base_version=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CompareVersionsResponse(), + ); + client.innerApiCalls.compareVersions = stubSimpleCall(expectedResponse); + const [response] = await client.compareVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes compareVersions without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedHeaderRequestParams = `base_version=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CompareVersionsResponse(), + ); + client.innerApiCalls.compareVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.compareVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.ICompareVersionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes compareVersions with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedHeaderRequestParams = `base_version=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.compareVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.compareVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes compareVersions with closed client', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.compareVersions(request), expectedError); + }); + }); + + describe('createVersion', () => { + it('invokes createVersion without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createVersion = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createVersion = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVersion( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IVersion, + protos.google.cloud.dialogflow.cx.v3.ICreateVersionOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with call error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with LRO error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateVersionProgress without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkCreateVersionProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateVersionProgress with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateVersionProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('loadVersion', () => { + it('invokes loadVersion without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.loadVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.loadVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadVersion without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.loadVersion = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.loadVersion( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadVersion with call error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadVersion = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.loadVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadVersion with LRO error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadVersion = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.loadVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLoadVersionProgress without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkLoadVersionProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLoadVersionProgress with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkLoadVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listVersions', () => { + it('invokes listVersions without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + ]; + client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + ]; + client.innerApiCalls.listVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IVersion[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersionsStream without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + ]; + client.descriptors.page.listVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Version[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Version) => { + 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.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request), + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listVersionsStream with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Version[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Version) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request), + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listVersions without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Version(), + ), + ]; + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IVersion[] = []; + const iterable = client.listVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listVersions with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 versionsModule.v3.VersionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 versionsModule.v3.VersionsClient({ + 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 versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 versionsModule.v3.VersionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 versionsModule.v3.VersionsClient({ + 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 versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 versionsModule.v3.VersionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 versionsModule.v3.VersionsClient({ + 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 versionsModule.v3.VersionsClient({ + 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.IOperation[] = []; + 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 versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_versions_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_versions_v3beta1.ts new file mode 100644 index 000000000000..1e24f16d582b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_versions_v3beta1.ts @@ -0,0 +1,4743 @@ +// Copyright 2026 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 versionsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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('v3beta1.VersionsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new versionsModule.v3beta1.VersionsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new versionsModule.v3beta1.VersionsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = versionsModule.v3beta1.VersionsClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = versionsModule.v3beta1.VersionsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new versionsModule.v3beta1.VersionsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new versionsModule.v3beta1.VersionsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new versionsModule.v3beta1.VersionsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new versionsModule.v3beta1.VersionsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new versionsModule.v3beta1.VersionsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = versionsModule.v3beta1.VersionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new versionsModule.v3beta1.VersionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new versionsModule.v3beta1.VersionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.versionsStub, undefined); + await client.initialize(); + assert(client.versionsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.versionsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.versionsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new versionsModule.v3beta1.VersionsClient({ + 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 versionsModule.v3beta1.VersionsClient({ + 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('getVersion', () => { + it('invokes getVersion without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ); + client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ); + client.innerApiCalls.getVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with closed client', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getVersion(request), expectedError); + }); + }); + + describe('updateVersion', () => { + it('invokes updateVersion without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ); + client.innerApiCalls.updateVersion = stubSimpleCall(expectedResponse); + const [response] = await client.updateVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ); + client.innerApiCalls.updateVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IVersion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with closed client', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(), + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest', + ['version', 'name'], + ); + request.version.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateVersion(request), expectedError); + }); + }); + + describe('deleteVersion', () => { + it('invokes deleteVersion without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVersion( + 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.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVersion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with closed client', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteVersion(request), expectedError); + }); + }); + + describe('compareVersions', () => { + it('invokes compareVersions without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedHeaderRequestParams = `base_version=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse(), + ); + client.innerApiCalls.compareVersions = stubSimpleCall(expectedResponse); + const [response] = await client.compareVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes compareVersions without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedHeaderRequestParams = `base_version=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CompareVersionsResponse(), + ); + client.innerApiCalls.compareVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.compareVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ICompareVersionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes compareVersions with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedHeaderRequestParams = `base_version=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.compareVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.compareVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.compareVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes compareVersions with closed client', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CompareVersionsRequest', + ['baseVersion'], + ); + request.baseVersion = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.compareVersions(request), expectedError); + }); + }); + + describe('createVersion', () => { + it('invokes createVersion without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createVersion = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createVersion = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVersion( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3beta1.IVersion, + protos.google.cloud.dialogflow.cx.v3beta1.ICreateVersionOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with call error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with LRO error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateVersionProgress without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkCreateVersionProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateVersionProgress with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateVersionProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('loadVersion', () => { + it('invokes loadVersion without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.loadVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.loadVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadVersion without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.loadVersion = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.loadVersion( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadVersion with call error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadVersion = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.loadVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadVersion with LRO error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadVersion = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.loadVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLoadVersionProgress without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkLoadVersionProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLoadVersionProgress with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkLoadVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listVersions', () => { + it('invokes listVersions without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + ]; + client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + ]; + client.innerApiCalls.listVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVersions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IVersion[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVersions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersionsStream without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + ]; + client.descriptors.page.listVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Version[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Version) => { + 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.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request), + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listVersionsStream with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Version[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Version) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request), + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listVersions without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Version(), + ), + ]; + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IVersion[] = + []; + const iterable = client.listVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listVersions with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 versionsModule.v3beta1.VersionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 versionsModule.v3beta1.VersionsClient({ + 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 versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 versionsModule.v3beta1.VersionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 versionsModule.v3beta1.VersionsClient({ + 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 versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 versionsModule.v3beta1.VersionsClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 versionsModule.v3beta1.VersionsClient({ + 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 versionsModule.v3beta1.VersionsClient({ + 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.IOperation[] = []; + 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 versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_webhooks_v3.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_webhooks_v3.ts new file mode 100644 index 000000000000..394c97378d35 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_webhooks_v3.ts @@ -0,0 +1,4459 @@ +// Copyright 2026 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 webhooksModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, operationsProtos, LocationProtos } 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 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('v3.WebhooksClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new webhooksModule.v3.WebhooksClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new webhooksModule.v3.WebhooksClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = webhooksModule.v3.WebhooksClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = webhooksModule.v3.WebhooksClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new webhooksModule.v3.WebhooksClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new webhooksModule.v3.WebhooksClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new webhooksModule.v3.WebhooksClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new webhooksModule.v3.WebhooksClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new webhooksModule.v3.WebhooksClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = webhooksModule.v3.WebhooksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new webhooksModule.v3.WebhooksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new webhooksModule.v3.WebhooksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.webhooksStub, undefined); + await client.initialize(); + assert(client.webhooksStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.webhooksStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.webhooksStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new webhooksModule.v3.WebhooksClient({ + 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 webhooksModule.v3.WebhooksClient({ + 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('getWebhook', () => { + it('invokes getWebhook without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ); + client.innerApiCalls.getWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.getWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWebhook without error using callback', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ); + client.innerApiCalls.getWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWebhook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IWebhook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWebhook with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWebhook with closed client', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getWebhook(request), expectedError); + }); + }); + + describe('createWebhook', () => { + it('invokes createWebhook without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ); + client.innerApiCalls.createWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.createWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWebhook without error using callback', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ); + client.innerApiCalls.createWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWebhook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IWebhook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWebhook with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWebhook with closed client', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createWebhook(request), expectedError); + }); + }); + + describe('updateWebhook', () => { + it('invokes updateWebhook without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedHeaderRequestParams = `webhook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ); + client.innerApiCalls.updateWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.updateWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWebhook without error using callback', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedHeaderRequestParams = `webhook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ); + client.innerApiCalls.updateWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWebhook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IWebhook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWebhook with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedHeaderRequestParams = `webhook.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWebhook with closed client', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateWebhook(request), expectedError); + }); + }); + + describe('deleteWebhook', () => { + it('invokes deleteWebhook without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWebhook without error using callback', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWebhook( + 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.deleteWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWebhook with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWebhook with closed client', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteWebhook(request), expectedError); + }); + }); + + describe('listWebhooks', () => { + it('invokes listWebhooks without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + ]; + client.innerApiCalls.listWebhooks = stubSimpleCall(expectedResponse); + const [response] = await client.listWebhooks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWebhooks without error using callback', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + ]; + client.innerApiCalls.listWebhooks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWebhooks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3.IWebhook[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWebhooks with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listWebhooks = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listWebhooks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWebhooksStream without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + ]; + client.descriptors.page.listWebhooks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWebhooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Webhook[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Webhook) => { + 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.listWebhooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWebhooks, request), + ); + assert( + (client.descriptors.page.listWebhooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listWebhooksStream with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWebhooks.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listWebhooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.Webhook[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3.Webhook) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWebhooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWebhooks, request), + ); + assert( + (client.descriptors.page.listWebhooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listWebhooks without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.Webhook(), + ), + ]; + client.descriptors.page.listWebhooks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IWebhook[] = []; + const iterable = client.listWebhooksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWebhooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listWebhooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listWebhooks with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWebhooks.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWebhooksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IWebhook[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWebhooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listWebhooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .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 webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 webhooksModule.v3.WebhooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 webhooksModule.v3.WebhooksClient({ + 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 webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 webhooksModule.v3.WebhooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 webhooksModule.v3.WebhooksClient({ + 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 webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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 webhooksModule.v3.WebhooksClient({ + 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); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + 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 webhooksModule.v3.WebhooksClient({ + 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 webhooksModule.v3.WebhooksClient({ + 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.IOperation[] = []; + 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 webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironmentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionPath', () => { + const result = client.projectLocationAgentEnvironmentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionPath', () => { + const result = client.projectLocationAgentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_webhooks_v3beta1.ts b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_webhooks_v3beta1.ts new file mode 100644 index 000000000000..ccab30af3b3d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/test/gapic_webhooks_v3beta1.ts @@ -0,0 +1,4226 @@ +// Copyright 2026 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 webhooksModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LocationProtos } 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 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('v3beta1.WebhooksClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new webhooksModule.v3beta1.WebhooksClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new webhooksModule.v3beta1.WebhooksClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = webhooksModule.v3beta1.WebhooksClient.servicePath; + assert.strictEqual(servicePath, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = webhooksModule.v3beta1.WebhooksClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dialogflow.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new webhooksModule.v3beta1.WebhooksClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new webhooksModule.v3beta1.WebhooksClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dialogflow.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new webhooksModule.v3beta1.WebhooksClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = webhooksModule.v3beta1.WebhooksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new webhooksModule.v3beta1.WebhooksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.webhooksStub, undefined); + await client.initialize(); + assert(client.webhooksStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.webhooksStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.webhooksStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new webhooksModule.v3beta1.WebhooksClient({ + 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 webhooksModule.v3beta1.WebhooksClient({ + 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('getWebhook', () => { + it('invokes getWebhook without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ); + client.innerApiCalls.getWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.getWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWebhook without error using callback', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ); + client.innerApiCalls.getWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWebhook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IWebhook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWebhook with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWebhook with closed client', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getWebhook(request), expectedError); + }); + }); + + describe('createWebhook', () => { + it('invokes createWebhook without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ); + client.innerApiCalls.createWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.createWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWebhook without error using callback', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ); + client.innerApiCalls.createWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWebhook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IWebhook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWebhook with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWebhook with closed client', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createWebhook(request), expectedError); + }); + }); + + describe('updateWebhook', () => { + it('invokes updateWebhook without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedHeaderRequestParams = `webhook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ); + client.innerApiCalls.updateWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.updateWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWebhook without error using callback', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedHeaderRequestParams = `webhook.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ); + client.innerApiCalls.updateWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWebhook( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.IWebhook | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWebhook with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedHeaderRequestParams = `webhook.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWebhook with closed client', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(), + ); + request.webhook ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest', + ['webhook', 'name'], + ); + request.webhook.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateWebhook(request), expectedError); + }); + }); + + describe('deleteWebhook', () => { + it('invokes deleteWebhook without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteWebhook = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWebhook without error using callback', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWebhook( + 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.deleteWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWebhook with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWebhook = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteWebhook(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWebhook with closed client', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteWebhook(request), expectedError); + }); + }); + + describe('listWebhooks', () => { + it('invokes listWebhooks without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + ]; + client.innerApiCalls.listWebhooks = stubSimpleCall(expectedResponse); + const [response] = await client.listWebhooks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWebhooks without error using callback', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + ]; + client.innerApiCalls.listWebhooks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWebhooks( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.IWebhook[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWebhooks with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listWebhooks = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listWebhooks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWebhooks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWebhooksStream without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + ]; + client.descriptors.page.listWebhooks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWebhooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Webhook[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Webhook) => { + 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.listWebhooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWebhooks, request), + ); + assert( + (client.descriptors.page.listWebhooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listWebhooksStream with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWebhooks.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listWebhooksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.Webhook[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.cx.v3beta1.Webhook) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWebhooks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWebhooks, request), + ); + assert( + (client.descriptors.page.listWebhooks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listWebhooks without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.Webhook(), + ), + ]; + client.descriptors.page.listWebhooks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IWebhook[] = + []; + const iterable = client.listWebhooksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWebhooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listWebhooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listWebhooks with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWebhooks.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWebhooksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.IWebhook[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWebhooks.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listWebhooks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('agent', async () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentGenerativeSettings', async () => { + const fakePath = '/rendered/path/agentGenerativeSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentGenerativeSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentGenerativeSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentGenerativeSettingsPath', () => { + const result = client.agentGenerativeSettingsPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentGenerativeSettingsName', () => { + const result = + client.matchProjectFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentGenerativeSettingsName', () => { + const result = + client.matchLocationFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentGenerativeSettingsName', () => { + const result = + client.matchAgentFromAgentGenerativeSettingsName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentGenerativeSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('agentValidationResult', async () => { + const fakePath = '/rendered/path/agentValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentValidationResultPath', () => { + const result = client.agentValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAgentValidationResultName', () => { + const result = + client.matchProjectFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAgentValidationResultName', () => { + const result = + client.matchLocationFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromAgentValidationResultName', () => { + const result = client.matchAgentFromAgentValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.agentValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('changelog', async () => { + const fakePath = '/rendered/path/changelog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + changelog: 'changelogValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'changelogValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromChangelogName', () => { + const result = client.matchAgentFromChangelogName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, 'changelogValue'); + assert( + (client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('continuousTestResult', async () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath, + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('conversation', async () => { + const fakePath = '/rendered/path/conversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + conversation: 'conversationValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + 'agentValue', + '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('matchAgentFromConversationName', () => { + const result = client.matchAgentFromConversationName(fakePath); + assert.strictEqual(result, 'agentValue'); + 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('deployment', async () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + deployment: 'deploymentValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'deploymentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromDeploymentName', () => { + const result = client.matchAgentFromDeploymentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromDeploymentName', () => { + const result = client.matchEnvironmentFromDeploymentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('entityType', async () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('environment', async () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('example', async () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + example: 'exampleValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'exampleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExampleName', () => { + const result = client.matchAgentFromExampleName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromExampleName', () => { + const result = client.matchPlaybookFromExampleName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('experiment', async () => { + const fakePath = '/rendered/path/experiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + experiment: 'experimentValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.experimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.experimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('experimentPath', () => { + const result = client.experimentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'experimentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.experimentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromExperimentName', () => { + const result = client.matchProjectFromExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromExperimentName', () => { + const result = client.matchLocationFromExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromExperimentName', () => { + const result = client.matchAgentFromExperimentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromExperimentName', () => { + const result = client.matchEnvironmentFromExperimentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExperimentFromExperimentName', () => { + const result = client.matchExperimentFromExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.experimentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flow', async () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('flowValidationResult', async () => { + const fakePath = '/rendered/path/flowValidationResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.flowValidationResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowValidationResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowValidationResultPath', () => { + const result = client.flowValidationResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromFlowValidationResultName', () => { + const result = + client.matchProjectFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFlowValidationResultName', () => { + const result = + client.matchLocationFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromFlowValidationResultName', () => { + const result = client.matchAgentFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromFlowValidationResultName', () => { + const result = client.matchFlowFromFlowValidationResultName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates.flowValidationResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('generator', async () => { + const fakePath = '/rendered/path/generator'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + generator: 'generatorValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.generatorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.generatorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('generatorPath', () => { + const result = client.generatorPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'generatorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.generatorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromGeneratorName', () => { + const result = client.matchProjectFromGeneratorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromGeneratorName', () => { + const result = client.matchLocationFromGeneratorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromGeneratorName', () => { + const result = client.matchAgentFromGeneratorName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchGeneratorFromGeneratorName', () => { + const result = client.matchGeneratorFromGeneratorName(fakePath); + assert.strictEqual(result, 'generatorValue'); + assert( + (client.pathTemplates.generatorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('intent', async () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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('page', async () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbook', async () => { + const fakePath = '/rendered/path/playbook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookPath', () => { + const result = client.playbookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookName', () => { + const result = client.matchProjectFromPlaybookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookName', () => { + const result = client.matchLocationFromPlaybookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookName', () => { + const result = client.matchAgentFromPlaybookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookName', () => { + const result = client.matchPlaybookFromPlaybookName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('playbookVersion', async () => { + const fakePath = '/rendered/path/playbookVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + playbook: 'playbookValue', + version: 'versionValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.playbookVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.playbookVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('playbookVersionPath', () => { + const result = client.playbookVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'playbookValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.playbookVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromPlaybookVersionName', () => { + const result = client.matchProjectFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromPlaybookVersionName', () => { + const result = client.matchLocationFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromPlaybookVersionName', () => { + const result = client.matchAgentFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchPlaybookFromPlaybookVersionName', () => { + const result = client.matchPlaybookFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'playbookValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromPlaybookVersionName', () => { + const result = client.matchVersionFromPlaybookVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.playbookVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironmentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionPath', () => { + const result = client.projectLocationAgentEnvironmentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', async () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = + client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentFlowTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentFlowTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentFlowTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentFlowTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentFlowTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchFlowFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'flowValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentFlowTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentFlowTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSession', async () => { + const fakePath = '/rendered/path/projectLocationAgentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionPath', () => { + const result = client.projectLocationAgentSessionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', async () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'sessionValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = + client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath, + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationAgentTransitionRouteGroups', async () => { + const fakePath = + '/rendered/path/projectLocationAgentTransitionRouteGroups'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAgentTransitionRouteGroupsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAgentTransitionRouteGroupsPath', () => { + const result = client.projectLocationAgentTransitionRouteGroupsPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'transitionRouteGroupValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchProjectFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchLocationFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchAgentFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName', () => { + const result = + client.matchTransitionRouteGroupFromProjectLocationAgentTransitionRouteGroupsName( + fakePath, + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + ( + client.pathTemplates + .projectLocationAgentTransitionRouteGroupsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('securitySettings', async () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCase', async () => { + const fakePath = '/rendered/path/testCase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCasePath', () => { + const result = client.testCasePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseName', () => { + const result = client.matchProjectFromTestCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseName', () => { + const result = client.matchLocationFromTestCaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseName', () => { + const result = client.matchAgentFromTestCaseName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseName', () => { + const result = client.matchTestCaseFromTestCaseName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('testCaseResult', async () => { + const fakePath = '/rendered/path/testCaseResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + test_case: 'testCaseValue', + result: 'resultValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.testCaseResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.testCaseResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('testCaseResultPath', () => { + const result = client.testCaseResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'testCaseValue', + 'resultValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.testCaseResultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTestCaseResultName', () => { + const result = client.matchProjectFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromTestCaseResultName', () => { + const result = client.matchLocationFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromTestCaseResultName', () => { + const result = client.matchAgentFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTestCaseFromTestCaseResultName', () => { + const result = client.matchTestCaseFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'testCaseValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchResultFromTestCaseResultName', () => { + const result = client.matchResultFromTestCaseResultName(fakePath); + assert.strictEqual(result, 'resultValue'); + assert( + (client.pathTemplates.testCaseResultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('tool', async () => { + const fakePath = '/rendered/path/tool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolName', () => { + const result = client.matchAgentFromToolName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('toolVersion', async () => { + const fakePath = '/rendered/path/toolVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + tool: 'toolValue', + version: 'versionValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.toolVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('toolVersionPath', () => { + const result = client.toolVersionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'toolValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.toolVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromToolVersionName', () => { + const result = client.matchProjectFromToolVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromToolVersionName', () => { + const result = client.matchLocationFromToolVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromToolVersionName', () => { + const result = client.matchAgentFromToolVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchToolFromToolVersionName', () => { + const result = client.matchToolFromToolVersionName(fakePath); + assert.strictEqual(result, 'toolValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromToolVersionName', () => { + const result = client.matchVersionFromToolVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.toolVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('version', async () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('webhook', async () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/tsconfig.json b/owl-bot-staging/google-cloud-dialogflow-cx/tsconfig.json new file mode 100644 index 000000000000..ca73e7bfc824 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx/webpack.config.js b/owl-bot-staging/google-cloud-dialogflow-cx/webpack.config.js new file mode 100644 index 000000000000..f6e9dcae9fcc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx/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: 'Agents', + filename: './agents.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', +};